/* =========================
   1) TOKENS & GLOBAL SCALE
   ========================= */
:root{
  /* Brand */
  --brand:        #007F99;
  --bs-primary:   var(--brand);

  /* Surfaces & text (light) */
  --ink:          #1f2937;
  --ink-soft:     #6b7280;
  --text:         var(--ink);
  --text-strong:  var(--ink);
  --muted:        var(--ink-soft);
  --panel:        #ffffff;
  --paper:        #f7f7f8;
  --line:         rgba(0,0,0,.08);
  --panel-border: rgba(0,0,0,.12);
  --hairline:     rgba(0,0,0,.08);

  /* Effects & shape */
  --shadow:       0 6px 18px rgba(0,0,0,.06);
  --radius:       24px;

  /* Icons */
  --icon-lg: 3rem;
  --icon-md: 2rem;

  /* Type scale (sectioncard baseline) */
  --fs-xs:   .85rem;
  --fs-sm:   .95rem;
  --fs-base: 1rem;
  --fs-lg:   1.15rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  clamp(1.2rem, 1vw + 1rem, 1.5rem);

  /* Misc */
  --chev-filter: invert(0) opacity(.55);
}

@media (prefers-color-scheme: dark){
  :root{
    --ink:          #e5e7eb;
    --ink-soft:     #a3a3a3;
    --text:         var(--ink);
    --text-strong:  #fff;
    --muted:        rgba(229,231,235,.72);
    --panel:        #242525;
    --paper:        #1a1a1a;
    --line:         rgba(255,255,255,.12);
    --panel-border: rgba(255,255,255,.12);
    --hairline:     rgba(255,255,255,.10);
    --shadow:       0 10px 24px rgba(0,0,0,.5);
    --chev-filter:  invert(1) opacity(.75);
  }
  body{ background: var(--paper); }
}

/* =========================
   2) BASE
   ========================= */
body{
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a{ color: var(--brand); text-decoration: none; }
a:hover{ text-decoration: underline; }

.navbar{ background: var(--brand); }
.container-xl, .container{ max-width: 1200px; }

.tema-card,
.pub-item.card {
  padding-bottom:1em;
  padding-left:1.1em;
}

/* =========================
   3) HERO
   ========================= */
.hero-banner{
  position: relative;
  border-radius: 0;
  color: var(--ink);
  background: linear-gradient(180deg, lightblue 0%, var(--panel) 100%);
  opacity: 0; animation: heroFadeIn 1.5s ease-out .2s forwards;
}
.hero-banner h1{
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .52em;
  line-height: 1;
  font-size: .70em;
  margin-bottom: 1.75rem;
  color: var(--brand);
  opacity: 0; transform: translateY(10px);
  animation: titleRise 1s ease-out .9s forwards;
}
.hero-banner .subtle{ font-size: var(--fs-base); opacity: .95; }
.hero-banner p{ color: var(--ink); font-size: var(--fs-sm); opacity: .95; }
.hero-banner .btn{
  padding: .6rem 1.1rem; border-radius: 999px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.15);
  opacity: 0; margin-bottom:.5rem; animation: buttonFade .8s ease-out .5s forwards;
}
.hero-banner .btn-primary{ background: var(--brand); border-color: var(--brand); }
.hero-banner .btn-primary:hover{ filter: brightness(.96); }

/* ✅ Secondary must be readable everywhere: white text + white outline */
.hero-banner .btn-tertiary {
  background: transparent;
  color: var(--ink);              /* only two dashes! */
  border: 2px solid var(--ink);  /* specify the border style */
  box-shadow: none;
}

@media (prefers-color-scheme: dark){
  .hero-banner {
    background: linear-gradient(
      180deg,
      rgb(38, 38, 40) 0%,   /* cool navy-ish top */
      var(--paper) 100%
    );
    color: var(--ink);
  }
  .hero-banner h1{ color: color-mix(in srgb, var(--brand) 90%, white 10%); }
  .hero-banner p{ color: var(--ink-soft); }
}

/* Animations */
@keyframes heroFadeIn{ from{opacity:0} to{opacity:1} }
@keyframes titleRise{ from{opacity:0;transform:translateY(15px)} to{opacity:1;transform:translateY(0)} }
@keyframes buttonFade{ from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }

/* =========================
   4) UNIFIED CARD SURFACE
   ========================= */
.card.KeyBox,
.sectioncard,
.link-card,
.feature-card,
.panel-card,
.tema-card,
.pub-item.card,
.contact-card,
.release-card{
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.sectioncard:hover,
.link-card:hover,
.tema-card:hover,
.pub-item.card:hover,
.contact-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow:
    0 6px 16px rgba(0,0,0,.10),
    inset 0 0 0 2px color-mix(in srgb, var(--brand) 55%, transparent);
}

/* =========================
   5) KPI CARDS
   ========================= */
.kpi-grid {
  max-width: 900px;
  margin-inline: auto;   /* centers the element */
  padding: 1.5em;  /* vertical and horizontal padding */
  box-sizing: border-box;        /* include padding inside the width */
}
.kpi-grid .grid{ gap:1.25rem; }
.card.KeyBox{
  display:flex; align-items:center; justify-content:center; text-align:center;
  padding:1.5rem 1.5rem; min-height:9rem;
}
.KeyValue{ color:var(--ink); font-size:clamp(1.6rem,3vw,2rem); font-weight:800; line-height:1.1; font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; margin-bottom:.25rem;}
.KeyTitle{ color:var(--ink); font-size:.7rem; font-weight:700; margin-bottom:.25rem;}
.KeySubtitle{ color:var(--ink-soft); font-size:.9rem; }

/* =========================
   6) SECTION CARDS — ALWAYS LEFT ALIGNED
   ========================= */
.sections{ background: var(--paper); padding:2rem 0; }

/* 🔒 No breakpoint trickery; hard left-aligned media layout */
.sectioncard{ cursor:pointer; }
.sectioncard .card-body{
  display:flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding: 1rem 1.25rem;
}
.sectioncard-icon{ flex:0 0 auto; font-size: var(--icon-lg); color: var(--brand); line-height:1; }
.sectioncard .sectioncard-textblock{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.section-title{ font-weight: 800; font-size: var(--fs-lg); line-height:1.2; margin:0 0 .15rem 0; color: var(--ink)}
.sectioncard .card-text{ margin:0; font-size: var(--fs-sm); line-height:1.3; color: var(--ink-soft)}

/* =========================
   7) LINK CARDS
   ========================= */
.link-card{ color: var(--ink); }
.link-card .card-title a{ color: var(--ink); font-size:.8em; font-weight:800; }
.link-card .card-title a:hover{ text-decoration:none; }
.link-card .card-subtitle, .link-card .card-text, .link-card .text-muted{ color: var(--ink-soft) !important; }
.link-card i.bi{ color: var(--ink-soft); opacity:.95; }

/* =========================
   8) SHORTY / PANEL CARD
   ========================= */
.panel-card{
  color: var(--text);
}
.panel-card .card-body{ padding: 1.25rem 1.25rem 1rem; }
.panel-card .card-title{
  color: var(--text-strong);
  margin-bottom:.35rem;
  padding-bottom:.5rem;
  border-bottom:1px solid var(--hairline);
}
.panel-card .text-muted{ color: var(--muted) !important; }
.plot-frame{ background: transparent; border: none; border-radius: 10px; padding: .25rem; }
.plot-frame .html-widget, .plot-frame .highcharts-container, .plot-frame .highcharts-root{ height:100% !important; }

/* Highcharts export menu — dark mode */
@media (prefers-color-scheme: dark){
  /* Dropdown container */
  .highcharts-menu {
    background: var(--panel) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: .375rem !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.5) !important;
  }
  .highcharts-menu hr { border-color: var(--hairline) !important; }
  /* Menu items */
  .highcharts-menu-item {
    color: var(--text) !important;
  }
  .highcharts-menu-item:hover {
    background: var(--brand) !important;
    color: #fff !important;
  }
  /* Context button background (SVG rect) */
  .highcharts-contextbutton .highcharts-button-box {
    fill: var(--panel) !important;
    stroke: var(--panel-border) !important;
  }
  .highcharts-contextbutton:hover .highcharts-button-box {
    fill: color-mix(in srgb, var(--panel) 75%, var(--brand) 25%) !important;
  }
  /* Hamburger icon lines */
  .highcharts-button-symbol {
    stroke: var(--ink) !important;
  }
}

/* Accordion inside panel */
.panel-accordion .accordion-item{ border:1px solid var(--panel-border); border-radius:.5rem; overflow:hidden; }
.panel-accordion .accordion-button{ background: var(--panel); color: var(--text); padding:.6rem 1rem; box-shadow:none; }
.panel-accordion .accordion-button:not(.collapsed){ background: color-mix(in srgb, var(--panel) 92%, var(--brand) 8%); }
.panel-accordion .accordion-body{ background: var(--panel); color: var(--text); border-top:1px solid var(--hairline); }
.panel-accordion .accordion-button::after{ filter: var(--chev-filter); }

/* =========================
   9) FEATURE CARD (ICON LEFT)
   ========================= */
.feature-card[data-clickable="true"]{ cursor:pointer; }
.feature-card .card-body{ text-align:left; }

.feature-row{
  display:flex;
  align-items:center;
  gap:1.25rem;
  flex-wrap: nowrap;
}
.feature-icon{ flex-shrink:0; display:flex; align-items:flex-start; justify-content:flex-start; }
.feature-icon i{ display:block; font-size: var(--icon-md); line-height:1; color: var(--brand); margin-top:.1rem; }
.feature-text{ flex:1 1 auto; min-width:0; }

.feature-eyebrow{ font-size:.8rem; font-weight:700; letter-spacing:.03em; color: var(--brand); margin-bottom:.15rem; }
.feature-title{ font-size: var(--fs-2xl); font-weight:800; margin-bottom:.15rem; color: var(--text-strong); }
.feature-subtitle{ font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom:.35rem; }
.feature-copy{ color: var(--text); }
.feature-copy p{ margin:.4rem 0; }

.feature-title a{ color: inherit !important; text-decoration: none !important; }
.feature-title a:hover{ color: var(--brand); text-decoration: underline; }

@media (max-width: 768px){
  .feature-row{ flex-wrap: wrap; }
  .feature-icon i{ font-size: 1.8rem; }
}

/* =========================
   10) READMORE
   ========================= */
.readmore{ position: relative; }
.readmore__content{
  position: relative;
  max-height: var(--readmore-height, 6rem);
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);

  /* fade last ~40% to transparent */
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.readmore:not(.expanded) .readmore__content::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:4rem; pointer-events:none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--panel), transparent 100%) 0%, color-mix(in srgb, var(--panel), transparent 10%) 60%, var(--panel) 100%);
}
.readmore__button-wrapper{ display:flex; justify-content:center; margin-top:.75rem; }
.readmore__toggle{
  border:0; background: var(--brand); color:#fff; width:2.4rem; height:2.4rem; border-radius:50%;
  font-size:1.5rem; line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  transition: transform .2s ease, background .2s ease; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.readmore__toggle:hover{ background: color-mix(in srgb, #f37321, black 12%); }
.readmore.expanded .readmore__content{
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}

/* Make the icon live in a true square and center it */
.readmore__icon{
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  line-height: 1;
}

/* Neutralize Bootstrap icon font quirks */
.readmore__icon .bi{
  display: block;
  line-height: 1;
  transform-origin: 50% 50%;
}

/* Rotate the glyph, not the wrapper */
.readmore.expanded .readmore__icon .bi{
  transform: rotate(45deg);
}

.readmore.expanded .readmore__icon .bi{
  transform: translateX(-0.03em) rotate(45deg);
}

/* =========================
   11) CONTACT CARD
   ========================= */
.contact-card{
  color: var(--text);
}
.contact-title{ font-weight: 800; font-size: var(--fs-2xl); margin-bottom: .6rem; }
.contact-row{ display:flex; align-items:flex-start; gap:1rem; }
.contact-icon{ flex-shrink:0; display:flex; align-items:flex-start; justify-content:center; }
.contact-icon i{ font-size: 2.4rem; line-height:1; color: var(--brand); margin-top:.15rem; }
.contact-text{ flex:1; min-width:0; }
.contact-name{ font-weight:700; margin-bottom:.15rem; color: var(--ink)}
.contact-role{ color: var(--ink-soft); font-weight:600; }
.contact-lines{ list-style:none; padding:0; margin:.25rem 0 0; }
.contact-line{ display:flex; align-items:baseline; gap:.25rem; color: var(--text); margin:.2rem 0; }
.contact-line i{ color: var(--ink-soft); }
.contact-line a{ color: var(--brand); text-decoration:none; }
.contact-line a:hover{ text-decoration: underline; }
@media (max-width:520px){ .contact-icon i{ font-size:2rem; } }

/* space between any two .card siblings */
.card + .card { margin-top: 1rem; }
.grid + .card { margin-top: 1rem; }

/* =========================
   12) PUBLICATION CALENDAR
   ========================= */
.pub-list{ display:flex; flex-direction:column; gap:.5rem; }

/* Card */
.pub-item.card{
  --bs-card-spacer-y: .5rem;
  --bs-card-spacer-x: .75rem;
}

/* Inner row */
.pub-item.card .card-body.pub-row{
  display:grid;
  grid-template-columns: 2.8rem 1fr;   /* date | text */
  align-items:center;
  gap:.75rem;
  padding:0;
  line-height:1.2;
}

/* Date */
.pub-datebox{
  width:2.8rem; text-align:center; line-height:1.05;
}
.pub-datebox .day{ font-weight:800; font-size:1.05rem; margin:0; color: var(--brand); }
.pub-datebox .mon{ font-weight:700; font-size:.7rem; text-transform:uppercase; opacity:.75; margin:0; color: var(--muted); }

/* Text */
.pub-text{ display:flex; flex-direction:column; gap:.1rem; min-width:0; }
.pub-title{ margin:0; font-weight:700; font-size: var(--fs-base); line-height:1.25; color: var(--text-strong); }
.pub-domain{ margin:0; font-size:.85rem; color: var(--muted); }

/* Footer link */
.pub-footer{ display:flex; justify-content:flex-end; margin-top:.75rem; }
.pub-more{ font-weight:600; font-size:.95rem; text-decoration:none; color: var(--brand); }
.pub-more:hover{ color: color-mix(in srgb, var(--brand) 85%, white 15%); text-decoration: underline; }
@media (prefers-color-scheme: dark){
  .pub-more:hover{ color: color-mix(in srgb, var(--brand) 85%, black 15%); }
}

/* Phone tweaks */
@media (max-width:576px){
  .pub-item.card .card-body.pub-row{ grid-template-columns: 2.4rem 1fr; gap:.6rem; }
  .pub-datebox{ width:2.4rem; }
  .pub-title{ font-size:.98rem; }
}

/* =========================
   13) UTILITIES & MISC
   ========================= */
.row.g-3{ --bs-gutter-x:1rem; --bs-gutter-y:1rem; }
.grid.g-3{ gap:1rem; }
#quarto-content>*{ padding-top:14px; }
#map{ border-radius:12px; max-height:70px; }
.footergrid{ max-width:1100px; margin-inline:auto; padding: var(--space-md) var(--space-sm); background: var(--panel); border-radius:12px; }
.sidebar nav[role=doc-toc] ul>li>a.active,
.sidebar nav[role=doc-toc] ul>li>ul>li>a.active{ border-left:1px solid var(--brand); color: var(--brand) !important; }
.sidebar nav[role=doc-toc] ul>li>a:hover,
.sidebar nav[role=doc-toc] ul>li>ul>li>a:hover{ color: var(--brand) !important; }


/* =========================
   Feature accordion (canonical — harmonized with shorty spacing)
   ========================= */
.feature-accordion{
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: transparent;
  margin: 1rem 1rem 1.25rem;
  overflow: hidden;
}
.feature-accordion .accordion-item{
  border: 0;
  background: transparent;
}
.feature-accordion .accordion-item + .accordion-item{
  border-top: 1px solid var(--hairline);
}
.feature-accordion .accordion-button{
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  padding: .75rem 1.25rem;
  box-shadow: none;
  border: none;
  border-radius: 0;
}
.feature-accordion .accordion-button:hover{
  background: color-mix(in srgb, var(--panel) 92%, var(--brand) 8%);
}
.feature-accordion .accordion-button:not(.collapsed){
  background: color-mix(in srgb, var(--panel) 95%, var(--brand) 5%);
  color: var(--text-strong);
}
.feature-accordion .accordion-button:focus{
  box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--brand) 25%, transparent);
}
.feature-accordion .accordion-button::after{
  filter: var(--chev-filter);
}
.feature-accordion .accordion-body{
  background: transparent;
  color: var(--text);
  border-top: 1px solid var(--hairline);
  padding: .85rem 1.25rem 1rem;
  line-height: 1.45;
}
.feature-card .feature-accordion{
  margin-top: 1rem;
  margin-bottom: 1rem;
}
@media (prefers-color-scheme: dark){
  .feature-accordion{ border-color: rgba(255,255,255,.2); }
  .feature-accordion .accordion-button:hover{ background: rgba(255,255,255,.04); }
  .feature-accordion .accordion-button:not(.collapsed){ background: rgba(255,255,255,.08); }
}

/* === Fix feature card icon alignment === */
.feature-card .card-body {
  padding: 1.25rem 1.25rem 1rem;
}

.feature-card .fx-row {
  display: flex;
  flex-direction: row;        /* always horizontal */
  align-items: flex-start;    /* top-align icon and text */
  gap: 1rem;                  /* nice breathing space */
}

/* icon/media column */
.feature-card .fx-media {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;    /* align icon to top */
  justify-content: center;
  width: auto;                /* don't force width */
}

.feature-card .fx-media i {
  font-size: 2rem;
  line-height: 1;
  color: var(--brand);
}

/* text column */
.feature-card .fx-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

/* mobile stays side-by-side too (no wrapping) */
@media (max-width: 576px) {
  .feature-card .fx-row {
    flex-wrap: nowrap;
  }
  .feature-card .fx-media i {
    font-size: 1.75rem;
  }
}


/* PHONE (≤576px) — icon left, text right */
@media (max-width: 576px){
  .sectioncard .card-body{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:1rem !important;
    text-align:left !important;
    padding:2rem 1.25rem !important;
  }
  .sectioncard .sectioncard-icon{ font-size:2rem !important; margin:0 !important; }
  .sectioncard .sectioncard-textblock{
    flex:1 1 auto; min-width:0;
    display:flex; flex-direction:column; align-items:flex-start; text-align:left !important;
  }
}

/* TABLET & DESKTOP (≥577px) — centered stack, regardless of markup */
@media (min-width: 577px){
  .sectioncard .card-body,
  .link-cards .sectioncard .card-body{  /* guard against listing styles */
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    justify-content:center !important;
    text-align:center !important;
    gap:.35rem !important;
    padding:1.25rem 1.5rem !important;
  }

  /* support both old (.sectioncard-icon) and new (.sc-icon .bi) markups */
  .sectioncard .sectioncard-icon,
  .sectioncard .sc-icon .bi{
    font-size:3rem !important;
    line-height:1;
    margin:0 0 .25rem 0 !important;
  }

  .sectioncard .sectioncard-textblock,
  .sectioncard .sc-copy{
    display:flex; flex-direction:column;
    align-items:center !important;
    text-align:center !important;
  }
}

/* Fix long text overflow in link cards */
.link-card,
.link-card .card-body,
.link-card .card-title,
.link-card .card-subtitle,
.link-card .card-text {
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;            /* gives natural hyphenation when possible */
}

.card-title > p {
  margin-bottom: 0;
}

.link-card i.bi {
  color: var(--brand);
}

.footergrid {
  margin: 1em;
  padding: 1em;
}

/* Keep wide tables inside panel-cards with horizontal scroll.
   Shorties use .shorty-table-wrapper instead — scoping overflow there
   prevents the title/description from scrolling along with the table. */
.panel-card .card-body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-card .card-body table,
.panel-card .card-body .table {
  width: max-content;   /* expand to natural width so scroll kicks in */
  min-width: 100%;      /* but fill the card when there’s room */
  border-collapse: collapse;
}

/* Keep cells on one line so the table doesn’t wrap awkwardly */
.panel-card .card-body table th,
.panel-card .card-body table td {
  white-space: nowrap;
}

.feature-card + p {
  margin-top: 1em;
}



h3, .h3 {
    font-weight: 500;
    color: var(--brand);
}

/* Base look (light & dark) */
.cardish-accordion {
  --acc-pad-x: 1rem;
  --acc-pad-y: 0.875rem;

  .accordion-item { border: 0; background: transparent; }

  .accordion-button {
    background: transparent;
    box-shadow: none !important;
    border-radius: var(--bs-border-radius-xxl) var(--bs-border-radius-xxl) 0 0;
    padding: var(--acc-pad-y) var(--acc-pad-x);
    font-weight: 700;
    color: var(--bs-body-color);
  }
  .accordion-button:not(.collapsed) {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--bs-primary);
  }

  .accordion-body { padding: 0 var(--acc-pad-x) var(--acc-pad-y); }

  .archive-item {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 0;
    border-top: 1px solid var(--bs-border-color-translucent);
  }
  .archive-item:first-child { border-top: 0; }

  .archive-item i.bi { font-size: 1.1rem; opacity: .9; color: var(--bs-danger); }

  /* 🔒 Kill Bootstrap's default blue link in this component */
  .archive-item a,
  .archive-item a:visited {
    color: inherit;               /* inherit card text color */
    text-decoration: none;
  }
  .archive-item a:hover {
    color: var(--bs-primary);     /* tasteful hover */
    text-decoration: underline;
  }
}

/* Dark mode — support both Bootstrap 5 data attr and Quarto's .quarto-dark */
[data-bs-theme="dark"] .cardish-accordion,
.quarto-dark .cardish-accordion {
  .accordion-button { color: var(--bs-body-color); background: transparent; }
  .accordion-button:not(.collapsed) {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
  }
  .accordion-body { background: transparent; }
  .archive-item { border-color: var(--bs-border-color-translucent, rgba(255,255,255,.15)); }
  .archive-item i.bi { color: #ff6b6b; }  /* gentle red that reads on dark */
}

/* Smooth theme toggle (optional) */
.cardish-accordion, .cardish-accordion * {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* Archive card should always use the card's themed colors */
.card-archive {
  /* Make inner bits inherit the card palette */
  color: var(--bs-card-color);
  background-color: var(--panel);

  .cardish-accordion {
    /* Buttons/headers */
    .accordion-button {
      background-color: var(--panel) !important; /* kill default white */
      color: var(--ink) !important;
      box-shadow: none !important;
    }
    .accordion-button:not(.collapsed) {
      /* subtle tint when open (works in both themes) */
      background-color: color-mix(in oklab, var(--bs-primary) 10%, var(--bs-card-bg)) !important;
      color: var(--bs-primary) !important;

    }

    /* Body inherits the card background */
    .accordion-body {
      background-color: var(--panel) !important;
      color: var(--ink) !important;
    }

    /* List items + borders that adapt to theme */
    .archive-item {
      display: flex; align-items: center; gap: .5rem;
      padding: .5rem 0;
      border-top: 1px solid var(--bs-card-border-color, var(--bs-border-color));
    }
    .archive-item:first-child { border-top: 0; }

    /* Icon and links */
    .archive-item i.bi { font-size: 1.05rem; color: var(--bs-danger); opacity: .9; }
    .archive-item a,
    .archive-item a:visited { color: inherit; text-decoration: none; }
    .archive-item a:hover   { color: var(--bs-primary); text-decoration: underline; }
  }
}

/* Ensure it flips in all dark-mode setups (Bootstrap attr + Quarto class).
   Using CSS variables means we usually don't need extra overrides here,
   but these increase specificity if your theme is stubborn. */
[data-bs-theme="dark"] .card-archive,
.quarto-dark .card-archive {
  .cardish-accordion .archive-item { 
    border-top-color: var(--bs-card-border-color, rgba(255,255,255,.15)) !important;
  }
}

.card-body {
    flex: 1 1 auto;
    -webkit-flex: 1 1 auto;
    padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x);
    color: var(--ink);
}

.accordion-body {
  background-color: var(--panel);
  color: var(--ink);
}
/* External link card — compact, responsive, wraps text properly */
.externcard {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
  color: var(--text);
  height: auto;
  align-self: start;
  max-width: 100%;
  position: relative;

  .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
  }

  /* Left side: icon + text stack */
  .d-flex.align-items-center.gap-3.min-w-0 {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
  }

  .externcard-icon {
    font-size: 1.5rem;
    color: var(--brand);
    flex-shrink: 0;
  }

  .min-w-0 {
    min-width: 0;
  }

  .externcard-title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
    margin: 0;
    color: var(--ink);
    word-break: break-word;
  }

  .externcard-subtitle {
    font-size: 0.9rem;
    margin: 0;
    color: var(--ink-soft);
    word-break: break-word;
  }

  /* Arrow always hugs the right */
  .externcard-chevron {
    flex-shrink: 0;
    font-size: 1.25rem;
    color: var(--brand);
    margin-left: 0.5rem;
  }

  a.stretched-link {
    color: inherit;
    text-decoration: none;
  }

  &:hover,
  &:focus-within {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
    box-shadow:
      0 6px 16px rgba(0,0,0,.10),
      inset 0 0 0 2px color-mix(in srgb, var(--brand) 55%, transparent);
  }
}

/* Responsive tweaks */
@media (max-width: 576px) {
  .externcard .card-body {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
  .externcard .externcard-icon { font-size: 1.35rem; }
  .externcard .externcard-chevron { font-size: 1.1rem; }
}

/* Dark mode — Quarto toggles data-bs-theme, not the OS media query,
   so --ink stays at its light-mode value. Override text explicitly. */
[data-bs-theme="dark"] .externcard,
.quarto-dark .externcard {
  background: #242525;
  border-color: rgba(255,255,255,.12);
}
[data-bs-theme="dark"] .externcard .externcard-title,
.quarto-dark .externcard .externcard-title {
  color: #e5e7eb;
}
[data-bs-theme="dark"] .externcard .externcard-subtitle,
.quarto-dark .externcard .externcard-subtitle {
  color: #a3a3a3 !important;
}

.externcard + p {
  margin: 1em;
}

/* =========================
   PDF PUBLICATION CARD
   Single panel-card with a download row and an optional
   archive accordion at the bottom (matches shorty rhythm).
   ========================= */
.pdf-publication {
  overflow: hidden;
}

.pdf-publication-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: background-color .15s ease;
}
.pdf-publication-link:hover,
.pdf-publication-link:focus-visible {
  background: color-mix(in srgb, var(--panel) 92%, var(--brand) 8%);
  color: inherit;
  text-decoration: none;
  outline: none;
}

.pdf-publication-icon {
  font-size: 1.75rem;
  color: var(--bs-danger, #dc3545);
  flex-shrink: 0;
}

.pdf-publication-text {
  flex: 1 1 auto;
  min-width: 0;
}

.pdf-publication-title {
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: .15rem;
  line-height: 1.3;
}

.pdf-publication-subtitle {
  font-size: .875rem;
  color: var(--muted);
}

.pdf-publication-chevron {
  font-size: 1.25rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Archive accordion sits flush against the download row,
   reusing the harmonized .feature-accordion treatment. */
.pdf-publication-archive {
  margin-top: 0;
}

.pdf-archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pdf-archive-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .55rem 0;
  border-top: 1px solid var(--hairline);
}
.pdf-archive-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.pdf-archive-list li:last-child {
  padding-bottom: 0;
}
.pdf-archive-list i.bi {
  font-size: 1rem;
  color: var(--bs-danger, #dc3545);
  flex-shrink: 0;
  opacity: .9;
}
.pdf-archive-list a,
.pdf-archive-list a:visited {
  color: inherit;
  text-decoration: none;
}
.pdf-archive-list a:hover {
  color: var(--brand);
  text-decoration: underline;
}

[data-bs-theme="dark"] .pdf-archive-list i.bi,
.quarto-dark .pdf-archive-list i.bi {
  color: #ff6b6b;
}

.title {
  color: var(--brand)
}

.card.KeyBox,
.sectioncard,
.link-card,
.feature-card,
.panel-card,
.tema-card,
.pub-item.card,
.tema-listing,
.contact-card{
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.form-label, .shiny-input-container .control-label {
    margin-top: .5rem;
    margin-bottom: .5rem;
}

/* Make sure select text is actually visible everywhere */
.form-select,
.form-select option {
  color: var(--ink) !important;
}

/* Dark mode variant, if needed */
@media (prefers-color-scheme: dark){
  .form-select,
  .form-select option {
    color: var(--ink) !important;
    background-color: var(--panel);
  }
}

.meta {
  white-space: normal;
}

/* =========================
   Dark mode footer fix
   ========================= */
/* =========================
   Unified dark footer colors
   ========================= */
:root.dark {
  /* Base text */
  --footer-text: #c7cbd3;        /* soft, readable gray */
  --footer-muted: #a6acb4;       /* slightly dimmer */
  --footer-link: #d3d7df;        /* same as text, but can underline */
  --footer-icon: #d3d7df;

  /* Borders */
  --footer-line: rgba(255,255,255,0.12);
}

/* Apply it to the whole footer */
footer {
  color: var(--footer-text);
  font-size: 0.95rem;
}

footer .text-muted,
footer small,
footer ul,
footer li {
  color: var(--footer-muted) !important;
}

/* Links in footer */
footer a,
footer a.link-secondary {
  color: var(--footer-link) !important;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Icons */
footer i {
  color: var(--footer-icon) !important;
}

/* Borders */
footer .border-top {
  border-top-color: var(--footer-line) !important;
}

footer h5 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}


footer small,
footer .text-muted,
footer ul,
footer li {
  font-size: 0.80rem !important;
  line-height: 1.4;
}

footer li i.bi {
  width: 1.4rem;      /* fixed width for all icons */
  display: inline-block;
  text-align: center; /* keeps icons centered in their box */
}

/* Normalize footer list layout */
footer li.footer-item {
  display: flex;
  align-items: flex-start;
}

/* Fixed-width icons so every line aligns */
footer li.footer-item i.bi {
  flex: 0 0 1.4rem; /* adjust if needed */
  text-align: center;
  margin-top: .15rem; /* visually centers */
}

/* Make the two-line address indent align perfectly */
footer .footer-address {
  display: inline-block;
}

/* Optional: tighten line-height for multi-line items */
footer li.footer-item {
  line-height: 1.3;
}

/* Scroll container for tables: covers both the explicit .shorty-table-wrapper
   (Lua shortcode path) and htmlwidget tables that land directly in .plot-frame. */
.shorty .shorty-table-wrapper,
.shorty .plot-frame {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shorty .shorty-table-wrapper table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-size: 0.9rem; /* small but extremely legible */
}

.shorty .shorty-table-wrapper table th,
.shorty .shorty-table-wrapper table td {
  white-space: nowrap;
}

.shorty-plotrow.shorty-two-plots {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .shorty-plotrow.shorty-two-plots {
    grid-template-columns: 1fr 1fr;
  }
}
/* Wrapper: one rounded container */
.accordion {
  --bs-accordion-border-color: #7d7d7d;
  border: 1px solid var(--bs-accordion-border-color);
  border-radius: var(--radius);
  overflow: hidden;              /* clip inner corners */
}

/* Items themselves should NOT be rounded */
.accordion-item {
  border: 0;
}

/* Base button style */
.accordion-button {
  color: var(--ink);
  background-color: var(--panel);
  border-radius: 0 !important;   /* reset Bootstrap’s tricks */
}

/* Only top item: round top corners */
.accordion-item:first-of-type .accordion-button {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

/* Only bottom item: round bottom corners when closed or open */
.accordion-item:last-of-type .accordion-button,
.accordion-item:last-of-type .accordion-button.collapsed {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.accordion-item + .accordion-item .accordion-button {
  border-top: 1px solid var(--bs-accordion-border-color);
}

/* Force caret to use your ink-muted or ink color */
.accordion-button::after {
  opacity: 1 !important;

  /* Use an SVG mask to recolor the arrow */
  background-image: none !important;
  mask-image: var(--bs-accordion-btn-icon);
  -webkit-mask-image: var(--bs-accordion-btn-icon);

  background-color: var(--brand); 
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 1.25rem;
}

.navbar .navbar-container>.navbar-nav {
  order: 4;
}

table.kable tr.group > td {
  color: var(--ink, #000) !important;
  font-weight: 600;
}

table.statgl-crosstable-rule {
  border-top: 2px solid #004459;
  border-bottom: 2px solid #004459;
  border-collapse: separate; /* usually default, but just in case */
}

.tema-card {
  background: var(--panel);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tema-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.tema-card-thumbnail {
  position: relative;
  overflow: hidden;
}

.tema-card-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
}

.tema-eyebrow {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--brand);
  color: white;
}

.tema-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.tema-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.tema-card-description {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted, #aaa);
}

/* Make each KPI column a flex container so margins don't collapse weirdly */
.kpi-grid .grid > .g-col-12.g-col-md-6 {
  display: flex;
  flex-direction: column;
}

/* Normalize the headings */
.kpi-grid .grid > .g-col-12.g-col-md-6 > h2 {
  margin: 0 0 1.75rem; 
}

/* Make sure the listing blocks don't add extra top margin */
.kpi-grid .grid > .g-col-12.g-col-md-6 > #tema-listing,
.kpi-grid .grid > .g-col-12.g-col-md-6 > #news-listing {
  margin-top: 0;
}

.kpi-grid h2 {
  margin-top: 0 !important;
  margin-bottom: 1.75rem;
}

.tema-card-thumbnail {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;              /* optional, keeps image tight */
}

.tema-card-thumbnail img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;      /* show entire image */
  object-position: center;
  border-radius: 0;         /* or keep if you want rounded top */
}

.input-group-text,
.form-control,
.form-control:focus {
  color: var(--ink);
  background-color: var(--panel);
}

/* Hide the left sidebar (but keep Quarto’s breadcrumb + layout working) */
#quarto-sidebar,
.quarto-sidebar {
  display: none !important;
  margin: 0 !important; 
  padding: 0 !important;
}

/* Reclaim the space the sidebar normally reserves */
#quarto-content {
  margin-left: 0 !important;
}

/* If you have any extra left padding from the sidebar layout, kill it */
body.nav-sidebar #quarto-content {
  padding-left: 0 !important;
}

/* 1) Hide the sidebar + its glass overlay */
#quarto-sidebar,
#quarto-sidebar-glass {
  display: none !important;
}

/* 2) Tell the layout that the sidebar is zero-width */
body.nav-sidebar {
  --quarto-sidebar-width: 0px !important;
}

/* 3) Remove any left offset the content gets in sidebar mode */
body.nav-sidebar #quarto-content,
body.nav-sidebar .page-columns {
}

/* Hide left sidebar + the glass overlay */
#quarto-sidebar,
#quarto-sidebar-glass {
  display: none !important;
}

/* Tell Quarto the left column is zero */
body.nav-sidebar {
  --quarto-sidebar-width: 0px !important;
}

/* Rebuild the grid only for the main container that holds sidebar + main + margin */
body.nav-sidebar #quarto-content.quarto-container.page-columns {
  grid-template-columns: 0px minmax(0, 1fr) var(--quarto-margin-width) !important;
}

/* Make sure the main content sits in the middle column */
body.nav-sidebar #quarto-document-content {
  grid-column: 2 !important;
}

/* Keep the TOC/margin sidebar in the right column */
body.nav-sidebar #quarto-margin-sidebar {
  grid-column: 3 !important;
}
/* Add breathing room to main content */
body.nav-sidebar #quarto-document-content {
  padding-left: 1.5em;
  padding-right: 1.5em;
}

/* Center body + TOC as a single constrained grid */
body.nav-sidebar #quarto-content.quarto-container.page-columns {
  width: min(900px, 100%);
  margin-inline: auto;
}
/* Center the entire 900px block (main + TOC) as a grid item */
body.nav-sidebar #quarto-content {
  justify-self: center;
}

body.nav-sidebar #quarto-content {
  justify-self: center;
  width: min(900px, 100%);
}
body.nav-sidebar #quarto-content.quarto-container.page-columns {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ---------- Anchors for normal document headings ---------- */

/* Quarto often puts ids on section, not only headings */
section[id],
h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id] {
  scroll-margin-top: 6rem;
}


/* ---------- Anchors inside shorty cards ---------- */

.shorty .card-title[id] {
  scroll-margin-top: 6rem;
}


/* ---------- Optional: any element with an id ---------- */
/* (useful if you sometimes anchor divs like <div id="contact">) */

[id] {
  scroll-margin-top: 6rem;
}

/* Desktop-only sticky navbar (keep current mobile behavior) */
@media (min-width: 992px) {
  .navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
  }
}

/* Explicitly keep mobile/tablet as-is */
@media (max-width: 991.98px) {
  .navbar {
    position: static; /* or whatever your current default is */
  }
}

@media (min-width: 992px) {
  h2, h3, h4, h5, [id] {
    scroll-margin-top: 90px; /* adjust to your navbar height */
  }
}

/* Make the anchor behave like your card container */
a.tema-card {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  padding: 1em;
}

/* Remove the default inner link outline */
a.tema-card:focus {
  outline: none;
}

/* Full-card highlight */
a.tema-card:focus-visible {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 0.75rem; /* match your card rounding */
}

.tema-listing > p { margin: 0; }

.pub-item {
  border-radius: 0.75rem; /* match your card rounding */
}

/* kill default focus outline on the invisible stretched link */
.pub-item .stretched-link:focus {
  outline: none;
}

/* show focus on the entire card */
.pub-item:focus-within {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}

.release-filter .form-control,
.release-filter .form-select {
  height: 38px;          /* same as Bootstrap default input */
  padding-top: .375rem;
  padding-bottom: .375rem;
}

/* ---------- Release calendar cards ---------- */
:root {
  /* meta = text used for dates, table descriptions, count — must stay legible
     in both themes (≈ WCAG AA on the panel background). */
  --meta: color-mix(in srgb, var(--text) 70%, transparent);
  /* Warm accent (canonical statgl `palette = "orange"`) — used for
     delayed-publication indicators and any other warm accents. */
  --brand-warm: #faa41a;
}
@media (prefers-color-scheme: dark) {
  :root {
    --meta: color-mix(in srgb, var(--text) 80%, transparent);
  }
}

.release-listing .release-cards .release-item .release-card {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.release-listing .release-cards .release-item .release-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow:
    0 12px 28px rgba(0,0,0,.08),
    inset 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent);
}
.release-listing .release-subject {
  letter-spacing: .04em;
  color: var(--brand);
}
.release-listing .release-title {
  color: var(--text-strong);
  line-height: 1.3;
}
.release-listing .release-date {
  color: var(--meta);
}
.release-listing .release-date i {
  opacity: .9;
}
.release-listing .release-badge {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.release-listing .release-tables {
  padding-left: 1.1rem;
  margin: 0;
}
.release-listing .release-tables li {
  margin: .15rem 0;
  color: var(--meta);
}
.release-listing .release-tables li::marker {
  color: color-mix(in srgb, var(--brand) 60%, var(--meta));
}
.release-listing .release-tables a {
  color: var(--brand);
}
.release-listing .release-tables a:hover {
  text-decoration: underline;
}
.release-listing .release-table-name {
  color: var(--meta);
}
.release-listing .release-count {
  color: var(--meta);
}
.release-listing .release-empty {
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px dashed var(--line);
  color: var(--meta);
}


.release-meta {
  color: var(--meta);
}

.release-listing .release-delayed {
  color: var(--brand-warm);
  font-weight: 600;
}
.release-listing .release-delayed i {
  opacity: .9;
}

/* Screen: hidden */
.print-footer { display: none; }

@media print {

/* typografi */
body { font-size: 11pt; line-height: 1.35; padding-bottom: 18mm; }
a { color: inherit; text-decoration: none; }

/* overskrifter */
h1, h2, h3 { break-after: avoid-page; page-break-after: avoid; }
h1, h2, h3 { orphans: 3; widows: 3; }

/* undgå split */
figure, img, pre, blockquote { break-inside: avoid; page-break-inside: avoid; }
table { break-inside: avoid; page-break-inside: avoid; }
tr, td, th { break-inside: avoid; page-break-inside: avoid; }

/* callouts/cards */
.callout, .card, .kpi, .kpi-card { break-inside: avoid; page-break-inside: avoid; }

/* luft før sektion */
h2 { margin-top: 18pt; }

/* manuel sideskift */
.pagebreak{
  break-before: page;
  page-break-before: always;
  display: block;
  height: 0;
}

/* footer */
.print-footer {
    display: block;

    right: 10mm;
    bottom: 8mm;
    left: auto;

    text-align: right;
    font-size: 9pt;
    line-height: 1.2;
    color: #666;

    background: transparent;
    border: none;
    padding: 0;

    z-index: 1;
    pointer-events: none; /* prevents selection weirdness */
  }


  .kpi-grid > footer.border-top {
    display: none !important;
  }



}

.pct-card .card-title {
  margin-bottom: 0.25rem;
}

.pct-card .form-range {
  min-width: 0;
}

.pct-card .pct-guess-value {
  min-width: 3.5rem;
  white-space: nowrap;
  font-weight: 600;
  color: var(--bs-body-color);
}

.pct-card .pct-main-result {
  font-size: 1.05rem;
  margin: 0 0 0.35rem 0;
}

.pct-card .pct-bar-wrap {
  margin-top: 0.25rem;
}

.pct-card .pct-bar {
  position: relative;
  display: flex;
  height: 40px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

.pct-card .pct-segment {
  flex: 1 1 0;
  border-right: 1px solid rgba(255,255,255,0.35);
}

.pct-card .pct-segment:nth-child(1)  { background: #e8f0f9; }
.pct-card .pct-segment:nth-child(2)  { background: #d1e2f3; }
.pct-card .pct-segment:nth-child(3)  { background: #b9d4ed; }
.pct-card .pct-segment:nth-child(4)  { background: #a2c6e7; }
.pct-card .pct-segment:nth-child(5)  { background: #8ab8e1; }
.pct-card .pct-segment:nth-child(6)  { background: #73aadb; }
.pct-card .pct-segment:nth-child(7)  { background: #5c9cd5; }
.pct-card .pct-segment:nth-child(8)  { background: #458ecf; }
.pct-card .pct-segment:nth-child(9)  { background: #2d80c9; }
.pct-card .pct-segment:nth-child(10) { background: #1672c3; border-right: 0; }

.pct-card .pct-marker {
  position: absolute;
  top: -6px;
  transform: translateX(-50%);
  width: 2px;
  height: 52px;
  background: var(--brand, #003366);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}

.pct-card .pct-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #777);
  margin-top: 0.4rem;
}

.pct-card .btn-primary {
  background: var(--brand, #003366);
  border-color: var(--brand, #003366);
}

.pct-card .btn-primary:hover,
.pct-card .btn-primary:focus {
  background: var(--brand, #003366);
  border-color: var(--brand, #003366);
}

.pct-card .btn-outline-secondary {
  border-color: var(--hairline);
}

/* =========================
   KPI GRID SPACING
   .grid has no external margin by default, so prose following a KPI
   row was crammed — patched site-wide with <br> hacks. This fixes it.
   ========================= */
.grid:has(.card.KeyBox) {
  margin-bottom: 1.75rem;
}

/* =========================
   FINAL / DRAFT STATUS
   Add final: true / false to a page's frontmatter to colour its listing card.
   ========================= */
.card--final {
  background: color-mix(in srgb, var(--panel) 82%, #198754 18%) !important;
  border-color: color-mix(in srgb, var(--line) 50%, #198754 50%) !important;
}
.card--draft {
  background: color-mix(in srgb, var(--panel) 82%, #dc3545 18%) !important;
  border-color: color-mix(in srgb, var(--line) 50%, #dc3545 50%) !important;
}

/* =========================
   Knitr chunk output inside a Bootstrap .grid
   -------------------------
   knitr wraps R chunk output in <div class="cell"><div class="cell-output-display">
   …</div></div>. Bootstrap's CSS Grid only lays out *direct* children as
   grid items, so .g-col-* elements emitted from an R chunk inside a .grid
   would get demoted to grandchildren and fall back to block stacking.
   `display: contents` makes the wrappers transparent for layout: their
   children become the effective grid items of the surrounding .grid.
   ========================= */
.grid > .cell,
.grid > .cell > .cell-output-display {
  display: contents;
}

/* =========================
   Filter subscribers (data-filter-show) — flash prevention
   -------------------------
   On pages that include a `{{< filter >}}` shortcode, hide every
   [data-filter-show] element by default; statgl-filter.js then toggles
   the `.statgl-visible` class on whichever ones match the current
   filter state. The :has() check scopes the rule so pages without a
   filter aren't affected (they have no JS to reveal anything).
   ========================= */
body:has([data-statgl-filter]) [data-filter-show]:not(.statgl-visible) {
  display: none !important;
}
/* =========================
   shorty TOC anchor: a hidden, top-level heading emitted by the `shorty`
   shortcode so its title reaches Quarto's TOC. The level varies (toc_level),
   so all of h1..h6 are covered. Element-qualified on purpose: Quarto copies
   header classes onto the wrapping <section>, and we must hide ONLY the
   header, never the section (which holds the visible card).
   ========================= */
h1.shorty-toc-anchor,
h2.shorty-toc-anchor,
h3.shorty-toc-anchor,
h4.shorty-toc-anchor,
h5.shorty-toc-anchor,
h6.shorty-toc-anchor {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
