/* ═══════════════════════════════════════════════════════════════
   Age & Birth Calculator Hub — Shared Design System
   shared.css
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --purple:        #6d28d9;
  --purple-mid:    #7c3aed;
  --purple-light:  #ede9fe;
  --purple-dark:   #5b21b6;
  --blue:          #2563eb;
  --blue-light:    #dbeafe;
  --text:          #1e1b2e;
  --text-secondary:#374151;
  --muted:         #6b7280;
  --border:        #e5e7eb;
  --border-strong: #d1d5db;
  --bg:            #f8f7ff;
  --bg-alt:        #f3f4f6;
  --white:         #ffffff;
  --green:         #059669;
  --green-light:   #d1fae5;
  --orange:        #d97706;
  --orange-light:  #fef3c7;
  --red:           #dc2626;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 12px rgba(109,40,217,.08), 0 1px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 8px 30px rgba(109,40,217,.12), 0 2px 8px rgba(0,0,0,.06);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.65;
  min-height: 100vh;
}

/* ─── TYPOGRAPHY ─── */
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.4px; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 700; }
h4 { font-size: 0.95rem; font-weight: 700; }
p  { color: var(--text-secondary); }

/* ─── NAV ─── */
#site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  color: var(--purple);
  margin-right: 24px;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  list-style: none;
}
.nav-item { position: relative; }
.nav-item > a, .nav-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-item > a:hover, .nav-trigger:hover,
.nav-item:focus-within > a, .nav-item:focus-within > .nav-trigger {
  background: var(--bg);
  color: var(--purple);
}
.nav-trigger .chevron {
  width: 12px; height: 12px;
  transition: transform 0.2s;
  opacity: 0.5;
}
.nav-item:focus-within .chevron,
.nav-item:hover .chevron { transform: rotate(180deg); opacity: 1; }

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 230px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
  z-index: 300;
  list-style: none;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-dropdown a:hover { background: var(--purple-light); color: var(--purple); }
.nav-dropdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 14px 4px;
  margin-top: 4px;
}
.nav-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
  margin-left: auto;
}
.nav-mobile-menu {
  display: none;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 16px 20px;
  position: absolute;
  top: 58px;
  left: 0; right: 0;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  z-index: 199;
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-section { margin-bottom: 16px; }
.nav-mobile-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--purple-light);
  margin-bottom: 6px;
}
.nav-mobile-menu a {
  display: block;
  padding: 9px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.nav-mobile-menu a:last-child { border-bottom: none; }

@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-hamburger { display: flex; }
}

/* ─── BREADCRUMB ─── */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--purple); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-strong); }

/* ─── PAGE WRAPPER ─── */
.page-wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 80px;
}
.page-wrap-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ─── HERO ─── */
.hero {
  text-align: center;
  padding: 48px 20px 36px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-light);
  color: var(--purple);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 4px 14px;
  margin-bottom: 16px;
}
.hero h1 { color: var(--text); max-width: 700px; margin: 0 auto 12px; }
.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 0;
  line-height: 1.6;
}

/* ─── CALCULATOR CARD ─── */
.calc-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--purple-light);
  padding: 36px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.calc-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.calc-card-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

/* Date input group */
.date-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.date-field { display: flex; flex-direction: column; gap: 5px; }
.date-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.date-field select,
.date-field input[type="number"],
.date-field input[type="text"] {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
  appearance: auto;
}
.date-field select:focus,
.date-field input:focus { border-color: var(--purple); }
.date-field input[type="number"] { width: 82px; text-align: center; }
.date-field input[type="number"]::-webkit-inner-spin-button,
.date-field input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
.date-sep { font-size: 1.2rem; color: var(--border-strong); margin-bottom: 10px; user-select: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 28px;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: var(--purple-light); color: var(--purple); }
.btn-secondary:hover { background: #ddd6fe; }
.btn-outline { background: transparent; color: var(--purple); border: 1.5px solid var(--purple); }
.btn-outline:hover { background: var(--purple-light); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }

/* Error */
.calc-error {
  display: none;
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 10px;
  text-align: center;
}
.calc-error.show { display: block; }

/* Privacy note */
.privacy-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
  font-style: italic;
}

/* Result divider */
.result-divider {
  border: none;
  border-top: 1.5px solid var(--border);
  margin: 28px 0;
  display: none;
}
.result-divider.show { display: block; }

/* ─── RESULT SECTION ─── */
.result-section { display: none; }
.result-section.show { display: block; }

.result-header { text-align: center; margin-bottom: 24px; }
.result-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Age blocks */
.age-blocks {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.age-block {
  text-align: center;
  padding: 0 24px;
  position: relative;
}
.age-block + .age-block::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; height: 70%;
  width: 1.5px;
  background: var(--border);
}
.age-num {
  display: block;
  font-size: clamp(2.6rem, 7vw, 4rem);
  font-weight: 900;
  color: var(--purple);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.age-lbl {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 5px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
}
.stat-card strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.stat-card span {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

/* Birthstone / extra result cards */
.extra-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.extra-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.extra-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.extra-card-info .card-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.extra-card-info .card-value { font-size: 1rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.extra-card-info .card-note { font-size: 0.78rem; color: var(--purple); margin-top: 2px; }

/* Live pill */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 16px;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: blink 1.3s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── CONTENT SECTIONS ─── */
.section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  margin-bottom: 20px;
}
.section h2 { margin-bottom: 14px; }
.section h3 { margin-top: 20px; margin-bottom: 8px; }
.section p { margin-bottom: 12px; font-size: 0.93rem; }
.section ul, .section ol { padding-left: 22px; margin-bottom: 12px; }
.section li { font-size: 0.93rem; color: var(--text-secondary); margin-bottom: 4px; }

/* ─── FAQ ─── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.4;
}
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--purple); flex-shrink: 0; transition: transform 0.2s; }
.faq-item.open .faq-q::after { content: '−'; }
.faq-a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-top: 10px;
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* ─── RELATED CALCULATORS ─── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.related-card:hover { border-color: var(--purple); background: var(--purple-light); box-shadow: var(--shadow-sm); }
.related-card-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.related-card-text .rc-title { display: block; font-size: 0.875rem; font-weight: 700; color: var(--text); }
.related-card-text .rc-desc  { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

/* ─── HOMEPAGE CARDS ─── */
.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tool-card-home {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: block;
}
.tool-card-home:hover { border-color: var(--purple); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card-home .tc-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--purple-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
}
.tool-card-home .tc-title { font-size: 0.975rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tool-card-home .tc-desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }

/* Birthstone chart */
.birthstone-table { width: 100%; border-collapse: collapse; }
.birthstone-table th, .birthstone-table td { padding: 10px 14px; font-size: 0.88rem; text-align: left; border-bottom: 1px solid var(--border); }
.birthstone-table th { font-weight: 700; background: var(--bg); color: var(--text); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.birthstone-table td:first-child { font-weight: 600; }
.birthstone-table tr:last-child td { border-bottom: none; }
.birthstone-table tr:hover td { background: var(--purple-light); }
.bs-gem { display: inline-flex; align-items: center; gap: 6px; }
.bs-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ─── HOMEPAGE SECTIONS ─── */
.home-section {
  padding: 60px 20px;
}
.home-section-inner { max-width: 1200px; margin: 0 auto; }
.home-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 8px;
}
.home-section h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 8px; }
.home-section .section-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 32px; }
.home-section.alt { background: var(--white); }

/* ─── FOOTER ─── */
#site-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 40px 20px 30px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-brand { }
.footer-brand .logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; color: var(--purple); font-size: 1rem; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; max-width: 260px; }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 0.85rem; color: var(--muted); text-decoration: none; margin-bottom: 7px; transition: color 0.15s; }
.footer-col a:hover { color: var(--purple); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-bottom p { font-size: 0.8rem; color: var(--muted); }
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.footer-bottom-links a:hover { color: var(--purple); }

/* ─── SCHEMA / HIDDEN ─── */
[data-schema] { display: none; }

/* ─── UTILITIES ─── */
.text-center { text-align: center; }
.text-purple { color: var(--purple); }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .calc-card { padding: 24px 18px; }
  .section { padding: 22px 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .extra-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .age-block { padding: 0 14px; }
  .age-num { font-size: clamp(2.2rem, 8vw, 3rem); }
  .home-section { padding: 40px 20px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .age-blocks { gap: 0; }
  .age-block { padding: 0 10px; }
}
