/* ══ GLOBAL DEVICE SUPPORT ADDITIONS ══ */

/* ── iPhone notch / Dynamic Island safe area support ── */
:root {
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}
header {
  padding-top: var(--safe-top);
  height: calc(70px + var(--safe-top));
}
@media (max-width: 560px) {
  header { height: calc(60px + var(--safe-top)); }
  .mobile-nav,
  #actors-page-overlay .mobile-nav,
  #contact-page-overlay .cp-mobile-nav,
  #contact-page-overlay .mobile-nav,
  #about-page-overlay .ab-mobile-nav,
  #news-page-overlay .np-mobile-nav,
  #bb-page-overlay .bb-mobile-nav,
  #bb-page-overlay .mobile-nav {
    top: calc(60px + var(--safe-top, 0px)) !important;
  }
}
.mobile-nav { top: calc(70px + var(--safe-top)); }
footer, .footer-bottom, .cp-footer-bottom, .np-footer-bottom, .footer-bottom-about {
  padding-bottom: calc(16px + var(--safe-bottom));
}

/* ── Prevent sticky hover on touch devices (all overlays) ── */
@media (hover: none) and (pointer: coarse) {
  .show-card-light:hover,
  .show-card-dark:hover,
  .show-card-past:hover { transform: none; }
  .cards-container:hover .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .cards-container:hover .side-panel { width: 0; pointer-events: none; }
  .btn-primary:hover, .btn-secondary:hover { transform: none; }
  nav a:hover { background: transparent; }
  .actor-card:hover .card-inner { transform: none; }
  .tl-card:hover { transform: none; }
  #about-page-overlay .glass-card:hover { transform: none; }
  #bb-page-overlay .glass-card:hover { transform: none; }
}

/* ── Very small phones (320px) ── */
@media (max-width: 320px) {
  .hero-tagline h1 { font-size: 20px; }
  .logo-circle { width: 90px; height: 90px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
  .header-logo-text { display: none; }
  nav a { padding: 6px 10px; font-size: 10px; letter-spacing: 0.1em; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── Landscape phone fix — all overlay pages ── */
@media (max-width: 812px) and (orientation: landscape) and (max-height: 500px) {
  #actors-page-overlay .hero,
  #about-page-overlay .hero-about,
  #contact-page-overlay .cp-hero,
  #news-page-overlay .np-hero,
  #bb-page-overlay .hero { min-height: auto; padding-top: 60px; padding-bottom: 40px; }

  #actors-page-overlay .hero-title,
  #about-page-overlay .hero-title-about { font-size: clamp(28px, 5vw, 44px); }

  #contact-page-overlay .cp-hero-title { font-size: clamp(26px, 5vw, 40px); }

  .hero-content { padding: 20px 24px 40px; gap: 20px; flex-direction: row; }
  .logo-circle { width: 100px; height: 100px; }

  /* Splash landscape */
  #splash-top { flex: 0 0 55%; }
  #splash-bottom { padding-top: 40px; padding-bottom: 10px; }
  .splash-device-wrap { max-width: 60vw; }
}

/* ── Tablet portrait (768–1024px) ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-content { padding: 40px 40px 80px; gap: 28px; }
  .cards-container { padding: 0 30px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .past-grid { grid-template-columns: repeat(2, 1fr); }
  #contact-page-overlay .cp-contacts-grid { grid-template-columns: 1fr 1fr; padding: 0 24px; }
  #contact-page-overlay .cp-visit-grid { grid-template-columns: 1fr; padding: 0 24px; }
  #about-page-overlay .ab-timeline { padding: 0 20px; }
  #about-page-overlay .tl-content { max-width: calc(50% - 30px); }
}

/* ── Large desktop (1440px+) ── */
@media (min-width: 1440px) {
  .hero-content { padding: 80px 80px 140px; }
  .cards-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Reduce motion — respect user accessibility preference ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora-blob { animation: none; }
  .logo-glow-ring { animation: none; }
  .logo-glow-ring2 { animation: none; }
  .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ── GPU compositing hint for overlay pages ── */
#actors-page-overlay,
#about-page-overlay,
#contact-page-overlay,
#news-page-overlay,
#bb-page-overlay {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── News page responsive additions ── */
@media (max-width: 767px) {
  #news-page-overlay .np-hero { min-height: 50vh; padding-top: 60px; }
  #news-page-overlay .np-container { padding: 0 16px; }
  #news-page-overlay .np-item { flex-wrap: wrap; gap: 12px; }
  #news-page-overlay .np-photo { width: 60px; height: 60px; flex-shrink: 0; }
  #news-page-overlay .np-title { font-size: 15px; }
  #news-page-overlay .np-preview { font-size: 13px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  #news-page-overlay footer { grid-template-columns: 1fr; padding: 32px 20px; gap: 20px; }
  #news-page-overlay .np-footer-bottom { flex-direction: column; gap: 4px; text-align: center; font-size: 12px; padding: 12px 16px; }
}
@media (max-width: 480px) {
  #news-page-overlay .np-hero-title { font-size: clamp(2rem, 8vw, 3rem); }
  #np-modal-box { border-radius: 16px; padding: 20px; }
}