@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  /* Premium Palette (Linen Canvas, Sienna Terracotta & Clean Teal) */
  --bg: #fdfbf7;
  --surface: #ffffff;
  --ink: #1d1a16;
  --muted: #625c52;
  --line: #e6dfd5;
  --accent: #8b5a36; /* Warm elegant sienna terracotta */
  --accent-rgb: 139, 90, 54;
  --accent2: #246a73; /* Sophisticated clean teal */
  --accent2-rgb: 36, 106, 115;
  --soft: #f4eee3;
  --cool: #eef6f5;
  --warn: #fff5dc;
  --deep: #161310;
  
  /* Layout & Cards System */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(28,24,20, 0.03);
  --shadow-md: 0 12px 36px rgba(28,24,20, 0.05);
  --shadow-lg: 0 24px 60px rgba(28,24,20, 0.08);
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Adaptive Dark Mode Scheme (Default System) */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) {
    --bg: #141210; /* Soft premium dark charcoal-chocolate */
    --surface: #1e1b18; /* Rich layered card surfaces */
    --ink: #f5f1eb;
    --muted: #a69f94;
    --line: #332c28; /* Warm elegant divider line */
    --accent: #e59760; /* Vibrant glowing terracotta sienna */
    --accent-rgb: 229, 151, 96;
    --accent2: #48a9a6; /* Glowing rich clean teal */
    --accent2-rgb: 72, 169, 166;
    --soft: #2a2521; /* Soft warm dark gray */
    --cool: #162424;
    --warn: #2f2717;
    --deep: #0b0a09; /* Deep black backgrounds */
    --shadow-sm: 0 2px 8px rgba(0,0,0, 0.5);
    --shadow-md: 0 12px 36px rgba(0,0,0, 0.6);
    --shadow-lg: 0 24px 60px rgba(0,0,0, 0.75);
  }
}

/* Explicit Manual Dark Mode Override */
:root.theme-dark {
  --bg: #141210; /* Soft premium dark charcoal-chocolate */
  --surface: #1e1b18; /* Rich layered card surfaces */
  --ink: #f5f1eb;
  --muted: #a69f94;
  --line: #332c28; /* Warm elegant divider line */
  --accent: #e59760;
  --accent-rgb: 229, 151, 96;
  --accent2: #48a9a6;
  --accent2-rgb: 72, 169, 166;
  --soft: #2a2521; /* Soft warm dark gray */
  --cool: #162424;
  --warn: #2f2717;
  --deep: #0b0a09; /* Deep black backgrounds */
  --shadow-sm: 0 2px 8px rgba(0,0,0, 0.5);
  --shadow-md: 0 12px 36px rgba(0,0,0, 0.6);
  --shadow-lg: 0 24px 60px rgba(0,0,0, 0.75);
}

/* Explicit Manual Light Mode Override */
:root.theme-light {
  --bg: #fdfbf7;
  --surface: #ffffff;
  --ink: #1d1a16;
  --muted: #625c52;
  --line: #e6dfd5;
  --accent: #8b5a36;
  --accent-rgb: 139, 90, 54;
  --accent2: #246a73;
  --accent2-rgb: 36, 106, 115;
  --soft: #f4eee3;
  --cool: #eef6f5;
  --warn: #fff5dc;
  --deep: #161310;
  --shadow-sm: 0 2px 8px rgba(28,24,20, 0.03);
  --shadow-md: 0 12px 36px rgba(28,24,20, 0.05);
  --shadow-lg: 0 24px 60px rgba(28,24,20, 0.08);
}

/* ── Base Styles ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--ink);
}

a {
  color: var(--accent2);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  margin: 2.75rem 0 1.25rem;
}

h3 {
  font-size: 1.35rem;
  margin: 2rem 0 0.85rem;
}

p {
  margin-bottom: 1.25rem;
}

/* ── Premium Sticky Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2rem;
  min-height: 76px;
  padding: 0 clamp(1rem, 5vw, 4rem);
  background: rgba(253, 251, 247, 0.8);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .site-header {
    background: rgba(13, 11, 10, 0.8);
  }
}
:root.theme-dark .site-header {
  background: rgba(13, 11, 10, 0.8);
}
:root.theme-light .site-header {
  background: rgba(253, 251, 247, 0.8);
}

.site-header .brand {
  display: grid;
  grid-template-columns: 36px auto;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  align-items: center;
  line-height: 1;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header .brand::before {
  content: "";
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface) url('/favicon.svg') center/22px 22px no-repeat;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.site-header .brand:hover::before {
  transform: rotate(-8deg) scale(1.05);
  border-color: var(--accent);
}

.site-header .brand::after {
  content: "Home Comfort Library";
  grid-column: 2;
  grid-row: 2;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
  white-space: nowrap;
}

/* ── Modern Dropdown Navigation ── */
.main-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-list a, .nav-group summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.nav-list a:hover, .nav-list a:focus-visible, 
.nav-group summary:hover, .nav-group summary:focus-visible,
.nav-group[open] summary {
  background: var(--soft);
  color: var(--accent2);
}

.nav-group {
  position: relative;
}

.nav-group summary {
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "";
  display: inline-block;
  margin-left: 0.4rem;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.2s ease;
}

.nav-group[open] summary::after {
  transform: rotate(180deg);
}

/* Absolute Glass dropdown panel */
.nav-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 101;
  width: max-content;
  min-width: 220px;
  max-width: 280px;
  padding: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.nav-group[open] .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-panel a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 46px;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
}

.nav-panel a strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  transition: var(--transition);
}

.nav-panel a span {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

.nav-panel a:hover {
  background: var(--cool);
}

.nav-panel a:hover strong {
  color: var(--accent2);
}

.nav-group:first-of-type .nav-panel {
  left: 0;
  transform: translateY(10px);
}
.nav-group:first-of-type[open] .nav-panel {
  transform: translateY(0);
}

.nav-group:last-of-type .nav-panel {
  left: auto;
  right: 0;
  transform: translateY(10px);
}
.nav-group:last-of-type[open] .nav-panel {
  transform: translateY(0);
}

/* Wide panel sizing */
.nav-panel-wide {
  min-width: 270px;
}

/* ── Interactive Search Toggle & Popover ── */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-toggle:hover, .search-toggle:focus-visible, .search-toggle[aria-expanded="true"] {
  background: var(--cool);
  border-color: var(--accent2);
  transform: scale(1.05);
}

.search-toggle .search-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.search-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 102;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  width: min(380px, calc(100vw - 2rem));
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.search-popover.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.search-popover input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  font: inherit;
  transition: var(--transition);
}

.search-popover input:focus {
  border-color: var(--accent2);
  outline: none;
  background: var(--surface);
}

.search-popover button {
  min-height: 42px;
  border: 1px solid var(--accent2);
  border-radius: var(--radius-sm);
  background: var(--accent2);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.search-popover button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Mobile Hamburger Drawer ── */
.mobile-hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  position: relative;
  text-indent: -9999px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.mobile-hamburger::before, .mobile-hamburger::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2.5px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, top 0.25s ease;
}

.mobile-hamburger::before {
  top: 15px;
  box-shadow: 0 8px 0 currentColor;
}

.mobile-hamburger::after {
  top: 29px;
}

.main-nav.open .mobile-hamburger::before {
  top: 22px;
  transform: rotate(45deg);
  box-shadow: none;
}

.main-nav.open .mobile-hamburger::after {
  top: 22px;
  transform: rotate(-45deg);
}

/* ── UI Sections (Heros & Bands) ── */
.hero, .band, .article-shell {
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 5vw, 4rem);
}

.hero-inner, .band-inner, .article {
  max-width: 1120px;
  margin: 0 auto;
}

.hero {
  background: linear-gradient(180deg, var(--soft) 0%, var(--bg) 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: -10%;
  right: -5%;
  width: 450px;
  height: 450px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36,106,115, 0.08) 0%, rgba(255,255,255,0) 70%);
  z-index: 1;
  pointer-events: none;
}

.hero-inner.has-visual {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.65;
}

.eyebrow {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.hero-facts {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
}

.hero-facts span {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-radius: 99px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

/* ── Modern Premium Visual Card Panel ── */
.photo-panel {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition);
}

.photo-panel:hover {
  transform: translateY(-5px);
  border-color: var(--accent2);
}

.photo-panel img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.photo-panel:hover img {
  transform: scale(1.03);
}

.photo-panel figcaption {
  padding: 1.1rem 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Buttons */
.button-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin: 2rem 0 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn:hover {
  background: var(--deep);
  border-color: var(--deep);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
}

.btn.secondary:hover {
  background: var(--accent);
  color: #ffffff;
}

/* ── Symptom & Topic Card Grids ── */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

.problem-grid a {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.problem-grid a:hover {
  transform: translateY(-6px);
  border-color: var(--accent2);
  box-shadow: var(--shadow-md);
}

.problem-grid a img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.problem-grid a:hover img {
  transform: scale(1.05);
}

.problem-grid a strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  padding: 1.25rem 1.25rem 0.5rem;
  color: var(--ink);
  transition: var(--transition);
}

.problem-grid a:hover strong {
  color: var(--accent2);
}

.problem-grid a span {
  display: block;
  padding: 0 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Card grids for topics */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.feature-card, .policy-card, .guide-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover, .policy-card:hover, .guide-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.feature-card strong, .policy-card strong, .guide-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  transition: var(--transition);
}

.feature-card:hover strong, .policy-card:hover strong, .guide-card:hover strong {
  color: var(--accent);
}

.feature-card span, .policy-card span, .guide-card span {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Latest Guide Card with Thumb */
.guide-card.with-thumb {
  padding: 0;
  overflow: hidden;
}

.guide-card.with-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-card.with-thumb:hover img {
  transform: scale(1.05);
}

.guide-card.with-thumb strong {
  padding: 1.25rem 1.25rem 0.5rem;
}

.guide-card.with-thumb span {
  padding: 0 1.25rem 1.5rem;
}

/* ── Editorial grids ── */
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.story-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.story-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent2);
  box-shadow: var(--shadow-md);
}

.story-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-card:hover img {
  transform: scale(1.04);
}

.story-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--ink);
  padding: 1.25rem 1.25rem 0.5rem;
  transition: var(--transition);
}

.story-card:hover strong {
  color: var(--accent2);
}

.story-card span {
  display: block;
  padding: 0 1.25rem 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.story-card.lead {
  grid-column: span 2;
  grid-row: span 2;
}

.story-card.lead img {
  aspect-ratio: 16/9;
}

.story-card.lead strong {
  font-size: 1.45rem;
}

/* ── Article Layout Sidebar ── */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 840px) 280px;
  gap: 3.5rem;
  align-items: start;
  max-width: 1160px;
  margin: 2rem auto;
}

.article-layout .article {
  max-width: none;
  width: 100%;
}

.article-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 1.25rem;
}

.sidebar-search, .sidebar-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-search label, .sidebar-block h2 {
  display: block;
  margin: 0 0 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.sidebar-search div {
  display: flex;
  gap: 0.35rem;
}

.sidebar-search input {
  flex: 1;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
}

.sidebar-search button {
  min-height: 38px;
  border: 1px solid var(--accent2);
  border-radius: var(--radius-sm);
  background: var(--accent2);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-search button:hover {
  background: var(--accent);
}

.sidebar-block a {
  display: block;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  transition: var(--transition);
}

.sidebar-block a:hover {
  color: var(--accent2);
  padding-left: 0.25rem;
}

.sidebar-block a:first-of-type {
  border-top: 0;
  padding-top: 0;
}

/* ── Content Blocks (TOC, Takeaways, Answer) ── */
.quick-answer, .toc, .author-box, .sources, .related, .note, .key-takeaways, .project-box, .tip-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.quick-answer {
  border-left: 5px solid var(--accent2);
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.65;
}

.quick-answer strong {
  color: var(--accent2);
}

.key-takeaways {
  border-left: 5px solid var(--accent);
  background: var(--soft);
}

.key-takeaways h2 {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.key-takeaways ul {
  list-style: none;
  padding: 0;
}

.key-takeaways li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.key-takeaways li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.tip-box {
  border-left: 5px solid var(--accent2);
  background: var(--cool);
}

.tip-box h2 {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
  margin-bottom: 0.85rem;
}

/* Project snapshot */
.project-box h2 {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent2);
  margin-bottom: 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
}

.project-grid div {
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
}

.project-grid strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

/* TOC */
.toc {
  background: var(--bg);
}

.toc strong {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.65rem;
}

.toc a {
  display: block;
  font-weight: 600;
  padding: 0.25rem 0;
  font-size: 0.95rem;
}

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* ── Premium Tables ── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.95rem;
}

th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--soft);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td {
  border-bottom: 0;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.breadcrumbs a {
  color: var(--accent2);
  font-weight: 700;
}

.breadcrumbs span:last-child {
  color: var(--muted);
  font-weight: 500;
}

/* ── Premium Footer ── */
.site-footer {
  padding: 4rem clamp(1rem, 5vw, 4rem);
  background: #141210; /* Fixed elegant warm dark background */
  color: #eae4d9; /* Fixed soft linen readability text color */
  border-top: 1px solid #2d2822; /* Fixed dark warm divider */
}

.site-footer a {
  color: #d2cac0; /* Fixed premium soft warm gray for links */
  transition: var(--transition);
  font-weight: 600;
}

.site-footer a:hover {
  color: #e59760; /* Sienna terracotta on hover */
  text-decoration: none;
}

.footer-grid-expanded {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 2rem;
  max-width: 1120px;
  margin: 0 auto;
}

.footer-about .footer-brand {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  display: block;
}

.footer-about p {
  font-size: 0.86rem;
  color: #a69f94; /* Fixed legible muted warm gray */
  line-height: 1.6;
}

.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #e59760; /* Fixed sienna terracotta for headers */
  margin-bottom: 1.1rem;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.65rem;
}

.site-footer li a {
  font-size: 0.88rem;
}

.footer-search {
  display: flex;
  position: relative;
  max-width: 320px;
  margin-top: 1rem;
}

.footer-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding: 0.5rem 4.5rem 0.5rem 1.25rem;
  font: inherit;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-search input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.footer-search button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  min-height: auto;
  border: 0;
  border-radius: 30px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 1.25rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.footer-search button:hover {
  background: var(--accent2);
}

@media(max-width:620px) {
  .footer-search {
    display: flex !important;
  }
  .footer-search button {
    width: auto !important;
  }
}

.footer-bottom {
  max-width: 1120px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom .fine-print {
  font-size: 0.8rem;
  color: #8a8175; /* Legible dark warm fine print */
}

/* ── Modern Premium Cookie Banner ── */
.cookie-banner {
  position: fixed;
  left: clamp(1rem, 4vw, 2.5rem);
  right: clamp(1rem, 4vw, 2.5rem);
  bottom: 1.5rem;
  z-index: 105;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.6;
}

.cookie-banner strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.cookie-actions {
  display: flex;
  gap: 0.65rem;
}

.cookie-actions button, .cookie-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.cookie-actions button.primary {
  background: var(--accent);
  color: #ffffff;
}

.cookie-actions button.primary:hover {
  background: var(--deep);
  border-color: var(--deep);
}

.cookie-actions button:not(.primary):hover {
  background: var(--soft);
}

/* ── Responsive Viewports ── */

/* Wide Tablets & Small Desktops (≤1120px) */
@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 1fr auto;
    min-height: 72px;
    padding: 0.5rem 1.5rem;
  }
  
  .main-nav {
    gap: 0.75rem;
  }
  
  .mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Sliding Mobile Menu */
  .nav-list {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    top: calc(100% + 8px);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    max-width: 500px;
    margin-left: auto;
  }
  
  .main-nav.open .nav-list {
    display: flex;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  .nav-list a, .nav-group summary {
    justify-content: space-between;
    min-height: 46px;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
  }
  
  /* Accordion mobile dropdowns */
  .nav-group {
    display: block;
    width: 100%;
  }
  
  .nav-group summary {
    width: 100%;
    border-radius: var(--radius-sm);
  }
  
  .nav-panel {
    position: static;
    width: 100% !important;
    max-width: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none;
    border: 0;
    padding: 0.5rem 0.5rem 0.25rem 1rem;
    background: var(--soft);
    border-left: 3px solid var(--accent2);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-top: -2px;
    display: none;
  }
  
  .nav-group[open] .nav-panel {
    display: block;
  }
  
  .nav-panel a {
    background: var(--surface);
    border: 1px solid var(--line);
    margin-bottom: 0.4rem;
  }
  
  /* Hero & layout grid stacks */
  .hero-inner.has-visual {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-inner.has-visual > div {
    order: 1;
  }
  
  .hero-inner.has-visual .photo-panel {
    order: 2;
    max-width: 600px;
    margin: 0 auto;
  }
  
  .problem-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .editorial-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .story-card.lead {
    grid-column: span 2;
  }
  
  .article-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .article-sidebar {
    position: static;
  }
  
  .footer-grid-expanded {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-about {
    grid-column: span 3;
    margin-bottom: 1.5rem;
  }
}

/* Small Screens & Mobile Phones (≤680px) */
@media (max-width: 680px) {
  .site-header {
    padding: 0.5rem 1rem;
  }
  
  .nav-list {
    left: 1rem;
    right: 1rem;
  }
  
  .problem-grid, .editorial-grid, .footer-grid-expanded {
    grid-template-columns: 1fr;
  }
  
  .story-card.lead {
    grid-column: auto;
    grid-row: auto;
  }
  
  .story-card.lead strong {
    font-size: 1.25rem;
  }
  
  .footer-about {
    grid-column: auto;
  }
  
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem;
    left: 1rem;
    right: 1rem;
  }
  
  .cookie-actions {
    justify-content: flex-start;
  }
  
  .cookie-actions button {
    flex: 1;
  }
  
  .button-row .btn {
    width: 100%;
  }
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Premium Search Page Visual Enhancements ── */
.search-page .search-box {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0 1rem 0;
  max-width: 760px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  width: 100%;
  padding-right: 3rem !important; /* Make room for the clear button */
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  font-size: 1.5rem !important;
  cursor: pointer;
  padding: 0.25rem !important;
  min-height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition) !important;
  z-index: 2;
  user-select: none;
}

.search-clear-btn:hover {
  color: var(--accent) !important;
  transform: scale(1.1) !important;
}

.search-clear-btn[hidden] {
  display: none !important;
}

.search-page input {
  flex: 1;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-page input:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(36, 106, 115, 0.12), var(--shadow-md);
}

.search-page button {
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent2);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-page button:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Dynamic Pill Filter Tabs */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
  max-width: 760px;
}

.filter-tab {
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.5rem 1.15rem;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  font-family: var(--font-sans);
}

.filter-tab:hover {
  background: var(--line);
  color: var(--ink);
  transform: translateY(-1px);
}

.filter-tab.active {
  background: var(--accent2);
  color: #ffffff;
  border-color: var(--accent2);
  box-shadow: var(--shadow-sm);
}

.filter-tab.active:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.search-results {
  display: grid;
  gap: 1.15rem;
  max-width: 760px;
  margin-top: 1.5rem;
}

.search-result {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
}

.search-result::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--line);
  transition: var(--transition);
}

.search-result:hover {
  transform: translateY(-3px);
  border-color: var(--accent2);
  box-shadow: var(--shadow-md);
}

.search-result:hover::before {
  background: var(--accent2);
  width: 6px;
}

.search-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-result-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 !important;
}

.search-result:hover .search-result-title {
  color: var(--accent2);
}

.search-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* Category Specific Badge Styling */
.badge-article { background: var(--cool); color: var(--accent2); }
.badge-topic { background: var(--soft); color: var(--accent); }
.badge-page { background: var(--warn); color: #8b6b24; }
.badge-home { background: var(--soft); color: var(--muted); }

.search-result-description {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0.65rem;
}

.search-result-snippet {
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.6;
  background: var(--bg);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--line);
  font-style: italic;
  margin-top: 0.55rem;
}

.search-highlight {
  background: rgba(36, 106, 115, 0.12); /* Soft teal highlighting */
  color: var(--accent2);
  padding: 0.05rem 0.2rem;
  border-radius: 4px;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .search-highlight {
    background: rgba(72, 169, 166, 0.2);
    color: var(--accent2);
  }
}
:root.theme-dark .search-highlight {
  background: rgba(72, 169, 166, 0.2);
  color: var(--accent2);
}

/* Premium Interactive Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: var(--transition);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  user-select: none;
}

.theme-toggle:hover {
  background: var(--soft);
  color: var(--accent);
  transform: rotate(20deg) scale(1.08);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: var(--transition);
}

/* Morphing Sun and Moon Icon visibility based on active theme class */
.theme-toggle .sun-icon {
  display: block;
}
.theme-toggle .moon-icon {
  display: none;
}

:root.theme-dark .theme-toggle .sun-icon {
  display: none;
}
:root.theme-dark .theme-toggle .moon-icon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .theme-toggle .sun-icon {
    display: none;
  }
  :root:not(.theme-light) .theme-toggle .moon-icon {
    display: block;
  }
}

/* Reading Time & Meta Styling inside Search Cards */
.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.search-result-readtime {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* Staggered Entrance Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger animation delays for the first 8 items for a beautiful premium entrance */
.search-result:nth-child(1) { animation-delay: 0.03s; }
.search-result:nth-child(2) { animation-delay: 0.06s; }
.search-result:nth-child(3) { animation-delay: 0.09s; }
.search-result:nth-child(4) { animation-delay: 0.12s; }
.search-result:nth-child(5) { animation-delay: 0.15s; }
.search-result:nth-child(6) { animation-delay: 0.18s; }
.search-result:nth-child(7) { animation-delay: 0.21s; }
.search-result:nth-child(8) { animation-delay: 0.24s; }

/* ── Screen Reader Accessibility Helper (Fixes popover layout bugs) ── */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Ad slots removed */

/* ── Rich E-E-A-T Editorial Bylines ── */
.eeat-byline {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 1.5rem 0 1.25rem 0;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.eeat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.eeat-avatar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

.eeat-avatar:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.eeat-meta-text {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.eeat-meta-text a {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px dotted var(--muted);
}

.eeat-meta-text a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.eeat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--cool);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.eeat-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}

@media (max-width: 600px) {
  .eeat-badge {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ── Interactive Social Share Bar ── */
.social-share-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 2rem 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-share-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.social-share-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  padding: 0;
}

.share-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
}

.share-btn.pinterest:hover {
  background: #bd081c !important;
  border-color: #bd081c !important;
}

.share-btn.facebook:hover {
  background: #1877f2 !important;
  border-color: #1877f2 !important;
}

.share-btn.twitter:hover {
  background: var(--deep) !important;
  border-color: var(--deep) !important;
}

.share-btn.copy-link:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* Share Clipboard Tooltip Bubble */
.share-btn.copy-link::after {
  content: "Link Copied!";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--deep);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.share-btn.copy-link::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 5px;
  border-style: solid;
  border-color: var(--deep) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  pointer-events: none;
  z-index: 10;
}

.share-btn.copy-link.copied::after,
.share-btn.copy-link.copied::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Premium Styled Table of Contents (TOC) Accordion Card ── */
.toc.premium-toc {
  display: block !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-left: 4px solid var(--accent) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.25rem 1.5rem !important;
  margin: 2.25rem 0 !important;
  box-shadow: var(--shadow-sm) !important;
  font-family: var(--font-sans) !important;
  text-align: left !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.toc-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  cursor: pointer !important;
  user-select: none !important;
  font-weight: 700 !important;
}

.toc-title {
  font-family: var(--font-serif) !important;
  font-size: 1.15rem !important;
  color: var(--ink) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.toc-title svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
}

.toc-toggle {
  background: none !important;
  border: 0 !important;
  color: var(--accent2) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  font-family: var(--font-sans) !important;
  min-height: auto !important;
  box-shadow: none !important;
}

.toc-toggle:hover {
  color: var(--accent) !important;
  transform: none !important;
}

.toc-panel {
  margin-top: 1.15rem !important;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
  overflow: hidden !important;
  max-height: 500px;
  opacity: 1;
}

.toc-panel.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  pointer-events: none !important;
}

/* Style TOC inner links */
.toc.premium-toc a {
  display: flex !important;
  align-items: center !important;
  padding: 0.4rem 0 !important;
  font-size: 0.94rem !important;
  color: var(--ink) !important;
  font-weight: 500 !important;
  border-bottom: 0 !important;
  transition: var(--transition) !important;
  gap: 0.5rem !important;
}

.toc.premium-toc a::before {
  content: "→" !important;
  color: var(--accent) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  transition: var(--transition) !important;
}

.toc.premium-toc a:hover {
  color: var(--accent2) !important;
  padding-left: 0.35rem !important;
}

.toc.premium-toc a:hover::before {
  transform: translateX(2px) !important;
  color: var(--accent2) !important;
}

/* ── HTML Sitemap ── */
.category-list {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
}

.sitemap-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sitemap-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sitemap-section ul.sitemap-articles {
  columns: 2;
  column-gap: 2.5rem;
}

@media (max-width: 640px) {
  .sitemap-section ul.sitemap-articles {
    columns: 1;
  }
}

.sitemap-section li {
  break-inside: avoid;
}

.sitemap-section a {
  display: inline-block;
  padding: 0.3rem 0;
  color: var(--body);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  font-size: 0.92rem;
  line-height: 1.45;
}

.sitemap-section a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Premium Contact Form Style ── */
.contact-form {
  display: grid;
  gap: 1.5rem;
  max-width: 600px;
  margin-top: 1.5rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 4px rgba(36, 106, 115, 0.12), var(--shadow-md);
}

.contact-form .btn {
  justify-self: start;
  min-height: 48px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--accent2);
  color: #ffffff;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.contact-form .btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

