/* css styles */

/* Fraunces (display) + Fira Sans (body) fonts for the navbar wordmark
   and the hero title. Hosted via Google Fonts. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Fira+Sans:wght@400;500;600;700&display=swap');


/* Keep navbar always visible, override Headroom.js hide-on-scroll */
#quarto-header {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  z-index: 1030;
  transform: none !important;
  transition: none !important;
  will-change: auto !important;
  border-bottom: none !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

/* Unified body link color. Litera's default link blue clashes with
   the teal we use for sidebar/TOC links, download buttons, and
   chart-help hovers, so paint all body content links the same shade
   for consistency. Scoped to #quarto-content so the navbar's white
   nav links and any intentionally-styled link elsewhere stay intact.
   The selector lists carve out elements that supply their own color
   (sidebar, TOC, hero/site buttons, etc.). */
#quarto-content a:not(.btn):not(.nav-link):not(.sidebar-link):not(.quick-link):not(.hero__button):not(.close-links__cta):not(.kf-modal__choice):not(.close-signoff__logo):not(.site-footer__brand-link):not(.site-footer__social):not(.site-footer__disclaimer):not(.svg-download-btn):not(.chart-help-link),
#quarto-content a:not(.btn):not(.nav-link):not(.sidebar-link):not(.quick-link):not(.hero__button):not(.close-links__cta):not(.kf-modal__choice):not(.close-signoff__logo):not(.site-footer__brand-link):not(.site-footer__social):not(.site-footer__disclaimer):not(.svg-download-btn):not(.chart-help-link):visited {
  color: #1380A1;
}
#quarto-content a:not(.btn):not(.nav-link):not(.sidebar-link):not(.quick-link):not(.hero__button):not(.close-links__cta):not(.kf-modal__choice):not(.close-signoff__logo):not(.site-footer__brand-link):not(.site-footer__social):not(.site-footer__disclaimer):not(.svg-download-btn):not(.chart-help-link):hover {
  color: #0e6380;
}

/* Tab/pill nav links (panel-tabset, nav-tabs): match the unified link
   color so the tab headers don't read in a different shade than the
   inline body links beside them. Excludes the active tab, which keeps
   whatever active styling its theme provides. */
.nav-tabs .nav-link:not(.active),
.nav-pills .nav-link:not(.active) {
  color: #1380A1;
}
.nav-tabs .nav-link:not(.active):hover,
.nav-pills .nav-link:not(.active):hover {
  color: #0e6380;
}

/* Navbar */
.navbar {
  letter-spacing: 0.04em;
}

/*  hover + active text is white */
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #ffffff !important;
}

/* Add spacing between nav items */
.navbar-nav .nav-item {
  margin-left: 1.05rem;
  margin-right: 1.05rem;
}

/* Brand on the left: logo + "HOUSING PRODUCTION PLAN" wordmark.
   Logo is the dark RKG mark; recolor with brightness+invert so it
   matches the navbar's muted-white text color. */
.navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0;
  padding-bottom: 0;
}
.navbar .navbar-brand .navbar-logo {
  height: 28px;
  width: auto;
  /* RKG logo ships dark; flip to a soft off-white tuned to the nav text. */
  filter: brightness(0) invert(1) opacity(0.85);
  transition: filter 0.15s ease;
}
.navbar .navbar-brand:hover .navbar-logo {
  filter: brightness(0) invert(1) opacity(1);
}
/* Wordmark to the right of the logo. Inherits the same sans-serif
   stack the hero title uses (Litera default), uppercase + tracked. */
.navbar .navbar-brand::after {
  content: "Housing Production Plan";
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}
.navbar .navbar-brand:hover::after { color: #ffffff; }

/* =============================================
   HOMEPAGE HERO SECTION - Full viewport height
   ============================================= */

/* Homepage only: navbar overlays the hero, hero starts at top of page */
body.homepage .navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

body.homepage #quarto-search {
  display: none !important;
}

body.homepage #quarto-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

body.homepage #quarto-content > * {
  margin-top: 0 !important;
}

/* Full-bleed hero container. The darkened image is painted by the
   body::before pseudo-element on body.homepage so the hero itself stays
   transparent. We then overlay a hard-left dark band that extends the
   navbar color down across the left third of the hero, fading into the
   image on the right — see body.homepage .hero::before below. */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: 72vh;
  min-height: 72lvh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0;
}

/* Left-side dark band that visually extends the navbar across the
   hero. Color is the exact Bootstrap `bg-dark` Litera applies to the
   navbar (#343a40), solid on the left and fading to transparent so the
   hero image takes over on the right. */
body.homepage .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    #343a40 0%,
    #343a40 35%,
    rgba(52, 58, 64, 0.85) 45%,
    rgba(52, 58, 64, 0.0) 70%
  );
  z-index: 1;
  pointer-events: none;
}

/* Dark overlay for text readability */
.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* Content container — sits inside the left dark band, content left-
   aligned and vertically centered. Width is capped to the left ~40%
   of the hero so the type stays within the solid color of the band. */
.hero__content {
  position: relative;
  z-index: 2;
  color: #ffffff;
  width: 100% !important;
  max-width: 920px !important;
  padding: 2rem 4rem 2rem 6vw;
  box-sizing: border-box;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-right: auto;
}

/* Override any Quarto/Bootstrap constraints on hero content children */
.hero__content > * {
  max-width: 100% !important;
  width: auto !important;
}

/* Main title — sized to fit comfortably inside the dark left band. */
.hero__content .hero__title,
.hero__content h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  max-width: 100% !important;
  width: auto !important;
  position: relative;
  text-align: left;
}

/* No divider line in the new layout */
.hero__content .hero__title::after,
.hero__content h1::after {
  content: none;
}

/* Subtitle */
.hero__content .hero__subtitle,
.hero__content h2 {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.45;
  margin: 0 0 2rem 0;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
  border-bottom: none;
  max-width: 100% !important;
  width: auto !important;
  text-align: left;
}

/* Hero buttons — glass-morphism panel effect matching the cover slide */
.hero__content .hero__button {
  color: #ffffff !important;
  border: 1px solid rgba(245, 241, 234, 0.35) !important;
  background: rgba(18, 20, 24, 0.22) !important;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px) saturate(115%);
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease,
              transform 0.15s ease, box-shadow 0.2s ease;
}

.hero__content .hero__button:hover {
  background: rgba(255, 255, 255, 0.85) !important;
  color: #1a1a1a !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

/* Hero buttons row — two buttons side by side without growing the
   hero's vertical footprint. The container has zero margin so the
   row sits exactly where a single button would. */
.hero__content .hero__buttons {
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 0;
}

/* =============================================
   ABOUT SECTION
   ============================================= */

/* Single shared darkened background for the whole homepage. Mirrors the
   exec-summary cover treatment: brightness applied directly to the image
   instead of a gradient overlay on top, so the hero and the parallax area
   below it can never drift in alignment or shade. */
body.homepage::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("images/hero-image.png") center center / cover no-repeat;
  filter: brightness(0.75);
  pointer-events: none;
}
body.homepage { background: transparent; }
body.homepage .hero__overlay { display: none; }
body.homepage .hero { background: transparent; }

.about-section {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(2px) saturate(105%);
  -webkit-backdrop-filter: blur(2px) saturate(105%);
  padding-top: 2rem;
  padding-bottom: 4rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  max-width: 900px;
  margin: 0 auto 4rem auto;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}

.about-section p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333333;
}

.about-section .callout {
  margin-bottom: 2rem;
}

.about-section h3 {
  text-align: center !important;
}





/* =============================================
   RESPONSIVE ADJUSTMENTS
   ============================================= */

/* Tablet */
@media (max-width: 992px) {
  .hero__content {
    padding: 1.5rem 2rem;
  }

  .about-section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Hide the wordmark next to the logo on narrow screens; logo only. */
  .navbar .navbar-brand::after { display: none; }

  /* Fill the hero with the dark band on mobile, no fade. */
  body.homepage .hero::before {
    background: rgba(52, 58, 64, 0.88);
  }

  .hero__content {
    padding: 1.5rem 1.5rem;
    max-width: 100% !important;
  }

  .hero__content .hero__title,
  .hero__content h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero__content .hero__subtitle,
  .hero__content h2 {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .hero__button {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

  .about-section {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .about-section p {
    font-size: 1rem;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .hero__content {
    padding: 1rem 1rem;
  }

  .hero__content .hero__title,
  .hero__content h1 {
    font-size: 1.75rem;
  }

  .hero__content .hero__subtitle,
  .hero__content h2 {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .hero__button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .about-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* Prevent horizontal scroll on all devices */
/* NOTE: overflow-x must NOT be on html, page-columns, or quarto-container
   as it breaks position:sticky on the TOC sidebar */
body,
body.nav-fixed {
  overflow-x: hidden;
  max-width: 100%;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

/* Hide default Quarto footer, replaced by custom footer */
.nav-footer {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* page-rows-contents reserves a second grid row (min 60px) for the nav-footer.
   Since we hide the nav-footer, collapse that row to zero. */
.page-rows-contents {
  grid-template-rows: [content-top] 1fr [content-bottom] 0px [page-bottom] !important;
}

/* Remove bottom gap before custom footer on content pages */
#quarto-content,
#quarto-document-content,
.page-columns,
.page-full,
#quarto-margin-sidebar {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* NOTE: Do NOT override height/align-self on #quarto-margin-sidebar
   or align-items on .page-columns, it breaks position:sticky on the TOC.
   Footer gap is handled by .page-rows-contents grid-template-rows above
   and the _quarto.yml sidebar JS fix. */

/* =============================================
   CUSTOM SITE FOOTER
   ============================================= */

.site-footer {
  background: #343a40;
  color: rgba(255, 255, 255, 0.55);
  font-family: Raleway, system-ui, sans-serif;
  padding: 3rem 2.5rem 1.75rem;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  padding-bottom: 0.75rem;
  flex-wrap: wrap;
}

/* Brand: logo + single-line tagline beneath. Logo is recolored to the
   same off-white as the body text via brightness(0) invert(1). */
.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.site-footer__brand-link {
  display: inline-block;
  line-height: 0;
}

.site-footer__brand-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-footer__brand-link {
  display: inline-block;
  line-height: 0;
  flex: 0 0 auto;
}

.site-footer__logo {
  height: 18px;
  width: auto;
  filter: brightness(0) invert(1) opacity(0.85);
  transition: filter 0.15s ease;
}

.site-footer__brand-link:hover .site-footer__logo {
  filter: brightness(0) invert(1) opacity(1);
}

.site-footer__report-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.site-footer__tagline {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

/* Connect-with-us column: heading + LinkedIn icon button. */
.site-footer__connect {
  text-align: right;
  flex: 0 0 auto;
}

.site-footer__connect h4 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 0.85rem;
  border-bottom: none;
  text-align: right;
}

.site-footer__social-row {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, transform 0.15s ease;
}

.site-footer__social:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #343a40;
  border-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

/* Links row: small inline policy-style links + Contact Us pushed right.
   Sits tight under the brand row, no divider above. */
.site-footer__links-row {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.site-footer__links-row a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.site-footer__links-row a:hover { color: #ffffff; }

.site-footer__contact { margin-left: auto; }

/* Bottom row: copyright + planning-purposes disclaimer. */
.site-footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  flex-wrap: wrap;
}

/* Disclaimer is collapsed to a "Website Disclaimer" label by default;
   the full text reveals on hover or keyboard focus. The label sits in
   the same line slot as the body so the row height doesn't jump. */
.site-footer__disclaimer {
  max-width: 720px;
  text-align: right;
  line-height: 1.5;
  position: relative;
  cursor: help;
  outline: none;
}

.site-footer__disclaimer-label {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  color: rgba(255, 255, 255, 0.55);
  transition: color 0.15s ease;
}

.site-footer__disclaimer:hover .site-footer__disclaimer-label,
.site-footer__disclaimer:focus .site-footer__disclaimer-label {
  color: #ffffff;
}

.site-footer__disclaimer-body {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.site-footer__disclaimer:hover .site-footer__disclaimer-body,
.site-footer__disclaimer:focus .site-footer__disclaimer-body {
  display: block;
}

@media (max-width: 768px) {
  .site-footer { padding: 2.25rem 1.5rem 1.5rem; }
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.75rem;
  }
  .site-footer__connect,
  .site-footer__connect h4 { text-align: left; }
  .site-footer__social-row { justify-content: flex-start; }
  .site-footer__tagline { white-space: normal; }
  .site-footer__brand-row { flex-wrap: wrap; gap: 0.5rem 0.85rem; }
  .site-footer__report-name { white-space: normal; }
  .site-footer__links-row { gap: 1rem 1.25rem; }
  .site-footer__contact { margin-left: 0; }
  .site-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-footer__disclaimer { text-align: left; }
}

/* =============================================
   IFRAME PAGES (Suitability & Urban Form)
   Iframe positioned directly below navbar via JS
   ============================================= */

/* Map iframe base styles, JS sets top/height dynamically. Background
   matches the ArcGIS app's own header teal so any unstyled gap inside
   the iframe (cross-origin, can't reach) blends with its header. */
.map-iframe {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  border: none;
  margin: 0;
  padding: 0;
  display: block;
  z-index: 10;
  background: #315458;
}

/* The navbar has a 0.8px translucent black border-bottom (Litera/
   Bootstrap default). On normal pages it's invisible because the body
   background is white anyway, but on iframe pages where the iframe
   sits flush against the navbar, that translucent border renders as a
   pale horizontal line. Remove it on iframe pages. */
body.iframe-page #quarto-header .navbar,
body.iframe-page .navbar {
  border-bottom: none !important;
}

/* Paint the page background the same teal as the ArcGIS app header.
   If any region of the embedded iframe is transparent (it has been —
   we previously saw the page background bleed through), it shows the
   matching teal instead of a white slab, making the gap visually
   disappear. */
body.iframe-page,
body.iframe-page #quarto-content,
body.iframe-page main,
body.iframe-page .quarto-container {
  background: #315458 !important;
}

/* page-layout: custom, zero out Quarto wrapper padding/margin */
.page-layout-custom #quarto-content {
  padding: 0;
  margin: 0;
}

.page-layout-custom main {
  padding: 0;
  margin: 0;
}

.page-layout-custom .quarto-container {
  padding: 0;
  margin: 0;
}

/* Iframe pages: collapse Quarto's content wrapper to zero so the fixed
   iframe sits flush against the navbar and no phantom scrollbar appears
   from a tall content shell behind it. */
body.iframe-page,
body.iframe-page #quarto-content,
body.iframe-page #quarto-document-content,
body.iframe-page main,
body.iframe-page .quarto-container,
body.iframe-page .page-columns {
  overflow: hidden !important;
  min-height: 0 !important;
  height: auto !important;
}
body.iframe-page #quarto-document-content > *:not(.map-iframe):not(script) {
  display: none !important;
}
body.iframe-page main > *:not(.map-iframe):not(script) {
  display: none !important;
}
body.iframe-page { overflow: hidden !important; }

/* Bootstrap's scrollspy adds padding-top to <body> equal to the
   data-bs-offset value (63px here) to keep anchored content from
   slipping under the fixed navbar. On iframe pages we don't need
   it — the iframe is position:fixed and the body has nothing else
   to reserve space for. Leaving the padding in place paints as a
   visible gap between the navbar and the iframe. */
body.iframe-page {
  padding-top: 0 !important;
}
body.iframe-page #quarto-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
body.iframe-page #quarto-content > * {
  margin-top: 0 !important;
}

/* Hide the custom site footer on full-viewport iframe pages — no room
   for it under the map and it'd fight the 100vh calc. */
body.iframe-page .site-footer,
body.iframe-page .nav-footer,
body.iframe-page footer {
  display: none !important;
}

/* Sidebar and right-rail TOC links: clean text-only nav style. Muted
   grey at rest, blue on hover, blue+bold when active. No underline,
   which leaks a different decoration color and reads as noisy in a
   stacked nav list. */
.sidebar .sidebar-item a,
.sidebar nav a,
#quarto-sidebar .sidebar-link,
#TOC a,
.toc-active,
nav[role="doc-toc"] a {
  color: #555 !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}
.sidebar .sidebar-item a:hover,
.sidebar nav a:hover,
#quarto-sidebar .sidebar-link:hover,
#TOC a:hover,
nav[role="doc-toc"] a:hover {
  color: #1380A1 !important;
  text-decoration: none !important;
}
.sidebar .sidebar-item a.active,
.sidebar nav a.active,
#quarto-sidebar .sidebar-link.active,
#TOC a.active,
nav[role="doc-toc"] a.active {
  color: #1380A1 !important;
  font-weight: 600;
}


.empl-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1.5rem;
  min-height: 220px;
}

.empl-stat p {
  margin: 0.2rem 0;
  line-height: 1.4;
}

.empl-stat__number {
  font-size: 2.4rem;
  line-height: 1;
}


.panel-tabset .small.text-muted {
  margin-top: 1rem;
}

/* Chart describer prose inside a panel-tabset tab: shrink vs. body copy
   and add breathing room above so it doesn't crowd the download button. */
.panel-tabset .tab-content > .tab-pane > p,
.panel-tabset > .tab-content p {
  font-size: 0.82rem;
  line-height: 1.55;
  margin-top: 1.25rem;
}

/* Nested tab pills — inner tabs within panel-tabsets (ported from Lynn) */
.panel-tabset .panel-tabset .nav-tabs {
  border-bottom: none !important;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.panel-tabset .panel-tabset .nav-tabs .nav-link {
  border: 1px solid #D0D5D5 !important;
  border-radius: 20px !important;
  padding: 0.2rem 0.9rem !important;
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #758D99 !important;
  background: transparent !important;
  transition: all 0.2s ease;
}
.panel-tabset .panel-tabset .nav-tabs .nav-link:hover {
  background: #F0F2F2 !important;
  color: #293333 !important;
}
.panel-tabset .panel-tabset .nav-tabs .nav-link.active {
  background: #293333 !important;
  color: #ffffff !important;
  border-color: #293333 !important;
}
.panel-tabset .panel-tabset .tab-content {
  border: none !important;
  padding: 0.5rem 0 0 0 !important;
}


/* Contain dygraph widget within parent */
.dygraphs {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Prevent horizontal scrollbars in grid/flex column layouts */
[class*="g-col-"],
.column {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* htmlwidget wrappers: constrain to column width */
.html-widget-container,
.html-widget,
.htmlwidget-container {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}

/* echarts4r: same constraint on wrapper and canvas. overflow:hidden clips
   any oversized canvas on first paint (echarts4r sometimes renders at its
   internal default width before the resize observer catches up inside a
   narrow column), which is what surfaces as a horizontal scrollbar in
   side-by-side chart layouts. */
.echarts4r {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box;
}
.echarts4r canvas {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* NOTE: Do NOT put overflow-x:hidden on #quarto-content, .page-columns,
   or any ancestor of the TOC, it breaks position:sticky.
   Horizontal overflow is handled by body-level rule + widget containment above. */

/* Chart info popup */
.chart-note {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  background: white;
  border-left: 3px solid #9DBF9E;
  padding: 14px 16px;
  font-family: 'Fira Sans', sans-serif;
  font-size: 12px;
  color: #293333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}
.chart-note.visible {
  opacity: 1;
  pointer-events: auto;
}
.chart-note img {
  width: 100%;
  border-radius: 3px;
}

/* "How to read this chart" hover link */
.chart-help-link {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.75rem;
  font-style: italic;
  color: #1380A1;
  cursor: pointer;
  margin-left: 0.6rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chart-help-link:hover {
  color: #0e6380;
}

/* Source note beneath charts */
.source-note {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.7rem;
  font-style: italic;
  color: #758D99;
  margin-top: 0.7rem;
  margin-bottom: 1rem;
}
