/* ==========================================================================
   SkinOriva — Editorial Skincare Publication Design System
   Palette derived from the official SkinOriva medallion logo:
   Warm Ivory (#FBF8F5), Soft Pearl Sand (#F4EDE6), Deep Burgundy (#5E1B28),
   Champagne Bronze (#A6764C / #7D5635), Botanical Sage (#4F6248),
   Hibiscus Blush (#F8ECEE), Deep Espresso Ink (#241C1B)
   ========================================================================== */

:root {
  /* Color tokens */
  --bg-page: #FBF8F5;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4EDE6;
  --bg-blush: #F8ECEE;
  --bg-sage: #EDF2EB;
  --bg-amber: #FBF4E8;

  --brand-primary: #5E1B28;
  --brand-primary-hover: #47121C;
  --brand-primary-soft: #7A2B3B;
  --brand-bronze: #A6764C;
  --brand-bronze-text: #744D2C;
  --brand-sage: #3F5239;
  --brand-rose: #B9485C;

  --ink-primary: #241C1B;
  --ink-secondary: #534744;
  --ink-muted: #6C5F5B;
  --ink-inverse: #FBF8F5;

  --border-hairline: #E6DBD2;
  --border-strong: #D3C3B6;
  --focus-ring: #5E1B28;

  /* Typography */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Layout */
  --container-max: 1220px;
  --prose-max: 72ch;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-subtle: 0 1px 3px rgba(36, 28, 27, 0.05), 0 4px 16px rgba(36, 28, 27, 0.03);
  --shadow-card: 0 2px 8px rgba(36, 28, 27, 0.06);
  --shadow-drawer: 0 12px 32px rgba(36, 28, 27, 0.16);
}

/* Base reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-primary);
  background-color: var(--bg-page);
  overflow-x: clip;
}

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

a {
  color: var(--brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-primary-hover);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink-primary);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.95rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: 1.05rem;
  font-family: var(--font-sans);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

p {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

ul, ol {
  margin-top: 0;
  margin-bottom: var(--space-4);
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.45rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-hairline);
  margin: var(--space-6) 0;
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--brand-primary);
  color: var(--ink-inverse);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 2000;
}

.skip-link:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.container--narrow {
  max-width: 860px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(251, 248, 245, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 70px;
  padding-block: 0.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.brand-link:hover {
  color: var(--brand-primary-hover);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--brand-bronze);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--brand-primary);
}

.brand-tagline {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-bronze-text);
  margin-top: 2px;
}

.primary-nav {
  display: none;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  text-decoration: none;
  color: var(--ink-primary);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 40px;
  min-height: 40px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.icon-btn:hover {
  border-color: var(--brand-bronze);
  color: var(--brand-primary);
}

.menu-toggle-label {
  display: none;
}

@media (min-width: 480px) {
  .menu-toggle-label {
    display: inline;
  }
}

@media (min-width: 1024px) {
  .primary-nav {
    display: block;
  }
  .menu-toggle {
    display: none;
  }
}

/* Mobile Navigation Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 28, 27, 0.48);
  z-index: 1250;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(340px, 88vw);
  background: var(--bg-page);
  border-left: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-drawer);
  z-index: 1260;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.is-open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-hairline);
}

.mobile-drawer-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-primary);
}

.mobile-drawer-nav {
  padding: 1rem 1.25rem 2rem;
}

.mobile-drawer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-drawer-nav li {
  margin: 0;
  border-bottom: 1px solid var(--border-hairline);
}

.mobile-drawer-nav a {
  display: block;
  padding: 0.85rem 0.25rem;
  text-decoration: none;
  color: var(--ink-primary);
  font-weight: 500;
}

.mobile-drawer-nav a:hover {
  color: var(--brand-primary);
}

.mobile-drawer-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-bronze-text);
  margin: 1.25rem 0 0.4rem;
  font-weight: 600;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.35rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
  background: var(--brand-primary);
  color: var(--ink-inverse);
}

.btn--primary:hover {
  background: var(--brand-primary-hover);
  color: var(--ink-inverse);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn--secondary:hover {
  background: var(--bg-blush);
  color: var(--brand-primary-hover);
}

.btn--subtle {
  background: var(--bg-subtle);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn--subtle:hover {
  background: var(--border-hairline);
  color: var(--ink-primary);
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-bronze-text);
  margin-bottom: var(--space-2);
}

.pill-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  text-decoration: none;
  border: 1px solid var(--border-hairline);
}

.pill-tag:hover {
  border-color: var(--brand-bronze);
  color: var(--brand-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding-block: clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border-hairline);
  background: linear-gradient(180deg, #FBF8F5 0%, #F5EFE8 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-7);
  }
}

.hero-lead {
  font-size: clamp(1.02rem, 1.5vw, 1.16rem);
  color: var(--ink-secondary);
  max-width: 56ch;
  margin-bottom: var(--space-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: var(--space-5);
}

.hero-media {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  aspect-ratio: 16 / 10;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Search Bar */
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 560px;
}

.search-box input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 46px;
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.search-box input[type="search"]::placeholder {
  color: var(--ink-muted);
}

/* ==========================================================================
   Sections, Grids & Cards
   ========================================================================== */
.section {
  padding-block: clamp(2.25rem, 5vw, 3.75rem);
}

.section--tinted {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-subtitle {
  color: var(--ink-secondary);
  max-width: 64ch;
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .card-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .card-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .card-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--brand-bronze);
  box-shadow: var(--shadow-card);
}

.card-media {
  aspect-ratio: 3 / 2;
  background: var(--bg-subtle);
  overflow: hidden;
  border-bottom: 1px solid var(--border-hairline);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-meta {
  font-size: 0.78rem;
  color: var(--brand-bronze-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.45rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  line-height: 1.28;
  margin-bottom: 0.5rem;
}

.card-title a {
  text-decoration: none;
  color: var(--ink-primary);
}

.card-title a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.card-excerpt {
  font-size: 0.94rem;
  color: var(--ink-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-hairline);
}

/* Category Compact Card */
.category-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  border-color: var(--brand-bronze);
  box-shadow: var(--shadow-card);
  color: var(--ink-primary);
}

.category-card-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-bronze-text);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.category-card h3 {
  font-size: 1.18rem;
  color: var(--brand-primary);
  margin-bottom: 0.4rem;
}

.category-card p {
  font-size: 0.91rem;
  color: var(--ink-secondary);
  margin-bottom: 0.75rem;
  flex: 1;
}

.category-card-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-sage);
}

/* Subcategory Link List */
.topic-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 640px) {
  .topic-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .topic-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.topic-list li {
  margin: 0;
}

.topic-item {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
  height: 100%;
}

.topic-item:hover {
  border-color: var(--brand-bronze);
  background: #FFFDFB;
}

.topic-item-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 0.25rem;
}

.topic-item-desc {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Breadcrumbs & Page Header
   ========================================================================== */
.page-header {
  padding-block: clamp(1.75rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
}

.breadcrumbs {
  margin-bottom: var(--space-3);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--brand-bronze);
}

.breadcrumbs a {
  color: var(--ink-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  margin-top: var(--space-3);
}

.article-meta-bar span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ==========================================================================
   Article Layout (with Optional Desktop 160x600 Side Rail)
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  padding-block: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 1200px) {
  .article-layout--with-rail {
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: var(--space-7);
  }
}

.article-prose {
  max-width: var(--prose-max);
  width: 100%;
  min-width: 0;
}

.article-prose h2 {
  margin-top: 2.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-hairline);
}

.article-prose h3 {
  margin-top: 1.5rem;
}

.article-hero-figure {
  margin: 0 0 var(--space-5);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
}

.article-hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-hero-figure figcaption {
  padding: 0.65rem 0.9rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
}

/* Callout Boxes */
.callout {
  padding: 1.2rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  border-left: 4px solid var(--brand-primary);
  background: var(--bg-surface);
  margin-block: var(--space-5);
}

.callout--learn {
  border-left-color: var(--brand-sage);
  background: var(--bg-sage);
}

.callout--safety {
  border-left-color: var(--brand-primary);
  background: var(--bg-blush);
}

.callout--note {
  border-left-color: var(--brand-bronze);
  background: var(--bg-amber);
}

.callout-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-primary);
  margin-bottom: 0.5rem;
}

.callout > :last-child {
  margin-bottom: 0;
}

/* Responsive Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-block: var(--space-5);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  text-align: left;
}

th, td {
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid var(--border-hairline);
  vertical-align: top;
}

th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--ink-primary);
}

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

/* Step list */
.step-list {
  list-style: none;
  padding: 0;
  counter-reset: tutorial-step;
}

.step-list li {
  counter-increment: tutorial-step;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.15rem;
}

.step-list li::before {
  content: counter(tutorial-step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--brand-primary);
  color: var(--ink-inverse);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* FAQ Accordion */
.faq-list details {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  margin-bottom: 0.75rem;
  padding: 0.95rem 1.15rem;
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.faq-list details[open] summary::after {
  content: "\2212";
}

.faq-list details p {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: var(--ink-secondary);
}

/* Sources list */
.sources-box {
  margin-top: var(--space-6);
  padding: 1.25rem 1.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.sources-box h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.2rem;
}

.sources-box ol {
  margin-bottom: 0;
}

/* Prev/Next Nav */
.pager-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-hairline);
}

@media (min-width: 640px) {
  .pager-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pager-link {
  display: block;
  padding: 1rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
}

.pager-link:hover {
  border-color: var(--brand-bronze);
}

.pager-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.pager-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--brand-primary);
  font-weight: 600;
}

/* ==========================================================================
   Editorial Trust Strip & Pathways
   ========================================================================== */
.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .trust-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.trust-item {
  padding: 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.trust-item h3 {
  font-size: 1.15rem;
  color: var(--brand-primary);
}

.trust-item p {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin-bottom: 0;
}

/* ==========================================================================
   Search & Filter Controls
   ========================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: var(--space-5);
  align-items: center;
}

.filter-select {
  min-height: 42px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.search-results-list {
  display: grid;
  gap: var(--space-4);
}

.search-result-card {
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.search-result-card h2 {
  font-size: 1.28rem;
  margin-bottom: 0.35rem;
}

.search-result-card h2 a {
  text-decoration: none;
  color: var(--brand-primary);
}

.search-result-card h2 a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Advertising Containers (Exact Breakpoint Alignment & Zero Mobile Clipping)
   ========================================================================== */
.ad-banner-wrap {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 0;
}

@media (min-width: 480px) {
  .ad-banner-wrap {
    padding-inline: clamp(1rem, 3vw, 2rem);
  }
}

.ad-section {
  margin-block: var(--space-5);
  padding: 0.75rem 0;
  background: #F6F0EA;
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  text-align: center;
  max-width: 100%;
}

@media (min-width: 480px) {
  .ad-section {
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
  }
}

.ad-section[hidden] {
  display: none;
}

.ad-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.ad-slot-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-inline: auto;
  width: 100%;
  max-width: 100%;
}

/* Reserved dimensions aligned 1:1 with assets/js/ads.js breakpoints:
   <500px: 320x50 | 500px-819px (incl. 768px tablet): 468x60 | >=820px: 728x90 */
.ad-slot--responsive .ad-slot-inner {
  min-height: 50px;
}

@media (min-width: 500px) {
  .ad-slot--responsive .ad-slot-inner {
    min-height: 60px;
  }
}

@media (min-width: 820px) {
  .ad-slot--responsive .ad-slot-inner {
    min-height: 90px;
  }
}

.ad-slot--in-content {
  margin-block: var(--space-6);
  padding-inline: 0;
}

.ad-slot--in-content .ad-slot-inner {
  min-height: 250px;
}

/* Desktop side rail only on wide screens >= 1200px */
.article-rail {
  display: none;
}

@media (min-width: 1200px) {
  .article-rail {
    display: block;
    width: 200px;
  }
  .ad-slot--rail .ad-slot-inner {
    min-height: 600px;
  }
}

.ad-consent-placeholder {
  font-size: 0.82rem;
  color: var(--ink-muted);
  padding: 0.5rem 0.75rem;
}

/* ==========================================================================
   Consent Banner & Preferences Dialog
   ========================================================================== */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: var(--bg-surface);
  border-top: 2px solid var(--brand-primary);
  box-shadow: 0 -8px 28px rgba(36, 28, 27, 0.14);
  padding: 1.15rem clamp(1rem, 3vw, 2rem);
}

.consent-banner[hidden] {
  display: none;
}

.consent-banner-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 900px) {
  .consent-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.consent-copy {
  max-width: 70ch;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.consent-copy strong {
  color: var(--ink-primary);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.98rem;
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  flex-shrink: 0;
}

.consent-dialog {
  width: min(560px, calc(100vw - 2rem));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  background: var(--bg-page);
  color: var(--ink-primary);
  box-shadow: var(--shadow-drawer);
}

.consent-dialog::backdrop {
  background: rgba(36, 28, 27, 0.55);
}

.consent-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.consent-toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-primary);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #23191A;
  color: #E7DDD7;
  padding-top: var(--space-7);
  padding-bottom: var(--space-6);
  margin-top: var(--space-7);
}

.site-footer a {
  color: #F4EAE3;
  text-decoration: none;
}

.site-footer a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.footer-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--brand-bronze);
}

.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: #FFFFFF;
}

.footer-heading {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #DFB895;
  margin-bottom: 0.85rem;
}

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

.footer-links li {
  margin-bottom: 0.45rem;
  font-size: 0.91rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: var(--space-5);
  font-size: 0.84rem;
  color: #C9BBB3;
}

.footer-pref-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #F4EAE3;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
}

.footer-pref-btn:hover {
  border-color: #DFB895;
  color: #FFFFFF;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
