/* Celebrating Jane: rosemary, for remembrance */

:root {
  --paper: #F1F3EE;
  --band: #E3E9E0;
  --field: #FFFFFF;
  --ink: #22302A;
  --ink-soft: #4C5B52;
  --leaf: #5F7A66;
  --leaf-deep: #3E5A48;
  --bloom: #8E7FB8;
  --rule: #C9D2C6;
  --error: #9A3B32;

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  /* type scale, roughly a perfect fourth around a 19px body */
  --step--1: 0.875rem;
  --step-0: 1.1875rem;
  --step-1: 1.5rem;
  --step-2: 2rem;
  --step-name: clamp(3rem, 2rem + 6vw, 6.25rem);

  --gap: 2.75rem;
  --cols: 1fr 10rem minmax(0, 35rem) 1fr;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.7;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
}

a { color: var(--leaf-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--bloom); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
.quiet { color: var(--ink-soft); }

.skip { position: absolute; left: -9999px; top: 0; padding: .5rem 1rem; background: var(--ink); color: var(--paper); }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* ---------- the grid: a narrow margin column for dates and labels, a reading column for text ---------- */
.row { display: grid; grid-template-columns: var(--cols); column-gap: var(--gap); }
.gutter { grid-column: 2; }
.col { grid-column: 3; }

/* ---------- site navigation ---------- */
.site-nav { padding: 1.5rem 0 0; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: 1.0625rem; padding: 0.35rem 0; display: inline-block; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--leaf); }

/* ---------- hero ---------- */
.hero { padding: clamp(2rem, 7vh, 5rem) 0 clamp(2.5rem, 6vh, 4rem); align-items: end; }
.sprig-wrap { align-self: stretch; display: flex; justify-content: flex-end; align-items: flex-end; }
.sprig { width: 100%; max-width: 9.5rem; height: auto; overflow: visible; margin-bottom: .4rem; }

.preface { font-style: italic; font-weight: 300; font-size: var(--step-1); color: var(--ink-soft); margin: 0 0 .35rem; }
.name {
  font-size: var(--step-name);
  font-weight: 200;
  letter-spacing: -0.015em;
  line-height: 0.98;
  margin-left: -0.04em; /* optical alignment of the capital */
}
.years { font-size: var(--step-1); font-weight: 300; color: var(--leaf-deep); margin: 0.9rem 0 0; font-variant-numeric: lining-nums; letter-spacing: 0.02em; }
.intro { margin-top: 1.75rem; max-width: 35rem; }
/* The hero text may run into the right margin so Jane's full name stays on one line. */
.hero .col { grid-column: 3 / 5; }
.intro p:last-child { margin-bottom: 0; }

.photo { margin: 0 0 3.5rem; }
.photo img { display: block; width: 100%; max-width: 22rem; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 25%; border-radius: 11rem 11rem 0.25rem 0.25rem; }

/* ---------- sections ---------- */
section { padding: 0 0 3.5rem; }
section h2 { font-size: var(--step-2); font-weight: 300; color: var(--leaf-deep); margin-bottom: 1.25rem; }

.event { padding-top: 0.5rem; }
.tba { font-size: var(--step-1); font-weight: 300; line-height: 1.5; max-width: 30em; }

.facts { margin: 0; }
.facts dt, .facts dd { padding-block: 0.9rem; }
.facts .row + .row > dd { border-top: 1px solid var(--rule); }
.facts dt { font-style: italic; color: var(--ink-soft); text-align: right; }
.facts dd { margin: 0; font-size: var(--step-1); font-weight: 300; line-height: 1.45; }
.facts dd .quiet, .facts dd a { font-size: var(--step-0); font-weight: 400; }
.facts dd.prose { font-size: var(--step-0); font-weight: 400; line-height: 1.7; }

/* ---------- sign-up band ---------- */
.band { background: var(--band); padding: 3rem 0 3.25rem; margin-bottom: 3.5rem; }
.band h2 { margin-bottom: 0.5rem; }
.lede { color: var(--ink-soft); margin-bottom: 1.5rem; }

.signup { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1rem; align-items: end; }
.field { display: grid; gap: 0.3rem; min-width: 0; }
.field label { font-size: var(--step--1); color: var(--ink-soft); }
.field input:not([type=radio]):not([type=checkbox]) {
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--field);
  border: 1px solid #AEBBAA; border-radius: 3px;
  padding: 0.7rem 0.8rem; width: 100%; min-height: 3rem;
}
.field input:not([type=radio]):focus { outline: 2px solid var(--bloom); outline-offset: 1px; border-color: var(--leaf-deep); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.signup button {
  grid-column: 1 / -1; justify-self: start;
  font: inherit; font-size: 1.0625rem; font-weight: 600; letter-spacing: 0.01em;
  color: #FFFFFF; background: var(--leaf-deep);
  border: 0; border-radius: 3px; padding: 0.8rem 1.5rem; min-height: 3rem; cursor: pointer;
}
.signup button:hover { background: var(--ink); }
.signup button:disabled { opacity: 0.7; cursor: progress; }
.status { grid-column: 1 / -1; margin: 0; min-height: 1.7em; }
.status.is-error { color: var(--error); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fine { font-size: var(--step--1); color: var(--ink-soft); margin: 0.25rem 0 0; max-width: 32em; }

.thanks { font-size: var(--step-1); font-weight: 300; line-height: 1.45; margin: 0.25rem 0 1.25rem; }
.thanks:focus { outline: none; }

/* ---------- updates ---------- */
.update { padding: 1.5rem 0 0.5rem; }
.update + .update .col { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.update + .update .gutter { padding-top: 1.5rem; }
.date { font-style: italic; font-size: var(--step--1); color: var(--ink-soft); text-align: right; padding-top: 0.45rem; margin: 0; }
.update h3 { font-size: var(--step-1); font-weight: 400; margin-bottom: 0.6rem; }
.update h3 a { color: inherit; text-decoration: none; }
.update h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.prose > :last-child { margin-bottom: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 3px; }
.prose blockquote { margin: 1.25em 0; padding-left: 1.1em; border-left: 2px solid var(--bloom); font-style: italic; color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose h2 { font-size: var(--step-1); margin: 1.6em 0 0.5em; color: var(--ink); }

/* ---------- single update page ---------- */
.post-head { padding: 2.5rem 0 2rem; }
.crumb { font-size: var(--step--1); margin-bottom: 3rem; }
.post-head .date { grid-row: 2; padding-top: 1rem; }
.post-title { grid-row: 2; font-size: var(--step-2); font-weight: 300; font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); }
.back { margin: 2.5rem 0 3.5rem; }

/* ---------- inner pages (obituary, remembrances) ---------- */
.page-head { padding: clamp(2.5rem, 8vh, 5rem) 0 2rem; }
.page-title { font-size: clamp(2.5rem, 1.6rem + 3.5vw, 4rem); font-weight: 200; letter-spacing: -0.01em; line-height: 1.05; }
.page-subtitle { font-size: var(--step-1); font-weight: 300; color: var(--leaf-deep); margin: 0.75rem 0 0; }
.page-lede { font-size: var(--step-1); font-weight: 300; line-height: 1.5; color: var(--ink-soft); margin: 1rem 0 0; max-width: 30em; }
.page-body { padding-bottom: 3.5rem; }
.page-body p { margin-bottom: 1.1em; hanging-punctuation: first; }

/* ---------- remembrance form ---------- */
.remember { display: grid; gap: 1.35rem; margin-top: 1.25rem; }
.remember .field textarea {
  font: inherit; font-size: 1.0625rem; line-height: 1.6; color: var(--ink);
  background: var(--field); border: 1px solid #AEBBAA; border-radius: 3px;
  padding: 0.75rem 0.85rem; width: 100%; min-height: 12rem; resize: vertical;
}
.remember .field textarea:focus { outline: 2px solid var(--bloom); outline-offset: 1px; border-color: var(--leaf-deep); }
.remember .field textarea[aria-invalid="true"] { border-color: var(--error); }
.remember .field input::placeholder { color: #8A968D; }
.hint { display: block; font-size: var(--step--1); color: var(--ink-soft); margin: 0.1rem 0 0; line-height: 1.5; }
.optional { color: var(--ink-soft); font-style: italic; }
.choice { border: 0; margin: 0; padding: 0; min-width: 0; gap: 0.6rem; }
.choice legend { font-size: var(--step--1); color: var(--ink-soft); padding: 0; margin-bottom: 0.4rem; }
.option { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.7rem; align-items: start; cursor: pointer; line-height: 1.45; }
.option input { width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--leaf-deep); }
.option .hint { margin-top: 0.15rem; }
.remember button[type=submit] {
  justify-self: start;
  font: inherit; font-size: 1.0625rem; font-weight: 600; letter-spacing: 0.01em;
  color: #FFFFFF; background: var(--leaf-deep);
  border: 0; border-radius: 3px; padding: 0.8rem 1.5rem; min-height: 3rem; cursor: pointer;
}
.remember button[type=submit]:hover { background: var(--ink); }
.remember button[type=submit]:disabled { opacity: 0.7; cursor: progress; }
.remember .status { margin-top: -0.5rem; }
.link-button { font: inherit; color: var(--leaf-deep); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: pointer; }
.link-button:hover { color: var(--ink); }

/* ---------- shared remembrances ---------- */
.remembrance { padding: 1.5rem 0 0.5rem; }
.remembrance + .remembrance .col { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.remembrance + .remembrance .gutter { padding-top: 1.5rem; }
.remembrance .col p { margin-bottom: 0.8em; }
.signature { font-style: italic; color: var(--leaf-deep); margin-top: 0.25rem; }

/* ---------- footer ---------- */
.site-footer { display: grid; grid-template-columns: var(--cols); column-gap: var(--gap); padding: 0 0 3rem; font-size: var(--step--1); }
.site-footer p { margin: 0 0 0.4rem; }

/* ---------- the sprig: one quiet drawing on arrival ---------- */
.sprig .stem { fill: none; stroke: var(--leaf-deep); stroke-width: 2.2; stroke-linecap: round; }
.sprig .leaf { fill: var(--leaf); }
.sprig .leaf:nth-child(3n) { fill: var(--leaf-deep); }
.sprig .bloom { fill: var(--bloom); }

@media (prefers-reduced-motion: no-preference) {
  .sprig .stem { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.2s cubic-bezier(.45,.05,.3,1) .2s forwards; }
  /* each leaf and blossom is drawn from its own origin (the leaf's base, the blossom's centre) */
  .sprig .leaf, .sprig .bloom { opacity: 0; animation: unfurl .9s ease-out forwards; }
  .sprig .leaf { animation-delay: calc(.35s + var(--i) * 70ms); }
  .sprig .bloom { animation-delay: calc(2.2s + var(--i) * 180ms); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes unfurl { from { opacity: 0; scale: .2; } to { opacity: 1; scale: 1; } }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  :root { --gap: 0px; --cols: 1.25rem 0 minmax(0, 1fr) 1.25rem; --step-0: 1.125rem; }
  .gutter { grid-column: 3; }
  .hero { padding-top: 2rem; }
  .hero .col { grid-column: 3; }
  /* "Jane Auld Bowen" is about 7x the font size wide; scale it to fit the phone's width on one line. */
  .name { font-size: min(var(--step-name), calc((100vw - 2.5rem) / 7.1)); }
  .sprig-wrap { justify-content: flex-start; margin-bottom: 1.25rem; }
  .sprig { max-width: none; width: auto; height: 9rem; margin: 0; }
  .facts dt { text-align: left; font-size: var(--step--1); padding: 0.75rem 0 0; }
  .facts dd { padding: 0 0 0.75rem; }
  .facts .row + .row > dd { border-top: 0; }
  .date { text-align: left; padding-top: 0; }
  .update + .update .gutter { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
  .update + .update .col { border-top: 0; padding-top: 0.25rem; }
  .remembrance + .remembrance .gutter { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
  .remembrance + .remembrance .col { border-top: 0; padding-top: 0.25rem; }
  .site-nav { padding-top: 1rem; }
  .remember button[type=submit] { justify-self: stretch; }
  .post-head .date { grid-row: auto; padding-top: 0; }
  .post-title { grid-row: auto; }
  .signup { grid-template-columns: 1fr; }
  .signup button { justify-self: stretch; }
}
