/* =========================================================
   0) CSS Variables (root)
   ========================================================= */
:root{
    --accent: #e0e0e0;
    --bg: #0d0f12;
    --container-max: 1280px;              /* FullHD baseline */
    --container-pad: 24px;
    --muted: #ffffffcc;
    --white: #fff;

    /* Cover defaults (override inline po potrebi) */
    --background-blur: 0px;
    --cover: url('https://cdn.kosticisinovi.rs/Pozadina/background-1-f174c13bb20f.webp');
}

/* Šire “container” na 2K/4K */
@media (min-width: 1920px){ :root{ --container-max: 1400px; } }
@media (min-width: 2560px){ :root{ --container-max: 1600px; } }

/* =========================================================
   1) Resets / Base
   ========================================================= */
*{ box-sizing: border-box; }

html, body{ height: 100%; overflow-x: hidden; }

body{
    background: var(--bg);
    color: var(--white);
    display: grid;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    grid-template-rows: auto 1fr auto;
    margin: 0;
    min-height: 100svh;
}

img{ display: block; height: auto; max-width: 100%; }

:focus-visible{
    outline: 2px solid rgba(255,255,255,.75);
    outline-offset: 2px;
}

/* =========================================================
   2) Layout helpers
   ========================================================= */
.container{
    margin-inline: auto;
    width: min(100% - 2*var(--container-pad), var(--container-max));
}

.hidden{ display: none !important; }
.center{ display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce){
    *{ animation: none !important; transition: none !important; }
}

/* =========================================================
   3) Header / Navbar
   ========================================================= */
.nav-brand{
    color: #fff;
    letter-spacing: .02em;
    padding: 10px 0;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 800;
}
.nav-brand img.logo{ height: 60px; width: auto; }

.nav-menu{
    align-items: center;
    display: flex;
    gap: clamp(12px, 2vw, 28px);
}
.nav-menu a{
    color: #fff;
    font-weight: 600;
    opacity: .9;
    padding: 8px 4px;
    position: relative;
    text-decoration: none;
}
.nav-menu a:hover{ opacity: 1; }
.nav-menu a.is-active::after{
    background: linear-gradient(90deg, rgba(255,255,255,.8), rgba(255,255,255,.25));
    border-radius: 2px;
    bottom: -6px;
    content: "";
    height: 2px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 70%;
}

.nav-toggle{
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: none;
    margin-left: 12px;
    padding: 8px;
}

.navbar{
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 64px;
}

.site-header{
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,.35);
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Mobile nav panel */
@media (max-width: 840px){
    .nav-toggle{ display: block; }
    .navbar{ position: relative; }

    .nav-menu{
        -webkit-backdrop-filter: blur(0);
        backdrop-filter: blur(0);
        background: rgba(0,0,0,.88);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 14px;
        box-shadow: 0 12px 30px rgba(0,0,0,.35);
        display: grid;
        gap: 8px;
        justify-items: center;
        left: auto;
        max-width: min(92vw, 420px);
        opacity: 0;
        padding: 12px 18px;
        pointer-events: none;
        position: absolute;
        right: 0;
        text-align: center;
        top: calc(100% + 8px);
        transform: translateY(-8px);
        transition: opacity .18s ease, transform .18s ease;
        white-space: nowrap;
        width: max-content;
    }
    .nav-menu a{ display: block; padding: 10px 12px; }
    .nav-menu.is-open{ opacity: 1; pointer-events: auto; transform: translateY(0); }
}

/* 4K nav sitnice */
@media (min-width: 2560px){
    .nav-brand{ font-size: 22px; }
    .navbar{ min-height: 76px; }
    .nav-menu{ gap: 32px; }
}

/* =========================================================
   4) Footer
   ========================================================= */
.footer-copy{ font-size: 14px; opacity: .75; }

.footer-email{
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    padding: 8px 14px;
    text-decoration: none;
}
.footer-email:hover{ text-decoration: underline; }

.footer-inner{
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 20px 0;
}

.site-footer{
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    background: rgba(0,0,0,.25);
    border-top: 1px solid rgba(255,255,255,.06);
}

/* =========================================================
   5) Cover / Hero
   ========================================================= */
.cover{
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 4vw, 40px);
    justify-content: center;
    min-height: 100dvh;
    overflow: hidden;
    padding: clamp(16px, 4vw, 40px);
    position: relative;
    text-align: center;
}
.cover::before{
    background-image: var(--cover);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    filter: blur(var(--background-blur));
    inset: 0;
    position: absolute;
    transform: scale(1.08);
    z-index: -1;
}
.cover::after{
    background: rgba(0,0,0,0.28);
    content: "";
    inset: 0;
    position: absolute;
    z-index: -1;
}
.cover > *{ position: relative; z-index: 1; }

@media (max-width: 520px){
    .cover::before{
        filter: blur(calc(var(--background-blur) * 2));
        transform: scale(1.04);
    }
}

/* Unutrašnji rešetka raspored (opciono) */
.cover > .container{
    align-items: center;
    display: grid;
    grid-template-rows: 1fr auto auto 1fr;
    height: 100%;
    margin-inline: auto;
    row-gap: clamp(16px, 3.5vh, 36px);
    width: min(100% - 2*var(--container-pad), var(--container-max));
}
.cover .brand{ grid-row: 2; }
.cover .cat-row{ grid-row: 3; }

@media (min-width: 1920px){ .cover > .container{ grid-template-rows: 1.2fr auto auto 1fr; } }
@media (min-width: 2560px){ .cover > .container{ grid-template-rows: 1.4fr auto auto 1fr; } }

@media (max-width: 640px){
    .cover{ min-height: auto; overflow: visible; padding-bottom: 24px; }
    .cover > .container{ grid-template-rows: auto auto auto; height: auto; row-gap: 16px; }
}

/* 🔒 FORCE mobile category layout – FINAL FIX */
@media (max-width: 640px){
    .cat-row{
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .cat{
        width: 100%;
    }

    .cat img{
        width: 100% !important;
        max-width: none !important;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }
}

/* Email chip u dnu covera (opciono) */
.cover-email{
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    background: rgba(0,0,0,0.45);
    border-radius: 999px;
    bottom: 18px;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    color: #fff;
    font-weight: 600;
    left: 50%;
    letter-spacing: .02em;
    line-height: 1;
    padding: 8px 14px;
    position: absolute;
    transform: translateX(-50%);
}
.cover-email:hover, .cover-email:focus{ background: rgba(0,0,0,0.55); text-decoration: underline; }
@media (max-width: 520px){ .cover-email{ bottom: 12px; font-size: 14px; padding: 7px 12px; } }

@media (orientation: landscape) and (max-height: 500px){
    .cover{
        min-height: auto;
        padding-block: 12px;
    }
    .cover > .container{
        height: auto;
        grid-template-rows: auto auto auto;
        row-gap: 12px;
    }
}

/* =========================================================
   6) Brand / Headings
   ========================================================= */
.brand{
    color: #fff;
    font-size: clamp(28px, 4.6vw, 64px);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.brand--outline{
    -webkit-text-stroke: .6px rgba(0,0,0,.25);
    text-shadow: 0 0 2px rgba(0,0,0,.5), 0 2px 14px rgba(0,0,0,.35);
}
.brand--pill{
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(0,0,0,.25);
    padding: 10px 22px;
}
.brand--underline{
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 8px;
    position: relative;
}
.brand--underline::after{
    background: linear-gradient(90deg, rgba(255,255,255,.65), rgba(255,255,255,.15));
    border-radius: 3px;
    bottom: 0;
    content: "";
    height: 3px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    width: 72%;
}
@media (max-width: 520px){ .brand--pill{ border-radius: 12px; padding: 8px 16px; } }

/* Naslovi / utility */
.page-title{ margin: 12px 0 22px; }
.topbar{
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    background: rgba(0,0,0,.35);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    position: sticky;
    top: 0;
}
.topbar a{ color: var(--white); margin-right: 12px; text-decoration: none; }
.brand-mini{ font-weight: 700; }

/* Elegantno “Nazad” dugme */
.btn-back{
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.20);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none !important;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
    font-weight: 700;
}
.btn-back:hover{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    transform: translateY(-2px);
}

/* =========================================================
   7) Categories (hero tri kartice)
   ========================================================= */
.cat-row{
    align-items: start;
    display: grid;
    gap: clamp(16px, 2.5vw, 28px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cat{
    align-items: center;
    color: var(--white);
    display: flex;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
    flex-direction: column;
    text-decoration: none;
    transition: transform .2s ease;
    width: 100%;
    min-width: 0;
}
.cat:hover{ transform: translateY(-4px); }

.cat img{
    border: 2px solid #fff;
    border-radius: 14px;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.cat span{
    background: rgba(0,0,0,.35);
    border-radius: 10px;
    font-size: clamp(16px, 1.8vw, 22px);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1.2;
    margin-top: 10px;
    padding: 8px 12px;
    text-shadow: 0 1px 8px rgba(0,0,0,.35);
}

@media (max-width: 1024px){
    .cat-row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ✅ Mobile: jedna ispod druge + sve iste širine */
@media (max-width: 900px){
    .cat-row{
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    /* ✅ poništi centriranje 4. kartice na mobilnom */
    .cat-row .cat:nth-child(4){
        grid-column: auto;
    }
}

/* Desktop-only: centriraj 4. kategoriju ispod srednje kartice */
@media (min-width: 1025px){
    .cat-row .cat:nth-child(4){
        grid-column: 2;
    }
}

@media (min-width: 2560px){
    /* umesto fiksnih clamp širina, samo malo veći “feel” preko tipografije */
    .cat span{ font-size: clamp(18px, 1.2vw, 26px); padding: 9px 14px; }
}

/* ✅ FullHD tuning: malo uži grid + manji gap da "OSTALO" diše */
@media (min-width: 1025px) and (max-width: 1919px){
    .cover .cat-row{
        max-width: 1120px;          /* smanji ukupnu širinu reda */
        margin-inline: auto;        /* centriraj grid */
        gap: 22px;                  /* malo manji razmak */
    }

    .cover .cat img{
        aspect-ratio: 16 / 10;      /* malo “plitkije” kartice */
    }

    .cover .cat span{
        font-size: 20px;            /* fiksiraj malo manje */
        padding: 7px 12px;
        border-radius: 10px;
    }
}


/* =========================================================
   8) Cards & Masonry (generic list/grid)
   ========================================================= */
.card{
    background: #111;
    border: 1px solid #222;
    border-radius: 14px;
    color: var(--white);
    display: block;
    overflow: hidden;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover{ box-shadow: 0 10px 30px rgba(0,0,0,.3); transform: translateY(-4px); }
.card img{ height: 180px; object-fit: cover; width: 100%; }
.card-title{ color: var(--muted); font-weight: 700; padding: 10px 12px; }

.grid{
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.masonry{ column-gap: 16px; columns: 1 260px; }
.m-item{ border-radius: 10px; display: inline-block; margin: 0 0 16px; overflow: hidden; }
.m-item img{ display: block; width: 100%; }
.back{ opacity: .85; }

/* =========================================================
   9) Project Gallery (KP-style)
   ========================================================= */
/* Stage (strelice + glavna kutija) */
.kp-gallery{ display: grid; gap: 16px; }

.kp-stage{
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px 1fr 48px;
    justify-items: center;
    margin: 0 auto;
    max-width: min(1880px, 96vw);
}

/* Glavna slika */
.kp-box{
    background: #0e0f12;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    height: clamp(360px, calc(100vh - 320px), 866px);
    overflow: hidden;
    width: 100%;
}
.kp-box img{ display: block; max-height: 100%; max-width: 100%; object-fit: contain; }

/* Navigacione strelice */
.kp-nav{
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: grid;
    height: 38px;
    place-items: center;
    transition: transform .15s ease, background .15s ease, opacity .15s ease;
    width: 38px;
    z-index: 5;
}
.kp-nav:hover{ background: rgba(0,0,0,.7); transform: scale(1.06); }
.kp-nav:disabled{ cursor: default; opacity: .35; }

/* Strip (thumbs) – zajedničko */
.kp-strip{
    background: rgba(0,0,0,.25);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    margin: 0 auto;
    max-width: min(1880px, 96vw);
    overflow: hidden;
    padding: 10px 14px;
}
.kp-strip-inner{
    display: flex;
    gap: 10px;
    overscroll-behavior-x: contain;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.kp-strip-inner::-webkit-scrollbar{ height: 8px; }
.kp-strip-inner::-webkit-scrollbar-thumb{ border-radius: 8px; }

/* Pojedinačni thumb */
.kp-thumb{
    background: transparent;
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    cursor: pointer;
    height: 64px;
    opacity: .85;
    outline: 2px solid transparent;
    overflow: hidden;
    padding: 0;
    transition: transform .12s ease, opacity .12s ease, outline-color .12s ease;
    width: 64px;
}
.kp-thumb:hover{ opacity: 1; transform: translateY(-2px); }
.kp-thumb.is-active{ opacity: 1; outline-color: rgba(255,255,255,.8); }
.kp-thumb img{ filter: contrast(1.02) saturate(1.02); height: 100%; object-fit: cover; width: 100%; }

/* Desktop: dva reda kada ih ima mnogo (opciono) */
.kp-strip.thumbs-two-rows .kp-strip-inner{
    display: grid;
    gap: 10px;
    grid-auto-columns: 64px;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, 64px);
    max-height: calc(64px * 2 + 10px);
    overflow-x: auto;
}
.kp-strip.thumbs-two-rows .kp-thumb{ height: 64px; width: 64px; }

/* Mobilni grid: 2–3 kolone po širini, visina čelije 64 */
.kp-strip.mobile-grid{
    overflow: visible;
    margin: 0 auto;
    max-width: 100%;
}
.kp-strip.mobile-grid .kp-strip-inner{
    --kp-cols: 2;                      /* podrazumevano; JS menja na 2 ili 3 */
    display: grid;
    grid-template-columns: repeat(var(--kp-cols), 1fr);
    grid-auto-rows: 64px;
    gap: 10px;
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: none;
}
.kp-strip.mobile-grid .kp-strip-inner::-webkit-scrollbar{ display: none; }
.kp-strip.mobile-grid .kp-thumb{ width: 100%; height: 64px; }

/* Skrivanje thumba (toggle) */
.kp-strip.is-collapsed{ display: none; }

/* Sitni responsive peglinzi */
@media (min-width: 1920px){
    .kp-stage{ gap: 12px; }
    .kp-strip{ padding: 12px 16px; }
}
@media (max-width: 640px){
    .kp-box{ height: calc(100dvh - 140px); padding: 8px; }
    .kp-box img{
        background: #0b0c0e;
        border-radius: 12px;
        box-shadow: 0 16px 34px rgba(0,0,0,.35);
    }
}

/* =========================================================
   10) Sticky Toolbar (counter + toggle) – iznad slike
   ========================================================= */
/* Toolbar iznad slike (fiksiran) */
.kp-toolbar{
    position: sticky;
    top: 8px;              /* desktop */
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* centriran counter, dugme desno */
    align-items: center;
    width: min(100% - 24px, 1280px);
    margin: 8px auto;
    pointer-events: none; /* da ne blokira scroll; deca imaju pointer-events: auto */
}
.kp-toolbar .kp-counter-wrap{ display:flex; justify-content:center; pointer-events:auto; }
.kp-toolbar .kp-toggle-wrap{  display:flex; justify-content:flex-end; pointer-events:auto; }

/* Counter “chip” */
.kp-counter{
    background: rgba(0,0,0,.60);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: #fff;
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
}

/* Toggle “chip” */
.kp-toggle{
    background: rgba(0,0,0,.55);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    text-decoration: none;
}
.kp-toggle:hover{ background: rgba(0,0,0,.7); }

/* Mobilni: približi dugme counteru i spusti toolbar ispod sticky hedera */
@media (max-width: 640px){
    .kp-toolbar{
        top: 66px; /* ~visina sticky hedera; koriguj ako ti je header drugačiji */
        grid-template-columns: 1fr auto auto 1fr;
        column-gap: 10px;
    }
    .kp-toolbar .kp-toggle-wrap{ justify-content:flex-start; }
}

/* Kada smo u fullscreen režimu, .kp-stage postaje 'overlay' */
.kp-stage.is-fullscreen{
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #000; /* potamni pozadinu */
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    justify-items: center;
}

/* Slika zauzima ceo ekran */
.kp-stage.is-fullscreen .kp-box{
    height: 100dvh !important;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #000;
}
.kp-stage.is-fullscreen .kp-box img{
    max-height: 100dvh;
}

.kp-stage.is-fullscreen {
    background: #000;
    z-index: 9998;
}

.kp-stage.is-fullscreen img {
    max-height: 100vh;
    object-fit: contain;
}

/* U fullscreen-u sklonimo thumbs strip */
.kp-stage.is-fullscreen ~ .kp-strip{ display: none !important; }

/* Toolbar ostaje vidljiv i u fullscreen-u */
.kp-stage.is-fullscreen + .kp-toolbar{
    position: fixed;
    top: 12px;
    left: 0; right: 0;
    margin: 0 auto;
    z-index: 10000;
}

/* ===== Fullscreen kontrole ===== */
.kp-fs-ui{
    position: fixed;
    inset: 0;
    z-index: 9999;              /* iznad svega */
    pointer-events: none;       /* bazno — dugmići sami imaju pointer-events:auto */
    transition: opacity .3s ease;
}

.kp-fs-ui .btn{
    pointer-events: auto;
    position: absolute;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease, transform .15s ease, opacity .15s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.kp-fs-ui .btn:hover { background: rgba(0,0,0,0.75); transform: scale(1.06); }
.kp-fs-ui .btn:active { transform: scale(0.96); }

/* pozicije */
.kp-fs-ui .btn-exit { top: 14px; left: 14px; font-size: 20px; }
.kp-fs-ui .btn-prev { top: 50%; left: 16px; transform: translateY(-50%); font-size: 30px; }
.kp-fs-ui .btn-next { top: 50%; right: 16px; transform: translateY(-50%); font-size: 30px; }

/* auto-hide */
.kp-fs-ui.is-hidden .btn { opacity: 0; pointer-events: none; transition: opacity .4s ease; }

/* mobilni: veće mete */
@media (pointer: coarse){
    .kp-fs-ui .btn{
        width: 54px;
        height: 54px;
        font-size: 28px;
    }
}


/* === Mobile landscape fix: dozvoli skrol na home/cover-u === */
@media (orientation: landscape) and (max-height: 500px){
    /* 1) Rastereti grid visinu da content može da preraste viewport */
    html, body{
        height: auto;            /* umesto 100% */
        min-height: 100vh;       /* ipak zadrži minimum */
        overflow-x: hidden;      /* samo X sakrivamo */
    }

    /* 2) Srednji grid red više nije 1fr (zakucan), nego "auto" */
    body{
        grid-template-rows: auto auto auto;   /* header | content(auto) | footer */
    }

    /* 3) Sam cover neka prirodno raste i dozvoli preliv (scroll stranice) */
    .cover{
        min-height: auto;        /* umesto 100dvh/100% */
        overflow: visible;       /* da ništa ne seče */
        padding-block: 12px 16px;
    }

    /* 4) Unutrašnji grid u cover-u – bez spacer redova, nek teče prirodno */
    .cover > .container{
        height: auto;
        grid-template-rows: auto auto auto;
        row-gap: 12px;
    }
}

/* === KP FULLSCREEN UI – robust visibility & layering === */
.kp-stage.is-fullscreen {
    background: #000;
    inset: 0;
    position: fixed;
    z-index: 9998;
}

/* FS kontrole iznad svega i vidljive po defaultu; .is-hidden smanjuje opacity */
.kp-fs-ui {
    pointer-events: none;
    position: fixed;
    inset: 0;
    opacity: 1;
    transition: opacity .25s ease;
    z-index: 10010; /* iznad stage + toolbar */
}
.kp-fs-ui.is-hidden { opacity: 0; pointer-events: none; }

/* Dugmići uvek klikabilni (prebijamo eventualne globalne postavke) */
.kp-fs-ui .btn { pointer-events: auto; opacity: 1; }

/* Povećaj malo hit-targete na dodirnim uređajima */
@media (pointer: coarse) {
    .kp-fs-ui .btn { width: 58px; height: 58px; font-size: 28px; }
}

/* Toolbar neka i dalje bude iznad, ali ispod FS dugmića (z-index manji od 10010) */
.kp-stage.is-fullscreen + .kp-toolbar {
    left: 0;
    margin: 0 auto;
    position: fixed;
    right: 0;
    top: 12px;
    z-index: 10002;
}

/* === MOBILE MAIN IMAGE: fiksna i malo veća visina (bez “računanja”) === */
@media (max-width: 640px) {
    .kp-box {
        /* umesto calc(100dvh - X) — fiksniji i dosledniji prikaz */
        height: min(78dvh, 78svh);
        padding: 8px;
    }
    .kp-box img {
        background: #0b0c0e;
        border-radius: 12px;
        box-shadow: 0 16px 34px rgba(0,0,0,.35);
    }
}

/* === MOBILE THUMBS: 2–3 kolone bez obzira na JS (fallback) === */
.kp-strip.mobile-grid {
    margin: 0 auto;
    max-width: 100%;
    overflow: visible;
}
.kp-strip.mobile-grid .kp-strip-inner {
    display: grid;
    gap: 10px;
    grid-auto-rows: 64px;
    grid-template-columns: repeat(2, 1fr); /* default 2 kolone */
    overflow: visible;
    padding-bottom: 0;
    scrollbar-width: none;
}
.kp-strip.mobile-grid .kp-strip-inner::-webkit-scrollbar { display: none; }
@media (max-width: 640px) and (min-width: 420px) {
    .kp-strip.mobile-grid .kp-strip-inner { grid-template-columns: repeat(3, 1fr); } /* 3 kolone kad ima širine */
}
.kp-strip.mobile-grid .kp-thumb { height: 64px; width: 100%; }

/* === “Sakrij sličice” dugme bliže counter-u na mobilnom === */
@media (max-width: 640px) {
    .kp-toolbar {
        top: 66px; /* uskladi sa visinom tvog sticky headera */
        grid-template-columns: 1fr auto auto 1fr;
        column-gap: 10px;
    }
    .kp-toolbar .kp-toggle-wrap { justify-content: flex-start; }
}

/* === Desktop “hover” misem u FS modu: pokaži UI čim se pomeri miš === */
@media (pointer: fine) {
    /* opciono: ako u JS dodaješ/uklanjaš klasu na body npr. .fs-ui-hidden/.fs-ui-show
       zadrži CSS kakav je; ovde držimo samo baznu vidljivost preko .is-hidden klase */
}

/* === Sigurnosni slojevi – ništa da ne preklopi FS UI === */
.kp-nav { z-index: 5; }        /* normalno */
.kp-counter { z-index: 10001; }/* ispod FS UI, iznad stage */

/* ===== Project details: top row + title/gallery alignment ===== */

.project-toprow{
    display: grid;
    grid-template-columns: auto 1fr auto; /* back | counter | toggle */
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.project-toprow .kp-counter-wrap{
    display: flex;
    justify-content: center;
}

.project-toprow .kp-toggle-wrap{
    display: flex;
    justify-content: flex-end;
}

/* ===== Project details layout: title left, gallery centered full width ===== */

.project-layout{
    display: grid;
    grid-template-columns: 1fr;   /* jedna kolona */
    gap: 14px;
    align-items: start;
}

/* naslov levo, bez margina (kao što već radi project-title) */
.project-title{
    margin: 0;
    padding-top: 0;
    justify-self: start;
}

/* galerija zauzima punu širinu i centriramo sadržaj */
.project-layout .kp-gallery{
    width: 100%;
    margin-top: 0;
}


@media (max-width: 900px){
    .project-layout{
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ===== Fixed stage size (main image area) ===== */

/* Možeš menjati ove 2 vrednosti po želji */
:root{
    --kp-stage-w: 980px;
    --kp-stage-h: 560px;
}

.kp-stage{
    /* centriranje */
    margin-left: auto;
    margin-right: auto;

    /* fiksna veličina */
    width: var(--kp-stage-w);
    height: var(--kp-stage-h);

    /* da ne “skače” layout i da se ništa ne preliva */
    overflow: hidden;

    /* postojeći layout obično je flex/relative; ovo pomaže nav dugmićima */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* da na manjim ekranima ne probije layout */
@media (max-width: 1100px){
    .kp-stage{
        width: min(100%, var(--kp-stage-w));
        height: min(70vh, var(--kp-stage-h));
    }
}

/* okvir u kome je slika neka popuni stage */
.kp-box{
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* slika se uklapa u fiksni okvir bez menjanja dimenzija stage-a */
#kpMain{
    width: 100%;
    height: 100%;
    object-fit: contain;   /* OPCIJA A: ne seče sliku */
    /* object-fit: cover;  /* OPCIJA B: popuni okvir, ali seče */
    display: block;
}

.kp-strip{
    width: var(--kp-stage-w);
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1100px){
    .kp-strip{
        width: min(100%, var(--kp-stage-w));
    }
}

/* Hint row (between counter and stage) */
.kp-hint-row{
    display: flex;
    justify-content: center;
    margin: 6px 0 12px;
    opacity: .85;
}

.kp-hint-pill{
    font-size: 13px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.85);
    backdrop-filter: blur(6px);
}

/* malo manji na telefonu */
@media (max-width: 600px){
    .kp-hint-pill{ font-size: 12px; padding: 7px 10px; }
}

/* hint ispod top bara */
.kp-hint-row{
    display: flex;
    justify-content: center;
    margin: -6px 0 14px;   /* malo ga privuci ka top baru */
}

/* TOP ROW: pravi centar (counter u centru stranice) */
.project-toprow{
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* levo i desno fleks, sredina auto */
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

/* levo dugme ostaje levo */
.project-toprow .btn-back{
    justify-self: start;
}

/* brojač u apsolutnom centru */
.project-toprow .kp-counter-wrap{
    justify-self: center;
    display: flex;
    justify-content: center;
}

/* toggle desno */
.project-toprow .kp-toggle-wrap{
    justify-self: end;
    display: flex;
    justify-content: flex-end;
}

/* Hint izgled (ako već imaš, možeš samo da dodaš animaciju ispod) */
.kp-hint-row{
    display: flex;
    justify-content: center;
    margin: 6px 0 14px;
    opacity: .92;
}

/* puls + shimmer */
.kp-hint-pill{
    position: relative;
    overflow: hidden;

    font-size: 13px;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 999px;

    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.88);

    backdrop-filter: blur(6px);

    animation: kpHintPulse 2.6s ease-in-out infinite;
}

/* shimmer sloj */
.kp-hint-pill::after{
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-120%);
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.18),
            transparent
    );
    animation: kpHintShimmer 3.2s ease-in-out infinite;
}

@keyframes kpHintPulse{
    0%, 100%{
        transform: scale(1);
        box-shadow: 0 0 0 rgba(255,255,255,0);
        opacity: .88;
    }
    50%{
        transform: scale(1.03);
        box-shadow: 0 0 18px rgba(255,255,255,.12);
        opacity: 1;
    }
}

@keyframes kpHintShimmer{
    0%{ transform: translateX(-120%); opacity: .0; }
    20%{ opacity: .65; }
    50%{ opacity: .55; }
    100%{ transform: translateX(120%); opacity: .0; }
}

/* Manje animacije za korisnike koji to traže */
@media (prefers-reduced-motion: reduce){
    .kp-hint-pill, .kp-hint-pill::after{
        animation: none !important;
    }
}

.kp-hint-pill{
    animation: kpHintPulse 2.6s ease-in-out infinite;
    animation-iteration-count: 4; /* ~10 sekundi pa stane */
}
.kp-hint-pill::after{
    animation: kpHintShimmer 3.2s ease-in-out infinite;
    animation-iteration-count: 3;
}


/* ✅ Stabilan mobile layout: 1 kolona, sve iste širine */
@media (max-width: 900px){
    .cat-row{
        grid-template-columns: 1fr;      /* uvek jedna ispod druge */
        justify-items: center;
    }

    .cat{
        width: 100%;
        max-width: 520px;               /* da ne bude preširoko */
        align-items: center;
    }

    .cat img{
        width: 100%;
        max-width: 520px;
        height: auto;
        aspect-ratio: 4 / 3;            /* svi cover-i iste proporcije */
        object-fit: cover;
    }

    .cat span{
        margin-top: 12px;
    }
}

.kp-stage.is-fullscreen{
    overscroll-behavior-x: contain;
    touch-action: pan-y;
}

/* ===== Page Loader (critical images) ===== */
.page-loader{
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity .28s ease, visibility .28s ease;
    opacity: 1;
    visibility: visible;
}

.page-loader.is-hidden{
    opacity: 0;
    visibility: hidden;
}

.page-loader__box{
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(0,0,0,.35);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.page-loader__spinner{
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 3px solid rgba(255,255,255,.22);
    border-top-color: rgba(255,255,255,.92);
    animation: loaderSpin .9s linear infinite;
}

.page-loader__brand{
    font-weight: 700;
    letter-spacing: .2px;
    color: rgba(255,255,255,.92);
    font-size: 16px;
}

.page-loader__hint{
    font-size: 13px;
    color: rgba(255,255,255,.70);
}

@keyframes loaderSpin{
    to{ transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce){
    .page-loader{ transition: none; }
    .page-loader__spinner{ animation: none; }
}




