/* =====================================================================
   THE CELEBRATION POST — parody broadsheet for Ronife's 20th.
   Masthead: UnifrakturMaguntia · Body: Merriweather
   Headlines: Playfair Display · Utility/labels: Barlow Condensed
   Content lives in CONFIG near the bottom of the <script>.
   ===================================================================== */
:root {
  --newsprint: #f1ecdd;
  --newsprint-deep: #e8e0cb;
  --ink: #181512;
  --ink-soft: #3a342c;
  --grey: #6b6355;
  --rule: #b7ac93;
  --rule-heavy: #181512;
  --red: #a32b1f;
  --stage-w: 460px;
  --stage-h: 100dvh;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Merriweather", serif;
  background: #0e0c0a;
  color: var(--ink);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

::selection {
  background: var(--red);
  color: var(--newsprint);
}

.cond {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

#gate {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #241f1a, #0e0c0a 65%);
  padding: 24px;
}
#gate.hidden {
  display: none;
}
.gate-card {
  width: min(360px, 100%);
  background: var(--newsprint);
  border: 1px solid var(--ink);
  padding: 34px 26px 28px;
  text-align: center;
  position: relative;
}
.gate-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(24, 21, 18, 0.3);
  pointer-events: none;
}
.gate-kicker {
  font-size: 11px;
  color: var(--red);
  margin-bottom: 8px;
}
.gate-mast {
  font-family: "UnifrakturMaguntia", cursive;
  font-size: clamp(30px, 9vw, 38px);
  line-height: 1;
  margin-bottom: 4px;
}
.gate-tagline {
  font-family: "Merriweather", serif;
  font-style: italic;
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.gate-rule {
  border-top: 3px double var(--ink);
  margin-bottom: 14px;
}
.gate-copy {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.gate-input {
  width: 100%;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 20px;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 12px 8px;
  border: 2px solid var(--rule);
  background: #fffdf8;
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease;
}
.gate-input:focus {
  border-color: var(--red);
}
.gate-input.shake {
  animation: gshake 420ms ease;
  border-color: var(--red);
}
@keyframes gshake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-7px);
  }
  40%,
  60% {
    transform: translateX(7px);
  }
}
.gate-hint {
  font-size: 11.5px;
  color: var(--grey);
  min-height: 16px;
  font-family: "Merriweather", serif;
}
.gate-btn {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid var(--ink);
  padding: 11px 20px;
  color: var(--ink);
  transition:
    background 150ms ease,
    color 150ms ease;
}
.gate-btn:hover {
  background: var(--ink);
  color: var(--newsprint);
}

/* ---------------- outer frame / phone-stage ---------------- */
#frame {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #241f1a, #0e0c0a 65%);
}

#stage {
  position: relative;
  width: min(var(--stage-w), 100vw);
  height: var(--stage-h);
  background: var(--newsprint);
  overflow: hidden;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
}

@media (min-width: 701px) {
  #stage {
    border-radius: 6px;
    box-shadow:
      0 50px 120px -20px rgba(0, 0, 0, 0.8),
      0 0 0 1px rgba(0, 0, 0, 0.4);
  }
}

/* ---------------- desktop notice ---------------- */
#desktop-notice {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(14, 12, 10, 0.88);
  padding: 24px;
}

#desktop-notice.show {
  display: flex;
}

.notice-card {
  background: var(--newsprint);
  max-width: 380px;
  padding: 38px 30px 30px;
  text-align: center;
  border: 1px solid var(--ink);
  position: relative;
}

.notice-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(24, 21, 18, 0.35);
  pointer-events: none;
}

.notice-card .cond {
  font-size: 12px;
  color: var(--red);
  margin-bottom: 10px;
}

.notice-card h2 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 26px;
  margin: 0 0 14px;
  line-height: 1.15;
}

.notice-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 22px;
}

.notice-card button {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--ink);
  padding: 11px 22px;
  color: var(--ink);
  transition:
    background 150ms ease,
    color 150ms ease;
}

.notice-card button:hover {
  background: var(--ink);
  color: var(--newsprint);
}

/* ---------------- pager track ---------------- */
#track {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
  transition: transform 480ms cubic-bezier(0.65, 0, 0.35, 1);
}

.page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 58px;
  -webkit-overflow-scrolling: touch;
}

.page::-webkit-scrollbar {
  width: 0;
}

.page-inner {
  padding: 14px 20px 10px;
}

/* ---------------- masthead (shared) ---------------- */
.masthead-block {
  text-align: center;
  padding-top: 8px;
}

.ears-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ear-box {
  flex: 1;
  border: 1px solid var(--ink);
  padding: 5px 7px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 9.5px;
  line-height: 1.35;
  color: var(--ink-soft);
  text-align: left;
}

.ear-box .cond-label {
  display: block;
  font-size: 8.5px;
  color: var(--red);
  letter-spacing: 0.1em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.ear-box.right {
  text-align: right;
}

.utility-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10px;
  color: var(--ink-soft);
  padding-bottom: 5px;
  border-bottom: 3px double var(--rule-heavy);
}

.nameplate {
  font-family: "UnifrakturMaguntia", cursive;
  font-weight: 400;
  font-size: clamp(40px, 13vw, 54px);
  line-height: 1;
  letter-spacing: 0;
  margin: 8px 0 2px;
}

.tagline {
  font-size: 10.5px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-family: "Merriweather", serif;
}

.byline-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  padding: 6px 0;
  border-top: 1.5px solid var(--rule-heavy);
  border-bottom: 3px double var(--rule-heavy);
  margin-bottom: 12px;
}

/* ---------------- stamp ---------------- */
.stamp {
  position: absolute;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--red);
  border: 3px solid var(--red);
  padding: 5px 12px;
  transform: rotate(-9deg);
  opacity: 0.9;
  border-radius: 3px;
  font-size: 12px;
  background: rgba(241, 236, 221, 0.55);
  z-index: 3;
}

/* ---------------- PAGE 1: FRONT PAGE (Ronife dedicated) ---------------- */
.headline {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: clamp(32px, 9.5vw, 42px);
  line-height: 1;
  margin: 2px 0 6px;
}

.deck {
  font-family: "Merriweather", serif;
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.hero-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  border: 1px solid var(--ink);
  margin-bottom: 4px;
  overflow: hidden;
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.85) contrast(1.14) brightness(0.97);
}

.quote-pin {
  position: absolute;
  max-width: 118px;
  background: var(--newsprint);
  border: 1px solid var(--ink);
  padding: 7px 9px 8px;
  font-family: "Merriweather", serif;
  font-style: italic;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.quote-pin::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.quote-pin .pin-author {
  display: block;
  margin-top: 3px;
  font-style: normal;
  font-size: 9px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "Barlow Condensed", sans-serif;
}

.figcap {
  font-size: 11px;
  color: var(--grey);
  padding: 6px 2px 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 12px;
}

.body-cols {
  column-count: 1;
}

.drop-cap::first-letter {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 48px;
  float: left;
  line-height: 0.78;
  padding: 4px 6px 0 0;
  color: var(--ink);
}

.body-cols p {
  font-size: 14.5px;
  line-height: 1.62;
  margin: 0 0 12px;
  color: var(--ink);
}

.jumpline {
  font-size: 11px;
  text-align: right;
  font-style: italic;
  color: var(--grey);
  margin-top: 4px;
}

/* ---------------- PAGE 2: LETTERS ---------------- */
.section-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 12px 0 8px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
}

.section-banner::before,
.section-banner::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-heavy);
}

.letter-salutation {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 19px;
  margin-bottom: 10px;
}

.letter-text {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink);
  white-space: pre-wrap;
}

.letter-text .cursor {
  display: inline-block;
  width: 2px;
  background: var(--ink);
  margin-left: 1px;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.pull-quote {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  border-left: 3px solid var(--red);
  padding: 2px 0 2px 14px;
  margin: 18px 0;
}

/* ---------------- PAGE 3: ARTS & MEMORIES ---------------- */
.photo-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.photo-card {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 0 0 8px;
}

.photo-card img,
.photo-card video {
  width: 100%;
  display: block;
  aspect-ratio: 4/3;
  object-fit: cover;
  filter: grayscale(0.85) contrast(1.1) sepia(0.06);
}

.photo-card figcaption {
  font-size: 11px;
  color: var(--ink-soft);
  padding: 7px 10px 0;
}

.photo-card figcaption .fig-num {
  color: var(--red);
  font-weight: 700;
  margin-right: 2px;
}

.play-dot {
  position: relative;
}

.play-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent rgba(241, 236, 221, 0.92);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

/* ---------------- PAGE 4: ALMANAC / CLASSIFIEDS ---------------- */
.almanac-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.almanac-box {
  border: 1px solid var(--ink);
  padding: 10px 10px 12px;
}

.almanac-box .cond {
  font-size: 9.5px;
  color: var(--grey);
  margin-bottom: 4px;
}

.almanac-box .val {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.classified-box {
  border: 1px dashed var(--ink-soft);
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}

.classified-box .cond {
  font-size: 10px;
  color: var(--red);
  margin-bottom: 4px;
}

.classified-box p {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  color: var(--ink);
}

/* ---------------- PAGE 5: OP-ED ---------------- */
.oped-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar-circle {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 17px;
}

.oped-byline .cond {
  font-size: 9.5px;
  color: var(--grey);
}

.oped-byline .name {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 15px;
}

.oped-title {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: 23px;
  line-height: 1.08;
  margin-bottom: 12px;
}

/* ---------------- PAGE 6: BACK PAGE ---------------- */
.finale-wrap {
  text-align: center;
  padding-top: 14px;
}

.finale-headline {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.02;
  margin: 12px 0 12px;
}

.finale-msg {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 auto 20px;
  max-width: 34ch;
}

.coupon {
  border: 2px dashed var(--ink);
  padding: 14px 16px;
  margin: 22px auto 4px;
  max-width: 280px;
  position: relative;
}

.coupon::before,
.coupon::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--newsprint);
  box-shadow: 0 0 0 2px var(--ink) inset;
}

.coupon::before {
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
}

.coupon::after {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
}

.coupon .cond {
  font-size: 9.5px;
  color: var(--grey);
  margin-bottom: 6px;
}

.coupon button {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}

.end-mark {
  font-size: 10px;
  color: var(--grey);
  margin-top: 28px;
  letter-spacing: 0.16em;
}

/* ---------------- confetti (finale) ---------------- */
.confetti-piece {
  position: absolute;
  top: -8px;
  z-index: 5;
  width: 6px;
  height: 11px;
  pointer-events: none;
  border-radius: 1px;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(115%) rotate(480deg);
    opacity: 0.85;
  }
}

/* ---------------- lightbox ---------------- */
#lightbox {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(10, 8, 6, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#lightbox.active {
  display: flex;
}

#lightbox img,
#lightbox video {
  max-width: 100%;
  max-height: 70%;
  border: 2px solid var(--newsprint);
}

#lightbox-caption {
  position: absolute;
  bottom: 15%;
  left: 6%;
  right: 6%;
  text-align: center;
  color: var(--newsprint);
  font-size: 13px;
  font-style: italic;
}

#lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--newsprint);
  color: var(--newsprint);
  font-size: 15px;
}

/* ---------------- bottom nav / pagination ---------------- */
#pagenav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--newsprint);
  border-top: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-family: "Barlow Condensed", sans-serif;
}

#pagenav .navbtn {
  font-size: 20px;
  color: var(--ink);
  padding: 2px 8px;
  line-height: 1;
}

#pagenav .navbtn:disabled {
  opacity: 0.25;
}

#pagenav .pageinfo {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

.dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 3px;
}

.dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule);
}

.dots span.active {
  background: var(--red);
}

.tapzone {
  position: absolute;
  top: 0;
  bottom: 52px;
  width: 16%;
  z-index: 8;
}

.tapzone.left {
  left: 0;
}

.tapzone.right {
  right: 0;
}

@media (max-width: 360px) {
  .nameplate {
    font-size: 36px;
  }

  .headline {
    font-size: 27px;
  }
}
