/* =========================================================
   Tyler Stiem — faithful port of the Squarespace "Bedford" site.
   One family (Mulish, standing in for Proxima Nova), charcoal on white.
   ========================================================= */

:root {
  --ink:        #2b2b2b;   /* wordmark, headings, titles */
  --text:       #4d4d4d;   /* body copy */
  --muted:      #8c8c8c;   /* captions, word counts, inactive nav */
  --rule:       #e3e3e3;   /* hairline dividers */
  --bg:         #ffffff;

  --serif-read: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Mulish", "Helvetica Neue", Arial, sans-serif;

  --container: 1040px;
  --page-pad: clamp(1.25rem, 4vw, 2.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------------- header ---------------- */
.site-header {
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  padding: 1.9rem 2rem;
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.wordmark {
  font-weight: 700;
  font-size: clamp(1.1rem, 0.95rem + 0.4vw, 1.3rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.main-nav {
  display: flex;
  gap: clamp(1rem, 2.2vw, 1.9rem);
  align-items: baseline;
}
.main-nav a {
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle { display: none; }

/* ---------------- home hero ---------------- */
.hero {
  width: 100%;
}
.hero img {
  width: 100%;
  height: clamp(340px, 82vh, 920px);
  object-fit: cover;
  object-position: center;
}

/* ---------------- generic page container ---------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 5rem) var(--page-pad) clamp(4rem, 9vw, 7rem);
}
.page-title {
  font-weight: 700;
  font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

/* ---------------- section label (REPORTAGE & ESSAYS etc.) ---------------- */
.section-label {
  text-align: center;
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
}
.section-label__text {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.section-label__rule {
  width: 130px;
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 1.4rem auto 0;
}
.section-label:first-child { margin-top: 0; }

/* ---------------- story rows ---------------- */
.stories { list-style: none; margin: 0; padding: 0; }

.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
  border-bottom: 1px solid var(--rule);
}
.story:first-of-type { border-top: 0; }

.story__title {
  font-weight: 600;
  font-size: clamp(1.35rem, 1rem + 1.1vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 1rem;
}
.story__title a { text-decoration: none; }
.story__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.story__pub {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  margin: 0 0 0.9rem;
}
.story__pub a { text-decoration: none; }
.story__pub a:hover { text-decoration: underline; }

.story__blurb {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}
.story__blurb a { color: var(--ink); }
.story__count {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
}
.story__listen {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
  padding-bottom: 1px;
}
.story__listen:hover { border-color: var(--ink); }

.story__figure { margin: 0; }
.story__figure img {
  width: 100%;
  height: auto;
  background: #f2f2f2;
}
.story__credit {
  margin: 0.7rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Story with no image: let the text span full width, capped for readability */
.story--textonly { grid-template-columns: 1fr; }
.story--textonly .story__body { max-width: 62ch; }

/* ---------------- about ---------------- */
.about-body {
  max-width: 34rem;
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
}
.about-body p { margin: 0 0 1.5rem; }
.about-body a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
}
.about-body a:hover { border-color: var(--ink); }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2.25rem var(--page-pad);
  text-align: center;
}
.site-footer p {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------------- accessibility ---------------- */
:focus-visible { outline: 2px solid #2b2b2b; outline-offset: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem;
  font-size: 0.85rem; z-index: 20;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------------- responsive ---------------- */
@media (max-width: 720px) {
  .site-header__inner {
    justify-content: center;
    position: relative;
    padding-block: 1.15rem;
  }
  .wordmark { font-size: 1.15rem; letter-spacing: 0.14em; }

  .nav-toggle {
    display: inline-flex;
    position: absolute;
    left: var(--page-pad);
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 26px;
    height: 22px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 0;
  }
  .nav-toggle span {
    display: block; height: 2px; width: 100%; background: var(--ink);
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 0.25rem var(--page-pad) 1rem;
    z-index: 15;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a {
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--rule);
    font-size: 1rem;
  }
  .main-nav a:last-child { border-bottom: 0; }

  .story {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  /* photo above text on mobile, matching the stacked mobile layout */
  .story__figure { order: -1; }

  .about-body { font-size: 1.1rem; }
}

/* ---------------- long-form article (e.g. In Somalia's Shadow) ---------------- */
.article { max-width: 40rem; margin-inline: auto; }
.article__title {
  font-weight: 700;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 1.25rem;
}
.article__byline {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.75rem;
}
.article__byline .pub { color: var(--ink); }
.article__dek {
  font-weight: 300;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem);
  line-height: 1.4;
  color: var(--text);
  margin: 0 0 2.25rem;
}
.article__lead { margin: 0 0 2.5rem; }
.article__lead img { width: 100%; height: auto; }
.article__lead figcaption {
  margin-top: 0.7rem; font-size: 0.85rem; color: var(--muted);
}
.article__body { font-weight: 300; font-size: 1.15rem; line-height: 1.85; color: var(--text); }
.article__body p { margin: 0 0 1.5rem; }
.article__body .sc {
  font-variant: small-caps; font-weight: 700; letter-spacing: 0.03em; color: var(--ink);
}
.article__source {
  font-size: 0.95rem; color: var(--text); margin: 0 0 2.5rem;
}
.article__source a { color: var(--ink); border-bottom: 1px solid var(--muted); text-decoration: none; }
.article__source a:hover { border-color: var(--ink); }
.article__aside {
  margin: 2.25rem 0; padding-left: 1.1rem; border-left: 3px solid var(--rule);
  font-style: italic; color: var(--muted); font-size: 1.02rem;
}
.article__endnote {
  margin: 2.75rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  font-size: 0.95rem; font-style: italic; color: var(--muted);
}
.article__endnote a { color: var(--muted); border-bottom: 1px solid var(--rule); text-decoration: none; }
.article__endnote a:hover { color: var(--ink); }
.article__back {
  display: inline-block; margin-top: 3rem;
  font-weight: 600; font-size: 0.85rem; letter-spacing: 0.02em;
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--muted); padding-bottom: 2px;
}
.article__back:hover { border-color: var(--ink); }

/* ---------------- radio audio player ---------------- */
.story__audio { width: 100%; max-width: 440px; margin-top: 0.6rem; height: 40px; }

/* ================ long-form article: two-column, serif, sticky image ============ */
.longform {
  --serif-read: "EB Garamond", Georgia, "Times New Roman", serif;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  font-family: var(--serif-read);
}
.longform__text {
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem) clamp(4rem, 8vw, 7rem);
  max-width: 40rem;
  margin-left: auto;
  width: 100%;
}
.longform__media {
  position: relative;
  align-self: stretch;
  background: #111;
}
.longform__media img {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: center;
}

.lf__title {
  font-family: var(--serif-read);
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 1.25rem;
}
.lf__dek {
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.42;
  color: #333;
  margin: 0 0 1.75rem;
}
.lf__by {
  display: block;
  margin-top: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.9em;
}
.lf__source {
  font-size: 1.05rem;
  color: #333;
  margin: 0 0 3rem;
}
.lf__source a { color: var(--ink); text-decoration: none; border-bottom: 1px solid #b5b5b5; }
.lf__source a:hover { border-color: var(--ink); }

.lf__body { font-size: clamp(1.12rem, 1rem + 0.4vw, 1.28rem); line-height: 1.72; color: #232323; }
.lf__body p { margin: 0 0 1.5rem; }
.lf__body .sc { font-variant: small-caps; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.lf__aside {
  margin: 2.25rem 0; padding-left: 1.1rem; border-left: 3px solid var(--rule);
  font-style: italic; color: #666;
}
.lf__endnote {
  margin: 3rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  font-size: 1rem; font-style: italic; color: #666;
}
.lf__endnote a { color: #666; border-bottom: 1px solid var(--rule); text-decoration: none; }
.lf__endnote a:hover { color: var(--ink); }
.lf__back {
  display: inline-block; margin-top: 2.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.82rem;
  letter-spacing: 0.02em; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--muted); padding-bottom: 2px;
}
.lf__back:hover { border-color: var(--ink); }

@media (max-width: 820px) {
  .longform { grid-template-columns: 1fr; }
  .longform__media { order: -1; }
  .longform__media img { position: static; height: auto; max-height: 70vh; }
  .longform__text { margin: 0 auto; }
}

/* ---------------- homepage: full-height banner, no footer, no whitespace ---------------- */
body.home {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@supports (height: 100dvh) {
  body.home { height: 100dvh; }   /* hugs the true bottom on mobile browsers */
}
body.home .site-header { flex: 0 0 auto; }
body.home main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
body.home .hero { flex: 1 1 auto; min-height: 0; width: 100%; }
body.home .hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}


/* ---------------- unlisted single-column serif essay (e.g. /helen) ---------------- */
.essay {
  max-width: 42rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) var(--page-pad) clamp(4rem, 8vw, 7rem);
  font-family: var(--serif-read);
}
.essay__lead { margin: 0 0 2.25rem; }
.essay__lead img { width: 100%; height: auto; }
.essay__lead figcaption { margin-top: 0.7rem; font-size: 0.92rem; font-style: italic; color: var(--muted); }
.essay__title {
  font-family: var(--serif-read);
  font-weight: 600; font-variant: small-caps; letter-spacing: 0.05em;
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem); line-height: 1.1;
  color: var(--ink); margin: 0 0 1.5rem;
}
.essay__body { font-size: clamp(1.12rem, 1rem + 0.4vw, 1.28rem); line-height: 1.72; color: #232323; }
.essay__body p { margin: 0 0 1.5rem; }
.essay__note {
  margin: 2rem 0; padding: 1rem 1.25rem; border-left: 3px solid var(--muted);
  background: #f6f6f4; font-family: var(--sans); font-size: 0.95rem; color: var(--text);
}
