@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces.woff2') format('woff2');
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/plus-jakarta-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="light"] {
  --bg: #f6f3ec;
  --bg-elevated: #fcfbf8;
  --bg-subtle: #ebe5d8;
  --bg-blueprint: #f1ede2;
  --bg-glass: rgba(246, 243, 236, 0.94);
  --text: #102026;
  --text-body: #1e3138;
  --text-muted: #526770;
  --border: #d5ccb9;
  --border-strong: #b2a68f;
  --accent-terracotta: #b85a3a;
  --accent-terracotta-hover: #974528;
  --accent-terracotta-soft: rgba(184, 90, 58, 0.1);
  --accent-mistral: #1b5e68;
  --accent-mistral-hover: #13464e;
  --accent-mistral-soft: #e1eef0;
  --brand-tile: #102026;
  --brand-arch: #f6f3ec;
  --shadow-sm: 0 1px 3px rgba(16, 32, 38, 0.05);
  --shadow-md: 0 10px 28px rgba(16, 32, 38, 0.08);
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
}

:root[data-theme="dark"] {
  --bg: #0d181c;
  --bg-elevated: #132329;
  --bg-subtle: #182c34;
  --bg-blueprint: #101f25;
  --bg-glass: rgba(13, 24, 28, 0.94);
  --text: #f3efe8;
  --text-body: #d6e0e3;
  --text-muted: #8ea5ad;
  --border: #233a43;
  --border-strong: #375763;
  --accent-terracotta: #d97250;
  --accent-terracotta-hover: #e68868;
  --accent-terracotta-soft: rgba(217, 114, 80, 0.14);
  --accent-mistral: #4ca3af;
  --accent-mistral-hover: #68b8c3;
  --accent-mistral-soft: rgba(76, 163, 175, 0.15);
  --brand-tile: #182c34;
  --brand-arch: #f3efe8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 36px rgba(0, 0, 0, 0.45);
}

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

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text-body);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  line-height: 1.68;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--text);
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 1.55rem + 2vw, 3.05rem);
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 2.05rem);
}

h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.38rem);
}

p, li {
  max-width: 72ch;
}

a {
  color: var(--accent-terracotta);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

:focus-visible {
  outline: 2px solid var(--accent-mistral);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  background: var(--accent-terracotta);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
}

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

.shell {
  width: min(1260px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Topbar Architecturale — 64px, 1 seule ligne garantie, ZÉRO retour à la ligne */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-strong);
}

.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

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

.brand-mark {
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.brand-name span {
  color: var(--accent-terracotta);
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-body);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 1rem;
  background: var(--accent-mistral);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-mistral);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.nav-cta:hover {
  background: var(--accent-mistral-hover);
  color: #ffffff !important;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 0.85rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* Bandeau supérieur de contexte climatique Zone H3 */
.context-banner {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.context-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  flex-wrap: wrap;
}

.context-code {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-mistral);
}

.context-code::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent-terracotta);
}

/* Eyebrow & Technical Labels */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-terracotta);
  margin-bottom: 0.65rem;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-xs);
}

/* Hero Plan d'Architecte / Diagnostic Interactif */
.hero-blueprint {
  padding: 2.2rem 0 2.5rem;
  border-bottom: 1px solid var(--border-strong);
}

.hero-arch-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 0;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.hero-arch-left {
  padding: clamp(1.5rem, 3vw, 2.6rem);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-coord {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.9rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.hero-lead {
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
  color: var(--text);
  font-weight: 500;
  margin: 0.85rem 0 1.25rem;
  line-height: 1.6;
}

/* 3 Boutons de pré-réglages architecturaux rapides */
.preset-panel {
  margin-top: 0.5rem;
  padding: 1.15rem;
  background: var(--bg-blueprint);
  border: 1px solid var(--border-strong);
}

.preset-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-mistral);
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.preset-btn {
  text-align: left;
  padding: 0.7rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.preset-btn strong {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.preset-btn span {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.preset-btn:hover {
  border-color: var(--accent-terracotta);
}

.preset-btn.is-active {
  background: var(--accent-mistral-soft);
  border-color: var(--accent-mistral);
  box-shadow: inset 3px 0 0 var(--accent-mistral);
}

.preset-live-readout {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.8rem 0.95rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.readout-cell small {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.readout-cell strong {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  color: var(--text);
}

.readout-cell.accent strong {
  color: var(--accent-terracotta);
}

.hero-arch-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-subtle);
}

.hero-photo-frame {
  position: relative;
  margin: 0;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-strong);
}

.hero-photo-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-tech-overlay {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-strong);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-tech-overlay strong {
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.hero-tech-overlay span {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-mistral);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-sub-plates {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sub-plate {
  padding: 0.9rem 1.1rem;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.sub-plate:first-child {
  border-right: 1px solid var(--border);
}

.sub-plate img {
  width: 68px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
}

.sub-plate div strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text);
}

.sub-plate div span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Buttons */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent-terracotta);
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-xs);
  text-decoration: none;
  border: 1px solid var(--accent-terracotta);
  cursor: pointer;
  font-size: 0.94rem;
  font-family: inherit;
  transition: background-color 0.15s ease;
}

.button:hover {
  background: var(--accent-terracotta-hover);
  color: #ffffff;
}

.button.secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.button.secondary:hover {
  border-color: var(--accent-mistral);
  color: var(--accent-mistral);
}

/* Calculateur Bilan Thermique Section */
.calc-section {
  margin: 2.5rem 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.calc-topbar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-strong);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.calc-topbar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-mistral);
}

.calc-body {
  padding: clamp(1.4rem, 2.5vw, 2.2rem);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: start;
  margin-top: 1.4rem;
}

.calc-form {
  display: grid;
  gap: 1.1rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.field small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.field input,
.field select {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.calc-results {
  background: var(--bg-blueprint);
  border: 1px solid var(--border-strong);
  padding: 1.4rem;
}

.result-highlight {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-terracotta);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

.result-highlight .big-power {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  font-weight: 600;
  color: var(--text);
  display: block;
  margin: 0.2rem 0;
}

.result-highlight .sub-power {
  font-size: 0.88rem;
  color: var(--accent-mistral);
  font-weight: 700;
}

.result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.85rem 0;
}

.mini-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.8rem 0.95rem;
}

.mini-card span {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.mini-card strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  color: var(--text);
}

.passive-box {
  background: var(--accent-mistral-soft);
  border: 1px solid var(--accent-mistral);
  padding: 0.95rem 1.1rem;
  margin-top: 0.95rem;
}

.passive-box h4 {
  margin: 0 0 0.45rem;
  font-size: 0.94rem;
}

.passive-box ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.88rem;
}

/* Fiches d'Ingénierie Thermique Asymétriques (Les 6 Guides) */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.engineering-showcase {
  display: grid;
  gap: 1.5rem;
}

.study-featured {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.study-featured-media {
  position: relative;
  border-right: 1px solid var(--border-strong);
  min-height: 320px;
  background: var(--bg-subtle);
}

.study-featured-media img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.study-metrics-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-strong);
  padding: 0.65rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.study-featured-body {
  padding: clamp(1.5rem, 2.5vw, 2.4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.study-cartouches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}

.cartouche {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-blueprint);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-mistral);
}

.studies-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.study-sheet {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: grid;
  grid-template-columns: 180px 1fr;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.study-sheet:hover {
  border-color: var(--accent-terracotta);
  box-shadow: var(--shadow-md);
}

.study-sheet-media {
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.study-sheet-media img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.study-sheet-body {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.study-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.study-sheet h3 {
  font-size: 1.14rem;
  margin-bottom: 0.5rem;
}

.study-sheet h3 a,
.study-featured h3 a {
  color: var(--text);
  text-decoration: none;
}

.study-sheet h3 a:hover,
.study-featured h3 a:hover {
  color: var(--accent-terracotta);
}

.study-sheet p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.study-sheet-foot {
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

/* Categories & Generic Guide Cards for Secondary Pages */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cat-card h3 a {
  text-decoration: none;
  color: var(--text);
}

.cat-card h3 a:hover {
  color: var(--accent-terracotta);
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.guide-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
}

.guide-card-media img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

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

.guide-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-mistral);
  margin-bottom: 0.5rem;
}

.guide-card h3 {
  margin-bottom: 0.6rem;
  font-size: 1.18rem;
}

.guide-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.guide-card h3 a:hover {
  color: var(--accent-terracotta);
}

.guide-card p {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

/* Article Layout */
.breadcrumbs {
  padding: 1.1rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

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

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

.article-header {
  padding: 1.4rem 0 1.8rem;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.9rem;
}

.article-hero-fig {
  margin: 0 0 2.2rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
}

.article-hero-fig img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
}

.article-hero-fig figcaption {
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.article-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 1.2rem;
}

.toc-sidebar h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-mistral);
  margin-bottom: 0.8rem;
}

.toc-sidebar ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
  font-size: 0.88rem;
}

.toc-sidebar a {
  color: var(--text-body);
  text-decoration: none;
}

.toc-sidebar a:hover {
  color: var(--accent-terracotta);
}

.summary-box {
  background: var(--bg-blueprint);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-mistral);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.summary-box h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.formula-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  border: 1px solid var(--border-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elevated);
  font-size: 0.92rem;
}

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

th {
  background: var(--bg-subtle);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sources-box {
  margin-top: 2.5rem;
  padding: 1.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
}

/* Newsletter Box */
.newsletter-band {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 2rem;
  margin: 3rem 0;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.newsletter-form {
  display: grid;
  gap: 0.85rem;
}

.newsletter-form input[type="email"] {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.96rem;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Footer */
.site-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-strong);
  padding: 3rem 0 2rem;
  margin-top: 3.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.footer-col h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--accent-terracotta);
}

.footer-bar {
  padding-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
}

.theme-switcher label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.theme-switcher select {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
}

.text-button {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.86rem;
  padding: 0;
}

dialog#analytics-consent { position: fixed; right: 20px; bottom: 20px; left: auto; top: auto; margin: 0; z-index: 200;
  max-width: 520px;
  width: calc(100% - 2rem);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-body);
  padding: 1.6rem;
  box-shadow: var(--shadow-md);
}

dialog#analytics-consent::backdrop {
  background: rgba(13, 24, 28, 0.6);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

/* Responsive Breakpoints — Mobile menu cleanly below 1024px */
@media (max-width: 1023px) {
  .menu-toggle {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-strong);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 0.75rem;
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open {
    display: flex;
  }
  .hero-arch-grid,
  .study-featured,
  .calc-layout,
  .article-grid,
  .newsletter-band {
    grid-template-columns: 1fr;
  }
  .hero-arch-left,
  .study-featured-media {
    border-right: none;
    border-bottom: 1px solid var(--border-strong);
  }
  .studies-2col,
  .category-grid,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toc-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .preset-buttons,
  .preset-live-readout,
  .studies-2col,
  .study-sheet,
  .category-grid,
  .guides-grid,
  .footer-grid,
  .field-row,
  .result-cards,
  .hero-sub-plates {
    grid-template-columns: 1fr;
  }
  .study-sheet-media {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .header-actions .nav-cta {
    display: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .newsletter-band,
  .toc-sidebar,
  dialog#analytics-consent { position: fixed; right: 20px; bottom: 20px; left: auto; top: auto; margin: 0; z-index: 200;
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
