/* 1. Reset & Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; scroll-behavior: smooth; }

/* 2. CSS Variables */
:root { 
  --afterdark-accent: #ffffff; /* Theme Color */
  --scrollbar-track: #2c3e50; 
  --scrollbar-thumb: var(--afterdark-accent); 
  --scrollbar-thumb-hover: #6a1b9a;
}

/* 3. Age Gate Styles (No Changes) */
#age-gate {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.95); color: #fff; z-index: 10000;
  display: none; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; padding: 20px; box-sizing: border-box;
}
#age-gate p {
  font-size: 1.1em; margin-bottom: 25px; max-width: 700px; line-height: 1.6;
}
.age-gate-buttons {
  display: flex; gap: 15px; margin-top: 10px;
}
#age-gate button {
  padding: 12px 20px; font-size: 1em; border: none; cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease; border-radius: 5px;
  flex-grow: 1; max-width: 250px;
}
#accept-age-btn { background-color: #f89304; color: #000; }
#accept-age-btn:hover { background-color: #007bff; color: #fff; }
#reject-age-btn { background-color: #6c757d; color: #fff; }
#reject-age-btn:hover { background-color: #5a6268; }

/* 4. Player & Info Bar (No Changes) */
.video-container { position: relative; width: 100%; padding-top: 56.25%; background-color: #000; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.info-bar { background-color: #000; text-align: center; padding: 10px 5px; margin-top: -1px; }
.info-bar p { color: #fff; margin: 0; font-size: 0.9em; font-style: italic; }
.info-bar i { margin-left: 8px; }

/* 5. Gallery & Category Styles (★★ CHANGES HERE ★★) */
.categorized-gallery-scroll-container {
    background-color: #150a00;
    max-height: 855px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    padding: 10px;
    margin-top: 0 !important; /* Ensures no gap */
    border-radius: 0 0 10px 10px;
}
.movies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px; /* ★★★ FIX: Sets BOTH row and column gap to 5px ★★★ */
}
.gallery-category-title { 
    grid-column: 1 / -1;
    background-color: #2C3E50; 
    color: var(--afterdark-accent);
    text-align: center; 
    padding: 8px 5px; 
    margin-top: 5px;    /* ★★★ FIX: Changed from 15px to 5px for smaller gap between sections ★★★ */
    margin-bottom: 5px; 
    font-size: 1.2em; 
    font-weight: bold; 
    border-radius: 4px; 
    text-transform: uppercase;
    border-bottom: 2px solid var(--afterdark-accent);
}
.gallery-item {
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
    border: 1px solid #444;
}
.gallery-item:hover img {
    transform: scale(1.05);
    border-color: #ffcc00;
}
.gallery-item p.movie-description-gallery {
    font-family: Arial, sans-serif;
    font-size: 0.75em;
    color: #ccc;
    margin-top: 5px;
    line-height: 1.3;
    height: 2.925em; /* Approx 3 lines */
    overflow: hidden;
}

/* 6. Skip Link (No Changes) */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static !important; width: auto !important; height: auto !important; padding: 8px 12px; background: #A70000; color: #fff; display: inline-block; z-index: 9999; }

/* 7. Media Queries (No Changes) */
@media (max-width: 768px) {
  .movies-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 8px; /* You can adjust mobile gap if needed */
  }
  .gallery-item img { height: 100px; }
  .gallery-item p.movie-description-gallery { font-size: 0.7em; height: 2.73em; }
  .gallery-category-title { font-size: 1.15em; }
  .age-gate-buttons { flex-direction: column; }
  #age-gate button { width: 100%; max-width: none; margin-bottom: 10px; }
}