/* ==========================================================================
   THE PAPER PORTFOLIO — CORE NEWSPAPER STYLESHEET
   Inspired by Niccolò Miranda's award-winning broadsheet experience
   ========================================================================== */

:root {
  --paper-bg: #e6e2da;
  --paper-surface: #dedad1;
  --paper-card: #e2ded5;
  --desk-bg: #151617;
  --ink-black: #121212;
  --ink-secondary: #383838;
  --ink-muted: #5e5e5e;
  --ink-subtle: rgba(18, 18, 18, 0.45);
  --border-rule: #121212;
  --border-hairline: rgba(18, 18, 18, 0.28);
  --accent-red: #d94228;
  --accent-gold: #e2b347;

  /* Typography */
  --font-masthead: 'UnifrakturMaguntia', 'Pirata One', Georgia, serif;
  --font-headline: 'Bodoni Moda', 'Playfair Display', Didot, 'Times New Roman', serif;
  --font-display-condensed: 'Anton', 'Oswald', 'Bebas Neue', Impact, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-mono: 'Space Mono', 'Courier New', Courier, monospace;
}

/* Night Edition / Photographic Negative Broadsheet */
html.night-edition {
  --paper-bg: #141415;
  --paper-surface: #1b1c1d;
  --paper-card: #18191a;
  --desk-bg: #0b0c0d;
  --ink-black: #ede9e1;
  --ink-secondary: #c9c5be;
  --ink-muted: #9c9993;
  --ink-subtle: rgba(237, 233, 225, 0.35);
  --border-rule: #ede9e1;
  --border-hairline: rgba(237, 233, 225, 0.25);
  --accent-red: #ff583b;
  --accent-gold: #f5c862;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--desk-bg);
  color: var(--ink-black);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-serif);
  background-color: var(--desk-bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.45;
}

/* Paper Grain Texture Overlay */
.paper-grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

html.night-edition .paper-grain-overlay {
  mix-blend-mode: screen;
  opacity: 0.12;
}

/* Custom Interactive Cursor */
#paper-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-black);
  pointer-events: none;
  z-index: 10000;
  transform: translate3d(-100px, -100px, 0);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.2s ease,
              border 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  margin-left: -8px;
}

#paper-cursor.active {
  width: 64px;
  height: 64px;
  margin-top: -32px;
  margin-left: -32px;
  background: var(--ink-black);
  color: var(--paper-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#paper-cursor-label {
  font-family: var(--font-display-condensed);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--paper-bg);
  user-select: none;
}

@media (pointer: coarse) {
  #paper-cursor {
    display: none !important;
  }
}

/* Main Broadsheet Container */
.broadsheet-container {
  max-width: 1480px;
  margin: 0 auto;
  background-color: var(--paper-bg);
  border-left: 2px solid var(--border-rule);
  border-right: 2px solid var(--border-rule);
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.45);
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================================================
   TOP MASTHEAD HEADER (AMSTERDAM, NL • THE PAPER PORTFOLIO • AUDIO/MENU)
   ========================================================================== */
.site-masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 2px solid var(--border-rule);
  position: relative;
  background-color: var(--paper-bg);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.masthead-location {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.masthead-city {
  font-family: var(--font-display-condensed);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.masthead-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
}

.masthead-center {
  text-align: center;
  min-width: 0;
}

.masthead-title {
  font-family: var(--font-masthead);
  font-size: 32px;
  font-weight: normal;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--ink-black);
  line-height: 1;
  display: inline-block;
}

.masthead-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

/* ── MASTHEAD RESPONSIVE TIERS ── */
@media (max-width: 1024px) {
  .site-masthead {
    padding: 10px 18px;
  }
  .masthead-title {
    font-size: 28px;
  }
  .masthead-controls {
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .site-masthead {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 8px;
  }
  .masthead-location {
    order: 1;
  }
  .masthead-controls {
    order: 2;
  }
  .masthead-center {
    order: 3;
    width: 100%;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed var(--border-hairline);
    text-align: center;
  }
  .masthead-title {
    font-size: 24px;
  }
}

/* Sub-breakpoint: Modern Phones (390px - 480px) */
@media (max-width: 480px) {
  .site-masthead {
    padding: 8px 12px;
  }
  .masthead-city {
    font-size: 12px;
    letter-spacing: 1px;
  }
  .masthead-meta {
    font-size: 10px;
  }
  .masthead-title {
    font-size: 21px;
  }
  .sound-btn-text,
  .btn-text {
    display: none;
  }
  .sound-btn {
    padding: 5px 8px;
  }
}

/* Sub-breakpoint: Compact Phones (360px - 389px) */
@media (max-width: 389px) {
  .site-masthead {
    padding: 6px 10px;
  }
  .masthead-city {
    font-size: 11px;
  }
  .masthead-meta {
    font-size: 9px;
  }
  .masthead-title {
    font-size: 19px;
  }
  .sound-btn {
    padding: 4px 6px;
  }
  .menu-btn {
    width: 26px;
    height: 24px;
  }
}

/* Sub-breakpoint: Budget / Small Androids (321px - 359px) */
@media (max-width: 359px) {
  .site-masthead {
    padding: 6px 8px;
  }
  .masthead-city {
    font-size: 10px;
    letter-spacing: 0.5px;
  }
  .masthead-title {
    font-size: 17.5px;
    letter-spacing: 0.8px;
  }
  .sound-btn {
    padding: 3px 5px;
  }
  .menu-btn {
    width: 24px;
    height: 22px;
  }
}

/* Sub-breakpoint: Ultra-Small & Fold Outer (<= 320px down to 280px) */
@media (max-width: 320px) {
  .site-masthead {
    padding: 5px 6px;
  }
  .masthead-city {
    font-size: 9.5px;
  }
  .masthead-title {
    font-size: 16px;
    letter-spacing: 0.5px;
  }
  .masthead-meta {
    display: none;
  }
  .sound-btn {
    padding: 2px 4px;
  }
}

.sound-btn:hover {
  background: var(--ink-black);
  color: var(--paper-bg);
}

.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-bar {
  width: 2px;
  height: 100%;
  background-color: currentColor;
  animation: soundBarAnim 1s ease-in-out infinite alternate;
}

.sound-bar:nth-child(2) {
  height: 60%;
  animation-delay: 0.2s;
}

.sound-bar:nth-child(3) {
  height: 80%;
  animation-delay: 0.4s;
}

.sound-btn.muted .sound-bar {
  animation: none;
  height: 2px;
}

@keyframes soundBarAnim {
  0% { height: 20%; }
  100% { height: 100%; }
}

.sound-btn-text,
.btn-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Minimalist Hamburger Menu Button */
.menu-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 28px;
  cursor: pointer;
  padding: 4px 0;
}

.menu-line {
  width: 100%;
  height: 2px;
  background-color: var(--ink-black);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-btn:hover .menu-line:first-child {
  transform: translateY(-1px);
}

.menu-btn:hover .menu-line:last-child {
  transform: translateY(1px);
}

/* ==========================================================================
   BREAKING NEWS TICKER TAPE MARQUEE
   ========================================================================== */
.ticker-tape-wrapper {
  background: var(--ink-black);
  color: var(--paper-bg);
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-rule);
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  user-select: none;
}

.ticker-tape {
  display: inline-block;
  white-space: nowrap;
  animation: tickerMarquee 38s linear infinite;
  font-family: var(--font-display-condensed);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes tickerMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-block;
  padding: 0 16px;
}

.ticker-item span.star {
  color: var(--accent-gold);
  margin: 0 6px;
}

/* Responsive Ticker tape typography for phone sub-breakpoints */
@media (max-width: 480px) {
  .ticker-tape-wrapper {
    padding: 5px 0;
  }
  .ticker-tape {
    font-size: 11px;
    letter-spacing: 1.2px;
  }
  .ticker-item {
    padding: 0 10px;
  }
}

@media (max-width: 320px) {
  .ticker-tape {
    font-size: 9.5px;
    letter-spacing: 0.8px;
  }
  .ticker-item {
    padding: 0 8px;
  }
}

/* ==========================================================================
   MASSIVE HEADLINE BANNERS (MIRANDA, WEBSITE, ETC.)
   ========================================================================== */
.giant-banner-block {
  background-color: var(--ink-black);
  color: var(--paper-bg);
  border-top: 2px solid var(--border-rule);
  border-bottom: 2px solid var(--border-rule);
  padding: 0;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.miranda-headline-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  user-select: none;
  filter: contrast(1.05);
}

.website-headline-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  filter: contrast(1.05);
}

.giant-banner-sub {
  font-family: var(--font-display-condensed);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--paper-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 6px;
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 768px) {
  .giant-banner-sub {
    font-size: 11px;
    letter-spacing: 2px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .giant-banner-sub {
    font-size: 9.5px;
    letter-spacing: 1.2px;
    justify-content: center;
    text-align: center;
    gap: 4px;
    padding: 4px 6px;
  }
}

@media (max-width: 359px) {
  .giant-banner-sub {
    font-size: 8.5px;
    letter-spacing: 0.8px;
  }
}

@media (max-width: 320px) {
  .giant-banner-sub {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
}

/* Horizontal Hairlines and Newspaper Rules */
.newspaper-rule {
  border: none;
  border-top: 1px solid var(--border-rule);
  margin: 0;
}

.newspaper-rule.double {
  border-top: 3px double var(--border-rule);
}

.newspaper-rule.thick {
  border-top: 2px solid var(--border-rule);
}

/* Editorial Drop Caps */
.drop-cap {
  float: left;
  font-family: var(--font-headline);
  font-size: 52px;
  line-height: 44px;
  padding-top: 4px;
  padding-right: 10px;
  padding-bottom: 0px;
  font-weight: 900;
  color: var(--ink-black);
}

.drop-cap-box {
  float: left;
  background-color: var(--ink-black);
  color: var(--paper-bg);
  font-family: var(--font-headline);
  font-size: 34px;
  line-height: 38px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  margin-bottom: 4px;
  font-weight: 900;
  border: 1px solid var(--border-rule);
}

/* Editorial Badge Tags */
.badge-tag {
  display: inline-block;
  background-color: var(--accent-red);
  color: #fff;
  font-family: var(--font-display-condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1;
}

.badge-tag.awards {
  background-color: #2b593f;
}

.badge-tag.speaker {
  background-color: #3b4d8a;
}
