/* =========================================
   SALSA HIGHLIGHTS
   Festival Selector + Year Selector
========================================= */

.salsa-highlights-page {
  width: 100%;
}


/* =========================================
   INTRO
========================================= */

.highlights-intro {
  text-align: center;
}

.highlights-intro .section-subtitle {
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.7;
  opacity: 0.8;
}


/* =========================================
   FESTIVAL SELECTOR
========================================= */

.event-section {
  background: var(--salsa-gradient-6);
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-4);

  max-width: var(--max-width);
  margin: 0 auto;
}


/* =========================================
   FESTIVAL CARD
========================================= */

.event-card {
  position: relative;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--color-surface);
  border: 1px solid rgba(42, 0, 115, 0.06);
  border-radius: 18px;

  box-shadow: var(--shadow-sm);

  color: var(--color-text);
  text-decoration: none;

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  opacity: 1;
}


/* =========================================
   FESTIVAL IMAGE
========================================= */

.event-filter {
  position: relative;

  display: block;
  width: 100%;

  aspect-ratio: 16 / 9;

  overflow: hidden;
}

.event-filter img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.6s ease;
}

.event-card:hover .event-filter img {
  transform: scale(1.05);
}


/* Subtle image treatment */

.event-filter::after {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      180deg,
      rgba(42, 0, 115, 0) 55%,
      rgba(42, 0, 115, 0.12) 100%
    );

  pointer-events: none;
}


/* =========================================
   FESTIVAL CONTENT
========================================= */

.event-card .info {
  position: relative;

  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;

  width: 100%;
  padding: var(--space-3);

  text-align: left;
}


/* Gallery eyebrow */

.event-card .event-tag {
  display: inline-flex;

  margin: 0 0 var(--space-1);

  color: var(--color-primary);

  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.08em;
  line-height: 1;

  text-transform: uppercase;
}


/* Festival title */

.event-card .event-name {
  margin: 0 0 var(--space-1);

  color: var(--color-text);

  font-size: 1.3rem;
  line-height: var(--leading-tight);

  text-align: left;
}


/* View highlights */

.event-card .event-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin: auto 0 0;
  padding-top: var(--space-2);

  color: var(--color-info);

  font-size: 0.95rem;
  font-weight: 600;

  line-height: 1.2;
}

.event-card .event-date::after {
  content: "→";

  font-family: var(--font-body);
  font-size: 1rem;

  transition: transform 0.2s ease;
}

.event-card:hover .event-date::after {
  transform: translateX(4px);
}


/* =========================================
   YEAR SELECTOR
========================================= */

.year-selector-section {
  max-width: var(--max-width);
  margin: 0 auto;

  text-align: center;
}


/* =========================================
   BACK BUTTON
========================================= */

.gallery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin: 0 auto var(--space-3);
  padding: 8px 16px;

  border-radius: 6px;

  background: var(--btn-tertiary-bg);
  color: var(--btn-tertiary-text);

  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;

  letter-spacing: 0.05em;
  text-transform: uppercase;

  transition: all 0.2s ease;
}

.gallery-btn::before {
  content: "←";
}

.gallery-btn:hover {
  background: var(--btn-tertiary-bg-hover);
  color: var(--btn-tertiary-text);
  opacity: 1;
}


/* =========================================
   FESTIVAL TITLE
========================================= */

.gallery-title {
  margin: 0 0 var(--space-3);

  color: var(--color-text);

  text-align: center;
}


/* =========================================
   DECADE FILTERS
========================================= */

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  gap: var(--space-1);

  margin: 0 auto var(--space-4);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 40px;
  padding: 8px 16px;

  border: 1px solid rgba(71, 30, 128, 0.15);
  border-radius: 999px;

  background: var(--color-surface);
  color: var(--purple-700);

  cursor: pointer;

  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;

  letter-spacing: 0.04em;
  text-transform: uppercase;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.tab:hover {
  border-color: var(--purple-500);
  background: var(--purple-100);

  transform: translateY(-1px);
}

.tab.active {
  border-color: var(--purple-800);

  background: var(--purple-800);
  color: #ffffff;
}


/* =========================================
   YEAR GRID
========================================= */

.gallery-grid {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(250px, 1fr));

  gap: var(--space-3);
}


/* =========================================
   YEAR CARD
========================================= */

.gallery-card {
  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--color-surface);

  border: 1px solid rgba(42, 0, 115, 0.06);
  border-radius: 18px;

  box-shadow: var(--shadow-sm);

  color: var(--color-text);
  text-decoration: none;

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);

  box-shadow: var(--shadow-lg);

  opacity: 1;
}

.gallery-card[hidden] {
  display: none;
}


/* =========================================
   YEAR IMAGE
========================================= */

.card-image-wrapper {
  position: relative;

  width: 100%;

  aspect-ratio: 16 / 9;

  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.6s ease;
}

.gallery-card:hover .card-image {
  transform: scale(1.05);
}


/* =========================================
   YEAR CONTENT
========================================= */

.card-title-wrapper {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: flex-start;

  padding: var(--space-2) var(--space-3);

  text-align: left;
}


/* Small label above year */

.card-title-wrapper::before {
  content: "Event Highlights";

  display: block;

  margin: 0 0 4px;

  color: var(--color-primary);

  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;

  letter-spacing: 0.07em;
  line-height: 1;

  text-transform: uppercase;
}


/* Year */

.card-title {
  margin: 0;

  color: var(--color-text);

  font-size: 1.65rem;
  line-height: 1.1;
}


/* View link */

.card-title-wrapper::after {
  content: "View Highlights  →";

  display: block;

  margin-top: var(--space-1);

  color: var(--color-info);

  font-size: 0.9rem;
  font-weight: 600;

  transition: transform 0.2s ease;
}

.gallery-card:hover .card-title-wrapper::after {
  transform: translateX(3px);
}


/* =========================================
   REVEAL
========================================= */

.fade-in-on-scroll {
  opacity: 0;

  transform: translateY(30px);

  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in-on-scroll.fade-in-visible {
  opacity: 1;

  transform: translateY(0);
}


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


/* =========================================
   SMALL DESKTOP / TABLET LANDSCAPE
========================================= */

@media (max-width: 1100px) {

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

  .gallery-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

}


/* =========================================
   TABLET
========================================= */

@media (max-width: 768px) {

  /* -----------------------------------------
     FESTIVAL SELECTOR
     Stack festival cards normally.
  ----------------------------------------- */

  .events-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .event-card .info {
    padding: var(--space-2);
  }

  .event-card .event-name {
    font-size: 1.15rem;
  }

  .event-card .event-date {
    padding-top: var(--space-1);
  }


  /* -----------------------------------------
     YEAR SELECTOR
     Keep the years compact at 2 per row.
  ----------------------------------------- */

  .gallery-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: var(--space-2);
  }


  /* -----------------------------------------
     DECADE FILTERS
     Allow horizontal scrolling if they do
     not fit comfortably on one line.
  ----------------------------------------- */

  .tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;

    width: 100%;

    gap: 8px;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 2px 2px var(--space-1);

    scrollbar-width: none;

    -webkit-overflow-scrolling: touch;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
  }

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 580px) {

  /* -----------------------------------------
     INTRO
  ----------------------------------------- */

  .highlights-intro .section-subtitle {
    line-height: 1.55;
  }


  /* -----------------------------------------
     FESTIVAL CARDS
  ----------------------------------------- */

  .events-grid {
    gap: var(--space-2);
  }

  .event-card .event-tag {
    font-size: 0.66rem;
  }

  .event-card .event-name {
    font-size: 1.05rem;
  }

  .event-card .event-date {
    font-size: 0.85rem;
  }


  /* -----------------------------------------
     YEAR CARDS
     Keep 2 cards per row on mobile.
  ----------------------------------------- */

  .gallery-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 10px;
  }

  .card-title-wrapper {
    padding: 12px;
  }


  /*
   * The image and year already make the card
   * purpose clear, so remove the repeated
   * eyebrow on smaller screens.
   */

  .card-title-wrapper::before {
    display: none;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .card-title-wrapper::after {
    margin-top: 4px;

    font-size: 0.78rem;
  }


  /* -----------------------------------------
     DECADE FILTERS
  ----------------------------------------- */

  .tabs {
    margin-bottom: var(--space-3);
  }

  .tab {
    min-height: 36px;

    padding: 7px 12px;

    font-size: 0.7rem;
  }

}


/* =========================================
   VERY SMALL PHONES
========================================= */

@media (max-width: 380px) {

  /*
   * Keep the year grid at 2 columns, but make
   * the content slightly tighter.
   */

  .gallery-grid {
    gap: 8px;
  }

  .card-title-wrapper {
    padding: 10px;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-title-wrapper::after {
    font-size: 0.72rem;
  }

}