/* ========================================
   ГАЛЕРИЯ — тип „Витрина“ (settings.gallery_layout = showcase)
   ======================================== */
.gallery-showcase .gs-top { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.gallery-showcase .gs-top h1 { margin: 0; }
.gallery-showcase .gs-stats { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: #64748b; }
.gallery-showcase .gs-stats span { background: #f1f5f9; border-radius: 999px; padding: 4px 12px; }
.gallery-showcase .gs-stats b { color: #0f172a; }

.gallery-showcase .gs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }

/* ── Страничен панел ── */
.gallery-showcase .gs-side {
    position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow: auto;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 10px;
    box-shadow: 0 2px 10px rgba(15,23,42,.05);
}
.gallery-showcase .gs-side a { text-decoration: none; color: #334155; }
.gallery-showcase .gs-side-all, .gallery-showcase .gs-side-main, .gallery-showcase .gs-side-albums a {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 9px; font-size: .88rem; font-weight: 600;
}
.gallery-showcase .gs-side-main { margin-top: 2px; }
.gallery-showcase .gs-side em { font-style: normal; font-size: .72rem; color: #94a3b8; background: #f1f5f9; border-radius: 999px; padding: 1px 8px; }
.gallery-showcase .gs-side a:hover { background: #f1f5f9; }
.gallery-showcase .gs-side a.is-active { background: #1976d2; color: #fff; }
.gallery-showcase .gs-side a.is-active em { background: rgba(255,255,255,.25); color: #fff; }
.gallery-showcase .gs-side-group.is-open > .gs-side-main { font-weight: 800; color: #0f172a; }
.gallery-showcase .gs-side-albums { list-style: none; margin: 2px 0 6px 12px; padding: 0 0 0 8px; border-left: 2px solid #e2e8f0; }
.gallery-showcase .gs-side-albums a { font-size: .82rem; font-weight: 500; padding: 6px 8px; }

/* ── Заглавия на редове ── */
.gallery-showcase .gs-h { font-family: inherit; font-size: 1.15rem; letter-spacing: 0; text-transform: none; font-weight: 800; color: #0f172a; margin: 0 0 12px; }
.gallery-showcase .gs-row { margin-bottom: 30px; }
.gallery-showcase .gs-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.gallery-showcase .gs-row-head a { font-size: .82rem; font-weight: 700; color: #1976d2; text-decoration: none; white-space: nowrap; }

/* ── Албуми: хоризонтална лента (начало) и мрежа (категория) ── */
.gallery-showcase .gs-rail {
    display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 4px 2px 14px; margin: 0 -2px; scrollbar-width: thin;
}
.gallery-showcase .gs-rail .gs-card { flex: 0 0 190px; scroll-snap-align: start; }
.gallery-showcase .gs-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.gallery-showcase .gs-card {
    display: block; text-decoration: none; color: inherit; background: #fff;
    border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,.06); transition: transform .2s, box-shadow .2s;
}
.gallery-showcase .gs-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(15,23,42,.16); }
.gallery-showcase .gs-card.is-active { outline: 3px solid #1976d2; }
.gallery-showcase .gs-card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); overflow: hidden; }
.gallery-showcase .gs-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.gallery-showcase .gs-card:hover .gs-card-img img { transform: scale(1.07); }
.gallery-showcase .gs-card-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; opacity: .5; }
.gallery-showcase .gs-card-badge { position: absolute; right: 8px; top: 8px; background: rgba(15,23,42,.72); color: #fff; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 3px 9px; backdrop-filter: blur(3px); }
.gallery-showcase .gs-card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.gallery-showcase .gs-card-body b { font-size: .9rem; color: #0f172a; line-height: 1.25; }
.gallery-showcase .gs-card-body small { font-size: .72rem; color: #94a3b8; }

/* ── Заглавна секция на албум ── */
.gallery-showcase .gs-hero {
    position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 18px;
    background: #1e293b; color: #fff; min-height: 150px; display: flex; align-items: flex-end;
}
.gallery-showcase .gs-hero::before {
    content: ""; position: absolute; inset: -20px; background: var(--gs-bg, linear-gradient(135deg, #1e3a5f, #1976d2)) center / cover;
    filter: blur(14px) brightness(.55); transform: scale(1.05);
}
.gallery-showcase .gs-hero-in { position: relative; z-index: 1; padding: 22px 24px; width: 100%; }
.gallery-showcase .gs-back { color: #cbd5e1; font-size: .82rem; text-decoration: none; font-weight: 600; }
.gallery-showcase .gs-back:hover { color: #fff; }
.gallery-showcase .gs-hero h2 { font-family: inherit; font-size: 1.7rem; letter-spacing: -.01em; text-transform: none; color: #fff !important; margin: 6px 0 8px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.gallery-showcase .gs-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .78rem; }
.gallery-showcase .gs-hero-meta span { background: rgba(255,255,255,.16); border-radius: 999px; padding: 3px 11px; backdrop-filter: blur(3px); }

/* ── Снимки: подравнени редове (justified rows) ── */
.gallery-showcase .gs-rows { display: flex; flex-wrap: wrap; gap: 6px; }
.gallery-showcase .gs-photo {
    position: relative; margin: 0; padding: 0; border-radius: 6px; overflow: hidden; background: #e2e8f0;
    flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * 210px);
    box-shadow: none; transform: none; cursor: zoom-in;
}
.gallery-showcase .gs-photo::before { content: ""; display: block; padding-top: calc(100% / var(--r)); }
.gallery-showcase .gs-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s, filter .35s; }
.gallery-showcase .gs-photo:hover img { transform: scale(1.05); filter: brightness(.92); }
.gallery-showcase .gs-photo figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 26px 10px 8px; text-align: left;
    color: #fff; font-size: .78rem; background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
    opacity: 0; transition: opacity .25s;
}
.gallery-showcase .gs-photo:hover figcaption { opacity: 1; }
@media (hover: none) { .gallery-showcase .gs-photo figcaption { opacity: 1; } }
.gallery-showcase .gs-rows-fill { flex-grow: 1000000; }

/* ── Мобилно ── */
@media (max-width: 860px) {
    .gallery-showcase .gs-layout { grid-template-columns: 1fr; gap: 16px; }
    .gallery-showcase .gs-side { position: static; max-height: none; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding: 8px; }
    .gallery-showcase .gs-side-group { display: contents; }
    .gallery-showcase .gs-side-all, .gallery-showcase .gs-side-main { white-space: nowrap; flex: none; }
    .gallery-showcase .gs-side-albums { display: none; }
    .gallery-showcase .gs-rail .gs-card { flex-basis: 150px; }
    .gallery-showcase .gs-albums { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-showcase .gs-hero h2 { font-size: 1.25rem; }
    .gallery-showcase .gs-photo { flex-basis: calc(var(--r) * 110px); }
}

/* ── Начало („Всички“): компактен изглед — категории като панели, подредени в колони ── */
.gallery-showcase .gs-overview { columns: 2 280px; column-gap: 16px; }
.gallery-showcase .gs-cat {
    break-inside: avoid; margin: 0 0 16px; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 14px; padding: 12px 12px 8px; box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.gallery-showcase .gs-cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.gallery-showcase .gs-cat-head .gs-h { margin: 0; font-size: 1rem; }
.gallery-showcase .gs-cat-head a { font-size: .74rem; font-weight: 700; color: #1976d2; text-decoration: none; white-space: nowrap; }
.gallery-showcase .gs-minis { display: flex; flex-direction: column; gap: 2px; }
.gallery-showcase .gs-mini {
    display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 10px;
    text-decoration: none; color: inherit; transition: background .15s;
}
.gallery-showcase .gs-mini:hover { background: #f1f5f9; }
.gallery-showcase .gs-mini-img {
    flex: none; width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1); display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.gallery-showcase .gs-mini-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-showcase .gs-mini-txt { display: flex; flex-direction: column; min-width: 0; }
.gallery-showcase .gs-mini-txt b { font-size: .86rem; color: #0f172a; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-showcase .gs-mini-txt small { font-size: .7rem; color: #94a3b8; }
@media (max-width: 860px) { .gallery-showcase .gs-overview { columns: 1; } }