/* ── RESPONSIVE OVERRIDES ── */

/* 1. Ultra Wide Screens - Cap content width for readability */
@media (min-width: 1800px) {
  .hero-content {
    padding-left: calc((100vw - 1600px) / 2);
  }
  .hero-meta {
    right: calc((100vw - 1600px) / 2);
  }
}

/* 2. Large Tablets & Laptops (max-width: 1100px) */
@media (max-width: 1100px) {
  .about {
    gap: 40px;
  }
  .about-heading {
    font-size: 42px;
  }
  .themes-grid, .cast-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns instead of 3 */
  }
}

/* 3. Small Tablets & Phones (max-width: 900px) */
/* (Your existing media query is here, these are additions to it) */
@media (max-width: 900px) {
  .hero {
    align-items: center; /* Center content on mobile for better focus */
    text-align: center;
  }
  
  .hero-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-synopsis {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-meta {
    position: relative;
    right: auto;
    bottom: auto;
    text-align: center;
    margin-top: 30px;
  }

  .about-stats {
    justify-content: space-around;
  }

  .scene-img {
    height: 400px;
  }
}

/* 4. Small Mobile Devices (max-width: 600px) */
@media (max-width: 600px) {
  nav {
    padding: 15px 20px;
  }
  
  .nav-logo {
    font-size: 18px;
  }

  .hero-logo {
    width: 280px;
  }

  .hero-tagline {
    font-size: 18px;
  }

  .hero-synopsis {
    font-size: 14px;
    line-height: 1.6;
  }

  .btn-primary, .btn-secondary {
    width: 100%; /* Full width buttons for easier tapping */
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
  }

  .about-heading {
    font-size: 32px;
  }

  .about-stats {
    flex-direction: column;
    gap: 25px;
    align-items: center;
  }

  .themes-grid, .cast-grid {
    grid-template-columns: 1fr; /* Single column */
  }

  .theme-card, .cast-card {
    padding: 30px 24px;
  }

  .cast-name {
    font-size: 40px;
  }

  .scene-quote {
    font-size: 24px;
  }
}

/* 5. Touch Device Optimizations */
@media (hover: none) {
  .theme-card:hover, .cast-card:hover {
    transform: none; /* Disable hover lifts on mobile to prevent "sticky" taps */
  }
  
  .nav.scrolled {
    background: rgba(10,10,10,1); /* Solid background for mobile header */
  }
}

/* 6. Fix for short screens (Landscape phones) */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    height: auto;
    padding: 100px 20px;
  }
  .hero-bg {
    height: 120%; /* Ensure coverage */
  }
}

/* ── RESPONSIVE OVERRIDES (Comprehensive) ── */

/* 1. Navigation & Header */
@media (max-width: 900px) {
  nav { 
    padding: 15px 24px; 
  }
  .nav-links { 
    display: none; /* Hide for mobile hamburger or drawer */
  }
  .hero-logo { 
    width: 320px; 
  }
}

/* 2. Legal Page & Content Widths */
@media (max-width: 900px) {
  .legal-page { 
    padding: 120px 24px 80px; 
  }
  .legal-title { 
    font-size: 36px; 
    line-height: 1.2;
  }
  .legal-highlight {
    padding: 16px;
    font-size: 14px;
  }
}

/* 3. Cookie Tables (Critical for Mobile) */
@media (max-width: 600px) {
  .cookie-table {
    display: block;
    overflow-x: auto; /* Allow horizontal swipe for tables on small phones */
    -webkit-overflow-scrolling: touch;
  }
  
  .cookie-table th, 
  .cookie-table td {
    min-width: 120px; /* Prevents text from being squashed too thin */
    padding: 10px;
    font-size: 13px;
  }

  .badge-essential, 
  .badge-analytics, 
  .badge-functional {
    font-size: 9px;
    padding: 2px 6px;
  }
}

/* 4. 404 Glitch Page Responsive */
@media (max-width: 600px) {
  .code {
    font-size: 80px; /* Shrink large "404" text so it doesn't overflow */
    letter-spacing: 2px;
  }
  
  .title {
    font-size: 24px;
  }
  
  .text {
    font-size: 14px;
    padding: 0 10px;
  }

  .wrap {
    padding: 20px;
  }

  /* Disable heavy animations on low-power mobile devices for better battery/perf */
  body::after {
    opacity: 0.02; /* Reduce static overlay intensity */
  }
}

/* 5. Grids & Footer */
@media (max-width: 900px) {
  .about { 
    grid-template-columns: 1fr; 
    padding: 60px 24px; 
    gap: 40px; 
  }
  
  .themes-grid, 
  .cast-grid { 
    grid-template-columns: 1fr; 
  }

  .site-footer { 
    padding: 40px 24px; 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 30px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* 6. Touch Targets */
@media (pointer: coarse) {
  .btn, 
  .btn-primary, 
  .btn-secondary {
    min-height: 48px; /* Easier to tap with fingers */
  }
  
  .nav-links a, 
  .legal-section a {
    padding: 5px 0; /* Increase clickable area */
  }
}

/* 7. High-Resolution Screen Cap */
@media (min-width: 1600px) {
  .legal-page {
    max-width: 1000px; /* Allow a bit more width on ultra-wide monitors */
  }
}