/* ==========================================================================
   Haringparty Best — Mobile Optimization Layer
   Loaded after styles.css/festival.css, overrides for mobile-first behavior.
   ========================================================================== */

/* iOS safe-area + smooth scroll + tap highlight */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  -webkit-tap-highlight-color: rgba(255, 122, 26, 0.25);
  text-rendering: optimizeLegibility;
}

/* Prevent horizontal scrollbar from any rogue overflow */
html, body { max-width: 100vw; overflow-x: hidden; }

/* All buttons/anchors: 44px minimum touch target */
button, .btn, a.btn, .faq-q, .lightbox-close, .lightbox-arrow,
.nav-links a, .sb-link {
  min-height: 44px;
}

/* Better form inputs: prevent iOS auto-zoom by using >=16px font on small screens */
input, textarea, select {
  font-size: 16px;
}

/* ============== HAMBURGER MENU ============== */
.nav-burger {
  display: none;
  background: transparent;
  border: 1px solid currentColor;
  width: 44px;
  height: 44px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: inherit;
  position: relative;
  z-index: 60;
}
.nav-burger span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-burger span::before,
.nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-burger span::before { top: -7px; }
.nav-burger span::after  { top: 7px; }
.nav-burger.open span { background: transparent; }
.nav-burger.open span::before { top: 0; transform: rotate(45deg); }
.nav-burger.open span::after  { top: 0; transform: rotate(-45deg); }

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(6, 9, 26, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 5.5rem 2rem 2rem;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  animation: drawerIn 0.25s ease;
}
@keyframes drawerIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
  display: block;
  padding: 1rem 0.5rem;
  font-family: var(--f-block, "Archivo Black", sans-serif);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff4d6;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 122, 26, 0.18);
}
.mobile-drawer a.cta {
  margin-top: 1.4rem;
  background: linear-gradient(135deg, #ff7a1a, #e63946);
  color: #fff4d6;
  text-align: center;
  border: none;
  padding: 1.1rem 1rem;
  border-radius: 2px;
  box-shadow: 0 8px 30px rgba(255, 122, 26, 0.4);
}
body.no-scroll { overflow: hidden; }

/* ============== FESTIVAL EDITION OVERRIDES ============== */
@media (max-width: 1024px) {
  .nav-burger { display: inline-flex; }
}

@media (max-width: 1024px) {
  /* Festival nav: hide desktop links + show burger */
  .nav-links { display: none !important; }

  /* Hero — extra top-padding so logo + glow clear the fixed nav.
     Nav is ~75px on mobile (logo+text). With safe-area-inset-top + 8.5rem
     the logo never visually overlaps the nav blur band. */
  .hero {
    padding: calc(env(safe-area-inset-top, 0) + 8.5rem) 0 3.5rem;
    min-height: auto;
  }
  .hero-content { padding: 0 1.25rem; }
  .hero-logo {
    width: clamp(180px, 56vw, 320px);
    height: clamp(180px, 56vw, 320px);
    margin-bottom: 1.2rem;
    /* Stronger glow so the metallic logo pops on dark mobile screens */
    filter:
      drop-shadow(0 0 22px rgba(255, 160, 51, 0.55))
      drop-shadow(0 0 38px rgba(255, 122, 26, 0.4))
      drop-shadow(0 4px 20px rgba(0, 0, 0, 0.6));
  }
  .hero-title { font-size: clamp(2.6rem, 13vw, 5rem); }
  /* Brighter 'DE HARING' on mobile — keep gradient luminous, never down to dark red */
  .hero-title .l2 {
    background: linear-gradient(180deg,
      #ffd089 0%,
      var(--c-orange-bright) 45%,
      var(--c-orange) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    filter:
      drop-shadow(0 2px 14px rgba(6,9,26,0.5))
      drop-shadow(0 0 28px rgba(255, 160, 51, 0.45));
  }
  .hero-sub { font-size: 1rem; padding: 0 0.5rem; }
  .hero-meta { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-meta-item {
    flex: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 122, 26, 0.2);
    padding: 0.85rem 1rem;
  }
  .hero-meta-item:nth-child(2) { border-right: 1px solid rgba(255, 122, 26, 0.2); }
  .hero-meta-item:nth-last-child(-n+2) { border-bottom: none; }
  .hero-meta-item:nth-child(odd) { border-right: 1px solid rgba(255, 122, 26, 0.2); }
  .hero-cta { margin-bottom: 2rem; }
  .hero-cta .btn { flex: 1; min-width: 240px; justify-content: center; }
  .scroll-cue { display: none; }

  /* Section padding shrink */
  .dark-section, .lineup-section, .photos-section, .sponsors-section,
  .faq-section, .countdown-section, .event-section { padding: 4rem 0; }
  .contact-section { padding: 4rem 0 2rem; }

  /* Section title */
  .section-title { font-size: clamp(2rem, 8vw, 3.6rem); }

  /* Marquee — faster on mobile */
  .marquee-track { animation-duration: 22s; font-size: 1.1rem; }

  /* Countdown cells — avoid overflow */
  .cd-grid { gap: 0.6rem; }
  .cd-cell { padding: 1.2rem 0.5rem; }
  .cd-cell .num { font-size: clamp(2.4rem, 11vw, 3.6rem); }

  /* Included strip → stack */
  .included-strip { padding: 1.6rem; gap: 1.2rem; grid-template-columns: 1fr; }
  .included-strip h3 { font-size: 1.6rem; }
  .included-list { grid-template-columns: 1fr; }

  /* Tier card — full width */
  .tier-flag { right: auto; left: 14px; top: -10px; }

  /* Photo grid — better usage of mobile space */
  .photo-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 110px; gap: 0.5rem; }
  .photo-tile.size-lg { grid-column: span 2; grid-row: span 2; }
  .photo-tile.size-md, .photo-tile.size-wide { grid-column: span 2; grid-row: span 1; }
  .photo-tile.size-tall { grid-column: span 1; grid-row: span 2; }

  /* Lightbox — keep arrows inside viewport */
  .lightbox { padding: 0.8rem; }
  .lightbox-frame { width: 96vw; height: 75vh; }
  .lightbox-close { top: 8px; right: 8px; width: 40px; height: 40px; }
  .lightbox-arrow { width: 40px; height: 40px; }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
  .lightbox-counter { top: 8px; left: 8px; right: auto; }

  /* Sponsor carousel tiles smaller */
  .sponsor-tile { width: 160px; height: 80px; font-size: 0.82rem; padding: 0.6rem; }

  /* Sponsor carousel head — single line */
  .sponsor-carousel-head { flex-direction: column; gap: 0.4rem; align-items: flex-start; }

  /* Contact: stack */
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Footer bar — stacked, centered */
  .footer-bar { flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; }

  /* Lineup poster rows */
  .poster-row { gap: 0 0.6rem; padding: 0.3rem 0; }
  .poster-row.tier1 { font-size: clamp(1.8rem, 9vw, 3rem); }
  .poster-row.tier2 { font-size: clamp(1.3rem, 6vw, 2.2rem); }
  .poster-row.tier3 { font-size: clamp(1rem, 4.5vw, 1.6rem); }
  .poster-row.tier4 { font-size: 0.78rem; letter-spacing: 0.15em; }

  /* FAQ */
  .faq-grid { gap: 2rem; }
  .faq-q { font-size: 0.88rem; padding: 1rem 1rem; }
  .faq-a { font-size: 0.92rem; }
  .faq-item.open .faq-a { max-height: 600px; }

  /* Buttons — straighten clip-path on full-width buttons */
  .hero-cta .btn { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); }

  /* Container — slight extra breathing room */
  .container { width: min(1320px, 94vw); }
}

/* ============== STYLES.CSS (Classic) OVERRIDES ============== */
@media (max-width: 980px) {
  /* Classic nav already hides links via .nav-links { display: none } at 980px,
     but the hamburger we add covers both editions. */

  .hero { padding: 2.5rem 0 3.5rem; }
  .hero-grid { gap: 2rem; }
  .hero-title { font-size: clamp(2.6rem, 12vw, 5rem); line-height: 0.9; }
  .hero-sub { font-size: 1rem; }
  .hero-meta { gap: 1rem; }
  .hero-meta-item .value { font-size: 1.1rem; }
  .hero-logo { max-width: 280px; }
  .hero-stamp { width: 110px; height: 110px; font-size: 0.75rem; bottom: -16px; right: -16px; }
  .hero-stamp strong { font-size: 1.5rem; }
  .countdown-cell { min-width: 64px; padding: 0.5rem 0.6rem; }
  .countdown-cell .num { font-size: 1.5rem; }

  .event-section, .lineup-section, .photos-section, .sponsors-section, .faq-section { padding: 3.5rem 0; }
  .included-strip { padding: 1.4rem; }
  .marquee-track { font-size: 1.05rem; animation-duration: 22s; }
  .ribbon { padding: 0.5rem 1rem; font-size: 0.9rem; }

  .lightbox { padding: 0.8rem; }
  .lightbox-frame { width: 96vw; height: 75vh; }
  .lightbox-close { top: 8px; right: 8px; }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
}

@media (max-width: 640px) {
  .hero-title { font-size: clamp(2.2rem, 12vw, 3.2rem); }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { justify-content: center; width: 100%; }
  .countdown { gap: 0.4rem; }
  .countdown-cell { flex: 1; min-width: 0; }
  .included-list { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; gap: 0.5rem; text-align: center; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .tier.featured { transform: none; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; }
  .sponsor-tile { width: 150px; height: 80px; font-size: 0.8rem; }
  .section-title { font-size: clamp(1.8rem, 8vw, 3rem); }
  .nav-logo-text { font-size: 0.9rem; }
  .nav-logo-text small { font-size: 0.6rem; }
  .nav-logo img { height: 38px; width: 38px; }
}

/* ============== ADMIN PAGE — Mobile sidebar drawer ============== */
@media (max-width: 720px) {
  .admin { grid-template-columns: 1fr !important; }
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    width: 80vw; max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    height: 100vh !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after {
    content: "";
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 150;
  }
  .admin-burger {
    display: inline-flex !important;
    position: fixed;
    top: 1rem; left: 1rem;
    z-index: 250;
    width: 44px; height: 44px;
    background: rgba(6, 9, 26, 0.85);
    color: #ff7a1a;
    border: 1px solid #ff7a1a;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
  }
  .admin-burger span {
    width: 18px; height: 2px; background: currentColor;
    position: relative; display: block;
  }
  .admin-burger span::before, .admin-burger span::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
  }
  .admin-burger span::before { top: -6px; }
  .admin-burger span::after  { top: 6px; }
  .admin .main { padding-top: 4rem; }
  .admin .topbar { padding-left: 3.5rem !important; }
}
.admin-burger { display: none; }

/* ============== CHECKOUT MOBILE ============== */
@media (max-width: 700px) {
  .checkout-shell { padding: 5rem 0 3rem; }
  .co-grid { gap: 1.2rem; }
  .co-panel { padding: 1.4rem; }
  .co-panel h3 { font-size: 1.2rem; }
  .steps { flex-wrap: wrap; }
  .step { flex: 1 1 50%; border-bottom: 1px solid rgba(255,122,26,0.2); padding: 0.7rem 0.6rem; font-size: 0.65rem; }
  .step:nth-child(2) { border-right: none; }
  .step:nth-child(3), .step:nth-child(4) { border-bottom: none; }
  .form-grid, .pm-list { grid-template-columns: 1fr !important; }
  .ticket-row { grid-template-columns: 1fr !important; gap: 0.6rem; }
  .summary-meta { grid-template-columns: 1fr 1fr !important; }
}

/* ============== TICKET PAGE MOBILE ============== */
@media (max-width: 700px) {
  .ticket { grid-template-columns: 1fr !important; }
  .ticket-meta { grid-template-columns: 1fr 1fr !important; }
  .info-strip { grid-template-columns: 1fr !important; }
  .confirm-banner { grid-template-columns: 1fr !important; text-align: center; gap: 1rem; padding: 1.4rem !important; }
}

/* ============== SPONSOREN PAGE MOBILE ============== */
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr !important; gap: 0.6rem !important; }
}

/* ============== Reduced motion support ============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track, .sponsor-track { animation: none !important; }
  .sunburst, .hero-rays, .hero-glow { animation: none !important; }
}
