/* ==========================================================================
   ITFoK 2026 DIGITAL FESTIVAL PLATFORM
   Curatorial Premise: "IMAGINING JUSTICE: From Unrest to Accountability"
   Design Style: Brutalist Broadside & Theatrical Black Box Functionalism
   Derived from Google Stitch MCP Design System (Agitprop Broadsheet)
   ========================================================================== */

:root {
  /* Colors: Master Palette */
  --bg-pitch: #0b0c0e;              /* Deep Stage Noir / Black Box Pitch */
  --surface-dim: #121315;           /* Surface Ground Substrate */
  --surface-low: #1b1c1e;           /* Level 1 Container Surface */
  --surface-container: #1f2022;     /* Level 2 Module Surface */
  --surface-high: #292a2c;          /* Raised Panel Surface */
  --surface-highest: #343537;       /* Highlight Surface */
  
  --primary-red: #d93829;           /* Insurrection Red / Primary Accent */
  --primary-red-hover: #b81f15;
  --primary-tint: #ffb4a8;          /* Light Red Tint */
  --primary-dark: #690001;          /* On-Primary Dark */
  
  --secondary-ochre: #fabc4d;       /* Streetlight Ochre / Halogen Glow */
  --secondary-dark: #bd8718;        /* Ochre Dark / Container */
  --secondary-deep: #432c00;
  
  --newsprint-bone: #f4f1ea;        /* Newsprint Ivory / Editorial Bone */
  --text-main: #e3e2e5;             /* Dominant Reading Text */
  --text-muted: #8f94a6;            /* Secondary Inscription / Metadata */
  --border-hairline: #2c2f3b;       /* Structural 1px Border Rule */
  --border-light: #474742;
  
  --color-success: #10b981;
  --color-error: #ff4d4d;
  --color-sold-out: #e11d48;

  /* Typography */
  --font-display: 'Oswald', 'Syne', sans-serif;
  --font-body: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-editorial: 'Newsreader', Georgia, serif;
  --font-mono: 'Space Mono', 'JetBrains Mono', monospace;
  --font-malayalam: 'Manjari', 'Noto Sans Malayalam', sans-serif;

  /* Spacing Rhythm (Strict 4px baseline) */
  --space-xs: 0.25rem;  /* 4px */
  --space-sm: 0.5rem;   /* 8px */
  --space-md: 1rem;     /* 16px */
  --space-lg: 1.5rem;   /* 24px */
  --space-xl: 2.5rem;   /* 40px */
  --space-2xl: 4rem;    /* 64px */

  /* Global Geometry: STRICT 0px BORDER RADIUS */
  --radius-global: 0px;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Enforces brutalist non-rounded aesthetic */
}

html {
  font-family: var(--font-body);
  background-color: var(--bg-pitch);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  background-color: var(--bg-pitch);
  color: var(--text-main);
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-pitch);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-highest);
  border: 1px solid var(--border-hairline);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red);
}

/* Selection */
::selection {
  background: var(--primary-red);
  color: var(--newsprint-bone);
}

/* Typographic Hierarchy Classes */
.font-display-hero {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.font-headline-xl {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.font-headline-lg {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
}

.font-headline-md {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.25;
  text-transform: uppercase;
}

.font-headline-sm {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.35;
  text-transform: uppercase;
}

.font-body-lg {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.65;
}

.font-body-md {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.55;
}

.font-body-sm {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.font-editorial-quote {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.6;
}

.font-label-caps {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.font-label-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.15rem;
  letter-spacing: 0.04em;
}

/* Structural Hairlines & Borders */
.border-broadsheet {
  border: 1px solid var(--border-hairline);
}
.border-broadsheet-t {
  border-top: 1px solid var(--border-hairline);
}
.border-broadsheet-b {
  border-bottom: 1px solid var(--border-hairline);
}
.border-broadsheet-l {
  border-left: 1px solid var(--border-hairline);
}
.border-broadsheet-r {
  border-right: 1px solid var(--border-hairline);
}
.border-accent-red {
  border: 1px solid var(--primary-red) !important;
}
.border-accent-ochre {
  border: 1px solid var(--secondary-ochre) !important;
}

/* Broadside Grid Matrix Overlay */
.broadsheet-grid {
  display: grid;
  gap: var(--space-md);
}

/* Buttons: Brutalist Non-Rounded Functionalism */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.5rem;
  min-height: 48px; /* Accessible touch target */
  background-color: var(--primary-red);
  color: var(--newsprint-bone);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--primary-red);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover {
  background-color: var(--newsprint-bone);
  color: var(--bg-pitch);
  border-color: var(--newsprint-bone);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  background-color: var(--surface-low);
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-secondary:hover {
  border-color: var(--secondary-ochre);
  color: var(--secondary-ochre);
  background-color: var(--surface-container);
}

.btn-ochre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  background-color: var(--secondary-ochre);
  color: var(--bg-pitch);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--secondary-ochre);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-ochre:hover {
  background-color: var(--newsprint-bone);
  color: var(--bg-pitch);
  border-color: var(--newsprint-bone);
}

/* Badges & Chips */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.5rem;
  background-color: var(--surface-container);
  border: 1px solid var(--border-hairline);
  color: var(--newsprint-bone);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-red {
  background-color: var(--primary-red);
  color: var(--newsprint-bone);
  border: 1px solid var(--primary-red);
}

.badge-ochre {
  background-color: var(--secondary-ochre);
  color: var(--bg-pitch);
  border: 1px solid var(--secondary-ochre);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-red);
  color: var(--newsprint-bone);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
}

.badge-live-dot {
  width: 6px;
  height: 6px;
  background-color: var(--newsprint-bone);
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

/* Marquee Ticker */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 35s linear infinite;
}
.animate-marquee:hover {
  animation-play-state: paused;
}

/* Interactive Card Effects */
.stage-card {
  background-color: var(--surface-low);
  border: 1px solid var(--border-hairline);
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}
.stage-card:hover {
  border-color: var(--primary-red);
}

.stage-card-ochre:hover {
  border-color: var(--secondary-ochre);
}

/* Ticket Stub Notched Pass (Voucher) */
.ticket-voucher {
  background: var(--surface-low);
  border: 1px solid var(--border-hairline);
  position: relative;
  overflow: hidden;
}

.ticket-notch-l {
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-color: var(--bg-pitch);
  border: 1px solid var(--border-hairline);
  transform: translateY(-50%) rotate(45deg);
}

.ticket-notch-r {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-color: var(--bg-pitch);
  border: 1px solid var(--border-hairline);
  transform: translateY(-50%) rotate(45deg);
}

.ticket-divider-dash {
  border-top: 2px dashed var(--border-hairline);
  margin: 1.25rem 0;
}

/* Soundwave Animation */
@keyframes soundwave {
  0%, 100% { height: 4px; }
  50% { height: 16px; }
}
.soundwave-bar {
  animation: soundwave 1.2s ease-in-out infinite;
}
.soundwave-bar:nth-child(2) { animation-delay: 0.2s; }
.soundwave-bar:nth-child(3) { animation-delay: 0.4s; }
.soundwave-bar:nth-child(4) { animation-delay: 0.6s; }
.soundwave-bar:nth-child(5) { animation-delay: 0.8s; }

/* Modal Backdrop & Dialog */
.itfok-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 12, 14, 0.94);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.itfok-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.itfok-modal-container {
  background-color: var(--surface-low);
  border: 1px solid var(--border-hairline);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.itfok-modal-backdrop.active .itfok-modal-container {
  transform: translateY(0);
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.itfok-toast {
  pointer-events: auto;
  background-color: var(--surface-high);
  border-left: 4px solid var(--primary-red);
  border-top: 1px solid var(--border-hairline);
  border-right: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  color: var(--text-main);
  padding: 0.875rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
  animation: slideToast 0.25s ease-out;
}
@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Interactive Map Blueprint Styling */
.map-building {
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s;
}
.map-building:hover, .map-building.active {
  fill: var(--primary-red) !important;
  fill-opacity: 0.6 !important;
  stroke: var(--newsprint-bone) !important;
  stroke-width: 1.5 !important;
}

/* Print Styles for Box Office Voucher */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-voucher, #printable-voucher * {
    visibility: visible;
  }
  #printable-voucher {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    padding: 20px;
  }
  .no-print {
    display: none !important;
  }
}
