/* ItsAgeCalculator extras: saved birthdays, milestone card, print certificate */

/* ---- saved-birthday switcher ---- */
.iac-prof { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .92rem; }
.iac-prof-lbl { font-weight: 700; color: var(--muted, #475569); margin-inline-end: 2px; }
.iac-chip { display: inline-flex; align-items: center; border: 1px solid var(--line, #dbe3ee); border-radius: 999px; background: var(--card, #fff); overflow: hidden; }
.iac-chip.is-on { border-color: var(--brand, #2563eb); background: color-mix(in srgb, var(--brand, #2563eb) 12%, transparent); }
.iac-chip button { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 6px 4px 6px 12px; line-height: 1.2; }
.iac-chip .iac-chip-x { padding: 6px 10px 6px 4px; color: var(--faint, #94a3b8); font-size: 1.05em; }
.iac-chip .iac-chip-x:hover, .iac-chip .iac-chip-x:focus-visible { color: #dc2626; }
.iac-chip.is-on .iac-chip-go { font-weight: 700; color: var(--brand, #2563eb); }
.iac-prof-add { border: 1px dashed var(--line, #cbd5e1); background: none; border-radius: 999px; padding: 6px 12px; font: inherit; color: var(--brand, #2563eb); cursor: pointer; }
.iac-prof-form { display: inline-flex; gap: 6px; }
.iac-prof-form[hidden], .iac-prof-add[hidden] { display: none; }
.iac-prof-form input { font: inherit; padding: 6px 10px; border: 1px solid var(--line, #cbd5e1); border-radius: 999px; min-width: 0; width: 11em; background: var(--card, #fff); color: inherit; }
.iac-prof-save { font: inherit; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--brand, #2563eb); color: #fff; cursor: pointer; }
.iac-prof-note { color: var(--faint, #94a3b8); font-size: .82rem; flex-basis: 100%; }
.iac-prof-msg { color: #b45309; font-size: .85rem; flex-basis: 100%; }

/* ---- milestone card ---- */
.iac-card-cta { margin: 14px 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.iac-card-btn { font: inherit; font-weight: 700; border: 0; border-radius: 14px; padding: 12px 20px; color: #fff; cursor: pointer; background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #7c3aed); box-shadow: 0 8px 20px rgba(37, 99, 235, .25); }
.iac-card-btn:hover { filter: brightness(1.06); }
.iac-card-msg { color: #b45309; font-size: .9rem; }
.iac-card-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(15, 23, 42, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.iac-card-modal[hidden] { display: none; }
.iac-card-box { background: var(--card, #fff); color: var(--text, #0f172a); border-radius: 20px; padding: 16px; width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 12px; }
.iac-card-box img { display: block; width: auto; max-width: 100%; max-height: calc(100vh - 210px); margin: 0 auto; border-radius: 12px; object-fit: contain; }
.iac-card-fmt, .iac-card-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.iac-card-fmt button, .iac-card-actions button { font: inherit; border: 1px solid var(--line, #cbd5e1); background: none; color: inherit; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.iac-card-fmt button[aria-pressed="true"] { background: var(--brand, #2563eb); border-color: var(--brand, #2563eb); color: #fff; }
.iac-card-actions .iac-btn-primary { background: var(--brand, #2563eb); border-color: var(--brand, #2563eb); color: #fff; font-weight: 700; }
body.iac-modal-open { overflow: hidden; }

/* ---- print: a clean one-page certificate of the results ---- */
.iac-print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  html, body { background: #fff !important; color: #000 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; }
  #wpadminbar, .site-head, .site-foot, header, footer, nav, aside, .nav, .crumbs, .foot-langs, .lang-switch,
  ins.adsbygoogle, .adsbygoogle, .google-auto-placed, [id^="aswift"], [id^="google_ads"], iframe,
  .iac-prof, .iac-card-cta, .iac-card-modal, .comments, #comments, .skip-link, .no-print { display: none !important; }

  /* On calculator pages print only the calculator and its results. */
  /* (the script marks the calculator's ancestors with .iac-print-path) */
  .iac-print-path > :not(.iac-print-path):not(.iac-tool):not(.iac-print-only),
  body.iac-has-tool .iac-tool button, body.iac-has-tool .iac-tool .hint { display: none !important; }
  .iac-print-path { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  body.iac-has-tool .iac-print-only { display: block !important; text-align: center; border-bottom: 2px solid #1e3a8a; padding-bottom: 10px; margin-bottom: 16px; }
  .iac-print-brand { font-size: 10pt; letter-spacing: .12em; text-transform: uppercase; color: #1e3a8a; font-weight: 700; }
  .iac-print-only h2 { font-size: 20pt; margin: 6px 0 4px; color: #0f172a; }
  .iac-print-name { font-size: 14pt; font-weight: 700; margin: 2px 0; }
  .iac-print-date { font-size: 9pt; color: #475569; margin: 2px 0 0; }
  body.iac-has-tool .iac-tool { border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px; }
  body.iac-has-tool .iac-tool input, body.iac-has-tool .iac-tool select { border: 0 !important; background: none !important; font-weight: 700; }
  /* compact: fits the full set of results on as few pages as possible */
  body.iac-has-tool .iac-tool { font-size: 8.5pt; line-height: 1.3; padding: 8px; }
  body.iac-has-tool .iac-tool * { margin-top: 0 !important; }
  body.iac-has-tool .iac-tool h2, body.iac-has-tool .iac-tool h3 { font-size: 10pt !important; margin-bottom: 4px !important; }
  body.iac-has-tool .iac-tool [class*="card"], body.iac-has-tool .iac-tool .box, body.iac-has-tool .iac-tool .panel { padding: 8px 10px !important; }
  body.iac-has-tool .iac-tool .result .big, body.iac-has-tool .iac-tool .big { font-size: 16pt !important; }
  body.iac-has-tool .iac-tool .stat { padding: 2px 0 !important; break-inside: avoid; }
  body.iac-has-tool .iac-tool .mega { display: block !important; columns: 2; column-gap: 10px; }
  body.iac-has-tool .iac-tool .mega > * { margin-bottom: 8px !important; }
  body.iac-has-tool .iac-tool .fields { display: flex !important; flex-wrap: wrap; gap: 6px 18px; }
  body.iac-has-tool .iac-tool .mega * { break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
}

/* ---- v1.9: calculator above the fold on phones ---- */
@media (max-width: 600px) {
  body:has(.iac-tool) .crumbs { margin-top: 12px; font-size: .82rem; }
  body:has(.iac-tool) h1 { font-size: 1.75rem; margin: .15em 0 .25em; }
  body:has(.iac-tool) .home-hero { padding: 14px 0 0; }
  body:has(.iac-tool) .home-hero h1 { font-size: 1.85rem; }
  body:has(.iac-tool) .home-hero .pill { display: none; }
  /* the full introduction is still on the page; on phones it is shortened to two lines */
  body:has(.iac-tool) .lead { font-size: 1rem; margin: 0 0 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
  .iac-prof { margin-bottom: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .iac-prof .iac-prof-note { display: none; }
  .iac-prof .iac-prof-lbl { display: none; }
}
.iac-prof-inline { margin: 8px 0 0; }

/* ---- embed box ---- */
.iac-embed { margin: 18px 0; border: 1px solid var(--line, #dbe3ee); border-radius: 14px; padding: 0 14px; background: var(--card, #fff); }
.iac-embed summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.iac-embed textarea { width: 100%; min-height: 96px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; padding: 10px; background: var(--bg, #f8fafc); color: inherit; resize: vertical; }
.iac-embed-copy { font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 8px 16px; background: var(--brand, #2563eb); color: #fff; cursor: pointer; margin: 8px 0 14px; }
.iac-embed p { font-size: .92rem; color: var(--muted, #475569); }
.iac-prof[hidden] { display: none !important; }

/* ---- v1.10: calendar milestones, certificate ---- */
.iac-cal-btn { font: inherit; font-weight: 700; border: 1px solid var(--line, #cbd5e1); background: var(--card, #fff); color: var(--brand, #1565e0); border-radius: 14px; padding: 11px 18px; cursor: pointer; }
.iac-card-name { font: inherit; border: 1px solid var(--line, #cbd5e1); border-radius: 999px; padding: 8px 14px; text-align: center; background: var(--card, #fff); color: inherit; }
.iac-cal-box h3 { margin: 4px 0 0; text-align: center; }
.iac-cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: calc(100vh - 220px); overflow: auto; }
.iac-cal-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line, #e3e9f2); border-radius: 12px; }
.iac-cal-when { font-weight: 700; }
.iac-cal-what { grid-column: 1; color: var(--muted, #475569); font-size: .92rem; }
.iac-cal-list a { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: .88rem; font-weight: 600; }

/* ---- v1.11: quick answer + how it's calculated ---- */
.aeo-quick-answer { margin: 18px 0; border: 2px solid var(--accent, #1565e0); border-radius: 16px; padding: 16px 18px; background: var(--card, #fff); }
.aeo-quick-answer h2 { font-size: 1.15rem; margin: 0 0 6px; }
.aeo-quick-answer > p { margin: 0 0 12px; font-size: 1.02rem; }
.geo-authority-panel { margin: 0; display: grid; gap: 8px; border-top: 1px solid var(--line, #e3e9f2); padding-top: 10px; font-size: .9rem; }
.geo-authority-panel div { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px; }
.geo-authority-panel dt { font-weight: 700; color: var(--muted, #475569); }
.geo-authority-panel dd { margin: 0; }
.geo-authority-panel code { font: .86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: normal; background: none; padding: 0; }
@media (max-width: 600px) { .geo-authority-panel div { grid-template-columns: 1fr; gap: 0; } }
