/* Traffas Tales — a family chronicle, 2009 onward.
   Light, warm and cheerful: cream paper, a cornflower blue lifted from the
   wedding (the vests, the hydrangeas, the lanterns) and a sunny yellow. The
   writing leads; photographs support it. Fraunces gives headings warmth,
   Inter keeps the reading easy. */

:root {
  --paper: #fffdf7;
  --paper-2: #fbf5e9;
  --card: #ffffff;
  --ink: #2b2521;
  --ink-soft: #4a423b;
  --muted: #7d7268;
  --line: #ece2d2;

  --blue: #2f6fb8;
  --blue-deep: #23558f;
  --sun: #f2a71b;
  --blush: #d9644f;
  --mint: #3f9b7e;

  --display: Fraunces, Georgia, "Times New Roman", serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 4.5vw, 56px);
  --band: clamp(52px, 7vw, 96px);
  --radius: 12px;
  --measure: 70ch;      /* one content column for text AND photographs */
  --row: 230px;
  --gap: 10px;
  --shadow: 0 1px 2px rgba(43,37,33,.05), 0 8px 24px rgba(43,37,33,.07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: clamp(16.5px, 1.05vw, 18px);
  line-height: 1.7; -webkit-font-smoothing: antialiased;
}

/* height:auto is load-bearing — the width/height attributes on every <img>
   act as presentational hints, so clamping width without releasing height
   stretches the picture to the attribute height. */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 12px 18px; font-weight: 600; }
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------------------------------------------------------------- header -- */

.site-head { position: sticky; top: 0; z-index: 50;
  background: rgba(255,253,247,.92); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); }

.head-inner { display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 66px; }

.brand { text-decoration: none; color: inherit; line-height: 1.1; }
.brand-name { display: block; font-family: var(--display); font-size: 1.26rem; font-weight: 700;
  font-variation-settings: "opsz" 40, "SOFT" 60, "WONK" 1;
  letter-spacing: -.012em; color: var(--ink); }
.brand-sub { display: block; font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { display: flex; gap: clamp(12px, 2vw, 26px); }
.nav a { color: var(--ink-soft); text-decoration: none; font-size: .94rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--sun); }

/* -------------------------------------------------------------- masthead --
   The front page leads with the writing, so the top is a warm title block
   rather than a full-bleed photograph. */

.masthead {
  background:
    radial-gradient(90rem 40rem at 12% -20%, #fdf0d6 0%, transparent 60%),
    radial-gradient(70rem 36rem at 92% 0%, #e6f0fb 0%, transparent 62%),
    var(--paper);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(44px, 7vw, 92px);
}
.masthead-title { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 1;
  font-size: clamp(2.7rem, 8.5vw, 6rem); line-height: .95;
  letter-spacing: -.03em; margin: 0 0 14px; color: var(--ink); }
.masthead-lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft);
  margin: 0; max-width: 54ch; }
.masthead-meta { margin: 22px 0 0; font-size: .86rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 22px; }
.masthead-meta strong { color: var(--blue); font-weight: 600; }

/* ---------------------------------------------------------------- bands --- */

.band { padding-block: var(--band); }
.band-tint { background: var(--paper-2); }

.eyebrow { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--blue); margin: 0 0 10px; font-weight: 600; }

.band-title { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 80, "SOFT" 60, "WONK" 1;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 clamp(24px, 3vw, 40px); }

/* ------------------------------------------------------------- year rail -- */

.year { display: flex; align-items: center; gap: 16px; margin: clamp(34px, 4vw, 56px) 0 20px; }
.year-num { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 120, "SOFT" 60, "WONK" 1;
  font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1;
  letter-spacing: -.025em; color: var(--blue); }
.year:nth-of-type(3n) .year-num { color: var(--blush); }
.year:nth-of-type(3n+2) .year-num { color: var(--mint); }
.year-rule { flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.year-count { font-size: .76rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; }

/* ------------------------------------------------------------- entries ---- */

.entries { display: flex; flex-direction: column; gap: clamp(14px, 1.8vw, 20px); }

.entry { display: grid; gap: clamp(14px, 2vw, 26px); grid-template-columns: 1fr;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 26px); text-decoration: none; color: inherit;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }

@media (min-width: 720px) {
  .entry.has-thumb { grid-template-columns: 190px 1fr; align-items: start; }
}

.entry:hover { transform: translateY(-2px); border-color: #d9cdb8;
  box-shadow: 0 2px 4px rgba(43,37,33,.06), 0 14px 34px rgba(43,37,33,.1); }

/* Thumbnails keep their own shape — no forced crop to a common ratio. */
.entry-thumb { border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.entry-thumb img { width: 100%; height: auto; }

.entry-date { font-size: .74rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 6px; }
.entry-title { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 48, "SOFT" 60, "WONK" 1;
  font-size: clamp(1.25rem, 2.1vw, 1.6rem); line-height: 1.15;
  margin: 0 0 8px; letter-spacing: -.015em; color: var(--ink); }
.entry:hover .entry-title { color: var(--blue); }
.entry-excerpt {
  margin: 0; color: var(--ink-soft);
  display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--lines, 4); overflow: hidden;
}
@media (max-width: 719px) { .entry-excerpt { -webkit-line-clamp: 6; } }
.entry-tag { display: inline-block; margin-top: 12px; font-size: .78rem; font-weight: 600;
  color: var(--blue); background: #eaf1fa; border-radius: 999px; padding: 3px 11px; }
.entry-tag.is-empty { color: var(--muted); background: var(--paper-2); font-weight: 500; }

/* --------------------------------------------------------------- article -- */

.page-head { padding-block: clamp(38px, 5vw, 72px) clamp(14px, 2vw, 26px); }
.page-date { font-size: .78rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--blue); margin: 0 0 10px; font-weight: 600; }
.page-title { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 1;
  font-size: clamp(2.1rem, 5.4vw, 3.7rem); line-height: 1.02;
  letter-spacing: -.03em; margin: 0; color: var(--ink); }

.prose { max-width: var(--measure); font-size: 1.04rem; }
.prose > * { margin: 0; }
.prose > * + * { margin-top: 1.35em; }
.prose h2, .prose h3 { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 60, "SOFT" 60; letter-spacing: -.015em; margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose blockquote { margin: 1.6em 0; padding: 2px 0 2px 22px;
  border-left: 4px solid var(--sun); color: var(--ink-soft); font-style: italic; }

.block { margin-block: clamp(26px, 3.4vw, 46px); }

/* -------------------------------------------------- justified photo grid --
   Aspect ratios come from real pixel dimensions at build time, so nothing
   reflows. Each tile also carries a max-width equal to its native width, so a
   150px original is never blown up to fill a row. */

.grid { display: flex; flex-wrap: wrap; gap: var(--gap); max-width: var(--measure); }

.shot { position: relative; display: block; overflow: hidden;
  background: var(--paper-2); border-radius: 8px;
  flex-grow: var(--ar); flex-basis: calc(var(--ar) * var(--row));
  cursor: zoom-in; border: 0; padding: 0;
  box-shadow: 0 1px 2px rgba(43,37,33,.06); }
.shot::before { content: ""; display: block; padding-top: calc(100% / var(--ar)); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .4s ease; }
.shot:hover img { transform: scale(1.04); }
.grid::after { content: ""; flex-grow: 999999; }

/* Figures float where WordPress had them, so text wraps as originally written.
   `flow-root` on .prose keeps the floats inside their own block. */
.prose { display: flow-root; }

.figure { margin: 0; max-width: 100%; }
.figure img { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); }

.figure-left  { float: left;  margin: .35em 1.7em .9em 0; }
.figure-right { float: right; margin: .35em 0 .9em 1.7em; }
.figure-center { margin: 1.5em auto; }
.figure-none  { margin: 1.5em 0; }

@media (max-width: 620px) {
  .figure-left, .figure-right { float: none; margin: 1.4em auto; }
}
.figcap { font-size: .86rem; color: var(--muted); margin-top: 10px; }

/* ---------------------------------------------------------------- video -- */

.video { margin-block: clamp(26px, 3.4vw, 46px); max-width: var(--measure); }
.video video { width: 100%; height: auto; border-radius: 10px; background: #000; box-shadow: var(--shadow); }
.video-note { font-size: .84rem; color: var(--muted); margin-top: 8px; }

.missing-note { color: var(--muted); font-size: .94rem; font-style: italic;
  border-left: 4px solid var(--line); padding-left: 18px; max-width: 60ch; }

/* ------------------------------------------------------------- lightbox -- */

.lb { position: fixed; inset: 0; z-index: 200; background: rgba(28,24,20,.94);
  display: none; align-items: center; justify-content: center; }
.lb.is-open { display: flex; }
.lb-img { max-width: 94vw; max-height: 86vh; width: auto; height: auto;
  object-fit: contain; border-radius: 8px; }
.lb-bar { position: absolute; inset-inline: 0; bottom: 0; display: flex;
  align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(14px, 3vw, 28px); font-size: .88rem; color: rgba(255,255,255,.78); }
.lb-cap { max-width: 70ch; }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  color: #fff; width: 48px; height: 48px; border-radius: 50%;
  font-size: 1.3rem; line-height: 1; cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.26); }
.lb-prev { left: clamp(10px, 2vw, 26px); }
.lb-next { right: clamp(10px, 2vw, 26px); }
.lb-close { position: absolute; top: clamp(10px, 2vw, 22px); right: clamp(10px, 2vw, 26px);
  background: none; border: 0; color: #fff; font-size: 1.9rem; line-height: 1;
  cursor: pointer; padding: 6px 10px; }

/* --------------------------------------------------------------- pagenav -- */

.pagenav { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 24px; margin-top: clamp(36px, 4.5vw, 64px); }
.pagenav a { color: var(--ink); text-decoration: none; max-width: 45%; font-weight: 500; }
.pagenav a:hover { color: var(--blue); }
.pagenav span { display: block; font-size: .72rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ---------------------------------------------------------------- footer -- */

.site-foot { border-top: 1px solid var(--line); background: var(--paper-2);
  padding-block: clamp(36px, 4.5vw, 60px); text-align: center; color: var(--muted); }
.foot-name { font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 40, "SOFT" 60, "WONK" 1;
  color: var(--ink); margin: 0 0 6px; font-size: 1.15rem; }
.foot-sub { margin: 0; font-size: .8rem; letter-spacing: .11em; text-transform: uppercase; }

@media (max-width: 620px) {
  :root { --row: 150px; }
  .nav { gap: 14px; }
  .nav a { font-size: .86rem; white-space: nowrap; }
}
@media (max-width: 460px) {
  .brand-sub { display: none; }
  .brand-name { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .shot:hover img, .entry:hover { transform: none; }
}

/* ------------------------------------------------------------------ hero --
   A big opening photograph above the light card list. The scrim only darkens
   the bottom, so the picture still reads as a picture. */

.hero { position: relative; background: var(--paper-2); }
.hero-media { position: relative; }
.hero-media img {
  width: 100%; height: min(74vh, 660px);
  object-fit: cover; object-position: 50% 40%;
}
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,22,18,.88) 2%, rgba(28,22,18,.52) 34%,
                              rgba(28,22,18,.12) 66%, transparent 100%);
}
.hero-copy { position: absolute; inset-inline: 0; bottom: 0; padding-block: clamp(26px, 5vw, 60px); }
.hero-title {
  font-family: var(--display); font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 1;
  font-size: clamp(2.6rem, 8vw, 5.6rem); line-height: .95;
  letter-spacing: -.03em; margin: 0 0 12px; color: #fff;
}
.hero-tagline {
  font-size: clamp(1rem, 1.5vw, 1.25rem); color: rgba(255,255,255,.9);
  margin: 0; max-width: 52ch;
}
.hero-meta {
  margin: 18px 0 0; font-size: .88rem; color: rgba(255,255,255,.78);
  display: flex; flex-wrap: wrap; gap: 8px 22px;
}
.hero-meta strong { color: #fff; font-weight: 700; }
.hero-meta a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hero-meta a:hover { color: var(--sun); }

/* front-page gallery trim */
.grid-more { margin: 12px 0 0; font-size: .9rem; }
