/* ============================================================================
 *  styles.css  —  BROADSHEET DESIGN SYSTEM  (New York Times-inspired layout)
 * ----------------------------------------------------------------------------
 *  Warm newsprint, a readable serif editorial voice, and a three-column
 *  homepage grid: left rail (navigation & filters), centre well (stories),
 *  right rail (the photographer & contact). Rules are used sparingly.
 *  Re-skin the whole site from the CSS variables in :root.
 * ========================================================================== */

:root {
  --paper:      #f7f2e9;   /* warm newsprint background            */
  --paper-2:    #fbf8f3;   /* cards / panels                       */
  --ink:        #17140f;   /* near-black editorial ink             */
  --ink-soft:   #4a4237;   /* secondary text                       */
  --ink-faint:  #8a7f6d;   /* captions / metadata                  */
  --rule:       #211d16;   /* strong rule (used rarely)            */
  --rule-soft:  #d8ccb4;   /* hairline dividers                    */
  --accent:     #7a1e12;   /* oxblood red — kickers, links, badges */
  --accent-ink: #5c160d;

  --serif:   "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --head:    "Playfair Display", Georgia, "Times New Roman", serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --sans:    "Libre Franklin", "Helvetica Neue", Arial, sans-serif;

  --maxw: 1320px;
}

* { 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);
  line-height: 1.5;
  /* faint ink-on-paper grain */
  background-image:
    radial-gradient(rgba(122,30,18,0.015) 1px, transparent 1px),
    radial-gradient(rgba(23,20,15,0.02) 1px, transparent 1px);
  background-size: 3px 3px, 4px 4px;
  background-position: 0 0, 1px 1px;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ── Top utility bar ─────────────────────────────────────────────────────── */
.topbar {
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 22px; flex-wrap: wrap; }
.topbar .tb-group { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar b { color: var(--ink); font-weight: 600; }
.topbar .tb-site a { color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Masthead (no rules around the nameplate) ────────────────────────────── */
.masthead { text-align: center; padding: 26px 0 14px; }
.masthead-title {
  font-family: var(--serif);
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: clamp(2.1rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}
.masthead-title a { color: inherit; text-decoration: none; }
.masthead-title a:hover { color: var(--accent-ink); text-decoration: none; }
.masthead-motto {
  font-family: var(--sans);
  font-size: clamp(0.72rem, 1.6vw, 0.86rem);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  margin: 12px 0 0;
}

/* ── Primary navigation (tabs) ───────────────────────────────────────────── */
.nav {
  border-top: 2px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
}
.nav .wrap { display: flex; align-items: stretch; gap: 4px; flex-wrap: wrap; justify-content: center; }
.nav-tab {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: none; border: 0;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-tab:hover { color: var(--accent); }
.nav-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-tab .count { color: var(--ink-faint); font-weight: 400; font-size: 0.74rem; }

/* ── Three-column homepage layout ────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 280px;
  gap: 0;
  padding: 20px 0 40px;
}
.layout--about { grid-template-columns: 1fr; }
.rail-left  { padding-right: 22px; border-right: 1px solid var(--rule-soft); }
.center     { padding: 0 26px; min-width: 0; }
.rail-right { padding-left: 22px; border-left: 1px solid var(--rule-soft); }
.rail-left .sticky, .rail-right .sticky { position: sticky; top: 62px; }

.rail-heading {
  font-family: var(--sans);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.rail-block { margin-bottom: 26px; }

/* year timeline (vertical) */
.year-list { display: flex; flex-direction: column; gap: 1px; }
.year-btn {
  font-family: var(--serif); font-weight: 600; font-size: 0.98rem;
  text-align: left; background: none; border: 0; color: var(--ink-soft);
  padding: 5px 8px; cursor: pointer; border-radius: 2px; display: flex;
  justify-content: space-between; align-items: baseline; gap: 8px;
}
.year-btn:hover { background: rgba(122,30,18,0.06); color: var(--ink); }
.year-btn.is-active { background: var(--ink); color: #fff; }
.year-btn .n { font-family: var(--sans); font-size: 0.68rem; opacity: 0.7; }

/* outlet list */
.outlet-list { display: flex; flex-direction: column; gap: 0; }
.outlet-btn {
  font-family: var(--sans); font-size: 0.78rem; text-align: left;
  background: none; border: 0; color: var(--ink-soft); cursor: pointer;
  padding: 4px 2px; display: flex; justify-content: space-between; gap: 6px;
  border-bottom: 1px solid transparent;
}
.outlet-btn:hover { color: var(--accent); }
.outlet-btn.is-active { color: var(--accent); font-weight: 700; }
.outlet-btn .n { color: var(--ink-faint); font-weight: 400; }

/* ── Section header in the centre well ───────────────────────────────────── */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--rule); padding-bottom: 6px; margin-bottom: 20px;
}
.section-head h2 {
  font-family: var(--sans); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 0.92rem; margin: 0; color: var(--ink);
}
.section-head .count { font-family: var(--sans); font-size: 0.74rem; color: var(--ink-faint); }

/* shared kicker / badge */
.kicker {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint);
  display: flex; align-items: center; gap: 7px; margin-bottom: 7px; flex-wrap: wrap;
}
.outlet-badge { color: var(--accent); }
.kicker .dot { color: var(--rule-soft); }

/* ── Lead story (above the fold) ─────────────────────────────────────────── */
.lead { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid var(--rule-soft); }
.lead-figure {
  margin: 0; cursor: pointer; display: grid; grid-template-columns: 1.5fr 1fr;
  gap: 24px; align-items: start;
}
.lead-imgwrap { position: relative; overflow: hidden; background: #e7dcc7; }
.lead-img { width: 100%; height: auto; display: block; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.lead-figure:hover .lead-img { transform: scale(1.03); }
.lead-headline {
  font-family: var(--head); font-weight: 800; letter-spacing: -0.015em;
  font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.07; margin: 3px 0 12px;
}
.lead-figure:hover .lead-headline { color: var(--accent-ink); }
.dateline { font-family: var(--sans); font-size: 0.74rem; color: var(--ink-soft); margin: 0 0 12px; }
.dateline b { text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); }
.lead-excerpt { font-size: 1.06rem; line-height: 1.55; margin: 0 0 12px; }
.lead-excerpt::first-letter {
  font-family: var(--head); font-weight: 800; font-size: 3rem; float: left;
  line-height: .78; padding: 6px 10px 0 0; color: var(--accent-ink);
}
.byline { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-faint); margin: 0; }

/* ── Clippings grid (masonry, natural aspect ratios preserved) ───────────── */
.grid { columns: 3 250px; column-gap: 24px; }
.card {
  break-inside: avoid; margin: 0 0 24px; cursor: pointer;
  border-bottom: 1px solid var(--rule-soft); padding-bottom: 14px;
}
.card-imgwrap { position: relative; overflow: hidden; background: #e7dcc7; margin-bottom: 10px; }
/* height:auto keeps every tearsheet at its ORIGINAL aspect ratio */
.card-img { width: 100%; height: auto; display: block; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.card:hover .card-img { transform: scale(1.035); }
.card:hover .card-headline { color: var(--accent-ink); }
.card-headline {
  font-family: var(--head); font-weight: 700; font-size: 1.12rem; line-height: 1.16;
  margin: 2px 0 6px;
}
.card-meta { font-family: var(--sans); font-size: 0.7rem; color: var(--ink-faint); letter-spacing: 0.02em; margin: 0 0 6px; }
.card-summary { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }
.card .zoom-cue, .lead .zoom-cue {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; display: grid;
  place-items: center; border-radius: 999px; background: rgba(23,20,15,.72); color: #fff;
  font-size: 1rem; opacity: 0; transform: scale(.7); transition: all .2s;
}
.card:hover .zoom-cue, .lead-figure:hover .zoom-cue { opacity: 1; transform: scale(1); }

/* placeholder for images blocked by Drive sharing */
.img-failed { min-height: 180px; background: repeating-linear-gradient(45deg,#e7ddc9 0 12px,#ded2ba 12px 24px); position: relative; }
.img-failed::after {
  content: "Image unavailable — set Drive sharing to “Anyone with the link”";
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  font-family: var(--sans); font-size: 0.68rem; color: var(--ink-soft); padding: 12px;
}

/* ── Right rail: photographer & contact ──────────────────────────────────── */
.bio-card { background: var(--paper-2); border: 1px solid var(--rule-soft); padding: 18px; margin-bottom: 22px; }
.bio-name { font-family: var(--head); font-weight: 800; font-size: 1.3rem; margin: 0 0 3px; }
.bio-role { font-family: var(--sans); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin: 0 0 12px; }
.bio-card p { font-size: 0.9rem; line-height: 1.5; margin: 0 0 10px; color: var(--ink-soft); }
.bio-card p:last-child { margin-bottom: 0; }

.stat-row { display: flex; justify-content: space-between; text-align: center; margin-bottom: 22px; }
.stat { flex: 1; }
.stat + .stat { border-left: 1px solid var(--rule-soft); }
.stat-num { font-family: var(--head); font-weight: 800; font-size: 1.4rem; color: var(--accent-ink); line-height: 1; }
.stat-label { font-family: var(--sans); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); display: block; margin-top: 4px; }

.contact-block { font-family: var(--sans); font-size: 0.82rem; }
.contact-block .ci { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); align-items: baseline; }
.contact-block .ci:last-child { border-bottom: 0; }
.contact-block .ci .lab { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.64rem; width: 62px; flex-shrink: 0; padding-top: 2px; }
.contact-block .ci .val { color: var(--ink); word-break: break-word; }
.contact-block .ci .val a { color: var(--accent-ink); }
.btn-nyt {
  display: block; text-align: center; font-family: var(--sans); font-weight: 700;
  font-size: 0.8rem; background: var(--ink); color: #fff; padding: 10px; margin-top: 14px;
  border-radius: 2px; letter-spacing: 0.03em;
}
.btn-nyt:hover { background: var(--accent); text-decoration: none; }

/* ── "The Photographer" full panel ───────────────────────────────────────── */
.about-panel { max-width: 780px; margin: 0 auto; padding: 6px 0 30px; }
.about-panel h2 { font-family: var(--head); font-weight: 800; font-size: 2rem; margin: 0 0 4px; }
.about-panel .role { font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent); margin: 0 0 20px; }
.about-panel p { font-size: 1.08rem; line-height: 1.65; margin: 0 0 16px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 26px; }
.about-grid h3 { font-family: var(--sans); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; border-bottom: 2px solid var(--rule); padding-bottom: 6px; margin: 0 0 12px; }

/* ── Empty state & footer ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 50px 20px; font-family: var(--head); font-style: italic; color: var(--ink-faint); font-size: 1.1rem; }
.colophon { border-top: 2px solid var(--rule); padding: 20px 0 44px; text-align: center; font-family: var(--sans); font-size: 0.76rem; color: var(--ink-faint); }
.colophon a { color: var(--accent-ink); }

/* ── Lightbox / reader modal ─────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,12,8,.88); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; z-index: 2; background: var(--paper-2); max-width: 1120px; width: 100%;
  max-height: 92vh; overflow: auto; display: grid; grid-template-columns: 1.5fr 1fr;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: modal-in .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-imgcol { background: #14110b; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.modal-imgcol img { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; cursor: zoom-in; transition: transform .35s; }
.modal-imgcol img.is-zoomed { transform: scale(1.9); cursor: zoom-out; }
.modal-meta { padding: 26px 28px; position: relative; }
.modal-headline { font-family: var(--head); font-weight: 800; font-size: 1.55rem; line-height: 1.12; margin: 6px 0 14px; }
.modal-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-family: var(--sans); font-size: 0.82rem; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); padding: 14px 0; margin: 4px 0 16px; }
.modal-dl dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.66rem; padding-top: 2px; }
.modal-dl dd { margin: 0; color: var(--ink); }
.modal-summary { font-size: 1rem; margin: 0 0 20px; }
.modal-link { display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 0.84rem; color: #fff; background: var(--accent); padding: 9px 18px; border-radius: 2px; }
.modal-link:hover { background: var(--accent-ink); text-decoration: none; }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--rule-soft); background: var(--paper-2); color: var(--ink); font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: var(--ink); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0,1fr) 260px; }
  .rail-left { display: none; }   /* filters move into a disclosure on mobile */
  .center { padding-left: 0; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .rail-right { display: none; }
  .center { padding: 0; }
  .lead-figure { grid-template-columns: 1fr; gap: 16px; }
  .modal-panel { grid-template-columns: 1fr; }
  .modal-imgcol img { max-height: 46vh; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { .grid { columns: 1; } }

/* mobile filter bar (shown only when rails are hidden) */
.mobile-filters { display: none; }
@media (max-width: 1080px) {
  .mobile-filters { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; margin-bottom: 8px; border-bottom: 1px solid var(--rule-soft); }
  .mobile-filters select { font-family: var(--sans); font-size: 0.8rem; padding: 7px 10px; border: 1px solid var(--rule-soft); background: var(--paper-2); color: var(--ink); border-radius: 2px; }
}

@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; scroll-behavior: auto !important; } }
