/* WSC – samostatné štýly galérie Realizácie pre články a stránky (shortcode [wsc_realizacie]). Načítava sa len tam, kde je shortcode. */
:root {
    /* MODRÁ */
    --wsc-primary: #2563eb;              /* akcia, výber, tlačidlá (biely text 5,2 : 1) */
    --wsc-primary-deep: #1e40af;         /* tmavý koniec prechodu, text na svetlomodrom */
    --wsc-primary-bg: #eff6ff;           /* svetlé modré pozadie (hover, info) */
    --wsc-primary-line: #93c5fd;         /* svetlomodrý okraj (hover) */
    --wsc-primary-head: #dbe3f6;         /* pás hlavičky tabuľky cien */

    /* ZELENÁ */
    --wsc-green: #16a34a;                /* okraje vstupných polí, fajočky, zvýraznenie */
    --wsc-green-dark: #15803d;           /* text a pozadie s bielym písmom (odznak „ušetríte“) */
    --wsc-green-bg: #f0fdf4;             /* svetlozelené pozadie (úspech) */
    --wsc-green-line: #bbf7d0;           /* svetlozelený okraj */
    --wsc-green-glow: rgba(22, 163, 74, .25);
    --wsc-green-on-blue: #86efac;        /* svetlozelený text na modrom boxe (≥ 4,5 : 1 na tmavšom páse) */

    /* SIVÁ – okraje (jemná = karty a oddeľovače, výraznejšia = prázdne prvky, kruhy, prerušované rámiky) */
    --wsc-border: #e2e6ea;
    --wsc-border-strong: #c3cad2;

    /* SIVÁ – texty a plochy */
    --wsc-text-dark: #1d2327;
    --wsc-text: #374151;
    --wsc-text-muted: #596273;           /* najsvetlejší text (5,5 : 1 aj na #f5f5f5) */
    --wsc-bg-light: #f5f5f5;

    /* ČERVENÁ – chyby */
    --wsc-danger: #b91c1c;
    --wsc-danger-bg: #fef2f2;
    --wsc-danger-line: #fecaca;

    /* ROZOSTUPY – jedna hodnota pre medzeru medzi sekciami (v 2.4.x sa sčítalo gap 18 + okraj 16–18 = ~34 px) */
    --wsc-gap: 18px;

    /* BIELA na modrom boxe */
    --wsc-on-blue: rgba(255, 255, 255, .94);
    --wsc-line-on-blue: rgba(255, 255, 255, .22);
    --wsc-wash: rgba(255, 255, 255, .08);   /* jemné zosvetlenie riadkov v modrom boxe (väčšie by zhoršilo kontrast bieleho textu) */
}

/* =====================================================================
   REALIZÁCIE – galéria fotiek pod tlačidlom „Pridať do košíka“ (2.5.0)
   Pás miniatúr (lazy) + okno s fotkou cez CSS :target – funguje aj bez
   JavaScriptu a vo všetkých prehliadačoch. Žiadna knižnica, žiadny súbor.
   ===================================================================== */
.wsc-gal {
    clear: both;
    margin: 28px 0 8px;
    padding-top: 22px;
    border-top: 2px solid var(--wsc-border);
    color: var(--wsc-text-dark);
}
.wsc-gal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
    margin-bottom: 6px;
}
.wsc-gal .wsc-gal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--wsc-text);
}
.wsc-gal .wsc-gal-desc {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--wsc-text-muted);
}
.wsc-gal-head .wsc-gal-desc { margin-bottom: 0; }
.wsc-gal a.wsc-gal-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--wsc-primary);
    text-decoration: none;
    white-space: nowrap;
}
.wsc-gal a.wsc-gal-all:hover { text-decoration: underline; }

/* ---- rozbaliteľný režim (<details>) ---- */
.wsc-gal--collapsible { padding-top: 0; border-top: 0; }
.wsc-gal-details {
    border: 2px solid var(--wsc-border);
    border-radius: 12px;
    background: #fff;
}
.wsc-gal-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}
.wsc-gal-summary::-webkit-details-marker { display: none; }
.wsc-gal--collapsible .wsc-gal-title { font-size: 16px; }
.wsc-gal-n { font-weight: 400; color: var(--wsc-text-muted); }
.wsc-gal-chev { width: 20px; height: 20px; color: var(--wsc-text-muted); transition: transform .2s ease; flex-shrink: 0; }
.wsc-gal-details[open] .wsc-gal-chev { transform: rotate(180deg); color: var(--wsc-primary); }
.wsc-gal-details[open] > .wsc-gal-summary { border-bottom: 2px solid var(--wsc-border); }
.wsc-gal-body { padding: 14px 16px 16px; }
.wsc-gal-body .wsc-gal-head { margin-bottom: 12px; }

/* ---- pás miniatúr: desktop = mriežka, mobil = posuvný rad ---- */
.wsc-gal-strip {
    display: grid;
    grid-template-columns: repeat(var(--wsc-gal-cols, 4), minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.wsc-gal-item { margin: 0; padding: 0; min-width: 0; }
.wsc-gal-item { scroll-margin-top: 35vh; }   /* po zatvorení okna sa stránka vráti k miniatúre, nie na jej horný okraj */
.wsc-gal a.wsc-gal-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
    text-decoration: none;
    background: #fff;
    color: var(--wsc-text-dark);
    border: 2px solid var(--wsc-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.wsc-gal a.wsc-gal-tile:hover,
.wsc-gal a.wsc-gal-tile:focus { color: var(--wsc-text-dark); border-color: var(--wsc-primary-line); box-shadow: 0 4px 14px rgba(37,99,235,.12); }
.wsc-gal a.wsc-gal-tile:focus-visible { outline: 3px solid var(--wsc-primary); outline-offset: 2px; }
.wsc-gal-media {
    position: relative;
    display: block;
    background: var(--wsc-bg-light);
    overflow: hidden;
}
/* Pomer strán 4:3 drží samotný obrázok (aspect-ratio prebíja pomer z atribútov width/height) –       */
/* rezervuje miesto ešte pred načítaním, takže stránka sa pri lazy načítaní fotiek neposúva (CLS).    */
/* !important: WordPress pri lazy fotkách dopisuje inline style (width:100%;height:75%;max-width:…), ktorý by prebil toto pravidlo. */
.wsc-gal .wsc-gal-img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .3s ease;
}
.wsc-gal a.wsc-gal-tile:hover .wsc-gal-img { transform: scale(1.04); }
/* lupa v rohu miniatúry */
.wsc-gal-media::after {
    content: "";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.94) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='M20 20l-4.2-4.2M11 8.5v5M8.5 11h5'/%3E%3C/svg%3E") center / 18px no-repeat;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.wsc-gal-cap { display: block; padding: 8px 10px 10px; }
.wsc-gal-cap strong { display: block; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--wsc-text-dark); }
.wsc-gal-cap small  { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--wsc-text-muted); }

/* dlaždica „Všetky realizácie“ */
.wsc-gal-cta a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--wsc-primary);
    border-radius: 12px;
    background: var(--wsc-primary-bg);
    color: var(--wsc-primary-deep);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background .2s;
}
.wsc-gal-cta a:hover { background: #fff; }
.wsc-gal-cta-a { font-size: 22px; line-height: 1; }

@media (max-width: 899.98px) {
    .wsc-gal { margin-top: 20px; padding-top: 18px; }
    .wsc-gal-strip {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-right: -4px;
    }
    .wsc-gal-item { flex: 0 0 240px; scroll-snap-align: start; }
    .wsc-gal-cta  { flex-basis: 200px; }
    .wsc-gal .wsc-gal-title { font-size: 18px; }
}

/* ---- okno s fotkou: zobrazí ho :target (odkaz #id), vypisuje sa v päte stránky ---- */
.wsc-gal-lb {
    display: none;                 /* zatvorené okno nič nevykresľuje ani nenačítava (lazy obrázky vnútri) */
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.wsc-gal-lb:target { display: flex; }
html:has(.wsc-gal-lb:target) { overflow: hidden; }   /* stránka za oknom sa neposúva */
.wsc-gal-lb-back {                 /* tmavé pozadie = odkaz, klik mimo okna ho zatvorí */
    position: absolute;
    inset: 0;
    background: rgba(11, 14, 20, .78);
    cursor: default;
}
.wsc-gal-lb-win {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1000px, 94vw);
    max-height: 94vh;
    max-height: 94dvh;
    overflow: hidden;
    border-radius: 16px;
    background: #0b0e14;
    box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.wsc-gal-lb a { text-decoration: none; }
.wsc-gal-lb a:focus-visible { outline: 2px solid var(--wsc-primary-line); outline-offset: 2px; }

.wsc-gal-lb-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,.14);
}
.wsc-gal-lb-name { font-size: 15px; font-weight: 700; margin-right: auto; color: #fff; }
.wsc-gal-lb a.wsc-gal-lb-all { font-size: 13px; font-weight: 600; color: #bfdbfe; white-space: nowrap; }
.wsc-gal-lb a.wsc-gal-lb-all:hover { text-decoration: underline; }
.wsc-gal-lb-count { font-size: 13px; color: var(--wsc-on-blue); white-space: nowrap; }
.wsc-gal-lb a.wsc-gal-lb-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 26px;
    line-height: 1;
}
.wsc-gal-lb a.wsc-gal-lb-close:hover { background: rgba(255,255,255,.28); color: #fff; }

.wsc-gal-lb-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: min(500px, 58vh);
    padding: 10px 64px;
}
.wsc-gal-lb-fig { margin: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.wsc-gal-lb .wsc-gal-lb-img {
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 8px;
}
.wsc-gal-lb a.wsc-gal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    transition: background .2s;
}
.wsc-gal-lb a.wsc-gal-nav:hover { background: rgba(255,255,255,.28); color: #fff; }
.wsc-gal-nav span { display: block; transform: translateY(-2px); }
.wsc-gal-nav--prev { left: 10px; }
.wsc-gal-nav--next { right: 10px; }

.wsc-gal-lb-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px 16px;
    border-top: 1px solid rgba(255,255,255,.14);
}
.wsc-gal-lb-cap { margin: 0; min-width: 0; font-size: 14px; line-height: 1.4; color: #fff; }
.wsc-gal-lb-cap strong { display: block; font-weight: 700; color: #fff; }
.wsc-gal-lb-cap span   { display: block; color: var(--wsc-border-strong); }
.wsc-gal-lb-thumbs { display: flex; gap: 8px; margin-left: auto; overflow-x: auto; padding: 3px; }
.wsc-gal-lb a.wsc-gal-th {
    flex: 0 0 auto;
    display: block;
    width: 88px; height: 66px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #1c2230;
    opacity: .75;
    transition: opacity .2s, border-color .2s;
}
.wsc-gal-lb a.wsc-gal-th:hover { opacity: 1; }
.wsc-gal-lb a.wsc-gal-th[aria-current="true"] { border-color: var(--wsc-primary-line); opacity: 1; }
.wsc-gal-lb a.wsc-gal-th { position: relative; }
.wsc-gal-lb .wsc-gal-th-img { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none !important; aspect-ratio: auto; object-fit: cover; }

@media (max-width: 899.98px) {
    /* mobil: okno na celú obrazovku, bez miniatúr (pod fotkou je počítadlo a popis) */
    .wsc-gal-lb-win {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .wsc-gal-lb-bar { padding: 10px 10px 10px 14px; gap: 10px; }
    .wsc-gal-lb-all { display: none; }
    .wsc-gal-lb-name { font-size: 14px; }
    .wsc-gal-lb-stage { flex: 1 1 auto; height: auto; padding: 8px 8px; }
    .wsc-gal-lb a.wsc-gal-nav { width: 44px; height: 44px; background: rgba(11,14,20,.55); }
    .wsc-gal-nav--prev { left: 8px; }
    .wsc-gal-nav--next { right: 8px; }
    .wsc-gal-lb-foot { padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
    .wsc-gal-lb-thumbs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wsc-gal a.wsc-gal-tile, .wsc-gal .wsc-gal-img, .wsc-gal-chev { transition: none; }
    .wsc-gal a.wsc-gal-tile:hover .wsc-gal-img { transform: none; }
}

/* ---- (2.9.4) režim „mriežka“ pre články: všetky fotky v mriežke, aj na mobile ---- */
.wsc-gal--grid .wsc-gal-strip { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 899.98px) {
    .wsc-gal--grid .wsc-gal-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        scroll-snap-type: none;
        margin-right: 0;
        padding-bottom: 0;
    }
    .wsc-gal--grid .wsc-gal-item { flex: none; }
}
.wsc-gal--embed { border-top: 0; padding-top: 0; }
