/* =========================================================
   Just the Docs layout: maximize main content width
   - Small padding
   - No readability max-width cap
   - Sidebar takes a fixed/clamped width; main fills the rest
   ========================================================= */

/* ---- Core layout variables ---- */
:root{
  /* Sidebar width (adjust if desired) */
  --nav-width: clamp(260px, 18vw, 320px);

  /* Minimal padding around main text */
  --content-pad-x: 1.0rem;
  --content-pad-y: 1.0rem;
}

/* Standard image widths */
.img-small  { max-width: min(100%, 300px); height: auto; }
.img-medium { max-width: min(100%, 600px); height: auto; }
.img-large  { max-width: min(100%, 900px); height: auto; }
.img-full   { width: 100%; height: auto; }

/* Center images cleanly */
.img-center {
  display: block;
  margin: 1.5rem auto;
}

/* ---- Headings / minor typography tweaks ---- */
.main-content h1:first-of-type { margin-top: 0.5rem; }
.main-content h3 { margin-top: 1.25rem; }

/* Optional: bibliography styling */
.csl-entry { margin-bottom: 0.75rem; }
.csl-left-margin { font-weight: 600; margin-right: 0.5rem; }

/* ---- Sidebar behavior ---- */
.side-bar{
  width: var(--nav-width) !important;
  min-width: var(--nav-width) !important;
  left: 0 !important;
  transition: transform 0.25s ease;
}

/* Hidden state (used by the built-in toggle JS) */
.side-bar.hidden{
  transform: translateX(-100%);
}

/* ---- Cover page ---- */
.report-cover {
  /* true full-bleed on screen */
  width: 100vw;
  height: 100vh;                 /* avoid min-height + padding overflow */
  margin-left: calc(-50vw + 50%);
  padding: 0;                    /* padding on inner panel instead */
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;              /* prevents accidental spill/scrollbars */
  box-sizing: border-box;
}

/* background image + overlay (NO fixed positioning) */
.report-cover::before {
  content: "";
  position: absolute;
  inset: 0;

  background:
    linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)),
    url("../images/cover.png") center / cover no-repeat;

  z-index: -1;
}

/* title panel */
.report-cover__panel {
  width: min(900px, 92vw);
  padding: clamp(24px, 4vw, 56px);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 60px rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
}

/* Make cover panel "glass" and readable on top of the dark cover overlay */
.report-cover__panel {
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
}
.report-cover__panel a { color: #fff; text-decoration: underline; }
.report-cover__panel strong { color: #fff; }


/* Optional: hide sidebar + header chrome ONLY on the cover page */
body.cover-page .side-bar,
body.cover-page .breadcrumb-nav,
body.cover-page .aux-nav {
  display: none !important;
}

body.cover-page .main {
  margin-left: 0 !important;
}

body.cover-page .main-content-wrap {
  padding-left: 0 !important;
}

/* ---- Main layout: no big gutter, fill available space ---- */
/* On desktop, Just the Docs offsets the main area with margin-left.
   We set that explicitly to match the sidebar width. */
@media (min-width: 50rem){
  .side-bar + .main,
  .side-bar + .main-content-wrap{
    margin-left: var(--nav-width) !important;
    width: auto !important;       /* let it naturally fill remaining space */
    max-width: none !important;   /* remove theme caps */
  }

  .main{
    max-width: none !important;   /* remove theme cap (often 50rem) */
  }
}

/* On-screen PDF page should not look like the site */
.pdf-page .pdf-main {
  padding: 0;
}

.pdf-page .pdf-main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Page breaks */
.page-break {
  height: 0;
}

/* Cover (screen) */
.pdf-cover {
  width: 100vw;
  height: 100vh;                 /* avoid min-height overflow */
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%); /* full-bleed even inside centered content */
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  overflow: hidden;
  box-sizing: border-box;

  background: url("../images/cover.png") center / cover no-repeat;
}

.pdf-cover__content {
  max-width: 700px;
  padding: 8vh 6vw;
}

.pdf-cover__rule {
  height: 1px;
  width: min(520px, 70vw);
  margin: 16px auto;
  background: rgba(255, 255, 255, 0.85);
}

.pdf-subtitle { margin-top: 1rem; font-size: 2.5rem; }
.pdf-author, .pdf-date { margin-top: 0.75rem; opacity: 0.95; font-size: 1.5rem; }

/* When sidebar is hidden, reclaim full width */
.side-bar.hidden + .main,
.side-bar.hidden + .main-content-wrap{
  margin-left: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* Remove theme “reading width” caps wherever they appear */
.main-content,
.page-content,
.content{
  max-width: none !important;
  width: 100% !important;
}

/* Minimal padding so content uses the window */
.main-content,
.page-content{
  padding-left: var(--content-pad-x) !important;
  padding-right: var(--content-pad-x) !important;
  padding-top: var(--content-pad-y) !important;
  padding-bottom: var(--content-pad-y) !important;
}

/* ---- Mobile / narrow screens: stack naturally ---- */
@media (max-width: 50rem){
  .side-bar{
    width: auto !important;
    min-width: 0 !important;
  }

  .main,
  .main-content-wrap{
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* =========================================================
   Glossary-only styles 
   ========================================================= */

.glossary-wrap {
  --bg-color: #f8f9fa;
  --text-color: #212529;
  --heading-color: #000;
  --accent-color: #0d6efd;
  --border-color: #dee2e6;
  --link-hover-bg: #0d6efd;
  --link-hover-text: #ffffff;

  font-family: 'Inter', 'Roboto', 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text-color);
  scroll-behavior: smooth;
}

/* Main glossary container */
.glossary-wrap .container {
  max-width: none !important;
  width: 100%;
  margin: 0;
  padding-left: var(--content-pad-x);
  padding-right: var(--content-pad-x);
}

/* Glossary header */
.glossary-wrap header {
  text-align: center;
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.glossary-wrap header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--heading-color);
  margin: 0;
}

/* Alphabet navigation */
.glossary-wrap .alpha-nav {
  text-align: center;
  margin-bottom: 3rem;
  position: sticky;
  top: 0;
  background-color: rgba(248, 249, 250, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.75rem 0;
  z-index: 2;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.glossary-wrap .alpha-nav a {
  text-decoration: none;
  color: var(--accent-color);
  margin: 0 0.25rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.glossary-wrap .alpha-nav a:hover {
  background-color: var(--link-hover-bg);
  color: var(--link-hover-text);
}

/* Glossary sections */
.glossary-wrap .glossary-section { margin-bottom: 3rem; }

.glossary-wrap .glossary-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

/* Definition list */
.glossary-wrap dl {
  display: grid;
  grid-template-columns: 220px 1fr; /* term column | definition column */
  column-gap: 1.5rem;
}

.glossary-wrap dt {
  font-weight: 600;
  margin: 0;
}

.glossary-wrap dd {
  margin: 0 0 1rem 0;
  padding-left: 1rem;             
  border-left: 2px solid var(--border-color);
}

/* Footer + utilities */
.glossary-wrap hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0;
}

.glossary-wrap footer {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.glossary-wrap .back-to-top {
  text-decoration: none;
  font-weight: 600;
  color: var(--text-color);
  background-color: #e9ecef;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.glossary-wrap .back-to-top:hover {
  background-color: #343a40;
  color: var(--bg-color);
}

/* Buttons */
.glossary-wrap .btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.glossary-wrap .btn-primary {
  color: var(--link-hover-text);
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

/* Glossary: offset anchor jumps so the term appears a few lines lower */
@media screen {
  :root { --glossary-anchor-offset: 5rem; }

  .glossary-wrap dt:target {
    scroll-margin-top: var(--glossary-anchor-offset);
  }

  .glossary-wrap .glossary-section:target {
    scroll-margin-top: var(--glossary-anchor-offset);
  }
}

.glossary-wrap .btn-primary:hover { opacity: 0.9; }

@media (max-width: 50rem) {
  .glossary-wrap dl {
    grid-template-columns: 1fr; /* Forces a single, full-width column */
  }
  
  .glossary-wrap dt {
    margin-bottom: 0.5rem; /* Separates the term slightly from its definition */
  }

  .glossary-wrap dd {
    margin-bottom: 2.5rem; /* Adds breathing room between individual glossary entries */
  }
}

/* =========================================================
   Figure captions (screen + print)
   ========================================================= */
.figcaption,
p.figcaption {
  display: block;
  margin: -0.75rem auto 1.5rem auto;
  max-width: 900px;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #4b5563;
  text-align: center;
}


/* Chapter title injected by layout: chapter */
.chapter-title {
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
}

/* =========================================================
   Disclaimer formatting
   ========================================================= */
.report-disclaimer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(128, 128, 128, 0.3);
  font-size: 0.85rem;
  line-height: 1.4;
  color: #6b7280; 
  text-align: left;
}
