:root {
  /* Gradient defaults */
  --bg-left: #111827;
  --bg-right: #374151;

  /* UI sizes */
  --arrow-size: 3rem;
  --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
  --progress-bar-height: 6px;
  --max-card-height: 80vh;

  /* Transition timing (sync with JS) */
  --transition-duration: 900ms;
}

/* Background layers: bg holds the current gradient, fg crossfades in */
#background-layer,
#background-layer-fg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(90deg, var(--bg-left), var(--bg-right));
  transform: scale(1.05); /* avoid edge artifacts when blurred */
  transition: opacity var(--transition-duration) ease-in-out,
    background var(--transition-duration) ease-in-out;
  opacity: 1;
  filter: blur(28px) saturate(1.05) contrast(1.02);
}

/* fg initially invisible */
#background-layer-fg {
  opacity: 0;
}

/* Keep body fallback gradient (fast paint) */
body {
  background: linear-gradient(90deg, var(--bg-left) 0%, var(--bg-right) 100%);
  background-image: var(--background-image);
  transition: background var(--transition-duration) ease-in-out;
  margin: 0;
  padding: 0;
  font-family: var(--secondary-font-family), sans-serif;
  color: #fff;
  height: 100vh;
  overflow-x: hidden;
}

/* bring content above the background layers */
.slider-container,
.footer-navigation {
  position: relative;
  z-index: 1;
}

/* layout / slider styles */
.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slider-title {
  font-size: 2.2rem;
  text-align: center;
  margin-top: 0.5rem;
}

.splide {
  width: 100%;
  max-width: 400px;
  height: var(--max-card-height);
  position: relative;
}

.splide__track {
  height: 100% !important;
}

.splide__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  margin: 1rem !important;
}

.splide__slide {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  border-radius: 16px;
  flex: 0 0 48%;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
}

.splide__slide a {
  display: block;
  text-decoration: none; /* Remove link underline */
  height: 100%; /* Ensure clickable area covers the full slide */
}

/* clickable slide wrapper coverage */
.splide__slide > a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

/* Title pinned to bottom-left of each slide */
.slide-overlay {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-radius: 0.5rem;
}
.slide-overlay h2 {
  font-family: var(--font-family, "Arial"), sans-serif;
  font-size: 1.2rem;
  margin: 0;
  color: #fff;
}
.slide-overlay p {
  font-family: var(--secondary-font-family, "Arial"), sans-serif;
  font-size: 0.95rem;
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.92);
}

/* Progress bar */
.progress-bar {
  width: 90%;
  height: var(--progress-bar-height);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin: 1rem auto 0;
  z-index: 1;
}
.progress {
  width: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  transition: width 0.5s ease;
}

/* footer */
.footer-navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.8rem 0;
  text-align: center;
  font-size: 0.95rem;
  z-index: 2;
  display: none;
}

/* responsive */
@media (max-width: 768px) {
  #background-layer,
  #background-layer-fg {
    filter: blur(22px);
  }
  .splide__slide {
    flex: 0 0 40%;
  }
  .slide-overlay h2 {
    font-size: 1rem;
  }
}
h3 {
  display: block;
  text-align: center;
  margin: 0 auto;
  font-size: var(--secondary-font-size) !important;
  line-height: var(--secondary-font-size) !important;
  font-weight: 700;
  max-width: 90%;
  text-transform: uppercase;
  color: var(--primary-color);
  padding: 1rem;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.splide__arrow {
  width: 3rem;
  height: 3rem;
  background: var(--primary-color);
}

.splide__arrow svg {
  fill: var(--secondary-color);
  height: 1rem;
  width: 1rem;
  display: block !important;
}

body.home h1,
body.home h2 {
  display: block !important;
  font-family: var(--font-family);
  padding-bottom: 0;
}

.splide__arrows--ttb .splide__arrow--prev {
  top: 0;
}

.splide__arrows--ttb .splide__arrow--next {
  bottom: 4rem;
}
