/* UVODNI HERO SLIDER (NAL-0014) – sites/templates/hero_slider.php + scripts_js/hero-slider.js */

.hero {
    --hero-h: clamp(420px, 60vh, 680px);
    --hero-fade: 900ms;
    --hero-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --hero-green: #00a651;
    --hero-green-dark: #008a43;

    float: left;
    position: relative;
    width: 100%;
    height: var(--hero-h);
    overflow: hidden;
    isolation: isolate;
    background-color: #12301f;
    color: #fff;
    line-height: normal;
}

.hero-slides {
    position: absolute;
    inset: 0;
    touch-action: pan-y;
}

/* --- slajdi: navzkrižno prelivanje --- */
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--hero-fade) ease-in-out, visibility 0s linear var(--hero-fade);
}

.hero-slide.is-active,
.hero-slide.is-leaving {
    visibility: visible;
    transition: opacity var(--hero-fade) ease-in-out, visibility 0s;
}

.hero-slide.is-active {
    opacity: 1;
    z-index: 2;
}

.hero-slide.is-leaving {
    z-index: 1;
}

.hero-media {
    position: absolute;
    inset: 0;
}

.hero-media img,
.hero-media video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* počasen "Ken Burns" zoom samo na slikah */
.hero-media img {
    transform: scale(1.06);
}

.hero--ready .hero-slide.is-active .hero-media img,
.hero--ready .hero-slide.is-leaving .hero-media img {
    transform: scale(1);
    transition: transform calc(var(--hero-interval, 7000ms) + var(--hero-fade)) linear;
}

/* zatemnitev za berljivost besedila */
.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to top, rgba(6, 22, 14, 0.72) 0%, rgba(6, 22, 14, 0.28) 42%, rgba(6, 22, 14, 0) 70%),
        linear-gradient(to right, rgba(6, 22, 14, 0.38) 0%, rgba(6, 22, 14, 0) 60%);
}

/* --- besedilo --- */
.hero-caption {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    padding: 0 24px 104px;
}

.hero-caption .marg {
    display: block;
}

.hero-copy {
    max-width: 680px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #c9e59a;
}

.hero-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
}

.hero .hero-title {
    margin: 0;
    font-size: clamp(30px, 1.6vw + 18px, 54px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: 0;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    text-wrap: balance;
}

.hero-text {
    margin-top: 14px;
    max-width: 46ch;
    font-size: 19px;
    line-height: 1.5;
    letter-spacing: 0.2px;
    color: rgba(255, 255, 255, 0.92);
    text-wrap: pretty;
}

.hero-text p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
}

.hero-text p + p {
    margin-top: 8px;
}

.hero .hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
    padding: 16px 30px;
    border-radius: 999px;
    background-color: var(--hero-green);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-shadow: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    transition: background-color 200ms ease, transform 160ms var(--hero-ease);
}

.hero .hero-btn i {
    transition: transform 200ms var(--hero-ease);
}

.hero .hero-btn:active {
    transform: scale(0.97);
}

.hero .hero-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .hero .hero-btn:hover {
        background-color: var(--hero-green-dark);
    }

    .hero .hero-btn:hover i {
        transform: translateX(4px);
    }
}

/* vstop besedila ob menjavi slajda */
.hero--multi .hero-copy > * {
    opacity: 0;
    transform: translateY(14px);
}

.hero--multi .hero-slide.is-active .hero-copy > *,
.hero--multi .hero-slide.is-leaving .hero-copy > * {
    opacity: 1;
    transform: none;
}

.hero--ready .hero-slide.is-active .hero-copy > * {
    transition: opacity 700ms var(--hero-ease) 250ms, transform 700ms var(--hero-ease) 250ms;
}

.hero--ready .hero-slide.is-active .hero-copy > :nth-child(2) {
    transition-delay: 320ms;
}

.hero--ready .hero-slide.is-active .hero-copy > :nth-child(3) {
    transition-delay: 390ms;
}

.hero--ready .hero-slide.is-active .hero-copy > :nth-child(4) {
    transition-delay: 460ms;
}

/* --- kontrole --- */
.hero-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    z-index: 3;
    padding: 0 24px;
    pointer-events: none;
}

/* levo pod besedilom – desno spodaj je plavajoči pripomoček "Živa" */
.hero-controls .marg {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.hero-controls button {
    pointer-events: auto;
}

.hero-dots {
    display: flex;
    align-items: center;
    margin: 0 8px 0 -4px;
}

.hero .hero-dot {
    display: flex;
    align-items: center;
    width: 40px;
    height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    cursor: pointer;
    transition: width 400ms var(--hero-ease);
}

.hero .hero-dot.is-active {
    width: 64px;
}

.hero-dot-fill {
    position: relative;
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.4);
    transition: background-color 200ms ease;
}

.hero-dot-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #fff;
    transform: scaleX(0);
    transform-origin: left center;
}

.hero-dot.is-active .hero-dot-fill::after {
    animation: hero-progress var(--hero-interval, 7000ms) linear forwards;
}

.hero.is-paused .hero-dot.is-active .hero-dot-fill::after {
    animation-play-state: paused;
}

.hero.is-stopped .hero-dot.is-active .hero-dot-fill::after {
    animation: none;
    transform: scaleX(1);
}

@keyframes hero-progress {
    to {
        transform: scaleX(1);
    }
}

.hero .hero-btn-round {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background-color: rgba(10, 30, 20, 0.28);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    transition: background-color 200ms ease, border-color 200ms ease, transform 160ms var(--hero-ease);
}

.hero-btn-round svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hero-btn-round .hero-ico-play {
    fill: currentColor;
    stroke-width: 1.5;
}

.hero .hero-btn-round:active {
    transform: scale(0.94);
}

.hero .hero-dot:focus-visible,
.hero .hero-btn-round:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .hero .hero-btn-round:hover {
        background-color: rgba(255, 255, 255, 0.18);
        border-color: #fff;
    }

    .hero .hero-dot:hover .hero-dot-fill {
        background-color: rgba(255, 255, 255, 0.7);
    }
}

.hero-toggle .hero-ico-play,
.hero.is-stopped .hero-toggle .hero-ico-pause {
    display: none;
}

.hero.is-stopped .hero-toggle .hero-ico-play {
    display: block;
}

/* --- mobilno --- */
@media (max-width: 980px) {
    .hero {
        --hero-h: clamp(420px, 64vh, 560px);
    }

    .hero-caption {
        padding: 0 20px 92px;
    }

    .hero-text {
        font-size: 17px;
    }
}

@media (max-width: 650px) {
    .hero-caption {
        padding: 0 16px 84px;
    }

    .hero-eyebrow {
        margin-bottom: 10px;
        font-size: 12px;
    }

    .hero-text {
        margin-top: 10px;
        font-size: 16px;
    }

    .hero .hero-btn {
        margin-top: 20px;
        padding: 14px 24px;
        font-size: 15px;
    }

    .hero-controls {
        bottom: 20px;
        padding: 0 16px;
    }

    .hero-dots {
        margin-right: auto;
    }

    .hero .hero-prev,
    .hero .hero-next {
        display: none;
    }
}

/* --- manj gibanja --- */
@media (prefers-reduced-motion: reduce) {
    .hero {
        --hero-fade: 200ms;
    }

    .hero-media img,
    .hero--ready .hero-slide.is-active .hero-media img,
    .hero--ready .hero-slide.is-leaving .hero-media img {
        transform: none;
        transition: none;
    }

    .hero--multi .hero-copy > *,
    .hero--ready .hero-slide.is-active .hero-copy > * {
        transform: none;
        transition: opacity 200ms ease;
        transition-delay: 0ms;
    }

    .hero .hero-dot,
    .hero .hero-btn,
    .hero .hero-btn i,
    .hero .hero-btn-round {
        transition: none;
    }
}
