/* Google Fonts import for Roboto family */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Roboto+Slab:wght@700&display=swap');

/* ============================================================
   HAL Accessible Slider — Stylesheet
   WCAG 2.1 AA compliant carousel
   ============================================================ */

/* ── Color tokens (edit to match your brand) ──────────────── */
:root {
    --hal-focus-color:   #5BA4F5;   /* focus ring color (light — for dark bg) */
    --hal-focus-gap:     #0E3D4A;   /* inner focus gap — matches dark nav bg   */
    --hal-overlay:       rgba(0, 0, 0, 0.25); /* slide bg darkening overlay    */
    --hal-arrow-bg:      rgba(0, 0, 0, 0.25); /* prev/next button background   */
    --hal-arrow-bg-hover:rgba(0, 0, 0, 0.45);
    --hal-btn-bg:        #ffffff;   /* CTA button background                   */
    --hal-btn-color:     #0E3D4A;   /* CTA button text color                   */
    --hal-btn-bg-hover:  #e8f0fe;
    --hal-icon-bg:       #0057B8;   /* icon box background (blue like FILC)    */
    --hal-dot-inactive:  rgba(255,255,255,0.45);
    --hal-dot-active:    #ffffff;
    --hal-height:        480px;     /* default height — overridden by shortcode */
}

/* ── Slider container ──────────────────────────────────────── */
/* min-height (not height) so when the page is linearized and all
   position:absolute becomes static, the container grows to fit
   stacked slides + controls instead of clipping them (WCAG CSS
   positioning — meaningful content must remain when linearized). */
.hal-slider {
    position: relative;
    width: 100%;
    min-height: var(--hal-slider-height, var(--hal-height));
    overflow: visible;             /* text with adjusted spacing must not clip
                                      (WCAG 1.4.12); slides fade via opacity
                                      so overflow:hidden is not needed        */
    background: #0E3D4A;           /* fallback bg while images load           */
    user-select: none;
    margin: 0;
    padding: 0;
}

/* Full-width hero mode — stretches to container edges */
.hal-slider--full-width {
    width: 100%;
    margin: 0;
}

/* Widget spacing — negative margins to break out of container padding */
.hal-slider--has-spacing {
    margin-left: -2rem;
    margin-right: -2rem;
    margin-top: -1.5rem;
    margin-bottom: -1.5rem;
    width: calc(100% + 4rem);
}

/* Combine full-width and spacing */
.hal-slider--full-width.hal-slider--has-spacing {
    width: 100%;
    margin: 0;
}

/* ── Individual slides ─────────────────────────────────────── */
.hal-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;          /* inactive slides don't intercept clicks   */
    z-index: 0;
    overflow: visible;             /* text with adjusted spacing must not clip */
}

.hal-slide--active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* ── Background image ──────────────────────────────────────── */
.hal-slide__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    z-index: 0;
    transition: filter 0.3s ease;
}

/* Light overlay — just enough to keep text readable */
.hal-slide__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--hal-overlay);
    transition: background 0.3s ease;
}

/* Hover/focus — lift the overlay, brighten the image */
.hal-slide--active:hover .hal-slide__bg,
.hal-slide--active:focus-within .hal-slide__bg {
    filter: brightness(1.12) contrast(1.05);
}

.hal-slide--active:hover .hal-slide__bg::after,
.hal-slide--active:focus-within .hal-slide__bg::after {
    background: rgba(0, 0, 0, 0.10);
}

/* ── Slide content area ────────────────────────────────────── */
/* min-height (not height) so text with increased spacing
   (WCAG 1.4.12 text spacing) can grow without clipping. */
.hal-slide__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 1.4375rem 0.6875rem;
    color: #ffffff;
    box-sizing: border-box;
    width: 100%;
    text-align: center;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Icon / graphic box (like the graduation cap) ──────────── */
.hal-slide__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 130px;
    background: var(--hal-icon-bg);
    border-radius: 6px;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

.hal-slide__icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
}

/* ── Headline ──────────────────────────────────────────────── */
/* No fixed height or overflow:hidden — text must tolerate user
   overrides for line-height, letter-spacing, word-spacing, and
   paragraph spacing without clipping (WCAG 1.4.12). */
.hal-slide__headline {
    font-family: Roboto, 'Roboto Slab', Georgia, sans-serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0 0 0.85rem;
    color: #ffffff;
    max-width: 700px;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    overflow: visible;
}

/* ── Body text ─────────────────────────────────────────────── */
.hal-slide__body {
    font-family: Roboto, Georgia, sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    line-height: 1.65;
    max-width: 600px;
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.93);
    border-radius: 0.5rem;
    transition: all 0.3s ease;     /* smooth transition when contrast changes  */
}
.hal-slide__body p { margin: 0; }

/* ── CTA button ────────────────────────────────────────────── */
.hal-slide__btn {
    display: inline-block;
    padding: 0.75rem 1.85rem;
    background: var(--hal-btn-bg);
    color: var(--hal-btn-color);
    font-weight: 700;
    font-size: 0.975rem;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hal-slide__btn:hover {
    background: var(--hal-btn-bg-hover);
    text-decoration: underline;
}

.hal-slide__btn:focus-visible {
    background: var(--hal-btn-bg-hover);
    outline: 3px solid var(--hal-focus-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--hal-focus-gap), 0 0 0 6px var(--hal-focus-color);
    text-decoration: underline;
}

.hal-slide__btn-arrow {
    font-size: 1.2em;
    transition: transform 0.2s ease;
}

.hal-slide__btn:hover .hal-slide__btn-arrow {
    transform: translateX(0.25rem);
}

/* ── Prev / Next arrows (side-mounted, like RS) ────────────── */
.hal-slider__prev,
.hal-slider__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--hal-arrow-bg);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hal-slider__prev { left:  14px; }
.hal-slider__next { right: 14px; }

.hal-slider__prev:hover,
.hal-slider__next:hover {
    background: var(--hal-arrow-bg-hover);
}

.hal-slider__prev:focus-visible,
.hal-slider__next:focus-visible {
    background: var(--hal-arrow-bg-hover);
    outline: 3px solid var(--hal-focus-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--hal-focus-gap), 0 0 0 6px var(--hal-focus-color);
}

/* ── Bottom bar: dots + play/pause ─────────────────────────── */
.hal-slider__bar {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 60px;               /* clear the side arrows                   */
}

/* Dot tablist */
.hal-slider__dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hal-slider__dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border-radius: 50%;
    background: var(--hal-dot-inactive);
    border: 2px solid rgba(255,255,255,0.65);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.hal-slider__dot--active,
.hal-slider__dot[aria-selected="true"] {
    background: var(--hal-dot-active);
    transform: scale(1.3);
}

.hal-slider__dot:focus-visible {
    outline: 3px solid var(--hal-focus-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--hal-focus-gap), 0 0 0 6px var(--hal-focus-color);
}

/* Play / Pause button */
.hal-slider__play-pause {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    margin-left: 6px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.hal-slider__play-pause:hover {
    background: rgba(0,0,0,0.55);
}
.hal-slider__play-pause:focus-visible {
    outline: 3px solid var(--hal-focus-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--hal-focus-gap), 0 0 0 6px var(--hal-focus-color);
}

/* ── Visually hidden utility (screen-reader only) ──────────── */
.hal-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Reduced motion — honour user preference (WCAG 2.3.3 AAA) ── */
@media (prefers-reduced-motion: reduce) {
    .hal-slide,
    .hal-slide__headline,
    .hal-slide__body,
    .hal-slide__btn,
    .hal-slide__btn-arrow,
    .hal-slider__prev,
    .hal-slider__next,
    .hal-slider__dot,
    .hal-slider__play-pause {
        transition: none !important;
    }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hal-slider {
        --hal-slider-height: 480px;
    }
    .hal-slide__content {
        padding: 1.75rem 3.5rem;   /* still clear the arrows                  */
        align-items: flex-start;
    }
    .hal-slide__icon {
        width: 90px;
        height: 90px;
    }
    .hal-slide__icon img {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .hal-slider {
        --hal-slider-height: 480px;
    }
    .hal-slide__content {
        padding: 1.25rem 3rem;
        align-items: center;
        text-align: center;
    }
    .hal-slide__icon {
        width: 70px;
        height: 70px;
        margin-bottom: 0.75rem;
    }
    .hal-slide__icon img {
        width: 42px;
        height: 42px;
    }
    .hal-slider__bar {
        padding: 0 50px;
    }
}
