/**
 * Front page hero slider — self-contained styles.
 *
 * Deliberately uses its own `ths-` prefixed classes and plain CSS (not Tailwind
 * utilities) so the slider renders correctly regardless of the Vite build state.
 * Brand color is pulled from the theme.json preset with a hard fallback.
 */

.ths-slider {
  --ths-primary: var(--wp--preset--color--primary, #992427);
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  outline: none;
}

.ths-viewport {
  position: relative;
  min-height: 28rem;
  height: calc(100vh - 11rem);
  max-height: 46rem;
}

@media (max-width: 782px) {
  .ths-viewport {
    height: auto;
    min-height: 32rem;
  }
}

/* Slides stack and cross-fade */
.ths-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease;
  z-index: 0;
}

.ths-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.ths-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  transition: transform 7s ease-out;
}

.ths-slide.is-active .ths-bg {
  transform: scale(1);
}

.ths-overlay {
  position: absolute;
  inset: 0;
}

.ths-overlay--dark {
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.66) 45%,
    rgba(0, 0, 0, 0.42) 100%
  );
}

.ths-overlay--medium {
  background: rgba(0, 0, 0, 0.5);
}

.ths-overlay--light {
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.15) 100%
  );
}

/* Content */
.ths-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.ths-container {
  max-width: 1280px;
  margin-inline: auto;
  padding: 4rem 1.5rem;
}

.ths-align-center .ths-container {
  text-align: center;
}

.ths-align-center .ths-actions {
  justify-content: center;
}

.ths-align-left .ths-container {
  text-align: left;
}

.ths-eyebrow {
  display: inline-block;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.4rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(4px);
}

.ths-title {
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
  margin: 0;
  max-width: 46rem;
}

.ths-align-center .ths-title {
  margin-inline: auto;
}

.ths-accent {
  color: var(--ths-primary);
}

.ths-subtitle {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  margin: 1.25rem 0 0;
  max-width: 38rem;
}

.ths-align-center .ths-subtitle {
  margin-inline: auto;
}

.ths-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.ths-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ths-btn--primary {
  background: var(--ths-primary);
  color: #fff;
}

.ths-btn--primary:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.ths-btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.ths-btn--ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Arrows */
.ths-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(4px);
}

.ths-arrow:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: #fff;
}

.ths-arrow svg {
  width: 1.25rem;
  height: 1.25rem;
}

.ths-arrow--prev {
  left: 1rem;
}

.ths-arrow--next {
  right: 1rem;
}

@media (max-width: 782px) {
  .ths-arrow {
    display: none;
  }
}

/* Pagination dots */
.ths-dots {
  position: absolute;
  bottom: 1.75rem;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.ths-dot {
  width: 2rem;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background-color 0.3s ease, width 0.3s ease;
}

.ths-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.ths-dot.is-active {
  background: #fff;
  width: 3rem;
}

/* Entrance animation for active slide content */
.ths-slide.is-active .ths-eyebrow,
.ths-slide.is-active .ths-title,
.ths-slide.is-active .ths-subtitle,
.ths-slide.is-active .ths-actions {
  animation: thsFadeUp 0.7s ease-out both;
}

.ths-slide.is-active .ths-title { animation-delay: 0.1s; }
.ths-slide.is-active .ths-subtitle { animation-delay: 0.25s; }
.ths-slide.is-active .ths-actions { animation-delay: 0.4s; }

@keyframes thsFadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Larger headings on bigger screens */
@media (min-width: 768px) {
  .ths-title {
    font-size: 3rem;
  }
  .ths-container {
    padding: 5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .ths-title {
    font-size: 3.5rem;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ths-slide,
  .ths-bg {
    transition: none;
  }
  .ths-slide.is-active .ths-eyebrow,
  .ths-slide.is-active .ths-title,
  .ths-slide.is-active .ths-subtitle,
  .ths-slide.is-active .ths-actions {
    animation: none;
  }
}
