/*
Theme Name: My Adaptive Slide Theme - Optimized
Version: 4.3
*/
* {
    box-sizing: border-box;
    scrollbar-width: none !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    user-select: none;
    -webkit-user-select: none;
}
*::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
html, body, .main-wrapper, .grid-container { scrollbar-width: none !important; -ms-overflow-style: none !important; }
body, html { margin: 0; padding: 0; height: 100%; font-family: 'Segoe UI', sans-serif; background-color: #455; }
.overlay { z-index: 2; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background-color: rgba(0, 0, 0, 0.4); transition: background 0.3s ease; }
.overlay h3 { margin: 0; color: #fff !important; font-size: clamp(1.1rem, 5vw, 1.5rem); text-transform: uppercase; font-weight: 700; text-shadow: 2px 2px 4px rgba(0,0,0,0.7); }
.kuti-titulli { position: absolute; left: 0; width: 100%; text-align: center; padding: 0 20px; }
.poz-lart { top: 15px; }
.poz-qender { top: 50%; transform: translateY(-50%); }
.poz-poshte { bottom: 15px; }

/* Teksti nën titull */
.kuti-tekst {
    position: absolute;
    left: 0;
    width: 100%;
    padding: 0 20px;
    margin: 0;
    line-height: 1.5;
    text-align: left;
}
/* top = pozicioni i titullit + lartësia e titullit (1em) + 1px gap */
.poz-lart  ~ .kuti-tekst  { top: calc(15px + 1em + 1px); }
.poz-qender ~ .kuti-tekst { top: calc(50% + 0.6em + 1px); }
.poz-poshte ~ .kuti-tekst { bottom: calc(15px + 1em + 1px); top: auto; }

/* Preview — 6 rreshta maksimum me ... */
.kuti-tekst--preview {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media only screen and (max-width: 768px) and (orientation: portrait) {
   .main-wrapper { width: 100%; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
   .grid-container { display: flex; flex-direction: column; width: 100%; min-height: 100dvh; }
   .box, a.box { position: relative; display: flex; align-items: center; justify-content: center; height: 33.33dvh; scroll-snap-align: start; background-size: cover; background-position: center; text-decoration: none; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 2px #3e2723; }
   .box-split { display: flex !important; flex-direction: row !important; }
   .box-split .split-child { flex: 1; height: 100%; position: relative; background-size: cover; background-position: center; }
   .box-split .split-child:first-child { border-right: 2px solid #3e2723; }
   .box-fullscreen { height: 100dvh !important; }
   .box-plusfullscreen { height: 133.33dvh !important; }
}
@media only screen and (max-width: 1024px) and (orientation: landscape) {
   .main-wrapper { width: 100%; height: 100dvh; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
   .grid-container { display: flex; flex-direction: column; width: 100%; }
   .box, a.box { position: relative; display: flex; align-items: center; justify-content: center; height: 100dvh; scroll-snap-align: start; background-size: cover; background-position: center; overflow: hidden; box-shadow: inset 0 0 0 2px #3e2723; }
   .box-split { display: flex !important; flex-direction: row !important; }
   .box-split .split-child { flex: 1; height: 100%; position: relative; background-size: cover; background-position: center; overflow: hidden; }
   .box-split .split-child:first-child { border-right: 2px solid #3e2723; }
   .box-fullscreen { height: 100dvh !important; }
   .box-plusfullscreen { height: 133.33dvh !important; }
}
@media (min-width: 769px) {
   .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 33.33vh; grid-auto-flow: dense; }
   .box { height: 100% !important; transition: transform 0.5s ease; }
   .box, a.box { position: relative; display: flex; align-items: center; justify-content: center; height: 100% !important; text-decoration: none; overflow: hidden; box-shadow: inset 0 0 0 2px #3e2723; }
   .box-double { grid-column: span 2; }
   .box-vertical { grid-column: span 1; }
   .box-split { grid-column: span 1; grid-row: span 1; display: flex !important; flex-direction: row !important; }
   .box-split .split-child { flex: 1; height: 100%; position: relative; background-size: cover; background-position: center; overflow: hidden; }
   .box-split .split-child:first-child { border-right: 2px solid #3e2723; }
   .box-split .split-child .box-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
   .box-fullscreen { grid-column: 1 / -1; height: 100vh !important; }
   .box-plusfullscreen { grid-column: 1 / -1; height: 133.33vh !important; }
}
/* Fshehja e versioneve — përputhet me layout media queries:
   Portrait:  (max-width: 768px) and (orientation: portrait)
   Landscape: (max-width: 1024px) and (orientation: landscape)
   Desktop:   (min-width: 769px)
*/
@media screen and (max-width: 768px) { .version-desktop { display: none !important; } }
@media screen and (min-width: 769px) { .version-portrait { display: none !important; } }
@media screen and (max-width: 768px) and (orientation: landscape) { .version-portrait { display: none !important; } }
@media screen and (min-width: 1025px) { .version-landscape { display: none !important; } }
@media screen and (max-width: 1024px) and (orientation: portrait) { .version-landscape { display: none !important; } }

/* .box-video — definicion i vetëm (versioni pa !important hequr, mbetet ky me !important) */
.box-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Shmang deformimin e videos */
    z-index: 1; /* E vendos videon mbi imazhin e sfondit */
}
.box, a.box {
    position: relative;
    overflow: hidden;
}
.box::after, a.box::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 2px #3e2723;
    z-index: 3;
    pointer-events: none;
}
.box .overlay {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* ═══════════════════════════════════════════════════════════
   KUTI KLIKUESHME — SHIGJETA CEPASH + OVERLAY FULLSCREEN
═══════════════════════════════════════════════════════════ */

.kuti-klikueshme { cursor: pointer; }

.kuti-cepat {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
}
/* ── SHIGJETAT E CEPAVE ── */
.cep {
    position: absolute;
    width: 22px;
    height: 15px;
    pointer-events: none;
    display: block;
}
.cep svg { width: 100%; height: 100%; overflow: visible; display: block; }
.cep svg polygon {
    fill: #39ff14;
    stroke: #1a8a00;
    stroke-width: 0.5;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 2px #39ff14) drop-shadow(0 0 4px rgba(57,255,20,0.4));
}
.cep-tl { top: 18px;    left: 18px; }
.cep-tr { top: 18px;    right: 18px; }
.cep-bl { bottom: 18px; left: 18px; }
.cep-br { bottom: 18px; right: 18px; }

.kuti-cepat.luaj { opacity: 1; }

/* Rrotullimi është BRENDA keyframe-eve — kjo është mënyra e vetme e sigurt */
.kuti-cepat.luaj .cep-tl { animation: cep-tl-anim 3s ease-in-out forwards; }
.kuti-cepat.luaj .cep-tr { animation: cep-tr-anim 3s ease-in-out forwards; }
.kuti-cepat.luaj .cep-bl { animation: cep-bl-anim 3s ease-in-out forwards; }
.kuti-cepat.luaj .cep-br { animation: cep-br-anim 3s ease-in-out forwards; }

/* ↖ top-left: rrotullohet 225deg dhe lëviz drejt cep */
@keyframes cep-tl-anim {
    0%   { opacity:0; transform: rotate(225deg) translateX(0); }
    8%   { opacity:1; transform: rotate(225deg) translateX(0); }
    28%  { opacity:1; transform: rotate(225deg) translateX(-7px); }
    45%  { opacity:1; transform: rotate(225deg) translateX(0); }
    65%  { opacity:1; transform: rotate(225deg) translateX(-7px); }
    80%  { opacity:1; transform: rotate(225deg) translateX(0); }
    100% { opacity:0; transform: rotate(225deg) translateX(0); }
}
/* ↗ top-right: rrotullohet 315deg */
@keyframes cep-tr-anim {
    0%   { opacity:0; transform: rotate(315deg) translateX(0); }
    8%   { opacity:1; transform: rotate(315deg) translateX(0); }
    28%  { opacity:1; transform: rotate(315deg) translateX(-7px); }
    45%  { opacity:1; transform: rotate(315deg) translateX(0); }
    65%  { opacity:1; transform: rotate(315deg) translateX(-7px); }
    80%  { opacity:1; transform: rotate(315deg) translateX(0); }
    100% { opacity:0; transform: rotate(315deg) translateX(0); }
}
/* ↙ bottom-left: rrotullohet 135deg */
@keyframes cep-bl-anim {
    0%   { opacity:0; transform: rotate(135deg) translateX(0); }
    8%   { opacity:1; transform: rotate(135deg) translateX(0); }
    28%  { opacity:1; transform: rotate(135deg) translateX(-7px); }
    45%  { opacity:1; transform: rotate(135deg) translateX(0); }
    65%  { opacity:1; transform: rotate(135deg) translateX(-7px); }
    80%  { opacity:1; transform: rotate(135deg) translateX(0); }
    100% { opacity:0; transform: rotate(135deg) translateX(0); }
}
/* ↘ bottom-right: rrotullohet 45deg */
@keyframes cep-br-anim {
    0%   { opacity:0; transform: rotate(45deg) translateX(0); }
    8%   { opacity:1; transform: rotate(45deg) translateX(0); }
    28%  { opacity:1; transform: rotate(45deg) translateX(-7px); }
    45%  { opacity:1; transform: rotate(45deg) translateX(0); }
    65%  { opacity:1; transform: rotate(45deg) translateX(-7px); }
    80%  { opacity:1; transform: rotate(45deg) translateX(0); }
    100% { opacity:0; transform: rotate(45deg) translateX(0); }
}

.kuti-cepat.fshih { display: none; }

/* ═══════════════════════════════════════════════
   OVERLAY — panel nga poshtë, 50% lartësi ekrani
   position:fixed ndaj <body> direkt (nga footer.php)
═══════════════════════════════════════════════ */
/* ── OVERLAY BACKDROP ── */
#kuti-fs-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 999999;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease;
}
#kuti-fs-overlay.aktiv {
    opacity: 1;
    pointer-events: all;
    background: rgba(0,0,0,0.65);
}

/* ── MODAL — 70vw x 70vh ── */
#kuti-fs-inner {
    position: relative;
    /* background kontrollohet 100% nga JS (fsInner.style) */
    background: #0a0a0a;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    border-radius: 8px;
    width: 70vw;
    height: 70vh;
    margin: 0;
    transform: scale(0.94);
    transition: transform 0.3s ease;
}
#kuti-fs-overlay.aktiv #kuti-fs-inner {
    transform: scale(1);
}

/* Mobile portrait — fullscreen, video mbush të gjithë ekranin */
@media only screen and (max-width: 768px) and (orientation: portrait) {
    #kuti-fs-overlay,
    #kuti-fs-overlay.aktiv {
        background: #000 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    #kuti-fs-inner {
        width: 100vw !important;
        height: 100dvh !important;
        border-radius: 0 !important;
        transform: none !important;
        margin: 0 !important;
        flex-direction: column !important;
        /* background: vendoset nga JS — pa rregull CSS këtu */
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    /* Media — mbush të gjithë ekranin */
    .kuti-fs-media,
    .kuti-fs-thumb {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        flex: none !important;
        background-color: #000 !important;
        background-size: cover !important;
        background-position: center !important;
        overflow: hidden !important;
    }
    .kuti-fs-video {
        position: absolute !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    /* Teksti — fshihet në portrait kur ka media */
    .kuti-fs-media ~ .kuti-fs-body,
    .kuti-fs-thumb ~ .kuti-fs-body {
        display: none !important;
    }
    /* Teksti — shfaqet gjithmonë kur nuk ka media (vetëm tekst) */
    .kuti-fs-body:first-child,
    .kuti-fs-body--vetem-tekst {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 32px 24px 32px !important;
        overflow-y: auto !important;
        /* background transparent — ngjyra vjen nga #kuti-fs-inner nëpërmjet JS */
        background: transparent !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        /* Siguro që scroll fillon nga lart */
        scroll-snap-type: none !important;
    }
}

/* Animacioni i countdown — global, funksionon në të gjitha orientimin */
@keyframes shfaq-controls {
    0%   { opacity: 0; transform: translateY(-50%) scale(0.85); }
    60%  { opacity: 1; transform: translateY(-50%) scale(1.05); }
    100% { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* Mobile landscape — fullscreen, vetëm për mobile (jo desktop) */
@media only screen and (orientation: landscape) and (max-width: 1024px) {
    #kuti-fs-overlay,
    #kuti-fs-overlay.aktiv {
        background: #000 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
    #kuti-fs-inner {
        width: 100vw !important;
        height: 100dvh !important;
        border-radius: 0 !important;
        transform: none !important;
        margin: 0 !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    .kuti-fs-media,
    .kuti-fs-thumb {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        flex: none !important;
        background-color: #000 !important;
        background-size: cover !important;
        background-position: center !important;
        overflow: hidden !important;
    }
    .kuti-fs-video {
        position: absolute !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    .kuti-fs-media ~ .kuti-fs-body,
    .kuti-fs-thumb ~ .kuti-fs-body {
        display: none !important;
    }
    .kuti-fs-body:first-child,
    .kuti-fs-body--vetem-tekst {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        height: 100dvh !important;
        padding: 32px 24px 32px !important;
        overflow-y: auto !important;
        background: transparent !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        scroll-snap-type: none !important;
    }
}

/* ── DESKTOP (min-width: 1025px) ── */
@media screen and (min-width: 1025px) {
    /* Pa backdrop — ekrani duket normalisht */
    #kuti-fs-overlay,
    #kuti-fs-overlay.aktiv {
        background: rgba(0,0,0,0) !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 20px 0 0 0 !important;
        overflow: visible !important;
        pointer-events: none !important;
    }
    #kuti-fs-overlay.aktiv {
        opacity: 1 !important;
        pointer-events: all !important;
    }
    /* Modal: 70vw × 70vh, lart, pa animacion */
    #kuti-fs-inner {
        width: 70vw !important;
        height: 70vh !important;
        border-radius: 8px !important;
        transform: none !important;
        transition: none !important;
        margin: 0 !important;
        flex-direction: row !important;
        overflow: hidden !important;
    }
    #kuti-fs-overlay.aktiv #kuti-fs-inner {
        transform: none !important;
    }
    /* Video mbush 100% të kutisë */
    .kuti-fs-media,
    .kuti-fs-thumb {
        flex: 1 1 100% !important;
        position: relative !important;
        align-self: stretch !important;
        overflow: hidden !important;
        background-size: cover !important;
        background-position: center !important;
    }
    .kuti-fs-video {
        position: absolute !important;
        top: 0 !important; left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }
    /* Teksti fshihet kur ka video */
    .kuti-fs-media ~ .kuti-fs-body,
    .kuti-fs-thumb ~ .kuti-fs-body {
        display: none !important;
    }
}

/* Media (video/imazh) — 40% majtas, mbush lartësinë e plotë */
.kuti-fs-media {
    flex: 0 0 40%;
    flex-shrink: 0;
    position: relative;
    background: #000;
    overflow: hidden;
    align-self: stretch;
}
.kuti-fs-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.kuti-fs-thumb {
    flex: 0 0 40%;
    flex-shrink: 0;
    align-self: stretch;
    background-size: cover;
    background-position: center;
}

/* Teksti djathtas — flex:1 zë gjithë gjerësinë kur nuk ka media */
.kuti-fs-body {
    flex: 1;
    padding: 20px 40px 20px 24px;
    overflow-y: auto;
    align-self: stretch;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.kuti-fs-title { color:#fff; font-size:clamp(1rem,2vw,1.5rem); text-transform:uppercase; margin:0 0 6px; line-height:1.2; }
.kuti-fs-date  { color:rgba(255,255,255,0.35); font-size:0.78rem; margin:0 0 14px; }
.kuti-fs-content { color:#ccc; font-size:clamp(0.85rem,1.3vw,1rem); line-height:1.7; }
.kuti-fs-content p { margin:0 0 0.9em; }
/* Tekst i drejtpërdrejtë (nga textarea, jo WP content) */
.kuti-fs-body--vetem-tekst .kuti-fs-content {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    /* ngjyra vjen nga inline style i JS (fs_text_color) */
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.75;
}
.kuti-fs-info { margin-top:16px; border-top:1px solid #222; padding-top:12px; }
.kuti-fs-info h4 { color:#ec0808; margin:0 0 4px; font-size:0.75rem; text-transform:uppercase; letter-spacing:1px; }
.kuti-fs-info p  { color:#999; line-height:1.5; font-size:0.85rem; }

/* Kohëzgjatja e videos — stil ore digitale, mbi butonin X */
.kuti-fs-duration {
    position: absolute;
    top: calc(50% + 1cm + 1cm - 34px);
    right: 10px;
    transform: none;
    width: auto;
    text-align: center;
    background: rgba(10,10,10,0.5);
    color: #b8ffcc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 21px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(200,255,210,0.15);
    z-index: 15;
    pointer-events: none;
    letter-spacing: 3px;
    opacity: 0;
    cursor: pointer;
    text-shadow:
        0 0 6px #39ff14,
        0 0 14px rgba(57,255,20,0.5);
    box-shadow: none;
}
.kuti-fs-duration.shfaq-x {
    animation: shfaq-controls 0.6s ease forwards;
    pointer-events: auto;
}
/* Landscape mobile — fixed ndaj viewport, jashtë çdo overflow:hidden */
.kuti-fs-duration-ls {
    position: fixed !important;
    top: 80px !important;
    right: 70px !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 9999999 !important;
}
/* Animacion për landscape mobile */
.kuti-fs-duration-ls.shfaq-x {
    animation: shfaq-controls-ls 0.6s ease forwards;
}
/* Desktop — brenda kutisë, në krye djathtas */
.kuti-fs-duration-ds {
    position: absolute !important;
    top: 10px !important;
    right: 50% !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 9999999 !important;
}
/* Animacion për desktop */
.kuti-fs-duration-ds.shfaq-x {
    animation: shfaq-controls-ls 0.6s ease forwards;
}
@keyframes shfaq-controls-ls {
    0%   { opacity: 0; transform: scale(0.85); }
    60%  { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
.kuti-loading { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; height:100%; }
.kuti-loading span { width:9px; height:9px; border-radius:50%; background:#fff; animation:kuti-bounce 1.1s ease-in-out infinite; }
.kuti-loading span:nth-child(2) { animation-delay:.18s; }
.kuti-loading span:nth-child(3) { animation-delay:.36s; }
@keyframes kuti-bounce {
    0%,80%,100% { transform:scale(.6); opacity:.4; }
    40% { transform:scale(1.2); opacity:1; }
}
/* ══════════════════════════════════════════════
   SEKSIONET — media grid + expand
══════════════════════════════════════════════ */
.seks-layer {
    position: absolute;
    inset: 0;
    z-index: 4;          /* mbi overlay(2) dhe border(3) */
    overflow: hidden;
}
.seks-grid {
    position: absolute;
    inset: 0;
    display: grid;
}
.seks-cell {
    position: relative;
    overflow: hidden;
    background: #000;
    box-sizing: border-box;
}
.seks-cell img,
.seks-cell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;   /* pa prerje brenda seksionit */
    display: block;
}
/* Vija ndarëse — identike me kufijtë e kutive */
.seks-cell.br { border-right:  2px solid #3e2723; }
.seks-cell.bb { border-bottom: 2px solid #3e2723; }