/* ==========================================================================
   base.css — structure and behaviour shared by all three looks.
   Colours, type and shape live in look-bold.css / look-manuscript.css / look-arch.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--hdr, 68px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  padding-bottom: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body, 1.15rem);
  line-height: var(--lh, 1.6);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus, currentColor); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 100; padding: 10px 14px; background: #fff; color: #000; }

/* elements used only by the Classic look */
.menu-btn, .contact-tab, .kicker { display: none; }
.ph.bio__img2, .ph.s-intro__wide { display: none; }
.photo-break__fig { margin: 0; }
.photo-break__fig figcaption { position: relative; z-index: 2; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--hdr, 68px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  background: var(--hdr-bg); color: var(--hdr-fg);
}
.top .mark { text-decoration: none; white-space: nowrap; }
.top nav { display: flex; gap: clamp(14px, 2.6vw, 34px); }
.top nav a { text-decoration: none; padding: 6px 0; }

/* ---------- carousel ---------- */
.carousel { position: relative; }
.track {
  display: flex; overflow-x: auto;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track:focus-visible { outline-offset: -6px; }
.slide {
  flex: 0 0 100%; scroll-snap-align: start; position: relative; overflow: hidden;
  min-height: max(560px, calc(100svh - var(--hdr, 68px) - var(--ctrl-h, 64px) - var(--sw-h, 0px)));
}
.car-ctrl {
  height: var(--ctrl-h, 64px);
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 0 var(--gutter);
  background: var(--ctrl-bg); color: var(--ctrl-fg);
}
.car-btn {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 2px solid currentColor; color: inherit; padding: 0;
}
.dots { display: flex; align-items: center; gap: 8px; }
.dots button { cursor: pointer; padding: 0; border: 0; background: currentColor; opacity: .4; width: 28px; height: 6px; transition: opacity .2s, width .25s, background .2s; }
.dots button[aria-selected="true"] { opacity: 1; }
.count { min-width: 3.4em; text-align: center; font-variant-numeric: tabular-nums; font-size: .95rem; }

/* ---------- media placeholders ---------- */
.ph {
  position: relative; overflow: hidden; background: var(--ph-bg, #ccc);
  display: grid; place-items: end start; min-height: 220px;
}
.ph::after {
  content: "Add " attr(data-file); position: absolute; left: 16px; bottom: 14px;
  font: 600 .8rem/1.2 system-ui, sans-serif; opacity: .65; color: var(--ph-fg, #000);
}
.ph img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: var(--img-pos, 50% 18%); }

.cover { position: relative; aspect-ratio: 2 / 3; width: min(100%, 340px); background: var(--cover-bg); color: var(--cover-fg); }
.cover img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.cover__fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 8% 9%; }
.cover__title { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1; }
.cover__by { font-size: 1rem; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .95em 1.55em; font-size: 1rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
  border: 2px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg); border-radius: var(--btn-r, 0);
  transition: background .18s, color .18s, border-color .18s;
}
.btn:hover { background: var(--btn-bg-h); color: var(--btn-fg-h); border-color: var(--btn-bd-h, var(--btn-bd)); }
.btn--ghost { background: transparent; color: var(--btn2-fg, var(--btn-bg)); border-color: var(--btn2-bd, var(--btn-bg)); }
.btn--ghost:hover { background: var(--btn2-bg-h, var(--btn-bg)); color: var(--btn2-fg-h, var(--btn-fg)); border-color: var(--btn2-bd-h, var(--btn-bg)); }

/* ---------- sections (shared skeleton) ---------- */
.bio, .writing, .inquire { position: relative; }
.bio { display: grid; }
.pull { margin: 2rem 0; }
.pull cite { display: block; margin-top: .8rem; font-style: normal; font-size: .95rem; }

.posts { display: block; }
.post { display: block; text-decoration: none; }

/* ---------- form ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; margin-top: 2rem; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: .95rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: .85em 1em; border: var(--input-bd); background: var(--input-bg); color: var(--input-fg); border-radius: var(--input-r, 0);
}
.field textarea { resize: vertical; min-height: 9rem; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.form__note { font-size: .95rem; opacity: .85; max-width: 38ch; }
.form__note.is-error { opacity: 1; font-weight: 600; }
.contact h3, .church h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.contact__mail { overflow-wrap: anywhere; }
.church__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 1rem; }

/* ---------- blog page ---------- */
.blog-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px 48px; align-items: end; }
.blog-head__side { display: grid; gap: 20px; max-width: 34rem; }
.blog-status { font-size: .9rem; opacity: .75; min-height: 1.4em; }

.mosaic {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: var(--tile-h, 176px);
  gap: var(--tile-gap, 10px); max-width: 1560px; margin: 0 auto; padding: var(--mosaic-pad, 0 var(--gutter) 72px);
}
.tile {
  grid-column: span var(--c, 2); grid-row: span var(--r, 1);
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  padding: 20px 22px; text-decoration: none;
  transition: transform .2s ease, background .2s, color .2s;
}
.tile:hover { transform: translateY(-3px); }
.tile__date { font-size: .85rem; opacity: .8; margin-bottom: auto; padding-right: 36px; }
.tile__title { display: block; line-height: 1.04; overflow-wrap: break-word; hyphens: auto; }
.tile__sub { display: block; margin-top: .7em; font-size: 1rem; line-height: 1.35; opacity: .85; max-width: 40ch; }
.tile__go { position: absolute; right: 16px; top: 16px; opacity: .85; }
.tile.sm .tile__title { font-size: clamp(1.1rem, 1.7vw, 1.4rem); }
.tile.md .tile__title { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.tile.lg .tile__title { font-size: clamp(1.8rem, 3.4vw, 3rem); }
.tile.xl .tile__title { font-size: clamp(2.2rem, 5vw, 4.6rem); }
.tile--sub, .tile--all { justify-content: center; }
.tile--sub .tile__title, .tile--all .tile__title { font-size: 1.2rem; }
.tile--all { align-self: start; height: 96px; }
.tile--all .tile__go, .tile--sub .tile__go { top: 50%; margin-top: -11px; right: 30px; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding: 28px var(--gutter); font-size: .95rem; }
.foot p:last-child { display: flex; gap: 20px; }

/* ---------- look switcher (review tool; hide with showSwitcher:false in js/config.js) ---------- */
.looks {
  position: fixed; right: 16px; bottom: 14px; z-index: 60;
  display: flex; align-items: center; gap: 4px; padding: 5px;
  background: #fff; color: #14161c; border-radius: 999px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, .28), 0 0 0 1px rgba(0, 0, 0, .08);
  font: 600 14px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  view-transition-name: looks;
}
.looks__label { padding: 0 10px 0 12px; opacity: .55; }
.looks button {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 10px 14px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: inherit;
}
.looks button:hover { background: #eef0f3; }
.looks button[aria-pressed="true"] { background: #14161c; color: #fff; }
.looks i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(128, 128, 128, .5); }
.looks button[data-look="bold"] i { background: linear-gradient(90deg, #161616 50%, #E7E6E2 50%); }
.looks button[data-look="manuscript"] i { background: linear-gradient(90deg, #DCE3DA 50%, #7B1E2E 50%); }
.looks button[data-look="classic"] i { background: linear-gradient(90deg, #0A5C7A 50%, #CF5A22 50%); }
.looks button[data-look="arch"] i { background: linear-gradient(90deg, #0D3B3E 50%, #F4B28A 50%); }
.looks :focus-visible { outline-color: #2a5bff; }

/* ---------- motion ---------- */
@keyframes name-in {
  from { opacity: 0; transform: translateY(.22em); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(-20% -6% -20% -6%); }
}
.name span { display: inline-block; animation: name-in .95s cubic-bezier(.2, .7, .2, 1) both; }
.name span:nth-child(2) { animation-delay: .14s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive (shared) ---------- */
@media (max-width: 1180px) {
  :root { --sw-h: 0px; }
  .looks { right: auto; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 1000px) {
  .mosaic { --tile-h: 150px; }
}
@media (max-width: 760px) {
  .top { gap: 8px; padding: 0 16px; }
  .top .mark { font-size: 1.2rem !important; }
  .top nav { gap: 2px !important; }
  .top nav a { padding: 8px 8px !important; font-size: .9rem !important; }
  .form { grid-template-columns: 1fr; }
  .blog-head { grid-template-columns: 1fr; }
  .mosaic { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .tile, .tile--sub, .tile--all { grid-column: 1 / -1; grid-row: auto; min-height: 150px; }
  .tile--sub, .tile--all { min-height: 84px; height: auto; }
  .looks__label { display: none; }
  .looks button { padding: 10px 11px; }
}
