/* ============================================================
   Journal of Islamic Sciences — presentation layer
   Palette taken from the journal's own masthead: gold + deep maroon.
   Targets the OJS 3.5 default theme; additive only.
   ============================================================ */

:root {
  --jis-maroon:      #7A1B1B;
  --jis-maroon-dk:   #5C1414;
  --jis-gold:        #C19B44;
  --jis-gold-soft:   #F3E9D2;
  --jis-cream:       #FBF8F2;
  --jis-ink:         #23201B;
  --jis-muted:       #6E6559;
  --jis-rule:        #E4DCCC;
}

/* ---------- global rhythm ---------- */
.pkp_structure_main { padding-top: 1.5rem; }

.pkp_page_index .homepage_about,
.pkp_page_index .current_issue,
.pkp_page_index .sections { margin-bottom: 2.25rem; }

/* the theme leaves very large gaps between blocks — tighten them */
.pkp_page_index .cmp_article_list > li { margin-bottom: 0; }
.pkp_page_index .sections .section { margin-bottom: 2rem; }

/* ---------- masthead image ---------- */
.pkp_page_index .homepage_image { text-align: center; margin: .5rem 0 2rem; }
.pkp_page_index .homepage_image img {
  max-width: 560px; width: 100%; height: auto;
}

/* ---------- about block ---------- */
.pkp_page_index .homepage_about {
  background: var(--jis-cream);
  border: 1px solid var(--jis-rule);
  border-left: 4px solid var(--jis-gold);
  border-radius: 3px;
  padding: 1.35rem 1.5rem;
}
.pkp_page_index .homepage_about h2 {
  margin: 0 0 .6rem; font-size: 1.05rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--jis-maroon); font-weight: 700;
}
.pkp_page_index .homepage_about p { color: var(--jis-ink); line-height: 1.62; }
.pkp_page_index .homepage_about p:last-child { margin-bottom: 0; }

/* ---------- current issue ---------- */
.pkp_page_index .current_issue h2,
.pkp_page_index .sections .section > h3 {
  font-size: 1.02rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--jis-maroon); font-weight: 700;
  border: 0; border-bottom: 2px solid var(--jis-gold);
  padding: 0 0 .45rem; margin: 0 0 1.1rem; display: block;
}
.pkp_page_index .current_issue_title {
  font-size: 1.3rem; font-weight: 600; color: var(--jis-ink); margin-bottom: .75rem;
}
.pkp_page_index .current_issue .described { display: flex; gap: 1.5rem; align-items: flex-start; }
.pkp_page_index .current_issue .cover img,
.pkp_page_index .current_issue img {
  max-width: 190px; height: auto;
  border: 1px solid var(--jis-rule);
  box-shadow: 0 2px 10px rgba(35,32,27,.10);
  border-radius: 2px;
}
.pkp_page_index .current_issue .published { color: var(--jis-muted); font-size: .93rem; }

/* ---------- article rows ---------- */
/* the theme spaces rows with li margin + summary margin + cover margin;
   all three have to go or the list reads as disconnected blocks */
.pkp_page_index .cmp_article_list,
.obj_issue_toc .cmp_article_list { padding-top: .35rem; }
.pkp_page_index .cmp_article_list > li,
.obj_issue_toc .cmp_article_list > li { margin-bottom: 0; }
.cmp_article_list .obj_article_summary { margin: 0; }
.cmp_article_list .obj_article_summary .cover { margin-bottom: 0; }

.cmp_article_list .obj_article_summary {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  grid-auto-rows: min-content;
  align-items: start;
  gap: .15rem 1.2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--jis-rule);
}
.cmp_article_list > li:last-child .obj_article_summary { border-bottom: 0; }

.cmp_article_list .obj_article_summary .cover {
  grid-column: 1; grid-row: 1 / span 3; display: block;
  /* the theme floats this container at width:25%, which inside a 104px grid
     cell collapses it to ~26px; the theme's global img{max-width:100%} then
     clamps the image to that. Size the CONTAINER, not just the image. */
  float: none; width: 104px; max-width: 104px; margin: 0;
}
.cmp_article_list .obj_article_summary .cover img {
  /* article cover art is a mix of portrait book jackets (ratio ~0.70) and
     landscape artwork (~1.77). A fixed box either crops one or dwarfs the
     other, so fix the WIDTH and let each image keep its own height. */
  width: 100%; height: auto; max-height: none;
  border: 1px solid var(--jis-rule); border-radius: 2px;
  box-shadow: 0 1px 6px rgba(35,32,27,.10); display: block;
}
.cmp_article_list .obj_article_summary > .title { grid-column: 2; grid-row: 1; }
.cmp_article_list .obj_article_summary > .meta  { grid-column: 2; grid-row: 2; }
.cmp_article_list .obj_article_summary > .galleys_links { grid-column: 2; grid-row: 3; }

/* rows without a cover use the full width */
.cmp_article_list .obj_article_summary:not(:has(.cover)) { grid-template-columns: minmax(0, 1fr); }
.cmp_article_list .obj_article_summary:not(:has(.cover)) > * { grid-column: 1; }

.cmp_article_list .obj_article_summary > .title {
  margin: 0 0 .1rem; line-height: 1.35; font-size: 1.05rem;
}
.cmp_article_list .obj_article_summary > .title a {
  color: var(--jis-maroon); font-weight: 600; text-decoration: none;
}
.cmp_article_list .obj_article_summary > .title a:hover,
.cmp_article_list .obj_article_summary > .title a:focus {
  color: var(--jis-maroon-dk); text-decoration: underline;
}
/* subtitle is a span inside the title heading */
.cmp_article_list .obj_article_summary .title .subtitle {
  display: block; margin-top: .12rem;
  color: var(--jis-muted); font-size: .95rem; font-weight: 400; line-height: 1.4;
}
.cmp_article_list .obj_article_summary .meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem;
  font-size: .89rem; color: var(--jis-muted); margin: .15rem 0 .45rem;
}
.cmp_article_list .obj_article_summary .authors { color: var(--jis-ink); margin: 0; }
.cmp_article_list .obj_article_summary .pages {
  float: none; font-variant-numeric: tabular-nums; color: var(--jis-muted); margin: 0;
}
.cmp_article_list .obj_article_summary .pages::before { content: "pp. "; }

/* ---------- PDF button ---------- */
.galleys_links { margin: 0; }
.galleys_links .obj_galley_link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; font-size: .82rem; font-weight: 600;
  letter-spacing: .03em;
  color: var(--jis-maroon); background: #fff;
  border: 1px solid var(--jis-gold); border-radius: 3px;
  text-decoration: none; transition: background .15s ease, color .15s ease;
}
.galleys_links .obj_galley_link:hover,
.galleys_links .obj_galley_link:focus {
  background: var(--jis-maroon); border-color: var(--jis-maroon);
  color: #fff; text-decoration: none;
}

/* ---------- sidebar ---------- */
.pkp_structure_sidebar .pkp_block { margin-bottom: 1.75rem; }
.pkp_structure_sidebar .pkp_block .title {
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--jis-maroon); font-weight: 700;
  border-bottom: 1px solid var(--jis-rule); padding-bottom: .4rem; margin-bottom: .7rem;
}
.pkp_structure_sidebar .pkp_block ul { list-style: none; margin: 0; padding: 0; }
.pkp_structure_sidebar .pkp_block li { margin-bottom: .35rem; }
.pkp_structure_sidebar .pkp_block a { color: var(--jis-ink); text-decoration: none; }
.pkp_structure_sidebar .pkp_block a:hover { color: var(--jis-maroon); text-decoration: underline; }

/* the feed block ships raw ATOM/RSS badge images — show tidy text links instead */
.pkp_structure_sidebar .block_web_feed img { display: none; }
.pkp_structure_sidebar .block_web_feed li a::after {
  content: attr(href);
  font-size: 0;
}
.pkp_structure_sidebar .block_web_feed li:nth-child(1) a::before { content: "Atom 1.0"; }
.pkp_structure_sidebar .block_web_feed li:nth-child(2) a::before { content: "RSS 2.0"; }
.pkp_structure_sidebar .block_web_feed li:nth-child(3) a::before { content: "RSS 1.0"; }
.pkp_structure_sidebar .block_web_feed li a {
  font-size: .88rem; color: var(--jis-muted);
}
.pkp_structure_sidebar .block_web_feed li a:hover { color: var(--jis-maroon); }

/* ---------- header ---------- */
.pkp_structure_head .pkp_site_name .is_img img { max-height: 74px; width: auto; }
.pkp_site_nav_menu a:hover { text-decoration: underline; }

/* ---------- archives listing ---------- */
.obj_issue_summary { border-bottom: 1px solid var(--jis-rule); padding-bottom: 1rem; }
.obj_issue_summary .title a { color: var(--jis-maroon); font-weight: 600; text-decoration: none; }
.obj_issue_summary .title a:hover { text-decoration: underline; }

/* ---------- small screens ---------- */
@media (max-width: 620px) {
  .cmp_article_list .obj_article_summary { grid-template-columns: 74px minmax(0, 1fr); gap: 0 .9rem; }
  .cmp_article_list .obj_article_summary .cover { width: 74px; max-width: 74px; }
  .cmp_article_list .obj_article_summary .cover img { width: 100%; height: auto; }
  .pkp_page_index .current_issue .described { flex-direction: column; }
  .pkp_page_index .current_issue img { max-width: 150px; }
}

/* ============================================================
   Fixes found by inspecting the rendered page
   ============================================================ */

/* The theme clearfixes .obj_article_summary with display:table pseudo-elements.
   Under `display:grid` those become grid ITEMS and add phantom rows.
   Same for the li and the current-issue block. */
.cmp_article_list .obj_article_summary::before,
.cmp_article_list .obj_article_summary::after,
.pkp_page_index .cmp_article_list > li::before,
.pkp_page_index .cmp_article_list > li::after,
.pkp_page_index .current_issue::before,
.pkp_page_index .current_issue::after { display: none !important; }

/* section heading: full width, no leftover theme border */
.pkp_page_index .sections .section > h3 {
  width: 100%; box-sizing: border-box; border-top: 0; border-left: 0; border-right: 0;
}
.pkp_page_index .sections .section { border: 0; margin-bottom: 1.4rem; }
.pkp_page_index .sections:not(:first-child) { margin-top: 1.75rem; }

/* current issue: remove the dead space under the cover */
.pkp_page_index .current_issue { margin-bottom: 1.75rem; }
.pkp_page_index .current_issue .current_issue_title { margin: .35rem 0 .8rem; }
.pkp_page_index .current_issue .described { margin-bottom: 0; padding-bottom: 0; }
.pkp_page_index .current_issue .described::before,
.pkp_page_index .current_issue .described::after { display: none; }
.pkp_page_index .current_issue .cover { margin-bottom: 0; float: none; }

/* trim the last row's trailing padding so sections butt up neatly */
.cmp_article_list > li:last-child .obj_article_summary { padding-bottom: .25rem; }

/* .articles carries a ~50px top margin from the theme; the heading already
   provides the separation, so the sections can sit closer together */
.pkp_page_index .sections .articles { margin-top: 0; }
.pkp_page_index .sections .section { margin-bottom: .9rem; }
.pkp_page_index .sections .section + .section { margin-top: 1.6rem; }
