.hero-slider {
  max-width: var(--hero-slider-width);
  margin: 20px auto 40px;
  position: relative;
  outline: none;
}

.hero-slider__slides {
  position: relative;
}

:root {
    /* Colors */
    --color-surface: var(--color-primary-900, #292929);
    --color-text: var(--color-on-primary, #FFFFFF);
    --color-text-muted: rgba(255, 255, 255, 0.85);

    /* Fonts */
    --font-family-base: var(--font-family, 'Inter', sans-serif);
    --font-weight-black: 900;

    /* Fixed size variables for the hero slider */
    --hero-slider-width: 1120px;  /* adjust width here */
    --hero-slider-height: clamp(260px, 45vw, 420px);  /* responsive fixed height */

    /* Portion of slider height reserved for media on mobile */
  --hero-slider-media-height-mobile: calc(var(--hero-slider-height) * 0.45);
}

.hero-slider__slide {
  display: none;
}

.hero-slider__slide.is-active {
  display: block;
}

.hero-slider__slide-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  background: var(--color-surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  position: relative;
  height: var(--hero-slider-height); /* fixed height */
}

.hero-slider__text {
  padding: 36px;
  padding-bottom: 64px; /* Space for actions */
}

/* Make these selectors more specific so they beat .main-content h2 / p (which sets text-align:center) */
.hero-slider__text .hero-slider__title {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-black);
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--color-text);
  text-align: left;
}

.hero-slider__text .hero-slider__summary {
  font-size: 16px;
  line-height: 1.8; /* more vertical spacing for easier reading */
  color: var(--color-text-muted);
  margin: 16px 0 28px; /* extra space above and below the paragraph */
  max-width: 100ch; /* limit line length for readability */
  text-align: left;
  padding-right: 12px; /* space between text and media */
}

.hero-slider__actions {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 36px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 2;
}

.hero-slider__media {
  position: relative;
  height: 100%; /* fill fixed height */
}

.hero-slider__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-slider__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 64px; /* was 12px: give dots more breathing room below the slider */
}

.hero-slider__dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-slider__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #444;
  opacity: 0.9;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.hero-slider__dot.is-active {
  background: #ffffff;
  opacity: 1;
}

/* Side navigation dots */
.hero-slider__arrow {
  --slider-nav-dot-size: 16px;
  background: transparent;
  border: none;
  padding: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.2s ease, transform 0.15s ease;
}

.hero-slider__arrow::before {
  content: "";
  width: var(--slider-nav-dot-size);
  height: var(--slider-nav-dot-size);
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.hero-slider__arrow:hover,
.hero-slider__arrow:focus-visible {
  color: rgba(255, 255, 255, 0.9);
}

.hero-slider__arrow:hover::before,
.hero-slider__arrow:focus-visible::before {
  transform: scale(1.25);
  opacity: 1;
}

.hero-slider__arrow:active::before {
  transform: scale(1.15);
}

/* Keep spacing rules */
.hero-slider__arrow--prev { margin-right: 8px; }
.hero-slider__arrow--next { margin-left: 8px; }

/* Improve focus visibility */
.hero-slider__arrow:focus-visible,
.hero-slider__dot:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

.hero-slider__arrow:focus:not(:focus-visible),
.hero-slider__dot:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-color-scheme: light) {
  .hero-slider__arrow {
    color: rgba(0, 0, 0, 0.55);
  }
  .hero-slider__arrow:hover,
  .hero-slider__arrow:focus-visible {
    color: rgba(0, 0, 0, 0.85);
  }
  .hero-slider__arrow:focus-visible,
  .hero-slider__dot:focus-visible {
    outline-color: rgba(0, 0, 0, 0.55);
  }
}

@media (max-width: 900px) {
  :root {
    /* slightly taller on phones while capped to viewport */
    --hero-slider-height: clamp(390px, 78vh, 546px);
  }
  .hero-slider__slide-inner {
    grid-template-columns: 1fr;
    height: var(--hero-slider-height);
  }
  .hero-slider__media {
    order: -1;
    height: var(--hero-slider-media-height-mobile);
  }
  .hero-slider__text {
    padding: 16px 16px 56px;
    overflow: hidden;
  }
  .hero-slider__actions {
    left: 16px;
    right: 16px;
    bottom: 16px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  
  /* Make buttons smaller and more mobile-friendly */
  .hero-slider__actions .btn {
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-slider__text .hero-slider__title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    hyphens: auto;
  }
  .hero-slider__text .hero-slider__summary {
    font-size: 14px;
    line-height: 1.5;
    margin: 12px 0 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
  }
  
  /* Mobile-specific controls styling */
  .hero-slider__controls {
    gap: 12px;
    padding: 0 16px;
  }
  
  .hero-slider__arrow {
    --slider-nav-dot-size: 14px;
    width: 52px;
    height: 52px;
  }
  
  .hero-slider__dots {
    gap: 6px;
  }
  
  .hero-slider__dot {
    width: 10px;
    height: 10px;
  }
}

@media (min-width: 800px) {
    .hero-slider__actions {
        justify-content: flex-start;
    }
}

/* Medium mobile devices */
@media (max-width: 600px) {
  .hero-slider__actions .btn {
    padding: 7px 10px;
    font-size: 13px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .hero-slider__controls {
    gap: 8px;
    padding: 0 12px;
  }
  
  .hero-slider__arrow {
    --slider-nav-dot-size: 12px;
    width: 44px;
    height: 44px;
  }
  
  .hero-slider__dots {
    gap: 4px;
  }
  
  .hero-slider__dot {
    width: 8px;
    height: 8px;
  }
  
  /* Make action buttons even more compact on very small screens */
  .hero-slider__actions {
    gap: 6px;
  }
  
  .hero-slider__actions .btn {
    padding: 6px 8px;
    font-size: 12px;
  }
}
