/* ============================================================
   My Baby Math — Shared Stylesheet
   Mobile-first, no external dependencies
   ============================================================ */

/* CSS Variables */
:root {
  --color-primary: #C2185B;
  --color-primary-hover: #AD1457;
  --color-pink-light: #FCE4EC;
  --color-pink-subtle: #FFF5F8;
  --color-text: #2C2C2C;
  --color-muted: #666666;
  --color-light-gray: #F5F5F5;
  --color-border: #E0E0E0;
  --color-white: #FFFFFF;
  --color-success: #2E7D32;
  --color-warning: #F57C00;
  --color-info: #1976D2;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --max-width-tool: 800px;
  --max-width-home: 1100px;
  --radius-card: 8px;
  --radius-button: 6px;
  --radius-input: 4px;
  --transition: 0.2s ease;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-header: 0 1px 4px rgba(0,0,0,0.08);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-button);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 16px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-header);
}
.header-inner {
  max-width: var(--max-width-home);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.site-logo:hover { text-decoration: none; color: var(--color-primary-hover); }

.site-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px 20px;
  gap: 4px;
}
.site-nav.nav-open { display: flex; }
.site-nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}
.site-nav a:last-child { border-bottom: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--color-primary); }

.hamburger {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text);
  padding: 4px 8px;
  border-radius: var(--radius-input);
  line-height: 1;
}
.hamburger:focus { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 { font-size: 1.6rem; font-weight: 700; color: var(--color-primary); line-height: 1.25; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; font-weight: 600; color: var(--color-primary); line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 600; color: var(--color-text); line-height: 1.35; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; }
.lead { font-size: 1.1rem; color: var(--color-muted); line-height: 1.6; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container { width: 100%; max-width: var(--max-width-tool); margin: 0 auto; padding: 0 20px; }
.container-wide { width: 100%; max-width: var(--max-width-home); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
}
.card-pink {
  background: linear-gradient(135deg, var(--color-pink-light) 0%, var(--color-pink-subtle) 100%);
  border: 1px solid #f8bbd0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-button);
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
  font-family: var(--font-stack);
  line-height: 1.4;
}
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); text-decoration: none; color: white; }
.btn-primary:focus { outline: 2px solid var(--color-primary); outline-offset: 3px; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-button);
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-stack);
}
.btn-secondary:hover { background: var(--color-primary); color: white; text-decoration: none; }
.btn-secondary:focus { outline: 2px solid var(--color-primary); outline-offset: 3px; }

.btn-text {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
  font-family: var(--font-stack);
}
.btn-text:hover { color: var(--color-primary-hover); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  font-size: 1rem;
  font-family: var(--font-stack);
  color: var(--color-text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: auto;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(194,24,91,0.12);
}
.form-group input.error { border-color: #c62828; }
.helper-text { font-size: 0.8rem; color: var(--color-muted); margin-top: 4px; display: block; }
.error-text { font-size: 0.8rem; color: #c62828; margin-top: 4px; display: none; }
.error-text.visible { display: block; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.radio-label input[type="radio"] { width: 18px; height: 18px; accent-color: var(--color-primary); cursor: pointer; flex-shrink: 0; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 24px;
  padding: 12px 0;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-primary); }

/* ============================================================
   FAQ / ACCORDION (native details/summary)
   ============================================================ */
.faq-list { list-style: none; padding: 0; }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-item:first-child { border-top: 1px solid var(--color-border); }
.faq-item details summary {
  padding: 16px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}
.faq-item details summary::-webkit-details-marker { display: none; }
.faq-item details summary::after { content: "+"; font-size: 1.4rem; color: var(--color-primary); flex-shrink: 0; margin-left: 12px; }
.faq-item details[open] summary::after { content: "−"; }
.faq-item details summary:hover { color: var(--color-primary); }
.faq-item details p { padding: 0 0 16px; color: var(--color-muted); font-size: 0.95rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-light-gray);
  border-top: 1px solid var(--color-border);
  padding: 40px 20px 0;
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-width-home);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.footer-col strong { display: block; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text); margin-bottom: 12px; }
.footer-col p { font-size: 0.875rem; color: var(--color-muted); margin-bottom: 0; line-height: 1.6; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: var(--color-muted); font-size: 0.875rem; text-decoration: none; }
.footer-col ul li a:hover { color: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
  max-width: var(--max-width-home);
  margin: 0 auto;
}
.footer-bottom p { font-size: 0.8rem; color: var(--color-muted); margin: 0; }
.footer-bottom a { color: var(--color-muted); }
.footer-bottom a:hover { color: var(--color-primary); }

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 200;
  flex-wrap: wrap;
}
.cookie-banner p { margin: 0; font-size: 0.875rem; color: var(--color-muted); flex: 1; }
.cookie-banner a { color: var(--color-primary); }

/* ============================================================
   TOOL PAGE SHARED STYLES
   ============================================================ */
.tool-hero {
  background: linear-gradient(135deg, var(--color-pink-light) 0%, var(--color-pink-subtle) 100%);
  border-radius: var(--radius-card);
  padding: 32px 24px;
  margin-bottom: 32px;
}
.tool-hero h1 { margin-bottom: 8px; }
.tool-hero .subtitle { color: var(--color-muted); font-size: 1rem; margin-bottom: 0; }

.result-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 32px;
}
.result-section.hidden { display: none; }
.result-primary { font-size: 2rem; font-weight: 700; color: var(--color-primary); margin: 8px 0 20px; line-height: 1.2; }
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.result-item { padding: 14px; background: var(--color-light-gray); border-radius: var(--radius-input); }
.result-item .result-label { font-size: 0.8rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.result-item .result-value { font-size: 1rem; font-weight: 600; color: var(--color-text); }

/* Related tools */
.related-tools { background: var(--color-light-gray); border-radius: var(--radius-card); padding: 24px; margin: 40px 0; }
.related-tools h2 { margin-top: 0; font-size: 1.1rem; }
.related-tools-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.related-tool-link {
  display: block;
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--transition), color var(--transition);
}
.related-tool-link:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

/* References */
.references { border-top: 1px solid var(--color-border); padding-top: 24px; margin-top: 40px; }
.references h2 { font-size: 1rem; color: var(--color-muted); }
.references ol { font-size: 0.85rem; color: var(--color-muted); }
.references ol li { margin-bottom: 8px; }

/* Progress bar */
.progress-bar-wrap { background: var(--color-border); border-radius: 20px; height: 20px; overflow: hidden; margin: 16px 0 8px; position: relative; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--color-pink-light), var(--color-primary)); border-radius: 20px; transition: width 0.6s ease; min-width: 4px; }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--color-muted); }

/* Comparison table */
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 16px 0; }
.comparison-table th { background: var(--color-pink-light); color: var(--color-primary); font-weight: 600; padding: 10px 14px; text-align: left; border: 1px solid #f8bbd0; }
.comparison-table td { padding: 10px 14px; border: 1px solid var(--color-border); vertical-align: top; }
.comparison-table tr:nth-child(even) td { background: var(--color-pink-subtle); }

/* ============================================================
   HOMEPAGE SPECIFIC
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, var(--color-pink-light) 0%, var(--color-pink-subtle) 60%, white 100%);
  padding: 60px 20px;
  text-align: center;
}
.hero-section h1 { font-size: 1.8rem; max-width: 600px; margin: 0 auto 16px; }
.hero-section .hero-sub { font-size: 1.05rem; color: var(--color-muted); max-width: 540px; margin: 0 auto 28px; }
.hero-meta { font-size: 0.85rem; color: var(--color-muted); margin-top: 16px; }
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 24px; }
.tool-card { padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: white; transition: box-shadow var(--transition), border-color var(--transition); }
.tool-card:hover { box-shadow: 0 4px 16px rgba(194,24,91,0.12); border-color: var(--color-primary); }
.tool-card .tool-icon { font-size: 2rem; margin-bottom: 12px; }
.tool-card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--color-text); }
.tool-card p { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 16px; }
.tool-card a.tool-cta { color: var(--color-primary); font-weight: 600; font-size: 0.9rem; }
.trust-badges { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.trust-badge { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.trust-badge .badge-icon { font-size: 1.4rem; flex-shrink: 0; }
.how-steps { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 24px; }
.how-step { text-align: center; padding: 24px 16px; }
.how-step .step-num { width: 48px; height: 48px; background: var(--color-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 700; margin: 0 auto 16px; }
.how-step h3 { margin-bottom: 8px; }
.cta-section { background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%); color: white; padding: 60px 20px; text-align: center; }
.cta-section h2 { color: white; font-size: 1.5rem; margin-bottom: 12px; margin-top: 0; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 24px; }
.cta-section .btn-cta { background: white; color: var(--color-primary); padding: 14px 36px; font-size: 1.05rem; border-radius: var(--radius-button); font-weight: 700; display: inline-block; text-decoration: none; transition: transform var(--transition); }
.cta-section .btn-cta:hover { transform: translateY(-2px); text-decoration: none; }

/* ============================================================
   RESPONSIVE — 768px+
   ============================================================ */
@media (min-width: 768px) {
  .header-inner { height: 64px; }
  .site-nav { display: flex; flex-direction: row; position: static; border: none; padding: 0; gap: 24px; background: transparent; }
  .site-nav a { border-bottom: none; padding: 0; font-size: 0.9rem; }
  .hamburger { display: none; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.25rem; }
  .container { padding: 0 40px; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .related-tools-grid { grid-template-columns: repeat(3, 1fr); }
  /* Homepage */
  .hero-section { padding: 80px 40px; }
  .hero-section h1 { font-size: 2.8rem; }
  .hero-section .hero-sub { font-size: 1.15rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-badges { flex-direction: row; justify-content: center; gap: 40px; }
  .how-steps { grid-template-columns: repeat(3, 1fr); }
  /* Tool hero */
  .tool-hero { padding: 48px 40px; }
  .tool-hero h1 { font-size: 2.2rem; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header, .site-footer, .cookie-banner, .hamburger,
  .btn-primary, .btn-secondary, .btn-text, .related-tools,
  .hero-section, .tool-hero form, .cta-section { display: none !important; }
  body { font-size: 12pt; color: #000; }
  .result-section { box-shadow: none; border: 1px solid #ccc; }
  .result-primary { font-size: 18pt; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* Focus indicators */
a:focus, button:focus, input:focus, select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
