/*
 * SoTL Africa — Custom Journal Stylesheet
 * Platform: Open Journal Systems (OJS) 3.1.2.4 / PKP Default Theme
 *
 * HOW TO APPLY:
 *   Dashboard → Settings → Website → Appearance → Advanced
 *   → Upload this file under "Journal Stylesheet (CSS)"
 *
 * NOTE ON THE COVER IMAGE:
 *   A true pop-up lightbox requires JavaScript, which cannot live
 *   in a .css file. This stylesheet instead makes the cover image
 *   open the full-size image in a new browser tab when clicked —
 *   the cleanest "view larger" experience achievable with CSS alone.
 *   The existing OJS anchor around the cover already handles the
 *   click; we just style it to signal that behaviour clearly.
 *
 * SECTIONS:
 *   1.  Design Tokens
 *   2.  Global / Body
 *   3.  Header & Navigation
 *   4.  Homepage — Current Issue block
 *   5.  Full Issue section (hidden)
 *   6.  Articles list
 *   7.  Additional content block
 *   8.  Sidebar
 *   9.  Footer
 *   10. Responsive tweaks
 *   11. Cover image — "View larger" affordance
 * ------------------------------------------------------------------ */


/* ══════════════════════════════════════════════════
   1. DESIGN TOKENS
   ══════════════════════════════════════════════════ */
:root {
  --sotl-crimson:     #8B1A1A;
  --sotl-crimson-dk:  #6B1212;
  --sotl-gold:        #C8973A;
  --sotl-cream:       #FAF7F2;
  --sotl-text:        #2C2C2C;
  --sotl-muted:       #666666;
  --sotl-border:      #E0D8CC;
  --sotl-link:        #7A1515;
  --sotl-link-hover:  #C8973A;
  --sotl-radius:      4px;
  --sotl-font-body:   'Noto Sans', sans-serif;
  --sotl-font-serif:  Georgia, 'Times New Roman', serif;
}


/* ══════════════════════════════════════════════════
   2. GLOBAL / BODY
   ══════════════════════════════════════════════════ */
body {
  background-color: var(--sotl-cream);
  color: var(--sotl-text);
  font-family: var(--sotl-font-body);
  font-size: 16px;
  line-height: 1.7;
}
a {
  color: var(--sotl-link);
  text-decoration: none;
}
a:hover, a:focus {
  color: var(--sotl-link-hover);
  text-decoration: underline;
}
h1, h2, h3, h4 {
  font-family: var(--sotl-font-serif);
  color: var(--sotl-crimson);
  line-height: 1.3;
}


/* ══════════════════════════════════════════════════
   3. HEADER & NAVIGATION
   ══════════════════════════════════════════════════ */
.pkp_structure_head {
  background-color: var(--sotl-crimson);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.pkp_site_name_wrapper {
  padding: 12px 0;
}
.pkp_navigation_primary .pkp_nav_list > li > a {
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  transition: background 0.2s;
}
.pkp_navigation_primary .pkp_nav_list > li > a:hover,
.pkp_navigation_primary .pkp_nav_list > li > a:focus {
  background-color: var(--sotl-crimson-dk);
  text-decoration: none;
  color: var(--sotl-gold);
}
.pkp_navigation_primary .pkp_nav_list li ul {
  background-color: var(--sotl-crimson-dk);
  border-top: 2px solid var(--sotl-gold);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.pkp_navigation_primary .pkp_nav_list li ul li a {
  color: #f5e9d9;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.pkp_navigation_primary .pkp_nav_list li ul li a:hover {
  background-color: rgba(0,0,0,0.2);
  color: var(--sotl-gold);
}
.pkp_search input[type="text"] {
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--sotl-radius);
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 5px 10px;
}
.pkp_search input[type="text"]::placeholder { color: rgba(255,255,255,0.6); }
.headerSearchPrompt { color: #fff !important; }


/* ══════════════════════════════════════════════════
   4. HOMEPAGE — CURRENT ISSUE BLOCK
   ══════════════════════════════════════════════════ */
.page_index_journal {
  padding: 24px 0;
}
.current_issue > h2 {
  font-size: 1.6rem;
  border-bottom: 3px solid var(--sotl-gold);
  padding-bottom: 8px;
  margin-bottom: 18px;
  display: inline-block;
}
.current_issue_title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sotl-muted);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

/* Grid layout: cover top-left, date bottom-left, description spans full right
   HTML order is: a.cover → .description → .published                        */
.obj_issue_toc .heading {
  display: grid !important;
  grid-template-columns: 300px 1fr !important;
  grid-template-rows: auto auto !important;
  column-gap: 28px !important;
  row-gap: 0 !important;
  align-items: start !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Override OJS clearfix pseudo-elements that fight grid layout */
.obj_issue_toc .heading::before,
.obj_issue_toc .heading::after {
  display: none !important;
  content: none !important;
}

/* Override OJS default .published margin (theme sets margin: 20px 0) */
.obj_issue_toc .published {
  margin: 0 !important;
}
.obj_issue_toc .heading .cover {
  margin-bottom: 0 !important;
}

/* Cover image — top-left cell */
.obj_issue_toc .heading > a.cover {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
  justify-self: stretch !important;
  line-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.obj_issue_toc .heading > a.cover > img,
.obj_issue_toc .heading .cover img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Published date — below the cover in left column */
.obj_issue_toc .heading > .published {
  grid-column: 1 !important;
  grid-row: 2 !important;
  align-self: start !important;
  margin: 6px 0 0 0 !important;
  padding: 0 !important;
}
.obj_issue_toc .heading .published .label {
  font-weight: 700;
  color: var(--sotl-crimson);
  display: block;
}
.obj_issue_toc .heading .published .value {
  display: block;
}

/* Description — right column, spans both rows, flush top */
.obj_issue_toc .heading > .description {
  grid-column: 2 !important;
  grid-row: 1 / 3 !important;
  align-self: start !important;
  font-size: 0 !important;          /* collapse bare &nbsp; text nodes */
  line-height: 0 !important;        /* collapse bare &nbsp; text nodes */
  color: #444;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
/* Restore sizing on actual child elements */
.obj_issue_toc .heading .description > * {
  font-size: 0.93rem !important;
  line-height: 1.75 !important;
}
/* Collapse the leading empty &nbsp; paragraph */
.obj_issue_toc .heading .description > p:first-child {
  display: none !important;
}
.obj_issue_toc .heading .description p {
  margin-top: 0;
  margin-bottom: 0.8em;
}


/* ══════════════════════════════════════════════════
   5. FULL ISSUE SECTION
   ══════════════════════════════════════════════════
   OPTION A (active): hide entirely.
   OPTION B: swap comments to show with clean buttons.
   ══════════════════════════════════════════════════ */

/* --- OPTION A: hide --- */
.obj_issue_toc .galleys { display: none; }

/*
--- OPTION B: show with styled buttons (uncomment to use)

.obj_issue_toc .galleys { margin: 20px 0; }
.obj_issue_toc .galleys > h2 {
  font-size: 1rem;
  color: var(--sotl-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.obj_issue_toc .galleys_links {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.obj_issue_toc .galleys_links li { margin: 0; }
.obj_issue_toc .galleys_links .obj_galley_link {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: var(--sotl-radius);
  background-color: var(--sotl-crimson);
  color: #fff !important;
  transition: background 0.2s;
}
.obj_issue_toc .galleys_links .obj_galley_link:hover,
.obj_issue_toc .galleys_links .obj_galley_link:focus {
  background-color: var(--sotl-gold);
  color: #fff !important;
  text-decoration: none;
}
*/


/* ══════════════════════════════════════════════════
   6. ARTICLES LIST
   ══════════════════════════════════════════════════ */
.obj_issue_toc .section > h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sotl-muted);
  border-bottom: 1px solid var(--sotl-border);
  padding-bottom: 6px;
  margin: 28px 0 14px;
}
.obj_article_summary {
  padding: 16px 0;
  border-bottom: 1px solid var(--sotl-border);
}
.obj_article_summary:last-child { border-bottom: none; }
.obj_article_summary .title a {
  font-family: var(--sotl-font-serif);
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--sotl-crimson);
  line-height: 1.4;
}
.obj_article_summary .title a:hover {
  color: var(--sotl-gold);
  text-decoration: underline;
}
.obj_article_summary .authors {
  font-size: 0.88rem;
  color: var(--sotl-muted);
  margin: 4px 0 10px;
}
.obj_article_summary .obj_galley_link,
.obj_article_summary .obj_galley_link.pdf {
  display: inline-block;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: var(--sotl-radius);
  background-color: var(--sotl-crimson);
  color: #fff !important;
  transition: background 0.2s;
}
.obj_article_summary .obj_galley_link:hover,
.obj_article_summary .obj_galley_link:focus {
  background-color: var(--sotl-gold);
  color: #fff !important;
  text-decoration: none;
}
.read_more {
  display: inline-block;
  margin-top: 24px;
  padding: 9px 22px;
  background-color: var(--sotl-crimson);
  color: #fff !important;
  border-radius: var(--sotl-radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.read_more:hover, .read_more:focus {
  background-color: var(--sotl-gold);
  color: #fff !important;
  text-decoration: none;
}


/* ══════════════════════════════════════════════════
   7. ADDITIONAL CONTENT BLOCK
   ══════════════════════════════════════════════════ */
.additional_content {
  margin-top: 40px;
  padding: 28px 32px;
  background: #fff;
  border-left: 4px solid var(--sotl-gold);
  border-radius: var(--sotl-radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 0.93rem;
}
.additional_content p { margin-bottom: 0.85em; color: var(--sotl-text); }
.additional_content strong { color: var(--sotl-crimson); }


/* ══════════════════════════════════════════════════
   8. SIDEBAR
   ══════════════════════════════════════════════════ */
.pkp_structure_sidebar .pkp_block {
  background: #fff;
  border: 1px solid var(--sotl-border);
  border-radius: var(--sotl-radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.pkp_structure_sidebar .pkp_block .title {
  display: block;
  background-color: var(--sotl-crimson);
  color: #fff;
  font-family: var(--sotl-font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  text-transform: uppercase;
}
.pkp_block_information .content { padding: 12px 14px; }
.pkp_block_information .content ul { list-style: none; padding: 0; margin: 0; }
.pkp_block_information .content li {
  padding: 6px 0;
  border-bottom: 1px solid var(--sotl-border);
}
.pkp_block_information .content li:last-child { border-bottom: none; }
.pkp_block_information .content a { font-size: 0.9rem; color: var(--sotl-link); }
.pkp_block_information .content a:hover { color: var(--sotl-link-hover); }


/* ══════════════════════════════════════════════════
   9. FOOTER
   ══════════════════════════════════════════════════ */
.pkp_structure_footer_wrapper {
  background-color: var(--sotl-crimson-dk);
  margin-top: 48px;
  padding: 24px 0;
}
.pkp_structure_footer { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.pkp_brand_footer img { filter: brightness(0) invert(1); opacity: 0.6; }
.pkp_brand_footer img:hover { opacity: 1; }


/* ══════════════════════════════════════════════════
   10. RESPONSIVE TWEAKS
   ══════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Single column stack on mobile */
  .obj_issue_toc .heading {
    display: block;
  }
  .obj_issue_toc .heading .cover img {
    width: 180px;
    max-width: 180px;
    margin-bottom: 8px;
  }
  .obj_issue_toc .heading .published {
    margin-bottom: 16px;
  }
  .additional_content { padding: 18px 16px; }
}


/* ══════════════════════════════════════════════════
   11. COVER IMAGE — LIGHTBOX
   ══════════════════════════════════════════════════
   Hover/zoom styles live here.
   The actual lightbox pop-up is driven by the
   companion <script> in the Custom Header Plugin.
   ══════════════════════════════════════════════════ */

/* Wrapper positioning for the hover badge */
.obj_issue_toc .heading .cover,
.obj_issue_toc .heading a.cover {
  position: relative;
  text-decoration: none !important;
}

/* The image itself */
.obj_issue_toc .heading .cover img {
  display: block;
  border: 3px solid var(--sotl-border);
  border-radius: var(--sotl-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  cursor: zoom-in;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

/* Lift and glow on hover */
.obj_issue_toc .heading .cover:hover img,
.obj_issue_toc .heading a.cover:hover img {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(139,26,26,0.25);
  border-color: var(--sotl-gold);
}

/* "View larger" badge — fades in on hover */
.obj_issue_toc .heading .cover::after,
.obj_issue_toc .heading a.cover::after {
  content: "🔍  View larger";
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(139, 26, 26, 0.88);
  color: #fff;
  font-size: 0.7rem;
  font-family: var(--sotl-font-body);
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.obj_issue_toc .heading .cover:hover::after,
.obj_issue_toc .heading a.cover:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Lightbox overlay — centred, dark backdrop ── */
#sotl-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.85);
  /* centre everything */
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.25s;
}
#sotl-lightbox.is-open {
  display: flex;
  opacity: 1;
}

/* The enlarged image — capped at a comfortable size */
#sotl-lightbox-img {
  display: block;
  max-width: min(550px, 88vw);
  max-height: 95vh;
  width: auto;
  height: auto;
  border: 4px solid #fff;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  cursor: default;
  transform: scale(0.94);
  transition: transform 0.25s;
  /* centred by the flex parent */
  margin: 0 auto;
}
#sotl-lightbox.is-open #sotl-lightbox-img {
  transform: scale(1);
}

/* Close button — large, obvious, top-right */
#sotl-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(139, 26, 26, 0.92);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  z-index: 100000;
}
#sotl-lightbox-close:hover {
  background: var(--sotl-gold, #C8973A);
  border-color: #fff;
}

/* Dismiss hint below the image */
#sotl-lightbox-hint {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-family: var(--sotl-font-body, sans-serif);
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  margin-top: 4px;
}