/* Evans Family Headquarters
   Type: Besley (a Clarendon, for headings) and Libre Franklin (for reading).
   Colour: spruce and brick, taken from the two houses. */

@font-face { font-family: "Besley"; src: url("fonts/besley-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("fonts/besley-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Besley"; src: url("fonts/besley-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Besley"; src: url("fonts/besley-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Franklin"; src: url("fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --spruce: #1d3a30;
  --spruce-deep: #14271f;
  --brick: #8f2d1f;
  --sky: #e3ecef;
  --ink: #1b1d1c;
  --mute: #55605b;
  --line: #cfd6d2;
  --paper: #ffffff;
  --display: "Besley", "Clarendon", "Rockwell", Georgia, serif;
  --text: "Libre Franklin", "Franklin Gothic Medium", "Segoe UI", Arial, sans-serif;
  --wrap: 76rem;
  --gap: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::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(--text); font-size: 1.1875rem; line-height: 1.55; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--brick); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--spruce); line-height: 1.08; margin: 0; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.375rem); margin-bottom: 0.5em; }
h2 a, h3 a { color: inherit; text-decoration: none; }
h2 a:hover, h3 a:hover { text-decoration: underline; text-decoration-thickness: 0.07em; }
h3 { font-size: 1.75rem; }

.wrap { width: min(100% - 2 * var(--gap), var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999rem; top: 0; background: var(--paper); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* Masthead */
.masthead { border-bottom: 2px solid var(--spruce); }
.masthead-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 2rem; padding-block: 1rem 0.85rem; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.75rem; color: var(--spruce); text-decoration: none; letter-spacing: -0.01em; }
.wordmark span { color: var(--brick); }
.masthead ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 1.6rem; }
.masthead nav a { color: var(--ink); text-decoration: none; display: inline-block; padding-block: 0.3rem; font-size: 1.0625rem; }
.masthead nav a:hover { text-decoration: underline; }
.masthead nav a[aria-current] { color: var(--brick); text-decoration: underline; text-decoration-thickness: 0.12em; }

/* Home: title */
.hero { padding-block: clamp(2.25rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.75rem); }
.hero h1 { font-size: clamp(2.6rem, 1rem + 6.4vw, 5.5rem); letter-spacing: -0.015em; line-height: 0.98; max-width: 13ch; }
.lede { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem); line-height: 1.4; color: var(--ink); max-width: 46ch; margin-top: 1.1rem; }

/* Home: the two houses */
.quiet-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.diptych { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 2rem); }
.base-photo { display: block; background: var(--sky); }
.base-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.base-text { display: grid; grid-template-columns: auto 1fr; gap: 0 1.5rem; padding-top: 1.1rem; align-items: start; }
.base-year { font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.5rem); line-height: 0.9; color: var(--brick); margin: 0; font-variant-numeric: lining-nums; }
.base-where { color: var(--mute); margin: 0.2rem 0 0.7rem; }
.plain-links { list-style: none; margin: 0; padding: 0; }
.plain-links li { margin-bottom: 0.3rem; }

/* Home: the year ruler */
.years { margin-top: clamp(3.5rem, 8vw, 6rem); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap) clamp(1.5rem, 5vw, 4rem); align-items: start; }
.split-photo-first { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.strip img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 25%; }
.ruler { list-style: none; margin: 4.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(25, minmax(0, 1fr)); border-top: 2px solid var(--spruce); }
.ruler li { position: relative; text-align: center; padding-top: 1.05rem; }
.ruler li::before { content: ""; position: absolute; top: 0; left: calc(50% - 1px); width: 2px; height: 0.5rem; background: var(--spruce); }
.ruler li.five::before { height: 0.9rem; }
.ruler a { display: block; padding: 0.35rem 0; font-size: 0.9375rem; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.ruler li.five a { font-weight: 700; }
.ruler a:hover { color: var(--brick); text-decoration: underline; }
.ruler .pin a { color: var(--brick); font-weight: 700; }
.ruler .pin::after { content: ""; position: absolute; top: -0.5rem; left: calc(50% - 0.45rem); width: 0.9rem; height: 0.9rem; background: var(--brick); border: 2px solid var(--paper); border-radius: 50%; }
.pin-label { position: absolute; bottom: calc(100% + 0.8rem); left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: 1.0625rem; color: var(--brick); }

/* Home: sections */
.people, .trips, .shop { margin-top: clamp(3.5rem, 8vw, 6rem); }
.print { margin: 0; }
.print { max-width: calc(var(--natural, 4000) * 1px); }
.print img { width: 100%; outline: 1px solid var(--line); outline-offset: -1px; }
.print figcaption, .rows figcaption { font-size: 1rem; color: var(--mute); padding-top: 0.45rem; }
.who { margin: 0 0 1.2rem; }
.who div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.who div:last-child { border-bottom: 1px solid var(--line); }
.who dt { font-family: var(--display); font-weight: 600; font-size: 1.25rem; }
.who dt a { color: var(--spruce); }
.who dd { margin: 0; }

.band { background: var(--sky); margin-top: clamp(3.5rem, 8vw, 6rem); padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.dogs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 1rem; }
.dogs li { display: grid; justify-items: center; text-align: center; line-height: 1.25; }
.dogs b { font-family: var(--display); font-weight: 600; font-size: 1.1875rem; color: var(--spruce); margin-top: 0.6rem; }
.dogs span:not(.oval) { color: var(--mute); font-size: 1rem; }
.oval { width: 5.75rem; height: 7rem; object-fit: cover; clip-path: ellipse(50% 50%); }
.oval-empty { display: block; border: 2px solid var(--spruce); border-radius: 50%; clip-path: none; opacity: 0.22; }

blockquote { margin: 0 0 1.1rem; padding-left: 1.1rem; border-left: 4px solid var(--brick); }
blockquote p { font-family: var(--display); font-style: italic; font-size: 1.3125rem; line-height: 1.4; color: var(--spruce); }

/* Footer */
.foot { background: var(--spruce); color: #fff; margin-top: clamp(4rem, 9vw, 7rem); padding-block: 2.75rem 3.25rem; }
.foot a { color: #fff; }
.foot :focus-visible { outline-color: #fff; }
.foot-name { font-family: var(--display); font-weight: 600; font-size: 1.5rem; margin-bottom: 0.6rem; }
.foot p { margin-bottom: 0.4rem; }

/* Inner pages */
.page-head { padding-block: clamp(1.75rem, 5vw, 3.25rem) 0.5rem; }
.page-head h1 { font-size: clamp(2.3rem, 1.3rem + 4vw, 4rem); letter-spacing: -0.012em; }
.crumbs { font-size: 1.0625rem; margin-bottom: 0.8rem; color: var(--mute); }

/* Section cards: links to the pages inside a section */
.cards { list-style: none; margin: clamp(1.5rem, 4vw, 2.5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 2rem clamp(1rem, 2.5vw, 2rem); }
.card-photo { display: block; background: var(--sky); aspect-ratio: 3 / 2; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.cards h2 { font-size: 1.5rem; margin: 0.75rem 0 0.3rem; }
.cards p { margin: 0; color: var(--mute); font-size: 1.0625rem; line-height: 1.45; }

/* Written pages: text set to a comfortable measure, photo rows at full width */
.prose { margin-top: clamp(1.5rem, 4vw, 2.5rem); }
.prose > p, .prose > ul, .prose > ol, .prose > blockquote { max-width: 66ch; }
.prose h2 { border-top: 2px solid var(--spruce); padding-top: 0.85rem; margin: clamp(2.5rem, 6vw, 4rem) 0 1rem; scroll-margin-top: 1rem; }
.prose h3 { margin: 2.25rem 0 0.8rem; scroll-margin-top: 1rem; }
.prose > .rows { margin: 1.5rem 0 2rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35rem; }
.prose table { border-collapse: collapse; margin: 1.25rem 0 2rem; font-size: 1.0625rem; display: block; max-width: 100%; overflow-x: auto; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.5rem 1.1rem 0.5rem 0; border-top: 1px solid var(--line); }
.prose th { font-weight: 700; color: var(--spruce); border-top: 2px solid var(--spruce); }
.yearlist { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; max-width: none; }
.prose .yearlist li { margin: 0; }
.yearlist a { display: block; padding: 0.4rem 0.7rem; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.yearlist a:hover { border-color: var(--brick); color: var(--brick); }

/* Construction time-lapse */
.lapse { margin: 1.5rem 0 2.5rem; max-width: 56rem; }
.lapse-frame { background: var(--sky); aspect-ratio: 4 / 3; }
.lapse-frame img { width: 100%; height: 100%; object-fit: contain; }
.lapse-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-top: 0.9rem; }
.lapse-bar button { font: inherit; font-size: 1.0625rem; color: #fff; background: var(--spruce); border: 2px solid var(--spruce); padding: 0.45rem 1.1rem; cursor: pointer; min-width: 6.5rem; }
.lapse-bar button:hover { background: var(--spruce-deep); }
.lapse-bar input[type="range"] { flex: 1 1 14rem; accent-color: var(--brick); height: 2rem; }
.lapse-date { font-family: var(--display); font-weight: 600; font-size: 1.25rem; color: var(--spruce); min-width: 12rem; }

/* Photo rows: every row is filled edge to edge, pictures keep their own shape */
.rows { --h: 15rem; display: flex; flex-wrap: wrap; gap: 1.5rem 0.85rem; }
.rows figure { margin: 0; min-width: 0; flex: var(--r) 1 calc(var(--r) * var(--h)); max-width: min(calc(var(--r) * var(--h) * 1.5), var(--w, 100%)); }
.rows figure.wide { flex-basis: 100%; max-width: var(--w, 100%); }   /* panoramas get a row to themselves */
.rows.solo figure { flex: 0 1 auto; max-width: min(100%, var(--w, 100%), 60rem); }  /* a picture on its own: plans, posters, family trees */
.rows a { display: block; }
.rows img { width: 100%; outline: 1px solid var(--line); outline-offset: -1px; }

/* Large-picture viewer */
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; background: #0f1513; color: #fff; }
.viewer::backdrop { background: #0f1513; }
.viewer[open] { display: grid; grid-template-rows: 1fr auto; }
.viewer-stage { min-height: 0; display: grid; place-items: center; padding: 1rem; }
.viewer-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; padding: 0.8rem var(--gap) 1rem; background: var(--spruce-deep); }
.viewer-caption { margin: 0; font-size: 1.125rem; }
.viewer-count { color: #b9c7c1; margin-left: 0.6rem; }
.viewer-buttons { display: flex; gap: 0.5rem; }
.viewer button { font: inherit; font-size: 1.0625rem; color: #fff; background: transparent; border: 2px solid #ffffff99; padding: 0.45rem 1rem; cursor: pointer; }
.viewer button:hover { background: #fff; color: var(--spruce-deep); }
.viewer :focus-visible { outline-color: #fff; }

@media (max-width: 62rem) {
  .ruler { grid-template-columns: repeat(5, 1fr); border-top: 0; gap: 0.4rem; margin-top: 1.75rem; }
  .ruler li { padding: 0; }
  .ruler li::before, .ruler .pin::after { display: none; }
  .ruler a { border: 1px solid var(--line); padding: 0.7rem 0; font-size: 1.0625rem; }
  .ruler .pin a { border-color: var(--brick); border-width: 2px; }
  .pin-label { position: static; transform: none; display: none; }
}
@media (max-width: 48rem) {
  body { font-size: 1.125rem; }
  .diptych, .split, .split-photo-first { grid-template-columns: 1fr; }
  .diptych { gap: 2.25rem; }
  .base-text { grid-template-columns: 1fr; gap: 0.5rem; }
  .dogs { grid-template-columns: repeat(2, 1fr); }
  .rows { --h: 11rem; }
  .masthead ul { gap: 0 1.2rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .masthead nav, .foot, .viewer { display: none; } }
