/* style.css — GLOBAL + UNIVERSAL ARTICLE STYLES
   (about.html desktop styles inline in about.html; index.html desktop styles inline in index.html)
   Section & Article keep both web+mobile here. Index/About mobile overrides live here. */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Playfair+Display:wght@700&display=swap');
@font-face{
  font-family:'Filmotype Maxwell';
  src:url('FilmotypeMaxwell.otf') format('opentype');
  font-weight:normal;font-style:normal;font-display:swap;
}
@font-face{
  font-family:'JMHTypewriter';
  src:
    url('fonts/JMHTypewriter.ttf') format('truetype'),
    url('fonts/JMHTypewriter.otf') format('opentype');
  font-weight:normal; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'GillSansNova-CnBold';
  src:
    url('fonts/GillSansNova-CnBold.ttf') format('truetype');
  font-weight:normal; font-style:normal; font-display:swap;
}

/* Vars */
:root{
  --font-sans:'Georgia',serif;
  --font-serif:'Georgia',serif;
  --font-logo:'Filmotype Maxwell','Georgia',serif;
  --font-folio:'JMHTypewriter',serif;
  --font-folio-2:'GillSansNova-CnBold',serif;

  --color-bg:#fff; --color-text:#111; --color-border:#606a97;
  --color-subtle:#666;

  --nav-bg:#000;
  --nav-glow:rgba(255,255,255,.30);

  --header-height:96px;
  --header-height-shrink:74px;
  --folio-h:36px;

  --mobile-menu-bg: rgba(25, 25, 30, 0.6);
}

/* Global layout */
html,body{height:100%}
body{
  margin:0; color:var(--color-text); background:var(--color-bg); line-height:1.7; font-family:var(--font-serif);
  display:flex; flex-direction:column; position:relative;
}
/* Subtle paper texture */
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;
  background-image:url('https://www.shutterstock.com/image-photo/old-newspaper-background-blank-grunge-600nw-2479887711.jpg');
  background-size:cover;background-position:center;opacity:.05;z-index:-1
}

/* Links */
a,a:visited{color:inherit;text-decoration:none}

/* Media safety */
html { overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* Section page images (global use) */
.section-page img{
  max-width:100%;height:auto;max-height:60vh;object-fit:contain;border:1px solid var(--color-border)
}

/* Footer baseline */
.site-footer-main{flex-shrink:0; margin-top:auto; background:transparent}

/* ----------------------------- */
/* UNIVERSAL ARTICLE STYLES      */
/* ----------------------------- */
.article-full{
  --article-width: min(1000px, 92vw);
  --article-measure: min(72ch, 92vw);
  padding: 1rem;
}
@media (min-width: 1024px){
  .article-full{ padding: 2rem 1.5rem; }
}
.article-header{
  max-width: var(--article-width);
  margin: 0 auto 1rem auto;
}
.article-kicker{
  font-size: .82rem;
  letter-spacing:.04em;
  text-transform:uppercase;
  color: var(--color-subtle);
  margin-bottom: .35rem;
  text-align:center;
}
.article-headline{
  font-family: var(--font-logo);
  font-weight: 400;
  line-height: 1.1;
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin: 0 0 .6rem 0;
}
.article-sub-headline{
  font-family: var(--font-logo);
  font-weight: 400;
  line-height: 1;
  font-size: clamp(1rem, 3vw, 2rem);
  text-align: center;
  margin: 0 0 .6rem 0;
}
.article-byline{
  font-family: var(--font-sans);
  text-align: center;
  margin: 0 0 .8rem 0;
  color: var(--color-text);
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
}
.article-excerpt{
  text-align: center;
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  margin: 0 0 1.1rem 0;
  color: var(--color-subtle);
}
.article-featured-image{
  max-width: var(--article-width);
  margin: 0 auto 1.25rem auto;
}
.article-featured-image img{
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  background: #f9f9f9;
}
.article-featured-image figcaption{
  font-size: .9rem;
  color: var(--color-subtle);
  margin-top: .35rem;
}

.article-body{
  max-width: var(--article-width);
  margin: 0 auto 4rem auto;
  font-size: clamp(1rem, 1.7vw, 1.1rem);
}
.article-body p{
  max-width: var(--article-measure);
  margin: 0 auto 1.05rem auto;
}
.article-body blockquote{
  max-width: var(--article-measure);
  margin: 1.25rem auto;
  padding: .75rem 1rem;
  border-left: 3px solid #000;
  background: #fafafa;
  font-style: italic;
}
.article-body h2, .article-body h3{
  max-width: var(--article-measure);
  margin: 2rem auto 1rem auto;
  line-height: 1.2;
}
.meta-row{
  max-width: var(--article-width);
  margin: .5rem auto 1rem;
  color: var(--color-subtle);
  font-size: .95rem;
}

/* ---------------------------------------------- */
/* INDEX PAGE (desktop styles inline in index.html; we add safe tweaks) */
/* ---------------------------------------------- */

/* Center the cover on mobile */
@media (max-width:1023px){
  body.index-page .issue-cover{
    display:flex !important;
    justify-content:center !important;
    align-items:center !important;
    text-align:center;
  }
  body.index-page .issue-cover img{ margin:0 auto; display:block; }
}

/* TOC: remove group borders; keep black rule only on each toc-title */
body.index-page .toc-group{ border-bottom:none !important; }
body.index-page .toc-title{
  border-bottom:1px solid #000 !important;
  padding-bottom:.35rem; margin-bottom:.5rem;
}
body.index-page .issue-toc li{ border-bottom:none !important; }

/* ========================================================= */
/* ===============  SECTION PAGE (web + mobile)  =========== */
/* ========================================================= */

/* Base (desktop & tablet) */
.section-header{
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  margin: 0 auto 1rem auto;
  max-width: min(1200px, 75vw);
}
.section-header h1{
  font-family: var(--font-logo);
  font-weight: 400;
  margin: 0 0 .35rem 0;
  font-size: clamp(1.8rem, 3vw, 2rem);
}
.section-header p{ margin:0; color: var(--color-subtle) }

.article-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: min(1200px, 94vw);
  margin: 0 auto 2rem auto;
}

/* Card (desktop/web) */
.article-card{
  display:block;
  border:none;                 /* no full card border on web */
  border-radius: 0;
  overflow:visible;
  background:#fff;
  transition: none;
}
/* No jump on hover; italicize title only */
@media (min-width:1024px){
  .article-card:hover{ transform:none !important; }
  .article-card:hover .article-card-title{ font-style: italic; }
}

.article-card img{ width:100%; height:auto; display:block; border:none; }
.article-card-title{
  margin: .6rem .85rem .25rem .85rem;
  font-family: var(--font-sans);
  font-size: 1.05rem;
}
.article-card-sub-title {
  margin: 0 .85rem .60rem .8rem;
  font-size: clamp(1rem, 2vw, 1rem);
  line-height: 1;
}
.article-card-excerpt{
  margin: 0 .85rem .65rem .85rem;
  color: var(--color-subtle);
  font-size: 0.4rem;
  line-height: 1.3;
}
.article-card-byline{
  margin:0 .85rem .85rem .85rem;
  color: var(--color-subtle);
  font-size:.95rem;
}

/* ===== Mobile overrides for SECTION page (your new requests) ===== */
@media (max-width:1023px){
  .article-grid{
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: .9rem;
    margin-bottom: 1.5rem;
  }

  /* 1) Each card has a bottom border except the last */
  .article-card{
    border-bottom:1px solid #000 !important;
    padding-bottom: 1rem;      /* ensures the border is visible below text */
  }
  .article-card:last-child{ border-bottom:none !important; }

  /* 2) Image spans full width WITH border; NO padding around the image */
  .article-card img{
    width:100% !important;
    border:1px solid #000 !important;
    margin:0; padding:0; box-sizing:border-box;
  }

  /* 3) Typography tweaks:
        - Title a bit bigger
        - Subtitle = Excerpt size
        - Excerpt & Subtitle a bit smaller than before
        - Title sits right under the image (no top gap) */
  .article-card-title{
    font-size: 1rem;      /* slightly bigger than desktop */
    margin: 0 1rem .25rem 1rem;   /* top=0 so it kisses the image */
  }
  .article-card-subtitle,
  .article-card-excerpt{
    font-size: .6rem;       /* a bit smaller */
    margin: 0 1rem .6rem 1rem;
  }
  .article-card-byline{
    font-size: .9rem;
    margin: 0 1rem 1rem 1rem;
  }
}

/* ========================================================= */
/* ===============  ARTICLE PAGE (web + mobile)  =========== */
/* ========================================================= */
@media (min-width:1024px){
  .article-featured-image{ margin-bottom: 1.5rem; }
  .article-body{ margin-bottom: 5rem; }
}
@media (max-width:1023px){
  .article-full{ padding: 1rem .9rem; }
  .article-featured-image{ margin: 0 auto 1rem auto; }
  .article-excerpt{ margin-bottom: .9rem; }
  .article-body p{ margin-bottom: .95rem; }
}

/* ========================================================= */
/* =======  INDEX & ABOUT — MOBILE ONLY IN THIS FILE  ======= */
/* ========================================================= */

/* INDEX (mobile only here; desktop stays inline in index.html) */
@media (max-width:1023px){
  body.index-page .site-main{ padding: 1rem .9rem; }
  body.index-page .issue-content{ grid-template-columns: 1fr; gap: 1rem !important; }
  body.index-page .issue-cover img{ max-height: 55vh !important; object-fit: contain !important; }
  body.index-page .issue-toc h3{ margin-bottom: .5rem; }
  body.index-page .mission-statement{ margin-top: 1rem; }
  body.index-page .mission-statement h2{ font-size: 1.4rem; }
}

/* ABOUT (mobile only here; desktop stays inline in about.html) */
@media (max-width:1023px){
  .about-wrap{ padding: 1rem .9rem !important; }
  .about-grid{ display:flex; flex-direction:column; gap:1.25rem !important; }
  .section-header h1{ font-size: clamp(1.8rem, 6vw, 2.1rem) !important; }
  .about-mission p{ font-size: 1rem !important; line-height: 1.8 !important; }
  .masthead-section h2{ font-size: 1.15rem !important; }
}

/* Tiny screens */
@media (max-width:420px){
  .article-card-title{ font-size: 1.02rem; } /* maintain slight bump */
  .article-card-byline{ font-size: .88rem; }
}

/* =========================================================
   EMBEDDED MEDIA THAT LINES UP WITH TEXT
   - Use var(--article-measure) so photos share the same left/right
     bounds as paragraphs (flush edges).
   - Featured image remains on var(--article-width); everything else below
     opts into var(--article-measure).
   ========================================================= */

/* A) Single embedded figure that aligns with text */
.article-body figure.figure-embed{
  max-width: var(--article-measure);
  margin: 1.1rem auto;         /* centered within the text column */
}
.article-body figure.figure-embed img{
  width: 100%; height: auto; display: block;
  border: 1px solid var(--color-border);
  background: #f9f9f9;
}
.article-body figure.figure-embed figcaption{
  font-size: .9rem; color: var(--color-subtle); margin-top: .35rem;
}

/* B) Portrait with text wrap — keep the container on the text column width */
.wrap-portrait{
  max-width: var(--article-measure);
  margin: 1.25rem auto;
}
.wrap-portrait .photo-left,
.wrap-portrait .photo-right{
  width: min(44%, 320px);
  margin: 0 var(--gutter, 18px) var(--gutter, 18px) 0;
  float: left;
  shape-outside: inset(0 round 6px);
  shape-margin: 6px;
}
.wrap-portrait .photo-right{
  float: right;
  margin: 0 0 var(--gutter, 18px) var(--gutter, 18px);
}
.wrap-portrait figure{ margin: 0; }
.wrap-portrait img{
  width: 100%; height: auto; display: block;
  border: 1px solid var(--color-border); background: #f9f9f9;
}
.wrap-portrait::after{ content:""; display:block; clear:both; }

/* C) Side-by-side (photo + text) constrained to the text column */
.media-side.within-text{
  max-width: var(--article-measure);
  margin: 1.25rem auto;
  display: grid;
  grid-template-columns: minmax(200px, 40%) 1fr; /* portrait-friendly */
  gap: clamp(12px, 2vw, 20px);
  align-items: start;
}
.media-side.within-text.reverse{
  grid-template-columns: 1fr minmax(200px, 40%);
}
.media-side.within-text figure{ margin: 0; }
.media-side.within-text .text > *{ margin: 0 0 1rem 0; }

/* Optional seam alignment + equal heights (use with .seam, .equal-height) */
.media-side.within-text.seam{ gap: 0; --col-inset: clamp(10px, 1.8vw, 18px); }
.media-side.within-text.seam:not(.reverse) figure{ padding-right: var(--col-inset); }
.media-side.within-text.seam:not(.reverse) .text { padding-left:  var(--col-inset); }
.media-side.within-text.seam.reverse figure{ padding-left: var(--col-inset); }
.media-side.within-text.seam.reverse .text  { padding-right: var(--col-inset); }

.media-side.within-text.equal-height{ align-items: stretch; }
.media-side.within-text.equal-height figure,
.media-side.within-text.equal-height .text{
  height: 100%; display:flex; flex-direction:column; box-sizing:border-box;
}
.media-side.within-text.equal-height figure img{
  width: 100%; height: 100%; object-fit: cover; /* use .no-crop to preserve */
}
.media-side.within-text.equal-height.no-crop figure img{ object-fit: contain; background:#fff; }

/* D) Two-up and three-up galleries also constrained to text column */
.photo-duo.narrow,
.photo-trio.narrow{
  max-width: var(--article-measure);
  margin: 1.25rem auto;
}
.photo-duo.narrow{ display:grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 20px); }
.photo-trio.narrow{ display:grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 20px); }
.photo-duo.narrow figure,
.photo-trio.narrow figure{ margin:0; }
.photo-duo.narrow img,
.photo-trio.narrow img{ width:100%; display:block; border:1px solid var(--color-border); background:#f9f9f9; }

/* Mobile behavior: stack & breathe */
@media (max-width: 900px){
  .media-side.within-text,
  .media-side.within-text.reverse{ grid-template-columns: 1fr; }
  .media-side.within-text.seam{ gap: var(--col-inset); }
  .media-side.within-text.seam figure,
  .media-side.within-text.seam .text{ padding: 0; }
}
@media (max-width: 700px){
  .wrap-portrait .photo-left,
  .wrap-portrait .photo-right{ float:none; width:100%; margin: 0 0 .75rem 0; }
  .photo-duo.narrow{ grid-template-columns: 1fr; }
}
@media (max-width: 600px){
  .photo-trio.narrow{ grid-template-columns: 1fr; }
}

/* ===== STRICT FLUSH HELPERS (align with article paragraph column) ===== */

/* For side-by-side blocks already using .within-text (max-width: var(--article-measure)) */
.media-side.within-text.strict-flush{
  gap: 0;                     /* photo + text meet at the grid seam */
}
.media-side.within-text.strict-flush .text > *{
  /* ensure copy hugs the column edge; no extra auto-centering */
  margin-left: 0;
  margin-right: 0;
}

/* If you combine with .seam, kill any inset so it stays perfectly flush */
.media-side.within-text.strict-flush.seam{
  --col-inset: 0;
}

/* Wrapped portrait block aligned to the same measure as paragraphs */
.wrap-portrait.strict-flush{
  max-width: var(--article-measure);
  margin-left: auto;
  margin-right: auto;
}
.wrap-portrait.strict-flush p{
  margin-left: 0;
  margin-right: 0;
}

/* Make sure the *outer* edge of a left-floating photo sits on the same x-axis as text */
.wrap-portrait.strict-flush .photo-left{  margin-left: 0; }   /* image’s left edge = paragraph left edge */
.wrap-portrait.strict-flush .photo-right{ margin-right: 0; }  /* text’s left edge = paragraph left edge */

/* Safety: figures/columns respect padding without growing */
.media-side figure,
.media-side .text,
.wrap-portrait figure{ box-sizing: border-box; }

