/* ========== TOKENS ========== */
:root{
  --thames:#1A2735;
  --bone:#F3EBDD;
  --rust:#A14D3A;
  --sea:#4E6F6C;
  --iron:#222222;
  --slate:#6B7C8F;
  --maxw:1080px;
  --readw:760px;
  --radius:4px;

  /* default accent */
  --accent: var(--sea);
}

/* Per-issue accent mapping */
body{ --accent: var(--sea); }
body[data-issue="crime"]{ --accent: var(--rust); }
body[data-issue="industry"]{ --accent: var(--sea); }
body[data-issue="parks"]{ --accent: var(--sea); }
body[data-issue="shopping"]{ --accent: var(--iron); }
body[data-issue="maps"]{ --accent: var(--slate); }

*{
  box-sizing:border-box;
}

body{
  margin:0;
  background:var(--bone);
  color:var(--iron);
  font-family:"Georgia","Times New Roman",serif;
  line-height:1.7;
  text-rendering:optimizeLegibility;
  font-size:1.05rem;
}

img{
  max-width:100%;
  height:auto;
  display:block;
}

a{
  color:var(--sea);
  text-decoration:none;
}

a:hover{
  color:var(--rust);
}

/* Underline links in main story text and marginalia for legibility */
.story-body a,
.marginalia a{
  text-decoration:underline;
  text-decoration-thickness:1px;
}

/* ========== HEADER (BOTH PAGES) ========== */

.hero{
  background:var(--thames);
  color:#fff;
  text-align:center;
  padding: clamp(18px, 3vw, 36px) 20px;
}

.hero-inner{
  max-width:900px;
  margin:0 auto;
}

.logo{
  margin:0;
  display:inline-flex;
  align-items:baseline;
  gap:.06em;
  text-transform:lowercase;
  font-size: clamp(42px, 6.8vw, 84px);
  line-height:1;
  letter-spacing:.012em;
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-weight:900;
  color:#fff;
  text-decoration:none;
}

.logo .emoji{
  display:inline-block;
  line-height:1;
  font-size:.8em;
  transform:translateY(.05em);
  margin:0 .05em;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

.logo .emoji::before{
  content: attr(data-emoji);
}

.logo:hover{
  opacity:.9;
}

.hero .logo:hover{
  color: var(--accent);
}

.subtitle{
  margin-top:.3rem;
  font-family:"Georgia","Times New Roman",serif;
  font-style:italic;
  font-size: clamp(16px, 2.3vw, 22px);
  color:#f3ebdd;
  opacity:.95;
}

/* ========== HEADLINES (GLOBAL) ========== */
h1, h2, h3, h4 {
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  color: var(--thames);
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 .6rem;
}

/* ========== GENERIC LAYOUT HELPERS ========== */

.section{
  max-width:var(--maxw);
  margin:0 auto;
  padding:28px 22px;
}

.section:first-of-type{
  padding-bottom:14px;     /* was 28px */
}

.kicker{
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:700;
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  color:var(--thames);
  font-size:.9rem;
}

/* Used on index intro + headings */
.title{
  margin:.4rem 0 1rem;
  font-size:clamp(28px,4vw,40px);
}

.intro{
  max-width:70ch;
  font-size:1.08rem;
}

/* ========== ABOUT (INDEX) ========== */

.about{
  max-width:800px;
  margin:0 auto;
  padding-bottom: 6px;
/*  margin-bottom: 28px; same as .section top pad */
}

.about h2{
  margin:0 0 .4rem;
  font-size:clamp(26px,3.4vw,36px);
}

.about p{
  margin:0;
  font-size:clamp(18px, 2.2vw, 21px);
  line-height:1.6;
}

/* ========== FEATURE GRID (INDEX) ========== */

.grid{
  display:grid;
  gap:16px;
  margin-top:22px;
  grid-template-columns: repeat(12,1fr);
}

.card{
  grid-column:span 12;
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:var(--radius);
  padding:18px 18px 20px;
  display:flex;
  align-items:center;
  gap:18px;
  color:inherit;
  transition:background .2s ease, transform .2s ease, border-color .2s ease;
}

.card:hover{
  background:#fff;
  transform:translateY(-2px);
  border-color:rgba(0,0,0,.22);
}

.card.inactive{
  filter: grayscale(100%) brightness(85%);
  opacity: 0.45;
  pointer-events: none;
}

/* Large feature emojis (index cards) */
.emoji{
  font-size:48px;
  flex:0 0 auto;
  line-height:1;
}

.card h3{
  margin:.1rem 0 .25rem;
  font-size:1.18rem;
}

.card p{
  margin:0;
}

@media(min-width:820px){
  .feature{
    grid-column:span 4;
  }
}

/* ========== SPECIAL PROJECT (INDEX) ========== */

.special-project{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 22px 28px;
}

.special-project-card{
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: url("./special/birds.jpg") center/cover no-repeat;
  background-size: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  min-height: 300px;
  text-decoration: none;
  color: #fff;
  background-color: var(--sea);
}

/* dark overlay for readability */
.special-project-card::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(0px);
  z-index: 1;
}

.special-project-inner{
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 48px 32px;
}

.special-kicker{
  margin: 0 0 .4rem;
  font-size: 1.3rem;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
}

.special-text{
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
  color: #f3f3f3;
  font-family: "Georgia","Times New Roman",serif;
}

/* Hover */
.special-project-card:hover{
  transform: translateY(-2px);
  transition: transform .2s ease, filter .2s ease;
  filter: brightness(1.05);
}

/* ========== COMING UP TEASERS (INDEX) ========== */

.grid.teasers .tile{
  grid-column:span 12;
  background:#fff;
  border:1px dashed rgba(26,39,53,.3);
  border-radius:var(--radius);
  padding:16px 18px 18px;
  display:flex;
  align-items:center;
  gap:14px;
  color:inherit;
  transition:
    background .2s ease,
    transform .2s ease,
    border-color .2s ease,
    filter .2s ease;
}

/* active tiles: lightly grey by default */
.grid.teasers .tile:not(.inactive){
  filter:grayscale(40%);
}

/* hover only for active tiles */
.grid.teasers .tile:not(.inactive):hover{
  filter:grayscale(0%);
  background:#fff;
  transform:translateY(-2px);
  border-color:rgba(26,39,53,.5);
}

/* emoji + text */
.grid.teasers .emoji{
  font-size:42px;
  flex:0 0 auto;
  line-height:1;
}

.grid.teasers h4{
  margin:0;
  color:var(--thames);
  font-size:1.05rem;
}

.grid.teasers p{
  margin:.25rem 0 0;
}

/* layout on desktop */
@media(min-width:820px){
  .grid.teasers .tile{
    grid-column:span 4;
  }
}

/* truly inactive state */
.grid.teasers .tile.inactive{
  filter: grayscale(100%) brightness(85%) !important;
  opacity: 0.45;
  pointer-events: none;
}

.grid.teasers .tile.inactive h4,
.grid.teasers .tile.inactive p,
.grid.teasers .tile.inactive .emoji{
  color:#777;
}

/* Padding for index-page kickers */
main.section .kicker{
  margin: 24px 0 12px;   /* top | sides | bottom */
}

/* ========== NEIGHBOURS & MEDIA DIRECTORY (INDEX) ========== */

.footer-links{
  padding: 24px 22px 30px;
  /* no special background: inherit page bone colour */
  background:none;
}

.footer-links-inner{
  max-width:var(--maxw);   /* align with other .section blocks */
  margin:0 auto;
  display:grid;
  grid-template-columns:1fr;
  gap:20px;
}

@media (min-width: 820px){
  .footer-links-inner{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:24px;
  }
}

.footer-links-title{
  margin:0 0 .8rem;
  font-size:1.05rem;
  text-transform:uppercase;
  letter-spacing:.14em;
}

.footer-link-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:.4rem;
}

.footer-link-list li{
  margin:0;
}

.footer-link-list a{
  display:block;
  padding:.45rem .6rem .5rem;
  border-radius:var(--radius);
  background:#fff; /* white buttons */
  border:1px solid rgba(0,0,0,.08);
  text-decoration:none;
  color:var(--thames);
  font-size:.94rem;
  font-family:Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  transition:
    background .18s ease,
    border-color .18s ease,
    transform .18s ease;
}

.footer-link-list a:hover{
  background:#fff;
  border-color:rgba(0,0,0,.22);
  transform:translateY(-1px);
}

/* ========== PROMO CARDS (INDEX) ========== */

.section.promo-cards{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 22px 28px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

@media (min-width: 820px){
  .section.promo-cards{
    grid-template-columns:1fr 1fr;
  }
}

.promo-card{
  background:#fff;
  border:1px solid rgba(0,0,0,.12);
  border-radius:var(--radius);
  padding:24px 26px 28px;
}

.promo-about-layout{
  display:flex;
  align-items:flex-start;
  gap:16px;
  margin-top:0;
}

.promo-avatar{
  flex:0 0 auto;
  margin-top:0.8rem;
}

.promo-avatar img{
  width:72px;
  height:72px;
  max-width:none;
  border-radius:50%;
  object-fit:cover;
  display:block;
}

.promo-about-text{
  flex:1 1 auto;
}

@media (max-width: 600px){
  .promo-about-layout{
    flex-direction:column;
    align-items:flex-start;
  }
}

.promo-card a{
  text-decoration:underline;
  color:var(--sea);
}

.promo-card a:hover{
  color:var(--rust);
}

.promo-title{
  margin:.2rem 0 .6rem;
  font-size:1.35rem;
  font-family:Inter, system-ui, sans-serif;
  font-weight:700;
  color:var(--thames);
}

.promo-card p{
  margin:.3rem 0 0;
  font-size:1.02rem;
  line-height:1.7;
  font-family:"Georgia","Times New Roman",serif;
  color:var(--iron);
}

.promo-card:nth-of-type(2) > p{
  margin-top:0.9rem;
}

.promo-embed{
  margin-top:1.1rem;
  text-align:center; /* center the button */
}

.promo-subscribe-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  padding:.55rem 1.15rem .6rem;
  border-radius:var(--radius);

  background:var(--accent);
  color:#fff !important;
  border:1px solid rgba(0,0,0,.1);

  font-family:Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size:.95rem;
  font-weight:700;
  text-decoration:none !important;

  cursor:pointer;
  transition:
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.promo-subscribe-button:hover{
  background:color-mix(in srgb, var(--accent) 85%, white);
  transform:translateY(-1px);
  box-shadow:0 2px 4px rgba(0,0,0,.12);
}

.promo-subscribe-note{
  margin:.55rem auto 0;
  text-align:center;
  max-width:280px;
  font-size:.85rem;
  color:#666;
}

/* ========== ISSUE KICKER (ARTICLE PAGE) ========== */

.issue-kicker{
  max-width:var(--maxw);
  margin:0 auto;
  padding:8px 22px 0;
  text-align: center;
}

.issue-kicker .kicker a{
  color:inherit;
  text-decoration:none;
  transition:color .25s ease;
}

.issue-kicker .kicker a span{
  color:var(--accent);
}

.issue-kicker .kicker a:hover{
  color:var(--accent);
}

/* ========== ARTICLE LAYOUT (BRIDGE & OTHER STORIES) ========== */

main{
  max-width:var(--maxw);
  margin:0 auto;
  padding:20px 22px 48px;
}

main.section{
  padding-top:10px;        /* was 20px via `main { padding:20px 22px 48px; } */
}

.story{
  max-width:var(--readw);
  margin:0 auto;
}

.story-header{
  margin-bottom:1.8rem;
}

.story-kicker{
  margin:0 0 .25rem;
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  font-size:.9rem;
  text-transform:uppercase;
  letter-spacing:.16em;
  color:var(--accent);
}

.story-title{
  margin:.05rem 0 .6rem;
  font-size: clamp(30px, 4.4vw, 42px);
}

.story-dek{
  margin:0;
  font-style:italic;
  color:var(--sea);
  font-size:1.05rem;
}

/* Full-bleed hero image within article */
.hero-image{
  width:100vw;
  margin:1.8rem 0 1.6rem;
  position:relative;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;
}

.hero-image img{
  width:100%;
  height:min(80vh, 760px);
  object-fit:cover;
  display:block;
}

.hero-image figcaption{
  max-width:var(--readw);
  margin:.5rem auto 0;
  padding:0 22px;
  font-size:.9rem;
  color:#555;
}

/* Generic full-bleed figure (for timeline and other pages) */
.full-bleed{
  width:100vw;
  position:relative;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;
}

.full-bleed img{
  width:100%;
  height:min(80vh, 760px);
  object-fit:cover;
  display:block;
}

.full-bleed figcaption{
  max-width:var(--readw);
  margin:.5rem auto 0;
  padding:0 22px;
  font-size:.9rem;
  color:#555;
}

/* Story body text */
.story-body{
  font-size: clamp(1.05rem, 1.3vw + 0.9rem, 1.2rem);
  line-height:1.7;
  position:relative;
}

.story-body p{
  margin:1rem 0;
}

/* Generic reveal animation for scrollytelling elements */
.reveal{
  opacity:0;
  transform:translateY(40px);
  transition:opacity .8s ease-out, transform .8s ease-out;
  will-change:opacity, transform;
}

.reveal.is-visible{
  opacity:1;
  transform:translateY(0);
}

blockquote.pull{
  margin:1.4rem 0;
  padding:.9rem 1rem;
  border-left:3px solid var(--accent);
  font-style:italic;
  color:var(--thames);
  background:rgba(255,255,255,.45);
}

/* Inline (column-width) figures inside story body */
.story-body figure.inline-figure{
  margin:1.6rem auto;
  max-width:var(--readw);   /* stay in main column */
}

.story-body figure.inline-figure img{
  width:100%;
  height:auto;
  display:block;
}

.story-body figure.inline-figure figcaption{
  max-width:var(--readw);
  margin:.5rem auto 0;
  padding:0 22px;
  font-size:.9rem;
  color:#555;
  line-height:1.5;
}

/* ========== MARGINALIA (ARTICLE NOTES) ========== */

.marginalia{
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  font-size:.85rem;
  line-height:1.5;
  color:#555;
  margin:1.1rem 0;
}

.marginalia-label{
  text-transform:uppercase;
  letter-spacing:.12em;
  font-size:.72rem;
  font-weight:600;
  color:var(--accent);
  margin-bottom:.15rem;
}

/* Desktop: notes in outer right margin */
@media (min-width: 980px){
  .marginalia{
    float:right;
    clear:right;
    width:220px;
    margin: .2rem -260px 1.3rem 1.5rem;
    text-align:left;
  }
}

/* Mobile / tablet: inline notes */
@media (max-width: 979px){
  .marginalia{
    border-left:2px solid rgba(0,0,0,.2);
    padding-left:.75rem;
  }
}

/* Left marginalia pattern (for timeline years, etc.) */
@media (min-width: 980px){
  .marginalia-left{
    float:left;
    clear:left;
    width:220px;
    margin:.2rem 1.5rem 1.3rem -260px;
    text-align:right;
  }
}

/* Highlighted internal-link timeline notes */
.timeline-note--feature .note-body{
  background:#b14f2a;       /* rust */
  color:#fff;
  padding:.65rem .75rem .7rem;
  border-radius:4px;
  margin-top:.3rem;
}

/* Keep the label untouched */
.timeline-note--feature .marginalia-label{
  margin-bottom:.25rem;
}

/* Make links readable on rust */
.timeline-note--feature .note-body a{
  color:#fff;
  text-decoration:underline;
  text-decoration-thickness:2px;
}

.timeline-note--feature .note-body a:hover{
  text-decoration-color:rgba(255,255,255,.7);
}

/* ========== AUTHOR + REFERENCES (ARTICLE) ========== */

.story-end{
  margin-top:2.8rem;
  padding-top:1.7rem;
  border-top:1px solid rgba(0,0,0,.16);
  font-family: Inter, system-ui, sans-serif;
  font-size:.95rem;
  color:#444;
  background:none;
}

.story-end .byline{
  margin:0 0 .25rem;
  line-height:1.5;
  background:none;
}

.story-end .byline strong{
  color:var(--thames);
  font-weight:600;
}

.story-end .date{
  display:inline-block;
  margin-top:0;
  font-size:.85rem;
  color:#666;
}

/* references */
.refs{
  margin-top:1.2rem;
  padding:0;
  border:none;
  background:none;
}

.refs summary{
  cursor:pointer;
  font-weight:600;
  color:var(--thames);
  list-style:none;
  margin-bottom:.4rem;
  background:none;
}

.refs summary::-webkit-details-marker{
  display:none;
}

.refs summary::after{
  content:" ▼";
  font-size:.8em;
  opacity:.6;
}

.refs[open] summary::after{
  content:" ▲";
}

.refs ol{
  margin:.2rem 0 0 1.2rem;
  padding:0;
  background:none;
}

.refs li{
  margin:.3rem 0;
  background:none;
}

.byline-social{
  display:inline-flex;
  gap:12px;
  margin-left:12px;
  vertical-align:middle;
}

.byline-social a{
  display:inline-flex;
  align-items:center;
  opacity:0.8;
  transition: opacity .2s ease, transform .2s ease;
}

.byline-social a:hover{
  opacity:1;
  transform: translateY(-1px);
}

.svg-icon{
  width:20px;
  height:20px;
  fill: currentColor;
}

/* ========== MORE FROM THIS ISSUE (ARTICLE) ========== */

.more-issue{
  max-width:var(--readw);
  margin:3rem auto 0;
  padding-top:1.8rem;
  border-top:1px solid rgba(0,0,0,.12);
}

.more-kicker{
  text-transform:uppercase;
  letter-spacing:.14em;
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  font-size:.85rem;
  color:#555;
  margin:0 0 .25rem;
}

.more-title{
  margin:0 0 1.2rem;
  font-size:1.4rem;
}

.more-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

@media (min-width:720px){
  .more-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

.more-card{
  border-radius:var(--radius);
  border:1px solid rgba(0,0,0,.12);
  padding:14px 16px 16px;
  background:rgba(255,255,255,.6);
  display:flex;
  gap:10px;
  align-items:center;
  color:inherit;
  transition:background .2s ease, transform .2s ease, border-color .2s ease;
}

.more-card-emoji{
  font-size:26px;
  flex:0 0 auto;
}

.more-card h3{
  margin:.1rem 0 .25rem;
  font-size:1.02rem;
}

.more-card p{
  margin:0;
  font-size:.95rem;
  color:#444;
  font-family:"Georgia","Times New Roman",serif;
}

.more-card:hover{
  background:#fff;
  transform:translateY(-2px);
  border-color:rgba(0,0,0,.22);
}

/* ========== FOOTER (BOTH PAGES) ========== */

footer{
  background:var(--thames);
  color:#fff;
  padding:18px 22px;
}

.foot-wrap{
  max-width:var(--maxw);
  margin:0 auto;
  text-align:center;
  font-family: Inter, "Segoe UI", system-ui, -apple-system,
               "Helvetica Neue", Arial, sans-serif;
  font-size:.9rem;
}

.foot-wrap small{
  opacity:.95;
}

.foot-wrap a{
  color:#f3ebdd;
  text-decoration:underline;
  text-decoration-thickness:1px;
}

.foot-wrap a:hover{
  color:#fff;
}

.foot-wrap .emoji{
  font-size:1em;
  transform:translateY(.06em);
}

/* ========== GLOBAL SCROLL PROGRESS BAR (ALL CONTENT PAGES, NOT INDEX) ========== */

body:not([data-page="index"]) .scroll-progress{
  position:fixed;
  top:0;
  left:0;
  height:3px;
  width:100%;
  transform-origin:0 0;
  transform:scaleX(0);
  background:var(--accent);
  z-index:999;
  pointer-events:none;
}

/* ========== PREFERS REDUCED MOTION ========== */

@media (prefers-reduced-motion: reduce){
  *{transition:none !important;}
  body:not([data-page="index"]) .scroll-progress{
    display:none;
  }
}