﻿/* Version 5 home slider: one full-width slide with dots */
.cr5 {
    position: relative;
    padding: 16px;
    border-radius: 0 0 20px 20px;
    background: var(--v5-stage, #0c4a6e);
}

/* featured slide */
.cr5-feature {
    position: relative;
    display: block;
    height: 500px;
    overflow: hidden;
    border-radius: 14px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
}

.cr5-feature-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: cr5-fade 0.6s ease;
    transition: transform 6s ease;
}

.cr5-feature:hover .cr5-feature-img {
    transform: scale(1.05);
}

@keyframes cr5-fade {
    from {
        opacity: 0;
        transform: scale(1.03);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cr5-feature-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 12px;
    padding: 32px;
    background: linear-gradient(to top, rgba(8, 47, 73, 0.92) 0%, rgba(8, 47, 73, 0.4) 50%, rgba(8, 47, 73, 0) 100%);
}

.cr5-badge {
    padding: 4px 14px;
    border-radius: 999px;
    background-color: var(--v5-accent, #a5b4fc);
    color: var(--v5-sky-900, #0c4a6e);
    font-size: 0.8rem;
    font-weight: 700;
}

.cr5-feature-title {
    margin: 0;
    max-width: 760px;
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    font-weight: 800;
    line-height: 1.5;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.cr5-feature-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.cr5-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.cr5-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cr5-feature:hover .cr5-read,
.cr5-feature:focus-visible .cr5-read {
    border-color: var(--v5-accent, #a5b4fc);
    background-color: var(--v5-accent, #a5b4fc);
    color: var(--v5-sky-900, #0c4a6e);
}

.cr5-feature:focus-visible {
    outline: 3px solid var(--v5-accent, #a5b4fc);
    outline-offset: 2px;
}

.cr5-counter {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    padding: 3px 12px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.45);
    font-size: 0.8rem;
    font-weight: 600;
}

/* dots: one per slide, over the bottom corner of the slide */
.cr5-dots {
    position: absolute;
    bottom: 36px;
    inset-inline-end: 40px;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cr5-dot {
    position: relative;
    width: 10px;
    height: 10px;
    padding: 0;
    overflow: hidden;
    border: none;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: width 0.3s ease, background-color 0.2s ease;
}

    .cr5-dot:hover {
        background-color: rgba(255, 255, 255, 0.85);
    }

    .cr5-dot:focus-visible {
        outline: 2px solid var(--v5-accent, #a5b4fc);
        outline-offset: 2px;
    }

.cr5-dot-active,
.cr5-dot-active:hover {
    width: 36px;
    background-color: rgba(255, 255, 255, 0.35);
}

/* time until the next slide */
.cr5-dot-fill {
    position: absolute;
    inset: 0;
    background-color: #fff;
    transform-origin: left;
    animation-name: cr5-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

[dir="rtl"] .cr5-dot-fill {
    transform-origin: right;
}

.cr5-progress-paused {
    animation-play-state: paused;
}

@keyframes cr5-progress {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@media (max-width: 960px) {
    .cr5-feature {
        height: 400px;
    }
}

@media (max-width: 600px) {
    .cr5 {
        padding: 8px;
        border-radius: 0 0 14px 14px;
    }

    .cr5-feature {
        height: 300px;
    }

    .cr5-feature-overlay {
        padding: 18px 18px 40px;
    }

    .cr5-dots {
        bottom: 18px;
        inset-inline-end: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cr5-feature-img {
        animation: none;
        transition: none;
    }
}
