/* =======================================================================
   language-detail.css — LANGUAGE DETAILS PAGE (FINAL)
   =======================================================================
   PURPOSE
   -----------------------------------------------------------------------
   - Styles the Language Details page
   - Displays seasons related to a selected language
   - Includes search, grid layout, and pagination
   - Fully supports Light + Dark themes
   - Mobile responsive with search toggle

   FILE RELATIONSHIP
   -----------------------------------------------------------------------
   global.css              → layout, grid, cards, typography
   header.css              → site header
   footer.css              → site footer
   language-detail.css     → language detail ONLY (this file)

   IMPORTANT RULES
   -----------------------------------------------------------------------
   - ❌ Do NOT style header or footer here
   - ❌ Do NOT redefine `.container`
   - ❌ Do NOT use unscoped selectors
   - ✔ Scope EVERYTHING to `.page-section`
   ======================================================================= */


/* =======================================================================
   PAGE WRAPPER
   -----------------------------------------------------------------------
   Light theme uses soft lavender background.
   Dark theme override is defined at the bottom.
   ======================================================================= */

.page-section {
  background: #faf5ff;        /* light theme background */
  padding-bottom: 40px;
}


/* =======================================================================
   OPTIONAL AD SLOT
   ======================================================================= */

.page-section .ad-slot {
  margin: 16px auto 24px;
  text-align: center;
}


/* =======================================================================
   HEADER (TITLE + SEARCH)
   ======================================================================= */

.page-section .seasons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  position: relative; /* needed for mobile search toggle */
}

.page-section .seasons-header h1 {
  margin: 0;
  font-size: 26px;
  color: var(--text);
}


/* =======================================================================
   SEARCH FILTER
   ======================================================================= */

.page-section .seasons-filters input {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.15);
  font-size: 14px;
  background: #fff;
  color: #111;
}


/* =======================================================================
   MOBILE SEARCH TOGGLE ICON
   ======================================================================= */

.page-section .search-toggle {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}


/* =======================================================================
   SEASONS GRID
   ======================================================================= */

.page-section .seasons-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}


/* =======================================================================
   SEASON CARD
   ======================================================================= */

.page-section .season-card {
  background: var(--card);         /* theme-safe */
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-1);
  transition: transform .15s ease, box-shadow .15s ease;
}

.page-section .season-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0,0,0,.15);
}

.page-section .season-thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.page-section .season-body {
  padding: 12px;
}

.page-section .season-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-section .season-meta {
  font-size: 13px;
  color: var(--muted);
}


/* =======================================================================
   PAGINATION (CLIENT-SIDE)
   ======================================================================= */

.page-section .pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
}

.page-section .pagination button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.page-section .pagination button:hover,
.page-section .pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}


/* =======================================================================
   RESPONSIVE LAYOUT
   ======================================================================= */

@media (max-width: 1024px) {
  .page-section .seasons-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {

  .page-section .seasons-header {
    flex-direction: row;
  }

  .page-section .seasons-header h1 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }

  .page-section .search-toggle {
    display: inline-block;
  }

  .page-section .seasons-filters {
    display: none;
    width: 100%;
    margin-top: 8px;
  }

  .page-section .seasons-filters.mobile-active {
    display: block;
  }

  .page-section .seasons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =======================================================================
   DARK THEME FIX — PAGE BACKGROUND (CRITICAL)
   -----------------------------------------------------------------------
   Prevents light lavender background in dark mode.
   Uses global dark background variable.
   ======================================================================= */

[data-theme="dark"] .page-section {
  background: var(--bg);
}
