/* Homepage featured-diagrams slide panel.
   Progressive enhancement: without JS the cards render as a readable,
   horizontally scrollable list of real links. slides.js adds `is-enhanced`
   to turn it into a fully-automatic, continuously looping crossfade
   slideshow. CSP-safe: no inline script/style; behaviour is in the module. */

.slides {
    margin: 1.5em 0 2em;
}

.slides__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1em;
    flex-wrap: wrap;
}

.slides__head h2 {
    margin: 0;
    border: 0;
    padding: 0;
    font-size: 1.35em;
}

.slides__hint {
    color: var(--text-light);
    font-size: 0.85em;
}

.slides__viewport {
    margin-top: 0.75em;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.slides__track {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-width: 0;
}

.slide__card {
    display: flex;
    align-items: center;
    gap: 1.5em;
    padding: 1.5em 1.8em;
    min-height: 300px;
    color: var(--text);
    text-decoration: none;
    border-left: 4px solid var(--primary);
    background:
        linear-gradient(135deg, rgba(36, 94, 168, 0.06), rgba(178, 92, 43, 0.05));
    transition: background 0.2s ease;
}

.slide__card:hover,
.slide__card:focus-visible {
    text-decoration: none;
    background:
        linear-gradient(135deg, rgba(36, 94, 168, 0.12), rgba(178, 92, 43, 0.10));
    outline: none;
}

.slide__card:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary);
}

.slide__text {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
    flex: 0 0 38%;
    max-width: 38%;
}

.slide__eyebrow {
    font-size: 0.72em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent);
}

.slide__title {
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.15;
    color: var(--primary-dark);
}

.slide__caption {
    color: var(--text-light);
    font-size: 0.95em;
}

.slide__cta {
    margin-top: 0.4em;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary);
}

.slide__figure {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    align-self: stretch;
}

.slide__svg {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: contain;
    /* diagrams read on a clean white plate */
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6em;
}

/* ---- Enhanced (JS on): crossfade slideshow ---- */
.slides.is-enhanced .slides__viewport {
    overflow: hidden;
    scroll-snap-type: none;
    position: relative;
    height: 320px;
}

.slides.is-enhanced .slides__track {
    display: block;
    position: absolute;
    inset: 0;
}

.slides.is-enhanced .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.slides.is-enhanced .slide.is-active {
    opacity: 1;
    pointer-events: auto;
}

.slides.is-enhanced .slide__card {
    height: 100%;
    min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
    .slides.is-enhanced .slide {
        transition: none;
    }
}

/* Controls (dots + prev/next), created by slides.js */
.slides__controls {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75em;
    margin-top: 0.9em;
}

.slides.is-enhanced .slides__controls {
    display: flex;
}

.slides__nav {
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.slides__nav:hover {
    background: var(--bg-soft);
}

.slides__dots {
    display: flex;
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: center;
}

.slides__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid var(--primary);
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.slides__dot[aria-current="true"] {
    background: var(--primary);
}

@media (max-width: 640px) {
    .slide__card {
        flex-direction: column;
        gap: 0.8em;
        text-align: center;
    }
    .slide__text {
        flex-basis: auto;
        max-width: none;
        align-items: center;
    }
    .slides.is-enhanced .slides__viewport {
        height: 420px;
    }
}
