/* ------------------------------------------------------------------
   The Margin — student magazine mockup
   Neutral placeholder branding. New Yorker–inspired editorial system.
   ------------------------------------------------------------------ */

:root {
  --paper:  #FBF8F1;
  --paper2: #F3EEE1;
  --panel:  #ECE6D7;
  --ink:    #1c1f26;
  --navy:   #16243F;
  --navy2:  #24355a;
  --gold:   #B08D3C;
  --rule:   #d6cdb6;
  --muted:  #5b6068;
  --kicker: #7a3b2e;   /* brick red for topic kickers */
  --desk:   #E4DAC4;   /* deeper parchment the "page" sits on */
  --maxw:   1240px;
  --sheet:  1320px;    /* width of the paper sheet behind content */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font-family: 'Spectral', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The reader pages sit on a centered "sheet" of paper; the desk shows at the
   edges on wide screens so the gutters read as an intentional margin, not void.
   On screens narrower than the sheet, the sheet is full-bleed (no gutters). */
body.reader { position: relative; }
body.reader::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 50%;
  width: min(100%, var(--sheet));
  transform: translateX(-50%);
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(22,36,63,.05), 0 18px 60px rgba(22,36,63,.10);
  z-index: -1;
}

/* Subtle paper grain over the whole reading surface — adds warmth and craft
   without leaning the palette lighter or darker. */
body.reader::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .12;
  mix-blend-mode: multiply;
}

/* The cover and the browse pages (issues/topics/writers/saved) are full-bleed
   paper with no desk frame; only the reading pages keep the centered sheet. */
body.reader.home, body.reader.wide { background: var(--paper); }
body.reader.home::before, body.reader.wide::before { display: none; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ---------- Utility top bar ---------- */
.utility {
  background: var(--navy);
  color: #EBD9A8;
  font-family: 'Spectral', serif;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.utility .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 42px;
}
.utility nav { display: flex; gap: 6px; }
.utility nav a { opacity: .9; padding: 5px 11px; border-radius: 4px; transition: background .18s ease, color .18s ease, opacity .18s ease; }
.utility nav a:hover { opacity: 1; background: var(--gold); color: var(--navy); }
.utility nav a.active { opacity: 1; background: rgba(176,141,60,.2); color: #F2E4BE; }
.signin {
  border: 1px solid var(--gold);
  color: #EBD9A8;
  padding: 4px 14px;
  border-radius: 3px;
  font-size: 11px;
  transition: background .15s;
}
.signin:hover { background: rgba(176,141,60,.18); }

/* Mobile menu (pure-CSS checkbox toggle; hidden on desktop) */
.navtog-input { display: none; }
.navtoggle {
  display: none;
  background: transparent; border: 1px solid var(--gold); color: #EBD9A8;
  width: 40px; height: 32px; border-radius: 4px; font-size: 17px; line-height: 1;
  cursor: pointer; align-items: center; justify-content: center;
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding: 30px 0 16px; }
.masthead .eyebrow {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold);
}
.masthead .logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--navy);
  margin: 8px 0 6px;
}
.masthead .issueline {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); font-style: italic; font-size: 15px;
}
.masthead .issueline span.rule { width: 60px; height: 1px; background: var(--gold); }

.hr-double {
  border: 0; border-top: 2px solid var(--navy); border-bottom: 1px solid var(--navy);
  height: 4px; max-width: var(--maxw); margin: 6px auto 0;
}
.hr-double.inset { margin: 6px 28px 0; }

/* ---------- Topic kicker ---------- */
.kicker {
  font-family: 'Spectral', serif;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--kicker); font-weight: 500;
}

/* ---------- Headlines ---------- */
.h-display {
  font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy);
  line-height: 1.1; letter-spacing: .005em;
}
.dek { font-style: italic; color: var(--muted); }
.byline { font-size: 13px; color: #7a7f87; letter-spacing: .02em; }

/* ---------- Homepage feature grid ---------- */
.lead-grid {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 34px;
  padding: 30px 0 10px;
}
.lead .art {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 3px;
  aspect-ratio: 16 / 8; display: flex; align-items: center; justify-content: center;
  color: #9c8f6e; font-style: italic; font-size: 13px; margin-bottom: 16px;
}
.lead .h-display { font-size: clamp(28px, 4.4vw, 44px); margin: 10px 0; }
.lead .dek { font-size: 18px; margin-bottom: 14px; }
.lead p.body { font-size: 16px; line-height: 1.62; }
.lead .dropcap::first-letter {
  font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy);
  font-size: 3.4em; line-height: .82; float: left; padding: 6px 10px 0 0;
}

.rail { border-left: 1px solid var(--rule); padding-left: 30px; display: flex; flex-direction: column; gap: 22px; }
.rail .item { border-top: 1px solid var(--rule); padding-top: 18px; }
.rail .item:first-child { border-top: 0; padding-top: 0; }
.rail .item h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 21px; line-height: 1.18; margin: 6px 0; }
.rail .item.verse p { font-style: italic; font-size: 17px; color: var(--navy); margin: 6px 0; line-height: 1.4; }

a.card-link:hover h3, a.card-link:hover .h-display { color: var(--navy2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Secondary story strip ---------- */
.section-head {
  display: flex; align-items: baseline; gap: 14px; margin: 38px 0 18px;
}
.section-head h2 {
  font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy);
  font-size: 22px; margin: 0; white-space: nowrap;
}
.section-head .line { flex: 1; height: 1px; background: var(--rule); }

.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding-bottom: 10px; }
.story { }
.story .art { background: var(--panel); border: 1px solid var(--rule); border-radius: 3px; aspect-ratio: 4/3; margin-bottom: 12px; display:flex; align-items:center; justify-content:center; color:#9c8f6e; font-style:italic; font-size:12px; }
.story h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 20px; line-height: 1.16; margin: 8px 0 6px; }
.story .dek { font-size: 14px; margin-bottom: 8px; }

/* ---------- Article reading view ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 26px 0 10px; }
.article .kicker { display: block; margin-bottom: 14px; }
.article h1 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: clamp(32px, 5vw, 50px); line-height: 1.08; margin: 0 0 16px; }
.article .dek { font-size: 21px; margin-bottom: 20px; }
.article .meta { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.article .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #EBD9A8; display:flex; align-items:center; justify-content:center; font-family:'Playfair Display',serif; font-weight:700; font-size:16px; }
.article .meta .who { font-size: 14px; }
.article .meta .who b { color: var(--navy); font-weight: 600; }
.article .hero { background: var(--panel); border:1px solid var(--rule); border-radius: 3px; aspect-ratio: 16/9; margin-bottom: 26px; display:flex; align-items:center; justify-content:center; color:#9c8f6e; font-style:italic; }
.article p { margin: 0 0 20px; }
.article p.lede::first-letter,
.article p.dropcap::first-letter {
  font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy);
  font-size: 3.6em; line-height: .8; float: left; padding: 8px 12px 0 0;
}
.article blockquote {
  margin: 28px 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold);
  font-family: 'Playfair Display', serif; font-style: italic; color: var(--navy);
  font-size: 24px; line-height: 1.3;
}
.article h2.sub { font-family:'Playfair Display',serif; color: var(--navy); font-size: 24px; margin: 34px 0 12px; }
.endmark { text-align: center; color: var(--gold); margin: 30px 0 0; letter-spacing: .4em; }

/* verse */
.poem { font-family:'Spectral',serif; font-size: 19px; line-height: 1.75; color: var(--ink); white-space: pre-line; }
.poem .title { font-family:'Playfair Display',serif; font-weight:700; color:var(--navy); font-size: 28px; margin: 28px 0 6px; white-space: normal; }

/* ---------- Generic page header ---------- */
.page-head { text-align: center; padding: 30px 0 10px; }
.page-head .kicker { display:block; margin-bottom: 8px; }
.page-head h1 { font-family:'Playfair Display',serif; font-weight:700; color:var(--navy); font-size: clamp(30px,5vw,46px); margin: 0 0 8px; }
.page-head p { color: var(--muted); font-style: italic; max-width: 560px; margin: 0 auto; }

/* ---------- Issues ---------- */
.issue-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 28px; padding: 26px 0; }
.issue-card { border:1px solid var(--rule); background:#fff; border-radius: 4px; overflow:hidden; transition: transform .15s, box-shadow .15s; }
.issue-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(22,36,63,.10); }
.issue-card .cover { background: var(--navy); color:#EBD9A8; aspect-ratio: 3/4; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding: 20px; }
.issue-card .cover .no { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); }
.issue-card .cover .name { font-family:'Playfair Display',serif; font-weight:900; font-size: 30px; margin: 10px 0; line-height:1; }
.issue-card .cover .theme { font-style: italic; opacity:.9; }
.issue-card .foot { padding: 14px 16px; }
.issue-card .foot .date { font-size: 13px; color: var(--muted); }
.issue-card .foot .count { font-size: 13px; color: var(--kicker); letter-spacing:.06em; }
.issue-card.soon { opacity: .55; }
.issue-card.soon .cover { background: var(--panel); color: var(--muted); }
.issue-card.soon .cover .name, .issue-card.soon .cover .no { color: var(--muted); }

/* ---------- Topics ---------- */
.topic-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 20px; padding: 26px 0; }
.topic { border:1px solid var(--rule); border-radius:4px; background:#fff; padding: 22px; transition: border-color .15s, transform .15s; }
.topic:hover { border-color: var(--gold); transform: translateY(-2px); }
.topic .ico { font-size: 26px; color: var(--gold); }
.topic .subj { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--kicker); margin: 12px 0 1px; }
.topic h3 { font-family:'Playfair Display',serif; color: var(--navy); font-size: 22px; margin: 12px 0 6px; }
.topic .subj + h3 { margin-top: 2px; }
.topic p { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.topic .n { font-size: 12px; letter-spacing:.14em; text-transform:uppercase; color: var(--kicker); }

/* ---------- Writers ---------- */
.team-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 26px; padding: 26px 0; }
.writer { text-align:center; }
.writer .pic { width: 96px; height: 96px; border-radius:50%; margin: 0 auto 14px; background: var(--navy); color:#EBD9A8; display:flex; align-items:center; justify-content:center; font-family:'Playfair Display',serif; font-weight:700; font-size: 30px; }
.writer h3 { font-family:'Playfair Display',serif; color: var(--navy); font-size: 21px; margin: 0 0 2px; }
.writer .role { font-size: 12px; letter-spacing:.14em; text-transform:uppercase; color: var(--kicker); margin-bottom: 10px; }
.writer p { font-size: 14px; color: var(--muted); margin: 0 auto; max-width: 260px; }
.writer .links { margin-top: 10px; font-size: 13px; color: var(--navy); font-style: italic; }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: #cdbf9a; margin-top: 54px; }
footer .wrap { padding: 34px 28px; display:flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
footer .brand { font-family:'Playfair Display',serif; font-weight:900; font-size: 26px; color:#EBD9A8; }
footer .cols { display:flex; gap: 54px; flex-wrap: wrap; }
footer .col h4 { font-size: 11px; letter-spacing:.2em; text-transform:uppercase; color: var(--gold); margin: 0 0 10px; }
footer .col a { display:block; color:#cdbf9a; font-size: 14px; margin-bottom: 7px; opacity:.9; }
footer .col a:hover { opacity:1; color:#EBD9A8; }
footer .fineprint { border-top:1px solid rgba(176,141,60,.3); }
footer .fineprint .wrap { padding: 16px 28px; font-size: 12px; letter-spacing:.04em; opacity:.7; justify-content:center; }

.back { display:inline-flex; align-items:center; gap:8px; font-size:13px; letter-spacing:.06em; text-transform:uppercase; color: var(--kicker); margin: 22px 0; }
.back:hover { color: var(--navy); }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .lead-grid { grid-template-columns: 1fr; }
  .rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 22px; }
  .story-grid { grid-template-columns: 1fr 1fr; }
  .issue-grid { grid-template-columns: 1fr 1fr; }
  .utility { position: relative; }
  .utility .wrap { justify-content: flex-end; gap: 14px; }
  .navtoggle { display: inline-flex; }
  .utility nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--navy);
    padding: 6px 0;
    box-shadow: 0 14px 30px rgba(0,0,0,.32);
    border-top: 1px solid rgba(176,141,60,.3);
    z-index: 60;
  }
  .navtog-input:checked ~ nav { display: flex; }
  .utility nav a { padding: 13px 28px; opacity: .92; }
  .utility nav a.active { border-bottom: 0; padding-left: 25px; border-left: 3px solid var(--gold); }
}
@media (max-width: 520px) {
  .story-grid, .issue-grid { grid-template-columns: 1fr; }
  body { font-size: 17px; }
  .wrap { padding: 0 20px; }
  .masthead .logo { font-size: 42px; }
}

/* ==================================================================
   EDITOR'S SUITE — login + dashboard + writing view
   ================================================================== */

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, #24355a 0%, rgba(36,53,90,0) 60%),
    var(--navy);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--paper); border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45); padding: 38px 36px; text-align: center;
}
.login-card .eyebrow { font-size: 10px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.login-card .logo { font-family: 'Playfair Display', serif; font-weight: 900; color: var(--navy); font-size: 40px; margin: 6px 0 2px; }
.login-card .sub { color: var(--muted); font-style: italic; font-size: 14px; margin-bottom: 24px; }
.field { text-align: left; margin-bottom: 16px; }
.field label { display:block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--rule); border-radius: 5px;
  background: #fff; font-family: 'Spectral', serif; font-size: 15px; color: var(--ink);
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176,141,60,.18); }
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 5px; cursor: pointer;
  background: var(--navy); color: #EBD9A8; font-family: 'Spectral', serif;
  font-size: 14px; letter-spacing: .1em; text-transform: uppercase; transition: background .15s;
}
.btn-primary:hover { background: var(--navy2); }
.login-error { color: #9b2c2c; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.login-hint {
  margin-top: 22px; padding: 12px 14px; background: var(--paper2); border: 1px dashed var(--rule);
  border-radius: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
}
.login-hint b { color: var(--navy); }
.login-back { display:block; margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 244px; flex-shrink: 0; background: var(--navy); color: #cdbf9a; display: flex; flex-direction: column; }
.sidebar .brandbox { padding: 24px 22px 18px; border-bottom: 1px solid rgba(176,141,60,.25); }
.sidebar .brandbox .logo { font-family: 'Playfair Display', serif; font-weight: 900; color: #EBD9A8; font-size: 24px; }
.sidebar .brandbox .tag { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.sidebar nav { padding: 14px 0; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 22px; font-size: 14px; color: #cdbf9a; opacity: .85; }
.sidebar nav a .g { width: 16px; text-align: center; color: var(--gold); }
.sidebar nav a:hover { opacity: 1; background: rgba(255,255,255,.04); }
.sidebar nav a.active { opacity: 1; background: rgba(176,141,60,.16); border-left: 3px solid var(--gold); padding-left: 19px; color: #EBD9A8; }
.sidebar .who { padding: 16px 22px; border-top: 1px solid rgba(176,141,60,.25); font-size: 13px; }
.sidebar .who b { color: #EBD9A8; display: block; }
.sidebar .who a { color: var(--gold); font-size: 12px; }

.ed-main { flex: 1; background: var(--paper); min-width: 0; }
.ed-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 34px; border-bottom: 1px solid var(--rule); background: var(--paper); }
.ed-top h1 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 26px; margin: 0; }
.ed-top .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ed-actions { display: flex; gap: 10px; }
.btn { padding: 9px 16px; border-radius: 5px; font-size: 13px; cursor: pointer; border: 1px solid var(--rule); background: #fff; color: var(--navy); font-family: 'Spectral', serif; }
.btn:hover { border-color: var(--gold); }
.btn.solid { background: var(--navy); color: #EBD9A8; border-color: var(--navy); }
.btn.solid:hover { background: var(--navy2); }
.btn.gold { background: var(--gold); color: #1c1300; border-color: var(--gold); }

.ed-body { padding: 28px 34px 60px; }

/* stat cards */
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 30px; }
.stat { background: #fff; border: 1px solid var(--rule); border-radius: 7px; padding: 18px 20px; }
.stat .n { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 32px; line-height: 1; }
.stat .l { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

.block-title { display:flex; align-items:baseline; gap: 12px; margin: 8px 0 16px; }
.block-title h2 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 20px; margin: 0; }
.block-title .line { flex:1; height:1px; background: var(--rule); }
.block-title a { font-size: 12px; color: var(--kicker); letter-spacing:.04em; }

/* draft table */
.draft-table { width: 100%; background: #fff; border: 1px solid var(--rule); border-radius: 7px; border-collapse: separate; border-spacing: 0; overflow: hidden; margin-bottom: 34px; }
.draft-table th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 13px 18px; border-bottom: 1px solid var(--rule); background: var(--paper2); font-weight: 500; }
.draft-table td { padding: 14px 18px; border-bottom: 1px solid var(--rule); font-size: 14px; vertical-align: middle; }
.draft-table tr:last-child td { border-bottom: 0; }
.draft-table tr:hover td { background: var(--paper); }
.draft-table .t { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 16px; }
.draft-table .kk { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--kicker); }
.muted { color: var(--muted); }

.pill { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 500; }
.pill.draft     { background: #ece6d7; color: #6b5d33; }
.pill.review    { background: #e7e0f1; color: #5a3f86; }
.pill.scheduled { background: #d9e6e2; color: #2f6f5b; }
.pill.published { background: #16243F; color: #EBD9A8; }

/* issue curation kanban */
.kanban { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.col-k { background: var(--paper2); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.col-k h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 2px 4px 12px; display:flex; justify-content:space-between; }
.kcard { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 12px 13px; margin-bottom: 10px; cursor: grab; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.kcard:hover { border-color: var(--gold); }
.kcard .kk { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--kicker); }
.kcard .t { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 15px; margin: 4px 0 6px; line-height: 1.2; }
.kcard .meta { font-size: 12px; color: var(--muted); }
.kcard.ghost { border-style: dashed; color: var(--muted); text-align:center; cursor: pointer; background: transparent; box-shadow:none; padding: 16px; }

/* ---------- Writing view ---------- */
.write-shell { display: flex; min-height: 100vh; background: var(--paper); }
.write-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.write-bar { display:flex; align-items:center; justify-content:space-between; padding: 12px 24px; border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.write-bar .left { display:flex; align-items:center; gap: 16px; }
.write-bar a.exit { font-size: 13px; color: var(--kicker); }
.save-ind { font-size: 12.5px; color: var(--muted); display:flex; align-items:center; gap:7px; }
.save-ind .dot { width: 7px; height: 7px; border-radius: 50%; background: #2f6f5b; }
.toolbar { display:flex; gap: 4px; align-items:center; padding: 8px 24px; border-bottom: 1px solid var(--rule); background: #fff; flex-wrap: wrap; }
.toolbar button { width: 34px; height: 32px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: var(--ink); font-family: 'Spectral', serif; font-size: 15px; }
.toolbar button:hover { background: var(--paper2); }
.toolbar button.on { background: var(--panel); color: var(--navy); }
.toolbar .sep { width: 1px; height: 20px; background: var(--rule); margin: 0 6px; }
.toolbar select { border: 1px solid var(--rule); border-radius: 5px; padding: 5px 8px; font-family:'Spectral',serif; font-size: 13px; background:#fff; color: var(--navy); }
.canvas { flex:1; overflow:auto; padding: 40px 24px 80px; }
.sheet { max-width: 720px; margin: 0 auto; }
.sheet .kk { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--kicker); }
.sheet .title-input { width: 100%; border: 0; background: transparent; font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 40px; line-height: 1.1; margin: 8px 0 14px; }
.sheet .title-input:focus { outline: none; }
.sheet .doc { font-size: 18px; line-height: 1.7; color: var(--ink); }
.sheet .doc p { margin: 0 0 18px; }
.sheet .doc p.lede::first-letter { font-family:'Playfair Display',serif; font-weight:700; color:var(--navy); font-size:3.4em; line-height:.8; float:left; padding: 8px 12px 0 0; }
.sheet .doc[contenteditable]:focus { outline: none; }

.inspector { width: 290px; flex-shrink: 0; border-left: 1px solid var(--rule); background: var(--paper2); padding: 20px 20px 40px; overflow:auto; }
.inspector h4 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.inspector h4:first-child { margin-top: 0; }
.insp-row { display:flex; justify-content:space-between; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.insp-row b { color: var(--navy); font-weight: 600; }
.insp-select { width: 100%; border: 1px solid var(--rule); border-radius: 5px; padding: 8px 10px; font-family:'Spectral',serif; font-size: 14px; background:#fff; color: var(--navy); }
.ver { font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--rule); color: var(--muted); }
.ver b { display:block; color: var(--navy); font-weight: 500; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .inspector { display: none; }
}

/* ---------- Suite: filters / search / toolbar ---------- */
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 20px; border: 1px solid var(--rule); background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; font-family: 'Spectral', serif; }
.chip:hover { border-color: var(--gold); }
.chip.on { background: var(--navy); color: #EBD9A8; border-color: var(--navy); }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; background: #fff; }
.search input { border: 0; outline: none; font-family: 'Spectral', serif; font-size: 14px; background: transparent; width: 200px; color: var(--ink); }

/* extra status / role pills */
.pill.idea      { background: #efe8da; color: #6b5d33; }
.pill.admin     { background: #16243F; color: #EBD9A8; }
.pill.editor    { background: #d9e6e2; color: #2f6f5b; }
.pill.writer    { background: #ece6d7; color: #6b5d33; }
.pill.contrib   { background: #eee; color: #555; }
.pill.active    { background: #d9e6e2; color: #2f6f5b; }
.pill.invited   { background: #e7e0f1; color: #5a3f86; }
.pill.suspended { background: #f1ddd9; color: #8a3b2c; }
.pill.live      { background: #16243F; color: #EBD9A8; }
.pill.planning  { background: #ece6d7; color: #6b5d33; }
.pill.progress  { background: #e7e0f1; color: #5a3f86; }

/* ---------- Toggle switch ---------- */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; vertical-align: middle; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: #cdc4ac; border-radius: 20px; transition: background .15s; }
.toggle .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked + .track { background: var(--gold); }
.toggle input:checked + .track::before { transform: translateX(18px); }

.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); vertical-align: middle; margin-right: 8px; }

/* ---------- Issues (manage) ---------- */
.issue-row { display: flex; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 18px 20px; margin-bottom: 14px; }
.issue-row .spine { width: 52px; height: 70px; border-radius: 3px; background: var(--navy); color: #EBD9A8; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 22px; flex-shrink: 0; }
.issue-row .spine.soon { background: var(--panel); color: var(--muted); }
.issue-row .grow { flex: 1; min-width: 0; }
.issue-row .grow h3 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 21px; margin: 0 0 3px; }
.issue-row .grow .sub { font-size: 13px; color: var(--muted); }
.progress-track { height: 7px; background: var(--panel); border-radius: 6px; overflow: hidden; margin-top: 10px; max-width: 320px; }
.progress-track .fill { height: 100%; background: var(--gold); }

/* ---------- Invite / access ---------- */
.invite { display: flex; gap: 10px; background: var(--paper2); border: 1px dashed var(--rule); border-radius: 8px; padding: 16px; margin-bottom: 26px; flex-wrap: wrap; align-items: center; }
.invite input, .invite select { padding: 10px 12px; border: 1px solid var(--rule); border-radius: 5px; font-family: 'Spectral', serif; font-size: 14px; background: #fff; color: var(--ink); }
.invite input.email { flex: 1; min-width: 200px; }
.legend { display: flex; gap: 26px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend b { color: var(--navy); }

/* ---------- Settings ---------- */
.settings { max-width: 760px; }
.set-group { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 6px 22px; margin-bottom: 22px; }
.set-group > .gh { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 18px; padding: 16px 0 6px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.set-row:last-child { border-bottom: 0; }
.set-row .label { font-size: 14.5px; }
.set-row .label b { color: var(--navy); display: block; font-weight: 600; margin-bottom: 2px; }
.set-row .label span { font-size: 12.5px; color: var(--muted); }
.set-row .control input[type=text], .set-row .control select { padding: 9px 12px; border: 1px solid var(--rule); border-radius: 5px; font-family: 'Spectral', serif; font-size: 14px; background: #fff; color: var(--ink); min-width: 240px; }
.set-row.danger .label b { color: #8a3b2c; }
.btn.danger { background: #fff; border-color: #d8b3aa; color: #8a3b2c; }
.btn.danger:hover { background: #f1ddd9; }

/* ---------- Preview overlay (reader's-eye view) ---------- */
.pv-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.62); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 22px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.pv-overlay.show { opacity: 1; pointer-events: auto; }
.pv-window { width: 100%; max-width: 1100px; height: 90vh; background: #fff; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.pv-bar { display: flex; align-items: center; gap: 13px; padding: 11px 15px; background: var(--paper2); border-bottom: 1px solid var(--rule); }
.pv-tag { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pv-dots { display: flex; gap: 6px; }
.pv-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.pv-dots i:nth-child(1){ background:#e06c5e; } .pv-dots i:nth-child(2){ background:#e6b94e; } .pv-dots i:nth-child(3){ background:#5bbd6a; }
.pv-url { flex: 1; background: #fff; border: 1px solid var(--rule); border-radius: 20px; padding: 6px 16px; font-size: 12.5px; color: var(--muted); text-align: center; font-family: 'Spectral', serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-url b { color: var(--navy); font-weight: 600; }
.pv-seg { display: flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; flex-shrink: 0; }
.pv-seg button { border: 0; background: #fff; padding: 6px 13px; font-size: 12px; cursor: pointer; color: var(--muted); font-family: 'Spectral', serif; }
.pv-seg button.on { background: var(--navy); color: #EBD9A8; }
.pv-bar .ext { font-size: 12px; color: var(--kicker); flex-shrink: 0; }
.pv-bar .x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; flex-shrink: 0; }
.pv-bar .x:hover { color: var(--navy); }
.pv-stage { flex: 1; background: #e6e0d2; overflow: auto; display: flex; justify-content: center; }
.pv-stage iframe { width: 100%; height: 100%; border: 0; background: var(--paper); }
.pv-stage.mobile { padding: 18px 0; align-items: flex-start; }
.pv-stage.mobile iframe { width: 390px; max-width: 100%; height: calc(90vh - 120px); min-height: 480px; border: 1px solid rgba(0,0,0,.18); border-radius: 20px; box-shadow: 0 10px 34px rgba(0,0,0,.28); }

/* draft-preview / issue-preview reader notice banner */
.pv-notice { background: var(--gold); color: #2a1d00; text-align: center; font-size: 13px; letter-spacing: .03em; padding: 8px 16px; font-family: 'Spectral', serif; }
.pv-notice b { font-weight: 600; }

/* ---------- Art placeholders read as intentional "art to come" frames,
   not empty boxes (defined last so they win the cascade) ---------- */
.lead .art, .story .art, .article .hero,
.feature .art, .stack .item .art {
  background-color: var(--panel);
  background-image: repeating-linear-gradient(45deg, rgba(22,36,63,.05) 0 1px, transparent 1px 12px);
  border: 1px solid var(--rule);
  color: #a2946f;
  font-style: normal;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

/* ---------- Distinctive kicker: a small gold tick before the label ---------- */
.kicker::before {
  content: "";
  display: inline-block; width: 15px; height: 2px;
  background: var(--gold); vertical-align: middle;
  margin-right: 9px; position: relative; top: -2px;
}

/* ---------- Hand-drawn masthead rule ---------- */
.handrule { display: block; width: min(460px, 72%); height: 15px; margin: 12px auto 0; color: var(--gold); }
.handrule path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Compact masthead — same cover style (wordmark + hand-drawn gold rule),
   sized down for inner pages so it's consistent everywhere. */
.masthead.compact { padding: 26px 0 8px; }
.masthead.compact .eyebrow { font-size: 10px; }
.masthead.compact .logo { font-size: clamp(30px, 3.6vw, 46px); margin: 4px 0 0; }
.masthead.compact .handrule { width: min(360px, 56%); }

/* ---------- Wide full-bleed pages (cover + browse): New Yorker–style ---------- */
.home main.wrap, .wide main.wrap { max-width: 1480px; padding: 0 44px; }
.home .masthead { padding-top: 34px; padding-bottom: 6px; }

.lead-band { display: grid; grid-template-columns: 1.7fr 1fr 1.05fr; margin-top: 26px; }
.lead-band > div { padding: 0 34px; }
.lead-band > div:first-child { padding-left: 0; }
.lead-band > div:last-child { padding-right: 0; }
.lead-band .col-rule { border-left: 1px solid var(--rule); }

.feature .art { aspect-ratio: 16/10; margin-bottom: 16px; display:flex; align-items:center; justify-content:center; }
.feature .h-display { font-size: clamp(30px, 3.2vw, 46px); margin: 12px 0; }
.feature .dek { font-size: 18px; margin-bottom: 14px; }
.feature p.body { font-size: 16px; line-height: 1.62; }
.feature .dropcap::first-letter { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 3.2em; line-height: .82; float: left; padding: 6px 10px 0 0; }

.stack .item { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--rule); }
.stack .item:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.stack .item .art { aspect-ratio: 16/10; margin-bottom: 10px; display:flex; align-items:center; justify-content:center; }
.stack .item h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 22px; line-height: 1.16; margin: 6px 0; }
.stack .item .dek { font-size: 14px; }

.rail-list .item { padding: 16px 0; border-top: 1px solid var(--rule); }
.rail-list .item:first-child { border-top: 0; padding-top: 0; }
.rail-list .item h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 19px; line-height: 1.18; margin: 6px 0; }
.rail-list .verse-feature p.line { font-family: 'Playfair Display', serif; font-style: italic; color: var(--navy); font-size: 19px; line-height: 1.34; margin: 6px 0; }
.home .story-grid, .wide .story-grid { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1000px) {
  .lead-band { grid-template-columns: 1fr; }
  .lead-band > div { padding: 0; }
  .lead-band .col-rule { border-left: 0; border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 24px; }
  .home .story-grid, .wide .story-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home main.wrap, .wide main.wrap { padding: 0 20px; }
  .home .story-grid, .wide .story-grid { grid-template-columns: 1fr; }
}

/* ---------- Editor suite: Planning ---------- */
.plan-issue { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 20px 22px; margin-bottom: 26px; }
.plan-issue .ph { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-issue h2 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 23px; margin: 0; }
.plan-issue .theme { color: var(--muted); font-style: italic; font-size: 14px; margin-top: 3px; }
.plan-issue .throughline { font-size: 14.5px; line-height: 1.6; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.plan-issue .throughline b { color: var(--navy); }
.plan-meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.plan-meta b { color: var(--navy); }

.plan-card { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 18px 20px; margin-bottom: 14px; }
.plan-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plan-card h3 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 21px; margin: 5px 0 3px; line-height: 1.18; }
.plan-card .who { font-size: 13px; color: var(--muted); }
.plan-card .brief { font-size: 15px; line-height: 1.62; color: var(--ink); margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--rule); }
.plan-card .brief .lab { display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--kicker); margin-bottom: 7px; }
.plan-card.add { border-style: dashed; text-align: center; color: var(--muted); cursor: pointer; }
.plan-card.add:hover { border-color: var(--gold); color: var(--navy); }

/* ---------- Reader: Saved (reading list) ---------- */
.story { position: relative; }
.saved-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.saved-foot .when { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.saved-foot .remove { font-size: 12px; color: var(--kicker); background: none; border: 0; cursor: pointer; font-family: 'Spectral', serif; letter-spacing: .04em; }
.saved-foot .remove:hover { text-decoration: underline; }
.bookmark { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(251,248,241,.92); border: 1px solid var(--rule); color: var(--gold); cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.bookmark:hover { border-color: var(--gold); }
.saved-empty { text-align: center; padding: 60px 20px; color: var(--muted); display: none; }
.saved-empty .mk { font-size: 30px; color: var(--gold); }
.saved-empty h3 { font-family: 'Playfair Display', serif; color: var(--navy); font-size: 24px; margin: 14px 0 8px; }
.saved-empty a.btn-text { color: var(--kicker); }

/* ====================================================================
   Page transitions, homepage doodle wallpaper, spacious cover grid
   ==================================================================== */

/* Cross-document fade (modern browsers) + a fade-in on every reader page */
@view-transition { navigation: auto; }
@keyframes pagefade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.reader > .masthead, body.reader > main { animation: pagefade .5s ease both; }
@media (prefers-reduced-motion: reduce) {
  body.reader > .masthead, body.reader > main { animation: none; }
}


/* Homepage cover grid — equal, generously spaced article cards */
.cover-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 66px 56px; max-width: 1240px; margin: 30px auto 0; }
.cover-card .art { aspect-ratio: 16 / 10; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; margin-bottom: 20px; background: var(--panel); display: block; box-shadow: 0 10px 30px rgba(22,36,63,.07); }
.cover-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-card h2 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: clamp(25px, 2.3vw, 33px); line-height: 1.13; margin: 12px 0; }
.cover-card .dek { font-style: italic; color: var(--muted); font-size: 16.5px; line-height: 1.5; margin-bottom: 12px; }
.cover-card .byline { font-size: 13px; color: #7a7f87; letter-spacing: .02em; }
a.cover-card:hover h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .cover-grid { grid-template-columns: 1fr; gap: 46px; max-width: 580px; }
}

/* ---------- Reading progress bar (article pages) ---------- */
.readbar { position: fixed; top: 0; left: 0; width: 100%; height: 7px; background: rgba(22,36,63,.15); z-index: 100; }
.readbar-fill { height: 100%; width: 0; background: #c0492b; transition: width .12s linear; }

/* ---------- Writer profile pages ---------- */
.profile-pic { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 16px; background: var(--navy); color: #EBD9A8; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 30px; }
.biblio { max-width: 760px; margin: 6px auto 0; }
.biblio-item { display: flex; gap: 20px; align-items: center; padding: 20px 0; border-top: 1px solid var(--rule); }
.biblio-item:first-child { border-top: 0; }
.biblio-item .thumb { width: 132px; height: 88px; flex-shrink: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--panel); }
.biblio-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.biblio-item h3 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--navy); font-size: 21px; line-height: 1.16; margin: 4px 0 6px; }
.biblio-item .bi-issue { font-size: 13px; color: var(--muted); font-style: italic; }
.biblio-item:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .biblio-item .thumb { width: 96px; height: 64px; } }

/* Clickable byline names */
.bylink { color: inherit; }
.bylink:hover { color: var(--kicker); text-decoration: underline; text-underline-offset: 2px; }
