/**
 * Front-page section styles for the Festival Theme.
 *
 * Loaded ONLY on the front page (see festival_theme_scripts() in functions.php) and
 * declared dependent on `festival-theme-style`, so it always loads AFTER style.css —
 * the global tokens, reset, utilities and base it relies on (var(--color-*), .card,
 * .section, .section-header, .lineup-grid) live there.
 *
 * Only selectors rendered EXCLUSIVELY on the front page belong here. Selectors shared
 * with single-event / archive-event pages stay in style.css, otherwise those pages
 * (which do not load this file) would lose their styling.
 */

/* ---------- Floating nav ---------- */
.float-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--color-primary);
  border: 2px solid var(--color-white);
  border-radius: 999px;
  padding: 0.6rem 0.45rem;
  z-index: 900;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.float-nav.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.float-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  color: var(--color-white);
  transition: background 0.2s ease, transform 0.2s ease;
}

/* todo: still needed? */
@media (hover: hover) {
  .float-nav-item:hover {
    background: rgb(var(--rgb-white) / 0.25);
    transform: scale(1.12);
  }
}

/* Mobile: horizontal strip at bottom-right */
@media (max-width: 768px) {
  .float-nav {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    transform: none;
    flex-direction: row;
    padding: 0.45rem 0.6rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100svh - var(--header-height));
  background: var(--hero-bg);
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(var(--rgb-shadow) / 0.25), rgb(var(--rgb-shadow) / 0.55));
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  min-height: calc(100svh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2.5rem;
  padding: var(--spacing);
  transform: translateY(-3.5vh);
}

.hero-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-event-info {
  margin-top: -0.75rem;
}

.hero-logo {
  width: 90%;
  height: auto;
  max-height: 50vh;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgb(var(--rgb-shadow) / 0.4));
}

.hero .hero-event-name {
  font-size: var(--text-xl-bold-size);
  font-weight: var(--text-xl-bold-weight);
  line-height: var(--text-xl-bold-lh);
  letter-spacing: var(--text-xl-bold-spacing);
  color: var(--color-white);
  text-transform: uppercase;
  margin: 0;
}

.hero-date {
  font-size: var(--text-xl-reg-size);
  font-weight: var(--text-xl-reg-weight);
  letter-spacing: var(--text-xl-reg-spacing);
  line-height: var(--text-xl-reg-lh);
  color: var(--color-white);
  margin: -0.12em 0 0;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 2.5rem;
  text-transform: uppercase;

}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 5.675rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--color-primary);
  color: var(--color-bg);
  font-weight: 700;
  font-size: 2.1rem;
  white-space: nowrap;
  transition: background var(--transition-fast) ease, color var(--transition-fast) ease, border-color var(--transition-fast) ease, transform var(--transition-fast) ease;
}

@media (hover: hover) {
  .hero-btn:hover,
  .hero-btn:focus {
    background: var(--color-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-2px);
  }
}

.hero-btn--ghost {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

@media (hover: hover) {
  .hero-btn--ghost:hover,
  .hero-btn--ghost:focus {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
  }
}

/* ---------- Lineup (front-page-only parts) ---------- */
.section.section-lineup {
  padding-top: var(--spacing-snappy);
}

.lineup-heading-row {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.lineup-heading {
  display: block;
  width: 100%;
  color: var(--color-secondary);
  font-size: var(--text-l-bold-size);
  font-weight: var(--text-l-bold-weight);
  letter-spacing: var(--text-l-bold-spacing);
  line-height: var(--text-l-bold-lh);
  text-transform: uppercase;
  text-align: center;
}

/* ---------- Info ---------- */
.info-link-row {
  display: block;
  margin: 0.5rem 0 0;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--color-border);
  border-radius: 0.875rem;
  color: var(--color-text);
  font-weight: 700;
  transition: background var(--transition-fast) ease, transform var(--transition-fast) ease;
}

@media (hover: hover) {
  .info-link-row:hover,
  .info-link-row:focus {
    background: var(--tint-secondary);
    transform: translateY(-2px);
  }
}

.section-info > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section-info .about-grid {
  flex: 1;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
}

.section-info .page-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-info .info-card,
.section-info .info-link-row {
  text-align: center;
}

.section-info .info-link-row a,
.section-info .info-link-description {
  margin-left: auto;
  margin-right: auto;
}

/* Card link wrapper — makes entire card clickable */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

/* Card headings */
.info-card h3,
.about-card h3 {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

/* ---------- About section page-cards ---------- */
.about-grid .page-card {
  text-align: center;
  color: var(--color-white);
}

.about-grid .page-card h3 {
  font-size: var(--text-m-bold-size);
  text-transform: uppercase;
  color: var(--color-white);
  margin-bottom: 0.75rem;
}

/* diagonal: top-left + bottom-right → secondary; top-right + bottom-left → primary */
.about-grid .page-card:nth-child(1),
.about-grid .page-card:nth-child(4) {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.about-grid .page-card:nth-child(2),
.about-grid .page-card:nth-child(3) {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* ---------- Info / About / Gallery grids ---------- */
.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.section-about > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing);
}

.section.section-about {
  background: var(--color-primary);
  color: var(--color-white);
  padding-top: var(--spacing-snappy);
}

.about-heading {
  text-transform: uppercase;
  font-size: var(--text-l-bold-size);
  font-weight: var(--text-l-bold-weight);
  letter-spacing: var(--text-l-bold-spacing);
  line-height: var(--text-l-bold-lh);
  text-align: center;
  color: var(--color-white);
  margin: 0;
  flex-shrink: 0;
}

.about-content-row {
  display: flex;
  gap: 1.5rem;
  flex: 10;
  min-height: 0;
}

.about-card-left {
  flex: 1;
  background: var(--color-white);
  border: none;
  border-radius: 1.5rem;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--color-primary);
}

.about-card-left .card-link {
  height: auto;
}

.about-excerpt {
  font-size: var(--text-s-reg-size);
  line-height: var(--text-s-reg-lh);
  margin: 0;
}

.about-excerpt p {
  margin: 0 0 0.75em;
}

.about-excerpt p:last-child {
  margin-bottom: 0;
}

.about-card-right {
  flex: 1;
  border-radius: 1.5rem;
  overflow: hidden;
  background: var(--surface-2);
  min-height: 0;
}

.about-card-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-sponsor-strip {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 0;
}

.about-sponsor-label {
  font-size: var(--text-m-bold-size);
  font-weight: var(--text-m-bold-weight);
  letter-spacing: var(--text-m-bold-spacing);
  line-height: var(--text-m-bold-lh);
  text-transform: uppercase;
  color: var(--color-white);
  margin: 0;
}

.about-sponsor-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
}

.about-sponsor-logos img {
  max-height: 6rem;
  max-width: 14rem;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Gallery ---------- */
.section.section-gallery {
  padding-top: var(--spacing-snappy);
}

.section-gallery > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gallery-heading {
  text-transform: uppercase;
  font-size: var(--text-l-bold-size);
  font-weight: var(--text-l-bold-weight);
  letter-spacing: var(--text-l-bold-spacing);
  line-height: var(--text-l-bold-lh);
  text-align: center;
  color: var(--color-primary);
  margin: 0;
  flex-shrink: 0;
}

.gallery-events-row {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  min-height: 0;
}

.gallery-event-card {
  flex: 1;
  max-width: 450px;
  height: 36.6rem;
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  display: block;
}

.gallery-event-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: transform 0.4s ease;
}

@media (hover: hover) {
  .gallery-event-card:hover img {
    transform: scale(1.04);
  }
}

.gallery-event-label {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  color: var(--color-primary);
  font-size: var(--text-s-reg-size);
  font-weight: var(--text-s-reg-weight);
  text-transform: uppercase;
  padding: 0.5rem 1.5rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

.gallery-empty-state {
  text-align: center;
  color: var(--color-muted);
  padding: calc(var(--spacing) * 2) 0;
}

/* ---------- Responsive ---------- */
/* Collapse the front-page-only grids. The shared `.lineup-grid` collapse stays in
   style.css; these live here so they override the base column rules above (which,
   loading after style.css, would otherwise win at narrow widths). */
@media (max-width: 900px) {
  .section-about .about-grid {
    grid-template-columns: 1fr;
  }

  /* Tighter grid gap on tablets — cards still 2×2 */
  .section-info .about-grid {
    gap: 0.75rem;
  }

  /* Scale down card padding and heading to keep content comfortable */
  .section-info .page-card {
    padding: 0.85rem;
  }

  .section-info .about-grid .page-card h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    margin-bottom: 0.5rem;
  }

  .about-content-row {
    flex-direction: column;
  }

  .about-card-right {
    min-height: 200px;
  }

  .gallery-events-row {
    flex-direction: column;
    align-items: center;
    gap: 0em;
  }

  .gallery-event-card {
    width: 100%;
    max-width: 480px;
    height: 16.625rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;

  }
}

@media (max-width: 600px) {
  /* Single column: 4 cards stack, each ~25dvh — still fills the viewport */
  .section-info .about-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .section-info .page-card {
    padding: 1rem;
  }

  .section-info .about-grid .page-card h3 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    margin-bottom: 0.35rem;
  }
}

@media (max-width: 768px) {
  .hero-btn {
    font-size: 1.5rem;
    padding: 0.65rem 3rem;
  }
}

@media (max-width: 480px) {
  .hero-inner {
    padding: var(--spacing);
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-btn {
    width: 100%;
    font-size: 1.25rem;
    padding: 0.65rem 1.5rem;
  }
}
