/* =========================================================
   BellyDay — corrected age calculator
   Page-scoped additions only. Shared components live in assets/site.css.
   Loads after /assets/site.css.
   ========================================================= */

body.ca {
  --ink-55: rgba(44, 27, 42, 0.66);
  background:
    radial-gradient(circle at 8% -10%, rgba(224, 138, 95, 0.09), transparent 40%),
    radial-gradient(circle at 100% 1%, rgba(77, 107, 85, 0.08), transparent 34%),
    var(--bone);
}

/* ---------- Breadcrumbs and hero ---------- */

.ca .crumbs { padding-top: 14px; font-size: 11.5px; color: var(--ink-55); }
.ca .crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; list-style: none; }
.ca .crumbs li + li::before { content: "›"; margin-right: 8px; color: var(--ink-55); }
.ca .crumbs a { color: inherit; }
.ca .crumbs a:hover { color: var(--ink); }
.ca .crumbs [aria-current="page"] { color: var(--ink-70); }

.ca-hero { padding-top: clamp(10px, 1.8vw, 22px); padding-bottom: clamp(8px, 1.2vw, 14px); }
.ca .hero h1 { max-width: 20ch; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; }
.ca .hero__lede { max-width: 74ch; margin-top: 7px; font-size: clamp(12.5px, 1.2vw, 14.5px); line-height: 1.42; }
.ca .hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-55);
}
.ca .hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.ca .hero__meta span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--sage); }
.ca .hero__meta span:first-child::before { display: none; }

/* ---------- Tool: one full-width card, two zones ---------- */

.ca-tool { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; }
.ca-panel {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--rose-tint);
  overflow: hidden;
}
.ca-card { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.ca-card__col { min-width: 0; padding: clamp(13px, 2.1vw, 26px); }
.ca-card__col--input { border-right: 1px solid var(--line); background: var(--paper); }
.ca-card__col--output { background: var(--bone); }

.ca-kicker,
.ca-output__label {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.ca-output__label { color: var(--ink-55); }

.ca-head__title {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}
.ca-head__sub { margin-top: 4px; max-width: 60ch; font-size: 12.5px; line-height: 1.45; color: var(--ink-70); }

.ca-fields { min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.ca-fields legend {
  float: left;
  width: 100%;
  margin-bottom: 5px;
  padding: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-70);
}
.ca-fields legend + * { clear: both; }
.ca-field { min-width: 0; margin-top: 7px; }
.ca-field > label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 600; color: var(--ink-70); }
.ca-fields .field__control {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--paper);
  font-size: 12px;
}
.ca-fields .field__control:focus-visible { border-color: var(--rose); }
.ca-fields .field__control[aria-invalid="true"] { border-color: var(--rose-deep); }
.ca-fields input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.ca-fields input[type="number"]::-webkit-inner-spin-button,
.ca-fields input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ca-ga-row { display: flex; align-items: center; gap: 6px; }
.ca-ga-row input { width: 68px; flex: 0 0 68px; text-align: center; }
.ca-ga-unit { font-size: 11.5px; color: var(--ink-70); }
.ca-group-hint { margin-top: 8px; font-size: 10.5px; line-height: 1.4; color: var(--ink-55); }
.field__hint { margin-top: 4px; font-size: 10.5px; line-height: 1.35; color: var(--ink-55); }
.field__error { margin-top: 4px; font-size: 10.5px; font-weight: 600; line-height: 1.35; color: var(--rose-deep); }
.ca-actions { display: flex; margin-top: 10px; }
.ca-actions .btn { min-height: 36px; padding: 0 13px; font-size: 11.5px; }
.ca-noscript { margin-top: 8px; font-size: 10.5px; line-height: 1.4; color: var(--ink-55); }

/* ---------- Result ---------- */

.ca-empty {
  margin-top: 9px;
  padding: 9px 11px;
  border-left: 3px solid var(--apricot);
  background: var(--apricot-soft);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-70);
}
.ca-result { margin-top: 8px; }
.ca-value {
  font-family: var(--font-display);
  font-size: clamp(21px, 2.6vw, 33px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.14;
  text-wrap: balance;
  color: var(--ink);
}
.ca-line { margin-top: 5px; font-size: 12.5px; line-height: 1.45; color: var(--ink-70); }
.ca-privacy { margin-top: 9px; font-size: 10.5px; color: var(--ink-55); }

/* ---------- Safety cards: directly under the result ---------- */

.ca-safety { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.ca-safety__card {
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--ink-70);
  background: var(--paper);
}
.ca-safety__card h3 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.ca-safety__card p { margin-top: 5px; font-size: 11.5px; line-height: 1.5; color: var(--ink-70); }
.ca-safety__card--urgent { border-left-color: var(--rose-deep); }

/* ---------- Secondary block and static notes ---------- */

.ca-secondary { margin-top: 10px; padding: 11px 14px; border: 1px solid var(--line); background: rgba(255, 253, 248, 0.72); }
.ca-secondary__row { font-size: 12px; line-height: 1.5; color: var(--ink-70); }
.ca-secondary__row + .ca-secondary__row { margin-top: 5px; }
.ca-secondary__note { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.5; color: var(--ink-70); }
.ca-trust { margin-top: 10px; font-size: 10.5px; line-height: 1.45; color: var(--ink-55); }

/* ---------- Pillar ---------- */

.ca .section__head { max-width: none; }
.ca .section h2 { font-size: clamp(23px, 2.5vw, 32px); line-height: 1.22; }
.ca .section__lede { max-width: 74ch; margin-top: 7px; font-size: 13.5px; line-height: 1.5; color: var(--ink-70); }
.ca .prose > p { margin-top: 10px; font-size: 13.5px; line-height: 1.68; color: var(--ink-70); }
.ca .prose a { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.ca-table-scroll { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); }
.ca-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ca-table caption { padding: 8px 11px; text-align: left; font-size: 11.5px; font-weight: 600; background: var(--bone-deep); }
.ca-table th, .ca-table td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ca-table thead th { font-size: 11px; color: var(--ink-70); background: rgba(255, 253, 248, 0.65); }
.ca-table tbody tr:last-child td { border-bottom: 0; }
.ca .sources { padding-left: 1.3em; }
.ca .sources li { margin-top: 7px; font-size: 12.5px; line-height: 1.55; }

/* ---------- Print-only summary ---------- */

.ca-print { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .ca-safety { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .ca .crumbs { padding-top: 9px; font-size: 10.5px; }
  .ca-hero { padding-top: 5px; padding-bottom: 5px; }
  .ca .hero h1 { font-size: 30px; }
  .ca .hero__lede { margin-top: 5px; font-size: 11.5px; line-height: 1.32; }
  .ca .hero__meta { display: none; }

  .ca-panel { box-shadow: 3px 3px 0 var(--rose-tint); }
  .ca-card { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .ca-card__col { padding: 9px 10px; }
  .ca-kicker, .ca-output__label, .ca-head__sub, .ca-noscript { display: none; }
  .ca-head__title { font-size: 16px; line-height: 1.18; }
  .ca-fields { margin-top: 7px; }
  .ca-fields legend { font-size: 10px; margin-bottom: 3px; }
  .ca-field { margin-top: 5px; }
  .ca-field > label { font-size: 9.5px; margin-bottom: 2px; }
  .ca-fields .field__control { height: 34px; font-size: 10.5px; }
  .ca-ga-row { gap: 4px; }
  .ca-ga-row input { width: 54px; flex-basis: 54px; }
  .ca-ga-unit { font-size: 9.5px; }
  .ca-group-hint, .field__hint { display: none; }
  .field__error { font-size: 9px; }
  .ca-actions { margin-top: 6px; }
  .ca-actions .btn { min-height: 30px; padding: 0 9px; font-size: 10px; }
  .ca-empty { margin-top: 5px; padding: 6px 7px; font-size: 10px; }
  .ca-result { margin-top: 5px; }
  .ca-value { font-size: 19px; line-height: 1.1; }
  .ca-line { margin-top: 3px; font-size: 10px; line-height: 1.32; }
  .ca-privacy { margin-top: 6px; font-size: 9px; }
  .ca-safety { margin-top: 8px; gap: 6px; }
  .ca-safety__card { padding: 8px 10px; border-left-width: 3px; }
  .ca-safety__card h3 { font-size: 11px; }
  .ca-safety__card p { margin-top: 3px; font-size: 9.5px; line-height: 1.4; }
  .ca-secondary { margin-top: 7px; padding: 8px 10px; }
  .ca-secondary__row { font-size: 10px; }
  .ca-secondary__note { font-size: 10px; }
  .ca .section h2 { font-size: 22px; }
}

/* At very narrow widths, stack so each control stays usable. The 390×844
   above-fold target is served by the two-column layout above. */
@media (max-width: 360px) {
  .ca-card { grid-template-columns: minmax(0, 1fr); }
  .ca-card__col--input { border-right: 0; border-bottom: 1px solid var(--line); }
  .ca-head__title { font-size: 17px; }
  .ca .hero__lede { font-size: 11px; }
}

/* ---------- Print: result, safety cards and dates only ---------- */

@media print {
  body.ca { background: #fff; }
  .masthead, .crumbs, .skip, .ca-hero, .ca-panel, .ca-trust, .section,
  .footer, .dock, .ca-actions, .ca-secondary__note { display: none !important; }
  .ca-tool { display: block; padding: 0; }
  .ca-print {
    display: block;
    color: #000;
    font-size: 11pt;
    line-height: 1.45;
  }
  .ca-print h2 { font-family: Georgia, serif; font-size: 16pt; margin-bottom: 8pt; }
  .ca-print dl { margin: 0; }
  .ca-print div { display: flex; gap: 12pt; margin: 0 0 4pt; }
  .ca-print dt { min-width: 110pt; font-weight: 700; }
  .ca-print dd { margin: 0; }
  .ca-safety { display: block; margin-top: 12pt; }
  .ca-safety__card { break-inside: avoid; margin-bottom: 8pt; border-left: 3px solid #000; }
  .ca-secondary { break-inside: avoid; }
}
