/* ==========================================================
   Dog Age Calculator: styles.css
   ========================================================== */

@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #2A6FDB;
  --color-primary-dark: #1F54A8;
  --color-secondary: #4CAF82;
  --color-secondary-dark: #357A5C;
  --color-accent: #FFC857;
  --color-bg: #F4F8FC;
  --color-card: #FFFFFF;
  --color-text: #1F2A3D;
  --color-muted: #6B7280;
  --color-border: #DCE6F1;
  --color-shadow: 0 4px 18px rgba(31, 42, 61, 0.08);
  --color-shadow-lg: 0 10px 30px rgba(31, 42, 61, 0.12);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --max-width: 900px;

  --font-heading: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:target, #calculator, #chart, #faq, #products, #how-dogs-age, #specific-ages, #lifespan { scroll-margin-top: 90px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 200, 87, 0.18) 0, transparent 28%),
    radial-gradient(circle at 88% 70%, rgba(76, 175, 130, 0.14) 0, transparent 32%);
  background-attachment: fixed;
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-text); line-height: 1.2; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4.6vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }

p { margin: 0 0 1em; text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
a { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--color-primary); }
:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; border-radius: 4px; }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 8px; left: 8px;
  width: auto; height: auto; margin: 0; clip: auto; white-space: normal;
  background: var(--color-primary); color: #fff;
  padding: 10px 14px; border-radius: 6px;
  text-decoration: none; z-index: 100;
}

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  background: #fff; color: var(--color-text);
  border-radius: var(--radius);
  box-shadow: var(--color-shadow-lg);
  padding: 18px 20px;
  z-index: 90;
  border: 1px solid var(--color-border);
}
.cookie-content { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; max-width: var(--max-width); margin: 0 auto; }
.cookie-content p { margin: 0; flex: 1 1 280px; font-size: 0.95rem; }
.cookie-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Header / nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 248, 252, 0.95);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 12px; position: relative; flex-wrap: nowrap; }
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem;
  color: var(--color-text); text-decoration: none;
}
.logo-icon { width: 26px; height: 26px; flex-shrink: 0; }
.logo:hover, .logo:focus { color: var(--color-primary); }

.primary-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; }
.primary-nav a { color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.primary-nav a:hover, .primary-nav a:focus { color: var(--color-primary); }
.primary-nav .sister-link { color: var(--color-secondary-dark); }

.nav-toggle {
  display: none; background: transparent; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 8px;
  flex-direction: column; justify-content: space-around;
  flex-shrink: 0;
}
.nav-toggle span { display: block; height: 3px; background: var(--color-text); border-radius: 2px; }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--color-shadow);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
  }
  .primary-nav.open {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
  }
  .primary-nav ul { flex-direction: column; padding: 16px 20px; gap: 14px; }
}

/* ===== Hero / calculator ===== */
.hero { padding: 36px 0 24px; text-align: center; }
.hero .container > .tagline,
.hero .container > h1,
.hero .container > .hero-intro { text-align: center; }
.tagline { color: var(--color-secondary-dark); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.92rem; margin: 0 0 6px; }
.hero h1 { margin-bottom: 14px; }
.hero-intro { color: var(--color-muted); margin: 0 auto 28px; max-width: 720px; }
.calculator-card { text-align: left; }

.calculator-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--color-shadow-lg);
  border: 1px solid var(--color-border);
}
.dog-form .form-row { margin-bottom: 18px; text-align: center; }
.dog-form label { display: block; font-weight: 700; margin-bottom: 8px; font-family: var(--font-heading); }
.dog-form .optional { font-weight: 400; color: var(--color-muted); font-size: 0.9rem; }

.dog-form input[type="text"] {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  font-size: 1.05rem;
  padding: 12px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  font-family: inherit;
  text-align: center;
}
.dog-form input[type="text"]:focus { border-color: var(--color-primary); }

/* ===== Size selector ===== */
.size-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 560px) {
  .size-selector { grid-template-columns: repeat(4, 1fr); }
}
.size-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 8px;
  cursor: pointer;
  font-family: var(--font-heading);
  color: var(--color-text);
  min-height: 64px;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}
.size-btn:hover { border-color: var(--color-primary); }
.size-btn .size-name { font-weight: 800; font-size: 1rem; }
.size-btn .size-weight { font-size: 0.78rem; color: var(--color-muted); font-weight: 600; }
.size-btn.is-active {
  background: var(--color-primary); color: #fff;
  border-color: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(42, 111, 219, 0.3);
}
.size-btn.is-active .size-weight { color: rgba(255, 255, 255, 0.9); }

/* ===== Buttons ===== */
.btn {
  display: inline-block; cursor: pointer;
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
  border: 0; border-radius: var(--radius);
  padding: 12px 22px;
  text-decoration: none; text-align: center;
  transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease;
  min-height: 44px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-large { padding: 16px 28px; font-size: 1.1rem; width: 100%; }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: 0 4px 0 var(--color-primary-dark); }
.btn-primary:hover, .btn-primary:focus { background: var(--color-primary-dark); color: #fff; }
.btn-secondary { background: var(--color-secondary); color: #fff; box-shadow: 0 4px 0 var(--color-secondary-dark); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--color-secondary-dark); color: #fff; }
.btn-amazon { background: #fff; color: var(--color-text); border: 2px solid var(--color-primary); }
.btn-amazon:hover, .btn-amazon:focus { background: var(--color-primary); color: #fff; }

/* ===== Result ===== */
.result {
  margin-top: 24px;
  padding: 24px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #E5EFFC, #F4F8FC);
  border: 2px dashed var(--color-primary);
  text-align: center;
}
.result-label { font-weight: 700; color: var(--color-muted); margin: 0 0 6px; font-family: var(--font-heading); }
.result-age { margin: 0 0 8px; font-family: var(--font-heading); font-weight: 800; }
.result-age #result-number { font-size: clamp(3rem, 8vw, 5rem); color: var(--color-primary); display: block; }
.result-unit { font-size: 1.2rem; color: var(--color-text); display: block; margin-top: 4px; }
.result-stage {
  display: inline-block; padding: 6px 14px; margin: 0 0 10px;
  background: var(--color-secondary); color: #fff;
  border-radius: 999px; font-weight: 700; font-family: var(--font-heading); font-size: 0.95rem;
}
.result-fact { color: var(--color-muted); font-size: 1rem; max-width: 540px; margin: 0 auto 16px; }

.result-progress {
  position: relative;
  height: 14px; background: #DCE6F1; border-radius: 999px; overflow: hidden;
  margin: 0 auto 22px; max-width: 480px;
}
.result-progress-bar { height: 100%; background: linear-gradient(90deg, var(--color-accent), var(--color-primary)); border-radius: 999px; width: 0; transition: width 600ms ease; }

/* Life-stage product recommendations under result */
.life-stage-recs {
  margin: 18px 0 4px; padding: 16px;
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--color-border); text-align: left;
}
.life-stage-recs h4 { margin: 0 0 10px; font-size: 1rem; color: var(--color-primary-dark); }
.life-stage-recs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.life-stage-recs a {
  display: block; padding: 10px 14px; background: #F4F8FC;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--color-text); font-weight: 600;
}
.life-stage-recs a:hover, .life-stage-recs a:focus { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.share-label { font-weight: 700; margin: 12px 0 10px; font-family: var(--font-heading); }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  background: var(--color-primary);
  color: #fff;
  transition: transform 120ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.share-btn svg { width: 18px; height: 18px; }
.share-btn:hover, .share-btn:focus { transform: translateY(-2px); }
.share-twitter { background: #000; color: #fff; }
.share-facebook { background: #1877F2; color: #fff; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-pinterest { background: #E60023; color: #fff; }
.share-email { background: #6B7280; color: #fff; }
.share-native { background: var(--color-secondary); color: #fff; }
.share-copy {
  background: #fff;
  color: var(--color-text);
  border: 2px solid var(--color-border);
}
.share-copy:hover, .share-copy:focus {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ===== Ad slots ===== */
.ad-slot { display: none; }
.ad-slot.is-live {
  display: flex; align-items: center; justify-content: center;
  margin: 30px auto;
  max-width: var(--max-width);
  min-height: 250px;
  background: #fff; border: 1px dashed var(--color-border); border-radius: var(--radius);
  color: var(--color-muted); font-size: 0.85rem;
}
.ad-label { letter-spacing: 0.1em; text-transform: uppercase; }

/* ===== Chart ===== */
.chart-section { padding: 36px 0; }
.chart-section h2 { text-align: center; }
.chart-section .container > p { text-align: center; max-width: 720px; margin: 0 auto 22px; }
.chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--color-shadow); background: #fff; }
.age-chart { width: 100%; border-collapse: collapse; min-width: 620px; }
.age-chart th, .age-chart td { padding: 12px 14px; text-align: left; }
.age-chart thead th { background: var(--color-primary); color: #fff; font-family: var(--font-heading); font-weight: 700; vertical-align: top; line-height: 1.2; }
.age-chart .th-sub { display: block; font-size: 0.78rem; font-weight: 600; opacity: 0.85; margin-top: 2px; }
.age-chart tbody tr:nth-child(even) { background: #F4F8FC; }
.age-chart tbody tr:hover { background: #E5EFFC; }
.age-chart .stage-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 700; color: #fff; font-family: var(--font-heading);
}
.stage-Puppy { background: #F4A261; }
.stage-Junior { background: #E76F51; }
.stage-Adult { background: var(--color-primary); }
.stage-Mature { background: var(--color-secondary); }
.stage-Senior { background: #5B8E7D; }
.stage-Geriatric { background: #1F2A3D; }

.chart-note {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.92rem;
  margin: 14px auto 0;
  max-width: 720px;
}

/* ===== FAQ ===== */
.faq-section { padding: 36px 0; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0; box-shadow: var(--color-shadow);
}
.faq-item summary {
  cursor: pointer; padding: 16px 22px;
  font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem;
  list-style: none; position: relative; padding-right: 50px;
  border-radius: var(--radius);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-size: 1.6rem; color: var(--color-primary); font-weight: 700;
  transition: transform 200ms ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item > p, .faq-item > ul, .faq-item > ol { padding: 0 22px 18px; margin: 0; }
.faq-item > ul, .faq-item > ol { padding-left: 44px; padding-bottom: 18px; }

/* ===== Products ===== */
.products-section { padding: 36px 0; }
.products-section > .container > h2,
.products-section > .container > .section-subtitle,
.products-section > .container > .affiliate-disclosure { text-align: center; }
.section-subtitle { color: var(--color-muted); margin: 0 0 8px; }
.affiliate-disclosure { color: var(--color-muted); font-size: 0.95rem; margin-bottom: 22px; }
.products-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .products-grid { grid-template-columns: 1fr 1fr; } }

.product-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--color-shadow); border: 1px solid var(--color-border);
  display: flex; flex-direction: column;
}
.product-card h3 { color: var(--color-primary-dark); }
.product-card > p { flex: 0 0 auto; }
.product-links { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 14px; }

/* ===== Sister site ===== */
.sister-section { padding: 36px 0; text-align: center; background: linear-gradient(135deg, #E8F5EF, #F4F8FC); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); margin-top: 30px; }
.sister-section h2 { color: var(--color-secondary-dark); }
.sister-section .btn { width: auto; max-width: 360px; }

/* ===== Footer ===== */
.site-footer { padding: 36px 0 60px; text-align: center; color: var(--color-muted); }
.footer-disclosure { font-size: 0.9rem; max-width: 560px; margin: 0 auto 16px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 14px; }
.footer-nav a { color: var(--color-text); text-decoration: none; font-weight: 600; }
.footer-nav a:hover, .footer-nav a:focus { color: var(--color-primary); }
.footer-meta { font-size: 0.9rem; margin: 4px 0; }

/* ===== Generic content pages ===== */
.content-page { padding: 36px 0 60px; }
.content-page h1 { margin-bottom: 8px; }
.content-page h2 { margin-top: 1.6em; }
.content-page article {
  background: #fff; padding: 28px; border-radius: var(--radius-lg);
  box-shadow: var(--color-shadow); border: 1px solid var(--color-border);
}
.content-page .updated { color: var(--color-muted); font-size: 0.95rem; margin-bottom: 20px; }
.content-page .updated-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--color-border); font-size: 0.85rem; }

/* ===== 404 ===== */
.not-found { text-align: center; padding: 80px 20px; }
.not-found .big { font-size: clamp(5rem, 18vw, 9rem); font-family: var(--font-heading); font-weight: 800; color: var(--color-primary); line-height: 1; margin: 0; }
.not-found p { max-width: 460px; margin: 12px auto 24px; color: var(--color-muted); }

/* ===== Direction toggle (Dog → Human / Human → Dog) ===== */
.direction-toggle {
  display: flex;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 22px;
  max-width: 360px;
}
.direction-btn {
  flex: 1;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  background: transparent;
  border: 0;
  color: var(--color-muted);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.direction-btn:hover { color: var(--color-text); }
.direction-btn.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(42, 111, 219, 0.35);
}

/* ===== Explainer / Lifespan sections ===== */
.explainer-section, .lifespan-section, .specific-ages-section {
  padding: 40px 0;
}
.explainer-section h2, .lifespan-section h2, .specific-ages-section h2 {
  text-align: center;
  margin-bottom: 18px;
}
.explainer-section .container > p,
.lifespan-section .container > p,
.specific-ages-section .container > p {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.size-rate-list, .lifespan-list, .breed-list {
  max-width: 720px;
  margin: 0 auto 1em;
  padding-left: 24px;
}
.size-rate-list li, .lifespan-list li, .breed-list li { margin-bottom: 8px; }
.chart-section .breed-list { text-align: left; }
.explainer-section h3, .lifespan-section h3, .chart-section h3 {
  text-align: center;
  margin-top: 1.6em;
}

/* ===== Specific dog ages accordion ===== */
.age-faq-list {
  margin-top: 28px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.age-faq-item {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--color-shadow);
  overflow: hidden;
}
.age-faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 48px 14px 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  position: relative;
  transition: background 0.15s;
}
.age-faq-item summary::-webkit-details-marker { display: none; }
.age-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s;
}
.age-faq-item[open] summary::after { content: "−"; }
.age-faq-item summary:hover { background: #F4F8FC; }
.age-faq-item p {
  padding: 0 18px 16px;
  margin: 0;
  font-size: 0.97rem;
}

/* ===== Number input with +/- buttons ===== */
.number-input-group {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  width: fit-content;
}
.number-input-group input[type="number"] {
  width: 80px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
  border: 0;
  padding: 10px 0;
  background: #fff;
  color: var(--color-text);
  -moz-appearance: textfield;
  appearance: textfield;
}
.number-input-group input[type="number"]::-webkit-outer-spin-button,
.number-input-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.number-input-group input[type="number"]:focus { outline: none; }
.number-input-group:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(42, 111, 219, 0.18);
}
.number-btn {
  background: var(--color-bg);
  border: 0;
  width: 48px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-family: var(--font-heading);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.number-btn:hover { background: var(--color-primary); color: #fff; }
.number-btn:active { background: var(--color-primary-dark); color: #fff; }
.number-btn:disabled {
  background: var(--color-bg);
  color: var(--color-border);
  cursor: not-allowed;
}

/* ===== Print stylesheet ===== */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .nav-toggle, .primary-nav, .ad-slot, .cookie-banner, .share, .product-links,
  .sister-section, .footer-nav, .skip-link, .calculator-card, .faq-section, .products-section, .hero {
    display: none !important;
  }
  #chart { padding: 0; }
  .age-chart { box-shadow: none; }
  .age-chart thead th { background: #ccc !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .container { max-width: none; padding: 0; }
}
