/* Every page but the homepage (log/build.py writes them from his Squarespace pages): the homepage's tokens, type and
   buttons (site.css), plus the few parts his inner pages need: a banner with his photo, sections of his words beside his
   photos, his gallery, questions that open, his contact form, his videos and the Retreat Guru calendar. One radius
   (--r), one accent (his sage); success is green (--good), never the accent. */
:root { --good: #23824f; --bad: #b3261e; --measure: 68ch; }

/* The nav sits over the banner like the homepage's; a page without a banner starts below it */
.sub main { padding-top: 0; }
.ptitle { padding: calc(var(--nav-h) + clamp(40px, 7vw, 88px)) 0 clamp(8px, 2vw, 24px); }
.ptitle .title { max-width: 22ch; }

/* Banner: his page's own photo and words */
.phero { position: relative; display: grid; min-height: min(68dvh, 680px); align-items: end; overflow: clip; color: #fff; }
.phero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phero__veil { position: absolute; inset: 0; background: linear-gradient(to top, rgb(14 20 16 / 0.7), rgb(14 20 16 / 0.15) 60%, rgb(14 20 16 / 0.3)); }
.phero__copy { position: relative; display: grid; justify-items: start; gap: 12px; padding-block: calc(var(--nav-h) + 48px) clamp(88px, 8vw, 96px); } /* room at the foot for the note button while it's built */
.phero__title { color: inherit; font-weight: 700; font-size: clamp(2.2rem, 1.2rem + 4vw, 4.4rem); line-height: 1.08; max-width: 18ch; text-shadow: 0 2px 24px rgb(0 0 0 / 0.4); }
.phero__sub { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem); text-shadow: 0 1px 12px rgb(0 0 0 / 0.5); }
.phero__go { margin-top: 10px; }

/* Sections */
.pg { padding-block: clamp(48px, 7vw, 96px); }
.pg--alt { background: var(--paper-2); }
.pg__in { display: grid; gap: clamp(28px, 4vw, 48px); justify-items: center; }
.pg__in > * { width: 100%; }
.pg__lead { max-width: var(--measure); }

/* His words */
.prose { max-width: var(--measure); justify-self: center; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); margin-top: 1.4em; }
.prose h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); margin-top: 1.4em; }
.prose h4 { font: 600 0.82rem/1.3 var(--text); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-ink); margin-top: 1.4em; }
.prose > :first-child { margin-top: 0; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.2em; display: grid; gap: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent-ink); text-underline-offset: 3px; }
.prose strong { color: var(--head-ink); font-weight: 600; }

/* Words beside one photo, alternating sides on wide screens */
.pg__split { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; max-width: var(--max); }
@media (min-width: 900px) {
  .pg__split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .pg__split--flip > .prose { order: 2; }
  .pg__split .prose { justify-self: stretch; }
}
.pg__img img, .gallery__img img { width: 100%; height: auto; border-radius: var(--r); }
.pg__img figcaption { margin-top: 10px; font-size: 0.92rem; color: var(--ink-2); }
.pg__img--wide { max-width: 900px; justify-self: center; }
.pg__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); max-width: var(--max); }
.pg__btn { text-align: center; }

/* His gallery */
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 180px), 1fr)); }
.gallery__img img { aspect-ratio: 1; object-fit: cover; }

/* Questions that open (the shared accordion gives them their spring) */
.faq { display: grid; margin-top: 1.2em; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; font: 600 1.05rem/1.35 var(--text); color: var(--head-ink); }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: ''; flex: none; width: 14px; height: 14px; background: linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 2px 100% no-repeat; color: var(--accent); transition: rotate 300ms var(--ease); }
.faq__item[open] summary::after { rotate: 45deg; }
.faq__item summary:hover { color: var(--accent-ink); }
.faq__a { padding-bottom: 20px; }
.faq__a > * + * { margin-top: 0.8em; }

/* His videos: the picture first, the player only when asked */
.yt { position: relative; aspect-ratio: 16 / 9; max-width: 900px; justify-self: center; border-radius: var(--r); overflow: clip; background: #000; }
.yt img, .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.yt__play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.92); color: #1d231f; font: 600 0.95rem/1 var(--text); cursor: pointer; transition: transform 180ms var(--ease); }
.yt__play:hover { transform: scale(1.04); }
.yt__play svg { width: 18px; height: 18px; }

/* The map on Vision */
.map { aspect-ratio: 16 / 9; max-width: 900px; justify-self: center; border-radius: var(--r); overflow: clip; box-shadow: inset 0 0 0 1px var(--line); }
.map iframe { width: 100%; height: 100%; border: 0; }

/* Retreat Guru's calendar keeps its own look; it gets the width */
.rg { min-height: 420px; }

/* His contact form */
.form { display: grid; gap: 18px; width: 100%; max-width: 720px; justify-self: center; padding: clamp(22px, 4vw, 40px); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line); }
.form__h { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.form__row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 8px; }
.field span { font-weight: 500; color: var(--head-ink); }
.field i { font-style: normal; color: var(--accent-ink); }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 0; border-radius: var(--r); background: var(--paper); color: var(--ink); font: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 28%, transparent); transition: box-shadow 160ms var(--ease); }
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus-visible, .field textarea:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__go { position: relative; justify-self: start; min-width: 140px; }
.form__err { color: var(--bad); font-weight: 500; }
.form__done { display: flex; align-items: center; gap: 10px; color: var(--good); font-weight: 600; }
/* sending: a turning ring in the button */
.form.is-sending .form__label { visibility: hidden; }
.form.is-sending .form__go::before { content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 0.35); border-top-color: #fff; animation: turn 700ms linear infinite; }
@keyframes turn { to { rotate: 1turn; } }
/* sent: a green check that draws itself */
.form__done svg { width: 24px; height: 24px; flex: none; }
.form__done path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 520ms 120ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
/* error: the whole box shakes once */
.form.is-shake { animation: shake 420ms var(--ease); }
@keyframes shake { 20% { translate: -8px 0; } 40% { translate: 7px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --good: #5fcf8f; --bad: #ff8a80; }
}
@media (prefers-reduced-motion: reduce) {
  .form.is-shake, .form__done path, .form.is-sending .form__go::before { animation: none; }
  .form__done path { stroke-dashoffset: 0; }
}
/* The full gallery: bigger tiles; 35 photos fill 5 columns exactly on wide screens */
.gallery--full { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: var(--max); }
@media (min-width: 700px) { .gallery--full { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .gallery--full { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
/* …and below that, the first photo runs wide so every row is full (2 and 3 columns: 36 cells) */
@media (max-width: 1099px) { .gallery--full .gallery__img:first-child { grid-column: span 2; } .gallery--full .gallery__img:first-child img { aspect-ratio: 2 / 1; } }
/* Family Living's choice: email me / call me */
.field--choice { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.field--choice legend { padding: 0; margin-bottom: 8px; font-weight: 500; color: var(--head-ink); }
.choice { display: inline-flex; align-items: center; gap: 10px; margin-right: 20px; min-height: 44px; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--accent); }
.field--choice[data-invalid] legend { color: var(--bad); }
.choice input { min-height: 0; padding: 0; box-shadow: none; background: none; }
/* Rows always full: three photos sit three across (one column on phones); ten in a gallery go two, then five across */
@media (min-width: 600px) { .pg__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery--10 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .gallery--10 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.gallery--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .gallery--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Host a Retreat's 35: the full gallery's rule (first photo wide below 1100px, five across above) */
.gallery--35 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .gallery--35 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .gallery--35 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1099px) { .gallery--35 .gallery__img:first-child { grid-column: span 2; } .gallery--35 .gallery__img:first-child img { aspect-ratio: 2 / 1; } }
