/* css/mobile.css */

/* --- EPISODE GRID --- */
/* Tablet layout adjustments */
@media (max-width: 768px) {
  .episode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .player-modal {
    align-items: flex-start; /* keep card in view without shifting backdrop */
    padding-top: clamp(1rem, 6vh, 3rem);
  }
}

/* Single column for very small screens */
@media (max-width: 480px) {
  .episode-grid {
    grid-template-columns: 1fr;
  }
}

/* --- DESKTOP OVERRIDES --- */
@media (min-width: 801px) {
  /* Hide mobile-only navigation on larger screens */
  .mobile-nav {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    max-height: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    z-index: -1 !important;
  }

  .burger {
    display: none !important;
  }
}

/* --- MOBILE HEADER, BURGER & NAV --- */
@media (max-width: 800px) {
  /* Fixed header always at top */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    width: 100%;
    background: #e2d7bf;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
    transition: padding 0.25s ease, height 0.25s ease;
  }

  /* Large logo state */
  .site-header .logo {
    height: 90px;
    transform-origin: center center;
    transition: height 0.25s ease, transform 0.25s ease;
  }

  /* Shrunk state */
  .site-header.shrunk {
    padding: 0.4rem 1rem;
  }

  .site-header.shrunk .logo {
    height: 55px;
    transform: scale(0.9);
  }

  /* Apply spacing for all main content after header */
  body main {
    margin-top: 110px;
    transition: margin-top 0.25s ease;
  }
  body .site-header.shrunk ~ main {
    margin-top: 70px;
  }

  /* Burger button */
  .burger {
    width: 28px;
    height: 22px;
    margin-left: auto;
    margin-right: clamp(0.75rem, 0vw, 1.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
    padding: 0;
  }

  .burger .line {
    width: 100%;
    height: 3px;
    background-color: black;
    transition: all 0.3s ease;
    border-radius: 5px;
  }

  .burger.open .top {
    transform: rotate(45deg) translateY(13px);
  }
  .burger.open .middle {
    opacity: 0;
  }
  .burger.open .bottom {
    transform: rotate(-45deg) translateY(-13px);
  }

  /* Social icons near burger */
  .header-socials {
    position: absolute;
    right: clamp(5.25rem, 11vw, 4.75rem);
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    grid-template-columns: repeat(2, 28px);
    grid-template-rows: repeat(2, 28px);
    gap: 0.6rem;
    margin: 0;
    padding: 0;
  }

  .header-socials a {
    width: 28px;
    height: 28px;
  }

  .header-socials img {
    width: 18px;
    height: 18px;
  }

  /* Mobile dropdown nav */
  .mobile-nav {
    display: flex;
    flex-direction: column;
    background: #e2d7bf;
    padding: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }

  /* Hidden state toggled by JS */
  .mobile-nav.hidden {
    display: none;
  }

  /* Expanded state when burger is active */
  .mobile-nav.is-open {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .mobile-nav .nav-list li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.15);
  }

  .mobile-nav .nav-list a {
    display: block;
  }

  .mobile-nav a {
    color: black;
    text-transform: uppercase;
    font-family: var(--font-main);
    font-weight: bold;
    text-align: center;
    padding: 0.75rem 0;
    text-decoration: none;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}


@media (max-width: 800px) {
  /* Always push content below the fixed header */
  body main,
  body .episodes-page,
  body .events-page {
    margin-top: 120px !important; /* match large header height */
    transition: margin-top 0.25s ease;
  }

  body .site-header.shrunk ~ main,
  body .site-header.shrunk ~ .episodes-page,
  body .site-header.shrunk ~ .events-page {
    margin-top: 80px !important; /* match shrunk header height */
  }

  /* Optional: make sure headings never sit flush to the top */
  .season-heading {
    padding-top: 1rem;
  }
}
