/* =====================================================================
   Photo essays — Exposure-style story layout
   Mirrors the section ("group") model used on telfordv.exposure.co:
   cover · text · full-width photo · photo set (justified rows) ·
   centred / wide / vertical single · photo beside text · big quote.
   The WordPress publisher plugin emits exactly this markup too.
   ===================================================================== */
:root {
  --ex-ink: #292525;
  --ex-head: #101010;
  --ex-bg: #ffffff;
  --ex-serif: "EB Garamond", Garamond, "Iowan Old Style", Georgia, serif;
  --ex-sans: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --ex-text: 700px;
  --ex-gap: 4px;
  --ex-row-gap: 6px;
}
body.essay-page { background: var(--ex-bg); color: var(--ex-ink); }
body.essay-page main { background: var(--ex-bg); }

/* ---------- cover ---------- */
.ex-cover { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #1a1a1a; color: #fff; text-align: center; }
.ex-cover__media { position: absolute; inset: 0; }
.ex-cover__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-cover__media::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.34); }
.ex-cover__titles { position: relative; z-index: 2; width: min(1316px, 100% - 48px); padding: 120px 0 140px; }
.ex-cover h1 { font-family: var(--ex-sans); font-weight: 700; text-transform: uppercase; letter-spacing: 3px; font-size: clamp(2rem, 4.45vw, 4rem); line-height: 1.15; margin: 0 auto; max-width: 1176px; color: inherit; }
.ex-cover .ex-subtitle { font-family: var(--ex-serif); font-style: italic; font-weight: 400; font-size: clamp(1.25rem, 2.2vw, 2rem); line-height: 1.3; margin: 8px auto 0; color: inherit; }
.ex-byline { position: absolute; left: 0; right: 0; bottom: 28px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--ex-serif); }
.ex-byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.85); }
.ex-byline .by { font-size: 18px; }
.ex-byline .by b { font-family: var(--ex-sans); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; font-size: 15px; margin-left: 4px; }
.ex-byline time { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; opacity: .9; }
.ex-byline time sup { font-size: .7em; }

/* two-fold cover: photo on the left, title on white to the right */
.ex-cover--two-fold { background: var(--ex-bg); color: var(--ex-head); display: grid; grid-template-columns: 45% 1fr; align-items: stretch; text-align: center; }
.ex-cover--two-fold .ex-cover__media { position: relative; min-height: 100vh; min-height: 100svh; }
.ex-cover--two-fold .ex-cover__media::after { display: none; }
.ex-cover--two-fold .ex-cover__side { position: relative; display: flex; align-items: center; justify-content: center; padding: 120px 48px 140px; }
.ex-cover--two-fold .ex-cover__titles { width: 100%; padding: 0; }
.ex-cover--two-fold h1 { font-size: clamp(2rem, 4.45vw, 4rem); }
.ex-cover--two-fold .ex-byline img { border-color: #fff; }
@media (max-width: 860px) {
  .ex-cover--two-fold { grid-template-columns: 1fr; }
  .ex-cover--two-fold .ex-cover__media { min-height: 62vh; }
  .ex-cover--two-fold .ex-cover__side { padding: 40px 24px 130px; }
}

/* ---------- story body ---------- */
.ex-story { padding: 80px 0 40px; }
.ex-group { margin: 0 0 60px; }
.ex-text { width: min(var(--ex-text), 100% - 48px); margin: 0 auto; font-family: var(--ex-serif); font-size: 18px; line-height: 1.52; color: var(--ex-ink); }
.ex-text p { margin: 0 0 16px; }
.ex-text p:last-child { margin-bottom: 0; }
.ex-text a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ex-text + .ex-photos, .ex-text + .ex-single, .ex-gtitle + .ex-text { margin-top: 0; }
.ex-group > .ex-text { margin-bottom: 60px; }
.ex-group > .ex-text:last-child { margin-bottom: 0; }
.ex-gtitle { width: min(1150px, 100% - 48px); margin: 0 auto 32px; text-align: center; font-family: var(--ex-sans); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: clamp(2rem, 4.2vw, 3.75rem); line-height: 1.1; color: var(--ex-head); }
.ex-dropcap > .ex-text p:first-child::first-letter,
.ex-dropcap .ex-side .ex-text p:first-child::first-letter { float: left; font-family: var(--ex-serif); font-weight: 700; font-size: 90px; line-height: 80px; padding: 4px 10px 0 0; color: var(--ex-ink); }

.ex-photo { position: relative; margin: 0; background: #f2f2f2; overflow: hidden; cursor: zoom-in; }
.ex-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ex-photo figcaption, .ex-caption { font-family: var(--ex-serif); font-style: italic; text-align: center; color: var(--ex-ink); font-size: 18px; line-height: 1.45; }
.ex-caption { width: min(var(--ex-text), 100% - 48px); margin: 16px auto 0; }

/* full-width single: edge to edge */
.ex-single--full .ex-photo { width: 100%; }
/* centred / vertical single: text-column width; wide single: col-10 */
.ex-single--center .ex-photo, .ex-single--vertical .ex-photo { width: min(var(--ex-text), 100% - 48px); margin: 0 auto; }
.ex-single--wide .ex-photo { width: min(82%, 100% - 48px); margin: 0 auto; }

/* photo set: justified rows, every photo in a row shares one height */
.ex-photos { width: 83.3333%; margin: 0 auto; padding-top: 12px; display: flex; flex-direction: column; gap: var(--ex-row-gap); }
.ex-row { display: flex; gap: var(--ex-gap); }
.ex-row .ex-photo { flex: var(--ar) 1 0; aspect-ratio: var(--ar); min-width: 0; }

/* photo beside text */
.ex-beside { width: min(1000px, 100% - 48px); margin: 0 auto; display: flex; align-items: center; gap: 40px; }
.ex-beside .ex-side { flex: 0 0 462px; max-width: 462px; }
.ex-beside .ex-side .ex-text { width: 100%; }
.ex-beside .ex-photo { flex: 1 1 0; min-width: 0; }
.ex-beside--photo-left { flex-direction: row-reverse; }

/* big quote */
.ex-quote { width: min(1150px, 100% - 48px); margin: 0 auto; padding: 60px 0 40px; text-align: center; font-family: var(--ex-sans); font-weight: 400; font-size: clamp(1.9rem, 4.9vw, 4.375rem); line-height: 1.1; color: var(--ex-ink); }
.ex-quote p { margin: 0; }

/* end of story */
.ex-end { width: min(var(--ex-text), 100% - 48px); margin: 20px auto 0; text-align: center; font-family: var(--ex-serif); font-size: 15px; color: #6d6767; }

@media (max-width: 1000px) {
  .ex-photos { width: calc(100% - 32px); }
  .ex-beside { flex-direction: column-reverse; gap: 28px; }
  .ex-beside--photo-left { flex-direction: column; }
  .ex-beside .ex-side { flex: none; max-width: none; width: 100%; }
  .ex-beside .ex-photo { width: 100%; flex: none; }
}
@media (max-width: 600px) {
  .ex-story { padding-top: 48px; }
  .ex-group { margin-bottom: 44px; }
  .ex-group > .ex-text { margin-bottom: 36px; }
  .ex-row.ex-row--many { flex-wrap: wrap; }
  .ex-row.ex-row--many .ex-photo { flex: 1 1 calc(50% - var(--ex-gap)); aspect-ratio: auto; height: 46vw; }
  .ex-photos { width: calc(100% - 16px); }
  .ex-text { font-size: 18px; }
  .ex-dropcap > .ex-text p:first-child::first-letter { font-size: 72px; line-height: 64px; }
}

/* ---------- lightbox ---------- */
.ex-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(10,10,10,.96); display: none; align-items: center; justify-content: center; }
.ex-lightbox.is-open { display: flex; }
.ex-lightbox img { max-width: 94vw; max-height: 90vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.ex-lightbox button { position: absolute; background: none; border: 0; color: #fff; font: 400 34px/1 var(--ex-sans); cursor: pointer; padding: 18px; opacity: .8; }
.ex-lightbox button:hover { opacity: 1; }
.ex-lightbox .lb-close { top: 8px; right: 12px; }
.ex-lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.ex-lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.ex-lightbox .lb-count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.7); font: 13px/1 var(--ex-sans); letter-spacing: 1px; }

/* ---------- photography index: Exposure-style story cards ---------- */
.ex-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ex-card { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; color: #fff; text-decoration: none; background: #222; }
.ex-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out, ease), opacity .4s; }
.ex-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0) 70%); }
.ex-card:hover img { transform: scale(1.04); }
.ex-card__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 24px 26px; text-align: center; }
.ex-card h3 { margin: 0; font-family: var(--ex-sans); font-weight: 700; text-transform: uppercase; letter-spacing: 3px; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.2; color: #fff; }
.ex-card p { margin: 8px 0 0; font-family: var(--ex-serif); font-style: italic; font-size: 18px; line-height: 1.3; color: #fff; }
.ex-card time { display: block; margin-top: 10px; font-family: var(--ex-serif); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.9); }
.ex-card time sup { font-size: .7em; }
@media (max-width: 640px) { .ex-cards { grid-template-columns: 1fr; } }
.ex-after { padding: 20px 0 var(--section-pad, 96px); }
.ex-after .story-nav { margin-top: 0; }
@media (min-width: 861px) {
  .site-header--twofold { background: rgba(255, 255, 255, 0.94); color: var(--ink); padding: 12px 0; box-shadow: 0 1px 0 var(--line); }
}
