/* ==========================================================================
   Kotorska biskupija — slider vijesti na naslovnici
   (boje i font dolaze iz header.css :root)
   ========================================================================== */

.kb-hero {
    --kb-hero-h: clamp(560px, 85vh, 820px);
    position: relative;
    height: var(--kb-hero-h);
    overflow: hidden;
    background: #1c1611;
    color: #fff;
    font-family: var(--kb-font);
    isolation: isolate;
}
.kb-hero *, .kb-hero *::before, .kb-hero *::after { box-sizing: border-box; }

.kb-hero__inner {
    position: relative;
    max-width: 1240px; height: 100%;
    margin: 0 auto; padding: 0 24px;
}

/* Slajdovi ----------------------------------------------------------- */
.kb-hero__track { position: absolute; inset: 0; }

.kb-slide {
    position: absolute; inset: 0;
    opacity: 0; visibility: hidden;
    transition: opacity .9s ease, visibility 0s linear .9s;
}
.kb-slide.is-active {
    opacity: 1; visibility: visible; z-index: 1;
    transition: opacity .9s ease, visibility 0s;
}

.kb-slide__media { position: absolute; inset: 0; overflow: hidden; }
.kb-slide__img {
    width: 100%; height: 100%; max-width: none;
    object-fit: cover; object-position: center 35%;
    transform: scale(1.06);
    transition: transform 9s linear;
}
.kb-slide.is-active .kb-slide__img { transform: scale(1); }

/* Zatamnjenje: dovoljno za čitljiv tekst, a slika ostaje živa */
.kb-slide__shade {
    position: absolute; inset: 0;
    background:
        linear-gradient(90deg, rgba(20, 15, 10, .78) 0%, rgba(20, 15, 10, .45) 45%, rgba(20, 15, 10, 0) 75%),
        linear-gradient(0deg, rgba(20, 15, 10, .85) 0%, rgba(20, 15, 10, 0) 45%);
}

.kb-slide .kb-hero__inner { display: flex; align-items: flex-end; padding-bottom: 150px; }

.kb-slide__body {
    max-width: 680px;
    opacity: 0; transform: translateY(18px);
    transition: opacity .6s ease .25s, transform .8s cubic-bezier(.2, .7, .2, 1) .25s;
}
.kb-slide.is-active .kb-slide__body { opacity: 1; transform: none; }

.kb-slide__meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    margin: 0 0 18px; padding: 0;
    font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
    color: rgba(255, 255, 255, .78);
}
.kb-slide__cat {
    display: inline-flex; align-items: center; gap: 12px; color: var(--kb-gold);
}
.kb-slide__cat::after { content: ''; width: 24px; height: 1px; background: rgba(255, 255, 255, .45); }

.kb-slide__title {
    margin: 0 0 16px !important; padding: 0;
    font-family: 'Lora', Georgia, serif !important; font-weight: 500 !important;
    font-size: clamp(30px, 4vw, 52px) !important; line-height: 1.12 !important; letter-spacing: -.01em;
    color: #fff !important; text-transform: none !important;
    text-wrap: balance;
}
.kb-slide__title a { color: inherit !important; text-decoration: none !important; }
.kb-slide__title a:hover { text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: 6px; }

.kb-slide__excerpt {
    margin: 0 0 28px; padding: 0; max-width: 560px;
    font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .82);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.kb-slide__more {
    display: inline-flex; align-items: center; gap: 10px;
    height: 48px; padding: 0 22px; border-radius: 999px;
    background: #fff; color: var(--kb-ink) !important;
    font-size: 15px; font-weight: 500; text-decoration: none !important;
    transition: gap .25s ease, background .2s;
}
.kb-slide__more:hover { gap: 14px; background: #f5f3f0; }

/* Kontrole ----------------------------------------------------------- */
.kb-hero__controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.kb-hero__controls .kb-hero__inner {
    display: flex; align-items: flex-end; gap: 32px;
    height: auto; padding-bottom: 36px;
}

.kb-hero__tabs {
    flex: 1; min-width: 0;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 20px;
    list-style: none; margin: 0; padding: 0;
}
.kb-hero__tabs li { margin: 0; padding: 0; list-style: none; }

html .kb-hero button.kb-hero__tab {
    display: block; width: 100%; padding: 0; margin: 0;
    border: 0; border-radius: 0; background: transparent !important; box-shadow: none;
    text-align: left; text-transform: none; letter-spacing: 0; cursor: pointer;
    font-family: var(--kb-font); color: rgba(255, 255, 255, .6) !important;
    transition: color .2s;
}
html .kb-hero button.kb-hero__tab:hover,
html .kb-hero button.kb-hero__tab.is-active { color: #fff !important; }

.kb-hero__bar {
    display: block; height: 2px; margin-bottom: 14px;
    background: rgba(255, 255, 255, .25); overflow: hidden; border-radius: 2px;
}
.kb-hero__bar > span {
    display: block; height: 100%; width: 100%;
    background: #fff; transform: scaleX(0); transform-origin: left;
}
.kb-hero__tab.is-done .kb-hero__bar > span { transform: scaleX(1); background: rgba(255, 255, 255, .55); }
.kb-hero__tab.is-active .kb-hero__bar > span {
    animation: kb-hero-progress var(--kb-hero-interval, 7000ms) linear forwards;
}
.kb-hero.is-paused .kb-hero__tab.is-active .kb-hero__bar > span { animation-play-state: paused; }
@keyframes kb-hero-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.kb-hero__tab-num {
    display: block; margin-bottom: 4px;
    font-size: 12px; font-weight: 500; letter-spacing: .14em; font-variant-numeric: tabular-nums;
}
.kb-hero__tab-title {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14px; font-weight: 400; line-height: 1.4;
}

.kb-hero__nav { display: flex; gap: 8px; flex: none; }
html .kb-hero button.kb-hero__arrow {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; padding: 0; margin: 0;
    border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
    background: transparent !important; color: #fff !important; box-shadow: none; cursor: pointer;
    transition: background .2s, border-color .2s;
}
html .kb-hero button.kb-hero__arrow:hover { background: rgba(255, 255, 255, .14) !important; border-color: rgba(255, 255, 255, .7); }

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

/* Responsive --------------------------------------------------------- */
@media (max-width: 1023px) {
    .kb-hero { --kb-hero-h: clamp(560px, 78svh, 720px); }
    .kb-slide .kb-hero__inner { padding-bottom: 110px; }
    .kb-hero__tab-title { display: none; }
    .kb-hero__tab-num { display: none; }
    .kb-hero__bar { margin-bottom: 0; }
    .kb-hero__tabs { gap: 8px; }
    html .kb-hero button.kb-hero__tab { padding: 14px 0; } /* veća površina za dodir */
    .kb-hero__controls .kb-hero__inner { align-items: center; padding-bottom: 28px; gap: 20px; }
}

@media (max-width: 640px) {
    .kb-hero__inner { padding: 0 16px; }
    .kb-slide__shade {
        background: linear-gradient(0deg, rgba(20, 15, 10, .92) 0%, rgba(20, 15, 10, .6) 45%, rgba(20, 15, 10, .1) 80%);
    }
    .kb-slide .kb-hero__inner { padding-bottom: 96px; }
    .kb-slide__meta { font-size: 11.5px; margin-bottom: 12px; }
    .kb-slide__excerpt { font-size: 15.5px; -webkit-line-clamp: 2; margin-bottom: 22px; }
    .kb-slide__more { height: 44px; padding: 0 18px; font-size: 14.5px; }
    .kb-hero__nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .kb-slide, .kb-slide__img, .kb-slide__body { transition: none !important; }
    .kb-slide__img { transform: none !important; }
    .kb-hero__tab.is-active .kb-hero__bar > span { animation: none; transform: scaleX(1); }
}
