/* Baby Delivery Updates: shared styles for the family page and the admin page.
   The look: sage gingham, olive lettering, a flowering vine and a pink bow. */

:root {
  --accent: #5F7436;        /* olive green, replaced from the admin page */
  --on-accent: #FFFFFF;     /* text on the olive */
  --ink: #2B2B26;
  --muted: #6B6F5E;
  --paper: #FFFFFF;
  --line: #DDE2CF;
  --tint: #F0F2EA;          /* a wash of the olive */
  --tint-strong: #D2D8C7;
  --butter: #FBF4DC;        /* warm cream */
  --blush: #FDF0EE;         /* pale pink */
  --rose: #E38CAE;          /* bow pink */
  --focus: #BF4F7C;         /* keyboard focus ring */
  --danger: #B3261E;
  --radius: 16px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Great Vibes", "Snell Roundhand", "Segoe Script", cursive;
  --sans: "Quicksand", ui-rounded, "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@supports (color: color-mix(in srgb, red 50%, white)) {
  :root {
    --tint: color-mix(in srgb, var(--accent) 9%, white);
    --tint-strong: color-mix(in srgb, var(--accent) 27%, white);
  }
}

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

[hidden] { display: none !important; }

html { font-size: 17px; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* Gingham: butter stripes running down, sage stripes running across. */
  background-color: #FFFDF6;
  background-image:
    linear-gradient(90deg, rgba(243, 226, 170, 0.6) 50%, transparent 50%),
    linear-gradient(rgba(196, 206, 172, 0.62) 50%, transparent 50%);
  background-size: 64px 64px;
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); }

strong { font-weight: 700; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The white card everything sits on, like the panel of an invitation. */
.wrap {
  position: relative; max-width: 1080px; margin: 52px auto 44px; padding: 0 30px 40px;
  background: var(--paper); border-radius: 30px;
  box-shadow: 0 0 0 1px rgba(95, 116, 54, 0.1), 0 22px 44px -28px rgba(70, 84, 36, 0.45);
}

/* The flowering vine across the top of each card, tied with the bow.
   The vine repeats from the middle outward and fades out at both ends. */
.garland { position: relative; height: 90px; margin: 0 -10px; }
.garland::before {
  content: ""; position: absolute; left: 0; right: 0; top: 32px; height: 50px;
  background: url("art/vine.svg") center / auto 100% repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
}
.garland::after {
  content: ""; position: absolute; left: 50%; top: -36px; width: 200px; height: 100px;
  transform: translateX(-50%);
  background: url("art/bow.svg") center / contain no-repeat;
}

/* A row of safari friends, as on the invitation. */
.parade {
  height: clamp(50px, 15vw, 76px); max-width: 460px; margin: 30px auto 0;
  background: url("art/animals.svg") center / contain no-repeat;
}

/* ---- Header ---------------------------------------------------------- */

.masthead { text-align: center; padding: 0 0 4px; }

/* "BABY DELIVERY" in spaced capitals over "Updates" in script. */
.title { line-height: 1; font-weight: 400; }
.title-caps {
  display: block; font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.2rem, 4.4vw, 1.75rem); letter-spacing: 0.16em; text-transform: uppercase;
}
.title-script {
  display: block; font-family: var(--script); color: var(--accent);
  font-size: clamp(3.3rem, 13vw, 4.9rem); line-height: 1.12;
}

.meta {
  margin-top: 4px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px;
  font-size: 0.84rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
}
.updated { margin-top: 6px; color: var(--muted); font-size: 0.88rem; }

/* ---- Status bar: a row of chevrons ------------------------------------ */

.chevrons { --notch: 16px; list-style: none; margin: 22px 0 0; padding: 0; display: flex; }
.chev {
  flex: 1 1 0; min-width: 0; min-height: 62px;
  display: flex; align-items: center; justify-content: center; gap: 9px; text-align: center;
  padding: 8px calc(var(--notch) + 4px) 8px calc(var(--notch) + 10px);
  margin-left: calc(4px - var(--notch));          /* tucks into the chevron before it */
  background: var(--tint); color: var(--muted);
  font-size: 0.94rem; font-weight: 700; line-height: 1.15;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%, var(--notch) 50%);
}
.chev:first-child {
  margin-left: 0; padding-left: 14px; border-radius: 14px 0 0 14px;
  clip-path: polygon(0 0, calc(100% - var(--notch)) 0, 100% 50%, calc(100% - var(--notch)) 100%, 0 100%);
}
.chev:last-child {
  padding-right: 12px; border-radius: 0 14px 14px 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, var(--notch) 50%);
}
.chev-short { display: none; }

.chev.is-done { background: var(--tint-strong); color: var(--ink); }
.chev.is-done::before {                            /* check mark */
  content: ""; flex: none; width: 6px; height: 12px; margin-top: -3px;
  border: solid var(--accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.chev.is-current { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* The picked sub-status, lined up under its stage. Nothing shows until one is picked. */
.chev-sub { margin-top: 8px; display: flex; }
.chev-pill {
  position: relative; left: var(--at, 50%); transform: translateX(-50%);
  padding: 3px 16px; border: 2px solid var(--accent); border-radius: 999px;
  background: var(--paper); color: var(--accent);
  font-size: 0.92rem; font-weight: 700; white-space: nowrap;
}
.chev-sub.is-first .chev-pill { left: 0; transform: none; }
.chev-sub.is-last { justify-content: flex-end; }
.chev-sub.is-last .chev-pill { left: 0; transform: none; }
.chev-pill.is-kidding { border-color: var(--rose); background: var(--rose); color: var(--ink); }

/* ---- Current status --------------------------------------------------- */

.now {
  margin: 22px 0; padding: 18px 20px 20px; text-align: center;
  border: 2px dashed var(--accent); border-radius: var(--radius);
}
.now-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
}
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.now-status {
  margin-top: 4px; font-family: var(--serif); font-weight: 600; color: var(--accent);
  font-size: clamp(1.75rem, 6.6vw, 2.9rem); line-height: 1.1; letter-spacing: 0.04em; text-transform: uppercase;
}
.now-note { margin: 8px auto 0; font-size: 1.05rem; max-width: 62ch; }

/* ---- Main columns ---------------------------------------------------- */

.columns {
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas: "stats photo" "timeline photo";
}
.area-stats { grid-area: stats; }
.area-photo { grid-area: photo; }
.area-timeline { grid-area: timeline; }

.panel { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }

/* Section headings: olive capitals, like the lettering on the invitation. */
.panel h2, .faq h2, .alerts h2, .wall h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.32rem; line-height: 1.2;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.panel h3 {
  margin: 20px 0 4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

.stats { margin: 0; }
.stat {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 14px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.stat:first-child { padding-top: 0; }
.stat:last-child { border-bottom: 0; padding-bottom: 0; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; font-weight: 700; font-size: 1.15rem; text-align: right; }
.stat dd.is-empty { font-weight: 500; font-size: 1rem; color: var(--muted); }

.tickbox {
  -webkit-appearance: none; appearance: none; display: block; position: relative;
  width: 24px; height: 24px; margin: 0; border: 2px solid var(--muted); border-radius: 7px; background: var(--paper);
}
.tickbox:checked { background: var(--accent); border-color: var(--accent); }
.tickbox:checked::after {
  content: ""; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px;
  border: solid var(--on-accent); border-width: 0 3px 3px 0; transform: rotate(45deg);
}

/* Dilation shown on a 0 to 10 ruler. */
.ruler-wrap { grid-column: 1 / -1; margin-top: 6px; }
.ruler { position: relative; height: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); overflow: hidden; }
.ruler-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.4s ease; }
.ruler::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), rgba(43, 43, 38, 0.26) calc(10% - 1px) 10%);
}
.ruler-scale { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* Scrolls once it gets long. The fade at the bottom hints that there is more. */
.timeline {
  list-style: none; margin: 0; padding: 0 6px 26px 0; max-height: 340px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}
.tl-item { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--tint-strong); margin-left: 5px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item::before {
  content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--tint-strong);
}
.tl-item.is-status::before { background: var(--accent); border-color: var(--accent); }
.tl-time { display: block; font-size: 0.82rem; color: var(--muted); }
.tl-label { font-weight: 700; }
.tl-note { color: var(--muted); }
.timeline-empty { color: var(--muted); }

/* ---- Photos ---------------------------------------------------------- */

.photo-frame {
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3;
  background: var(--tint); border-radius: 12px; overflow: hidden;
}
/* Pinned to the frame so the whole photo always shows, tall or wide. */
.photo-frame img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
.photo-empty { color: var(--muted); padding: 20px; text-align: center; }
.photo-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.photo-nav:disabled { opacity: 0.35; cursor: default; }
.photo-prev { left: 10px; }
.photo-next { right: 10px; }
.photo-caption { color: var(--muted); margin-top: 10px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 3px; }
.thumb { flex: none; width: 58px; height: 58px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--tint); overflow: hidden; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-on { border-color: var(--accent); }
.photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 12px; }
.photo-tools .msg { margin-top: 0; }
.photo-status { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 1.05rem; }

/* ---- FAQs, email alerts and messages (centered column) ----------------- */

.faq, .alerts, .wall { max-width: 720px; margin: 34px auto 0; }

/* The big announcement, in the script from the invitation. */
.faq-headline {
  font-family: var(--script); font-weight: 400; color: var(--accent); text-align: center;
  font-size: clamp(3.4rem, 15vw, 5.6rem); line-height: 1.15; margin: 6px 0;
}
.faq-list { margin: 0; }
.faq-list dt { position: relative; margin-top: 18px; padding-left: 28px; font-weight: 700; }
.faq-list dt:first-child { margin-top: 0; }
.faq-list dt::before {                               /* a small flower marks each question */
  content: ""; position: absolute; left: 0; top: 0.18em; width: 18px; height: 18px;
  background: url("art/flower.svg") center / contain no-repeat;
}
.faq-list dd { margin: 3px 0 0 28px; }

.alerts { background: var(--butter); border-radius: var(--radius); padding: 20px; }
.alerts h2 { margin-bottom: 4px; }
.alert-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.alert-form input { flex: 1 1 220px; }

.wall h2 { margin-bottom: 4px; }
.wall-form { margin-top: 12px; padding: 2px 18px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.wall-form button { margin-top: 14px; }
.wall-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.wall-empty { color: var(--muted); }
.note { padding: 12px 16px; border-radius: var(--radius); background: var(--butter); }
.note:nth-child(3n + 2) { background: var(--blush); }
.note:nth-child(3n + 3) { background: var(--tint); }
.note-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; }
.note-name { font-weight: 700; overflow-wrap: anywhere; }
.note-time { font-size: 0.82rem; color: var(--muted); }
.note-body { margin-top: 3px; white-space: pre-line; overflow-wrap: anywhere; }
button.note-remove { padding: 6px 0 0; font-size: 0.86rem; }

.foot { text-align: center; margin-top: 18px; font-size: 0.9rem; }
.foot a { color: var(--muted); }

/* ---- Forms and buttons ----------------------------------------------- */

label { display: block; font-weight: 700; font-size: 0.93rem; margin: 14px 0 4px; }
.stat label { margin: 0; font: inherit; }

input, textarea, select { font: inherit; color: var(--ink); }
input:not([type="checkbox"]), textarea, select {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper);
}
input[type="color"] { padding: 4px; height: 46px; }
input[type="file"] { padding: 8px; }
textarea { resize: vertical; }

button {
  font: inherit; font-weight: 700; padding: 11px 22px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent);
}
button:disabled { opacity: 0.55; cursor: default; }
button.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
button.small { padding: 5px 14px; font-size: 0.88rem; white-space: nowrap; }
button.link-btn { background: none; border-color: transparent; border-radius: 8px; color: var(--accent); text-decoration: underline; padding: 11px 6px; }

.msg { min-height: 1.5em; margin-top: 8px; font-size: 0.93rem; color: var(--muted); }
.msg.is-error { color: var(--danger); }
.hint, .wall-lead { color: var(--muted); font-size: 0.93rem; margin-bottom: 6px; }

/* ---- Passcode and login screens --------------------------------------- */

.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 60px 16px 32px; }
.gate-box {
  width: min(440px, 100%); padding: 0 28px 24px; background: var(--paper); border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(95, 116, 54, 0.1), 0 22px 44px -28px rgba(70, 84, 36, 0.45);
}
.gate-box .title { text-align: center; }
.gate-lead { text-align: center; margin-top: 2px; }
.gate-box button { width: 100%; margin-top: 16px; }
.gate-box .parade { margin-top: 10px; }
.gate-back { margin-top: 14px; font-size: 0.93rem; text-align: center; }

/* ---- Admin page ------------------------------------------------------ */

.admin { max-width: 760px; }
.admin .masthead { padding-bottom: 20px; }
.admin .panel { margin-bottom: 18px; }
.admin .panel > button, .admin .panel > .button-row { margin-top: 16px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-links { display: flex; align-items: center; justify-content: center; gap: 6px 14px; flex-wrap: wrap; font-size: 0.93rem; margin-top: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 600; margin: 14px 0 0; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }

.picker { display: grid; gap: 6px; margin: 4px 0 8px; }
.pick {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left;
  background: var(--paper); color: var(--ink); border-color: var(--line); border-radius: 12px; padding: 10px 14px;
}
.pick-sub { margin-left: 28px; font-weight: 600; }
.pick.is-live::after { content: "live now"; font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.pick.is-picked { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pick.is-picked::after { color: inherit; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.plain-list .wall-text { white-space: pre-line; }
.admin-photos { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.admin-photo { display: flex; align-items: center; gap: 12px; }
.admin-photo img { flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--tint); }
.admin-photo-text { flex: 1; color: var(--muted); font-size: 0.93rem; overflow-wrap: anywhere; }

/* ---- Phones ---------------------------------------------------------- */

@media (max-width: 760px) {
  body { background-size: 48px 48px; }
  .wrap { margin: 46px 10px 24px; padding: 0 14px 30px; border-radius: 24px; }
  .garland { height: 76px; margin: 0 -4px; }
  .garland::before { top: 28px; height: 40px; }
  .garland::after { top: -34px; width: 176px; height: 88px; }

  .chevrons { --notch: 10px; margin-top: 16px; }
  /* The lettering shrinks with the screen so "Admitted" still fits on the smallest phones. */
  .chev { min-height: 54px; font-size: clamp(10px, 3.3vw, 0.76rem); padding: 6px var(--notch) 6px calc(var(--notch) + 4px); margin-left: calc(3px - var(--notch)); }
  .chev:first-child { padding-left: 6px; }
  .chev:last-child { padding-right: 5px; }
  .chev-full { display: none; }
  .chev-short { display: inline; }
  .chev.is-done::before { display: none; }           /* no room for the check mark: the shade says it */

  .now { margin: 16px 0; padding: 16px 14px 18px; }
  .columns { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stats" "photo" "timeline"; gap: 14px; }
  .panel { padding: 16px; }
  .photo-frame { aspect-ratio: 1 / 1; }              /* squarer, so tall phone photos get more room */
  .alerts { padding: 16px; }
  .gate { padding-top: 56px; }
  .gate-box { padding: 0 20px 22px; }
  .pick-sub { margin-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
  .ruler-fill { transition: none; }
}
