/* Shared styles for new (Jinja2-rendered) pages only — index.html/faq.html/
   cost_calculator.html/about.html keep their own inline copies unchanged.
   Keep in sync with the inline <style> blocks in those files if the shared
   header/drawer/footer/cc-* patterns change. */

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

:root {
  --ink: #1a1a1a;
  --ink-light: #6b6b6b;
  --ink-faint: #a8a8a8;
  --bg: #f7f5f2;
  --white: #ffffff;
  --accent: #2d5a3d;
  --accent-light: #e8f0eb;
  --warn: #b45309;
  --warn-light: #fef3c7;
  --border: #e2ddd8;
  --radius: 12px;
  --shadow: 0 2px 20px rgba(0,0,0,0.07);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo-icon { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; }
.logo-icon img { width: 100%; height: 100%; display: block; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-cta {
  background: var(--accent); color: white; text-decoration: none;
  font-size: 0.78rem; font-weight: 600; padding: 7px 14px; border-radius: 20px;
  white-space: nowrap; transition: background 0.2s;
}
.header-cta:hover { background: #224830; }
.header-dropdown { position: relative; }
.header-dropdown > .header-cta { cursor: pointer; border: none; font-family: inherit; }
.header-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 6px;
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px; min-width: 170px;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 25;
}
.header-dropdown:hover .header-dropdown-menu,
.header-dropdown:focus-within .header-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.header-dropdown-menu a {
  display: block; padding: 9px 12px; border-radius: 7px; color: var(--ink);
  text-decoration: none; font-size: 0.85rem; font-weight: 500; white-space: nowrap;
}
.header-dropdown-menu a:hover { background: var(--accent-light); color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--ink); text-decoration: none; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.nav-link:hover { color: var(--accent); }
.nav-link.current { color: var(--accent); font-weight: 600; }

/* ── LANGUAGE SWITCHER (desktop: globe-icon dropdown, reuses .header-dropdown) ── */
.lang-trigger {
  display: flex; align-items: center; gap: 5px;
  background: none; color: var(--ink-light); border: 1px solid var(--border);
  padding: 6px 10px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lang-trigger:hover { border-color: var(--accent); color: var(--accent); background: none; }
.lang-trigger svg { width: 15px; height: 15px; flex-shrink: 0; }
.lang-dropdown-menu a.current { color: var(--accent); font-weight: 600; }

/* ── LANGUAGE SWITCHER (mobile drawer) ── */
.lang-switcher-drawer { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.lang-switcher-drawer-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-faint); padding: 0 10px; margin-bottom: 4px;
}
.lang-switcher-drawer-label svg { width: 13px; height: 13px; }
.lang-drawer-link.current { color: var(--accent); font-weight: 600; }
.logo-text { font-family: 'DM Serif Display', serif; font-size: 1.05rem; color: var(--ink); }
.badge {
  font-size: 0.68rem; background: var(--accent-light); color: var(--accent);
  padding: 3px 9px; border-radius: 20px; font-weight: 600; letter-spacing: 0.03em;
}

/* ── MOBILE NAV DRAWER ── */
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: none; border: none; cursor: pointer;
  color: var(--ink); padding: 0; margin-right: 2px;
}
.menu-btn svg { width: 20px; height: 20px; display: block; }

.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 30;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 250px; max-width: 78vw;
  background: var(--white); box-shadow: 2px 0 24px rgba(0,0,0,0.15);
  transform: translateX(-100%); transition: transform 0.25s ease;
  z-index: 40; padding: 18px; display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-close {
  align-self: flex-end; background: none; border: none; font-size: 1.3rem;
  line-height: 1; cursor: pointer; color: var(--ink-light); padding: 6px; margin-bottom: 8px;
}
.drawer-link {
  color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 12px 10px; border-radius: 8px; transition: background 0.15s, color 0.15s;
}
.drawer-link:hover { background: var(--accent-light); color: var(--accent); }

@media (max-width: 700px) {
  .menu-btn { display: flex; }
  .header-left .header-cta, .header-left .header-dropdown { display: none; }
  .header-right .nav-link { display: none; }
  .header-left { gap: 6px; }
}

@media (max-width: 480px) {
  header { padding: 0 1rem; }
}

/* ── SHARED CONTENT-PAGE HERO ── */
.page-hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 36px 40px 30px;
  text-align: center;
}
.page-hero-inner { max-width: 720px; margin: 0 auto; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-light); color: var(--accent);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em;
  padding: 5px 12px; border-radius: 20px; margin-bottom: 14px;
}
.page-hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 10px;
}
.page-hero p { font-size: 0.92rem; color: var(--ink-light); font-weight: 300; }
.page-hero a { color: var(--accent); text-decoration: none; font-weight: 500; }
.page-hero a:hover { text-decoration: underline; }

.page-main { max-width: 720px; margin: 0 auto; padding: 36px 24px 60px; }

/* ── SHARED CARD (matches cost_calculator.html's .cc-card) ── */
.cc-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.cc-card h2 {
  font-family: 'DM Serif Display', serif; font-size: 1.25rem; color: var(--ink); margin-bottom: 14px;
}
.cc-card p { font-size: 0.92rem; color: var(--ink-light); line-height: 1.75; margin-bottom: 14px; }
.cc-card p:last-child { margin-bottom: 0; }
.cc-card a { color: var(--accent); text-decoration: none; font-weight: 500; }
.cc-card a:hover { text-decoration: underline; }
.cc-byline { font-size: 0.8rem; color: var(--ink-faint); font-weight: 600; letter-spacing: 0.03em; margin-bottom: 4px; }

.cc-question {
  font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: var(--ink);
  margin-bottom: 16px;
}

/* ── STAGE PICKER (matches cost_calculator.html's .cc-stage-*) ── */
.cc-stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-stage-option {
  background: var(--bg); border: 2px solid var(--border); border-radius: 10px;
  padding: 10px 6px 12px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 6px; transition: border-color 0.15s, background 0.15s;
  font-family: 'DM Sans', sans-serif; text-decoration: none;
}
.cc-stage-option:hover { border-color: var(--accent); }
.cc-stage-option.selected { border-color: var(--accent); background: var(--accent-light); }
.cc-stage-option img { width: 100%; max-width: 70px; height: auto; display: block; }
.cc-stage-option span { font-size: 0.76rem; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.25; }

.cc-field { margin-bottom: 16px; }
.cc-field-grafts { margin-top: 20px; margin-bottom: 0; }
.cc-field label {
  display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-light);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.cc-field input[type="number"], .cc-field select {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 13px; font-family: 'DM Sans', sans-serif; font-size: 0.95rem;
  color: var(--ink); background: var(--bg); outline: none; transition: border-color 0.2s;
}
.cc-field input[type="number"]:focus, .cc-field select:focus { border-color: var(--accent); background: var(--white); }

.cc-cost-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.cc-cost-table th {
  text-align: left; font-size: 0.7rem; font-weight: 600; color: var(--ink-light);
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0 12px 10px;
  border-bottom: 2px solid var(--border);
}
.cc-cost-table th:last-child, .cc-cost-table td:last-child { text-align: right; }
.cc-cost-table td {
  padding: 14px 12px; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; color: var(--ink);
}
.cc-cost-table tr:last-child td { border-bottom: none; }
.cc-cost-table td.cc-cost-value { font-family: 'DM Serif Display', serif; font-size: 1.15rem; color: var(--accent); }

.disclaimer {
  background: var(--warn-light); border-radius: 7px; padding: 11px 13px;
  font-size: 0.76rem; color: var(--warn); display: flex; gap: 7px; align-items: flex-start; margin-top: 16px;
}

/* ── RELATED CALCULATOR PROMPT (shown below results on every calculator
   page, suggesting the next tool that fits the user's likely journey) ── */
.related-calc-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--accent-light); border-radius: 10px;
  padding: 14px 16px; margin-top: 16px;
  text-decoration: none; transition: background 0.15s ease;
}
.related-calc-box:hover { background: #dcebe3; }
.related-calc-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.related-calc-text { flex: 1; min-width: 0; }
.related-calc-text strong { display: block; font-size: 0.85rem; color: var(--ink); margin-bottom: 2px; }
.related-calc-text p { font-size: 0.78rem; color: var(--ink-light); margin: 0; line-height: 1.45; }
.related-calc-link {
  flex-shrink: 0; font-size: 0.82rem; font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 520px) {
  .related-calc-box { flex-wrap: wrap; }
  .related-calc-link { width: 100%; text-align: right; }
}

/* ── COMPARISON GUIDES (shared by /hair-transplant-techniques,
   /hair-loss-medications, and future item-vs-item guide pages) ── */
.cc-card ul { margin: 0 0 14px 20px; }
.cc-card li { font-size: 0.87rem; color: var(--ink-light); line-height: 1.65; margin-bottom: 6px; }

.guide-table-wrap { overflow-x: auto; }
.guide-table { min-width: 480px; }

.pros-cons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 10px 0 14px; }
.pros-cons-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 8px;
}
.pros-label { color: var(--accent); }
.cons-label { color: var(--ink-faint); }
.best-for-note { font-size: 0.87rem; }

/* ── HUB GRID (for /norwood and future cluster hubs) ── */
.hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.hub-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; text-decoration: none; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  transition: border-color 0.15s;
}
.hub-card:hover { border-color: var(--accent); }
.hub-card img { width: 100%; max-width: 90px; height: auto; }
.hub-card-title { font-size: 0.92rem; font-weight: 600; color: var(--ink); text-align: center; }
.hub-card-sub { font-size: 0.76rem; color: var(--ink-light); text-align: center; }

@media (max-width: 600px) {
  .page-hero { padding: 28px 20px 24px; }
  .page-main { padding: 28px 16px 48px; }
  .pros-cons-grid { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 480px) {
  .cc-stage-grid { gap: 6px; }
  .cc-stage-option { padding: 6px 3px 8px; }
  .cc-stage-option span { font-size: 0.68rem; }
}

/* ── FOOTER ── */
footer { text-align: center; padding: 20px; color: var(--ink-faint); font-size: 0.75rem; border-top: 1px solid var(--border); background: var(--white); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
