/* ==========================================================================
   THE MULLIDEN DAILY — stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT,WONK@9..144,300..900,0..100,0..1&family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&family=Special+Elite&display=swap');

:root {
  --paper:        #f3e9d2;
  --paper-shade:  #ebdfbd;
  --paper-deep:   #e1d4ad;
  --ink:          #1c1815;
  --ink-soft:     #4a3f37;
  --ink-light:    #7a6a5d;
  --red:          #c8341d;
  --red-deep:     #8c2010;
  --gold:         #c79a48;
  --tape:         rgba(232, 200, 98, 0.55);

  --serif-display: "Fraunces", "Times New Roman", serif;
  --serif-body:    "Newsreader", "Georgia", serif;
  --mono-script:   "Special Elite", "Courier New", monospace;

  --max-width: 1100px;
  --reading-width: 720px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 0.07 0'/></filter><rect width='220' height='220' filter='url(%23n)' opacity='0.6'/></svg>");
  background-size: 240px;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.65;
  font-feature-settings: "onum", "kern";
  font-optical-sizing: auto;
  position: relative;
}

/* Faint vertical center fold */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    transparent 49.5%,
    rgba(28,24,21,0.035) 50%,
    transparent 50.5%);
  z-index: 0;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}
a:hover { color: var(--red); }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
  text-align: center;
  padding: 2.5rem var(--gutter) 1rem;
  position: relative;
  z-index: 1;
}

.masthead-meta {
  max-width: var(--max-width);
  margin: 0 auto 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  font-family: var(--mono-script);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.masthead-meta > :nth-child(1) { text-align: left; }
.masthead-meta > :nth-child(2) { text-align: center; }
.masthead-meta > :nth-child(3) { text-align: right; }

.masthead-title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 900;
  font-size: clamp(3.4rem, 14vw, 8.5rem);
  line-height: 0.88;
  margin: 0;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.masthead-title a {
  color: inherit;
  text-decoration: none;
}

.masthead-tagline {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
  letter-spacing: 0.01em;
}

.masthead-flourish {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.8rem 0 0;
  letter-spacing: 0.4em;
}

.masthead-rules {
  height: 8px;
  margin: 1.1rem auto 0;
  max-width: var(--max-width);
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* ==========================================================================
   Section bar (navigation)
   ========================================================================== */

.section-bar {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14, "SOFT" 0, "WONK" 0;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem var(--gutter) 0.7rem;
  background: var(--paper-shade);
  border-bottom: 2px solid var(--ink);
  border-top: 1px solid var(--ink);
  position: relative;
  z-index: 1;
}
.section-bar a {
  color: var(--ink);
  text-decoration: none;
  margin: 0 0.4rem;
}
.section-bar a:hover { color: var(--red); }
.section-bar a[aria-current="page"] {
  color: var(--red-deep);
  border-bottom: 2px solid var(--red);
  padding-bottom: 0.05rem;
}
.section-bar .sep {
  color: var(--red);
  font-weight: 700;
  margin: 0 0.15rem;
  user-select: none;
}

/* ==========================================================================
   Page main
   ========================================================================== */

main.container {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* ==========================================================================
   Department label (eyebrow above strip)
   ========================================================================== */

.dept {
  display: inline-block;
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14, "SOFT" 0, "WONK" 0;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--red-deep);
  border-top: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  padding: 0.25rem 0.85rem;
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Hero strip / per-strip article
   ========================================================================== */

.hero-strip {
  margin: 0 0 4rem;
  position: relative;
}

/* Showcase mode for single-strip pages: center the display block,
   but keep editor's note + script body left-aligned for readability. */
.hero-strip--centered {
  text-align: center;
}
.hero-strip--centered .hero-strip-summary {
  margin-left: auto;
  margin-right: auto;
}
.hero-strip--centered .editor-note {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.hero-strip--centered .strip-script {
  text-align: left;
}

.hero-strip-title {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  font-weight: 800;
  font-size: clamp(2.2rem, 6.5vw, 4.4rem);
  line-height: 1;
  margin: 0 0 0.5rem;
  letter-spacing: -0.025em;
}
.hero-strip-title a { color: inherit; text-decoration: none; }
.hero-strip-title a:hover { color: var(--red-deep); }

.hero-strip-summary {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
  max-width: 32em;
  line-height: 1.45;
}

.editor-note {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 1rem;
  color: var(--red-deep);
  border-left: 3px solid var(--red);
  padding: 0.35rem 0 0.35rem 1rem;
  margin: 0 0 1.75rem;
  max-width: var(--reading-width);
}

.strip-meta-line {
  font-family: var(--mono-script);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

/* ==========================================================================
   Strip frame (the comic image with tape & shadow)
   ========================================================================== */

.strip-frame {
  position: relative;
  margin: 0 auto 2.5rem;
  max-width: 820px;
  background: #fefcf3;
  padding: 14px;
  border: 2px solid var(--ink);
  box-shadow:
    0 1px 0 rgba(28,24,21,0.05),
    0 22px 40px -22px rgba(28,24,21,0.45),
    8px 8px 0 -2px var(--paper-deep);
  transform: rotate(-0.4deg);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s ease;
}
.strip-frame:hover {
  transform: rotate(0deg) translate(-2px, -2px);
  box-shadow:
    0 1px 0 rgba(28,24,21,0.06),
    0 30px 50px -24px rgba(28,24,21,0.55),
    10px 10px 0 -2px var(--paper-deep);
}

.strip-frame > a,
.strip-frame > img {
  display: block;
  width: 100%;
  border: 1px solid var(--ink);
}
.strip-frame > a img { border: 0; width: 100%; }

/* tape stickers on the corners */
.strip-frame::before,
.strip-frame::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 70px;
  height: 18px;
  background: var(--tape);
  border: 1px solid rgba(28,24,21,0.18);
  box-shadow: 0 1px 1px rgba(0,0,0,0.06);
  pointer-events: none;
}
.strip-frame::before { left: 18px; transform: rotate(-7deg); }
.strip-frame::after  { right: 18px; transform: rotate(8deg); }

/* ==========================================================================
   Strip script (screenplay treatment with red rule)
   ========================================================================== */

.strip-script {
  position: relative;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(28,24,21,0.05) 31px,
      rgba(28,24,21,0.05) 32px
    ),
    var(--paper);
  border: 1px solid var(--ink-light);
  padding: 1.85rem 1.5rem 1.6rem 3.5rem;
  font-family: var(--mono-script);
  font-size: 0.97rem;
  line-height: 32px;
  color: var(--ink);
  max-width: var(--reading-width);
  margin: 0 auto;
}
.strip-script::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 2.4rem;
  width: 1px;
  background: var(--red);
  opacity: 0.55;
}

.strip-script-label {
  position: absolute;
  top: -0.85rem;
  left: 1.5rem;
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red-deep);
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--red);
  background: var(--paper);
}

.strip-script-panels {
  list-style: none;
  margin: 0;
  padding: 0;
}
.strip-script-panels li {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
  align-items: baseline;
}
.strip-script-panels li:last-child { margin-bottom: 0; }
.panel-num {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-deep);
  white-space: nowrap;
}
.strip-script-panels li p { margin: 0; }
.strip-script em { font-style: italic; color: var(--ink-soft); }

/* ==========================================================================
   Section heading (e.g., "More Strips", "All Strips")
   ========================================================================== */

.section-head {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 0;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.01em;
  margin: 3rem 0 1.6rem;
  padding-bottom: 0.6rem;
  border-bottom: 4px double var(--ink);
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--red);
}

/* ==========================================================================
   Archive grid
   ========================================================================== */

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.75rem 1.5rem;
}

.archive-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--ink);
  padding: 0.9rem;
  position: relative;
  transition: transform 0.25s cubic-bezier(.2,.8,.2,1), box-shadow 0.25s ease;
  box-shadow: 5px 5px 0 -1px var(--ink);
}
.archive-card:hover {
  transform: translate(-3px, -3px) rotate(-0.5deg);
  box-shadow: 8px 8px 0 -1px var(--ink);
  color: var(--ink);
}

.archive-card-num {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--red);
  color: var(--paper);
  font-family: var(--serif-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
}

.archive-card img {
  width: 100%;
  height: auto;
  border: 1px solid var(--ink);
  background: #fefcf3;
  margin-bottom: 0.85rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
}

.archive-card h3 {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 36, "SOFT" 30, "WONK" 0;
  font-weight: 800;
  font-size: 1.35rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.archive-card p {
  font-family: var(--serif-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Crumb / back-to-archive link
   ========================================================================== */

.crumb {
  font-family: var(--mono-script);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin: 2.5rem 0 0;
  text-align: center;
  color: var(--ink-soft);
}
.crumb a { color: var(--ink-soft); }
.crumb a:hover { color: var(--red); }

/* ==========================================================================
   Editorial article (about, 404)
   ========================================================================== */

.editorial {
  max-width: 38em;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.85;
}
.editorial h1 {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  line-height: 1;
  margin: 0 0 1.5rem;
  letter-spacing: -0.025em;
}
.editorial p { margin: 0 0 1.4rem; }
.editorial p.lede {
  font-size: 1.4rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
  max-width: 28em;
  margin-bottom: 2rem;
}
.editorial p.body-first::first-letter {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1;
  font-weight: 900;
  float: left;
  font-size: 5.4rem;
  line-height: 0.85;
  padding: 0.4rem 0.65rem 0 0;
  color: var(--red);
}
.editorial .signoff {
  font-family: var(--mono-script);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-top: 2.5rem;
  border-top: 1px solid var(--ink-light);
  padding-top: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.paper-footer {
  background: var(--paper-shade);
  border-top: 4px double var(--ink);
  margin-top: 4rem;
  padding: 2.5rem var(--gutter) 2rem;
  font-family: var(--serif-body);
  position: relative;
  z-index: 1;
}
.footer-cols {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem;
}
.footer-cols section h4 {
  font-family: var(--serif-display);
  font-variation-settings: "opsz" 14;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--red-deep);
  margin: 0 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--ink);
}
.footer-cols section p {
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 0.5rem;
  color: var(--ink-soft);
}
.footer-rule {
  max-width: var(--max-width);
  margin: 1.75rem auto 1rem;
  height: 1px;
  background: var(--ink);
}
.footer-fineprint {
  max-width: var(--max-width);
  margin: 0 auto;
  font-family: var(--mono-script);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.6;
}

/* ==========================================================================
   Page-load animation (one orchestrated stagger)
   ========================================================================== */

.masthead, .section-bar, main.container > * {
  opacity: 0;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) forwards;
}
.masthead     { animation-delay: 0.05s; }
.section-bar  { animation-delay: 0.20s; }
main.container > *:nth-child(1) { animation-delay: 0.35s; }
main.container > *:nth-child(2) { animation-delay: 0.48s; }
main.container > *:nth-child(3) { animation-delay: 0.60s; }
main.container > *:nth-child(4) { animation-delay: 0.72s; }
main.container > *:nth-child(5) { animation-delay: 0.84s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .masthead, .section-bar, main.container > * {
    opacity: 1;
    animation: none;
  }
  .strip-frame, .archive-card { transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 700px) {
  .masthead-meta {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    font-size: 0.66rem;
  }
  .masthead-meta > :nth-child(1),
  .masthead-meta > :nth-child(2),
  .masthead-meta > :nth-child(3) { text-align: center; }

  .strip-script { padding: 1.5rem 1rem 1.4rem 2.5rem; }
  .strip-script::before { left: 1.5rem; }
  .strip-script-panels li { grid-template-columns: 2.6rem 1fr; gap: 0.45rem; }
  .strip-script-label { left: 1rem; }

  .footer-cols { grid-template-columns: 1fr; gap: 1.5rem; }
}
