/*
 * Object gallery and object page.
 *
 * Extracted from the source layouts objektai.html and objektas.html. Loaded
 * only on the gallery page template and on single objects, after main.css,
 * which it relies on for the design tokens (--ink, --line, --mut, --soft, …)
 * and for the base .btn / .wrap / .band rules.
 *
 * The base .lb rules are repeated here from single-product.css on purpose:
 * they live in that file alone, which only loads on product pages, so an object
 * page would otherwise render the lightbox as a plain block at the bottom of
 * the document. Same verbatim-repeat trade-off single-product.css already
 * documents for .gal-zoom.
 *
 * Added on top of the source: the lightbox arrows and counter (the delivered
 * layout browsed a single photo, the task asks for a browsable gallery) and the
 * .gempty / .gmore wrappers the dynamic grid needs.
 *
 * @package Statybumedis
 */

/* ===== OBJEKTŲ GALERIJA ===== */
.gfil{display:flex; gap:8px; flex-wrap:wrap; padding:2px 0 22px}
.gfil a{border:1.5px solid var(--line); border-radius:8px; padding:8px 14px; font-size:14px; color:var(--ink); background:#fff}
.gfil a.on{background:var(--ink); color:#fff; border-color:var(--ink)}
.gfil a:hover{border-color:var(--ink)}

.ggrid{display:grid; grid-template-columns:repeat(3,1fr); gap:22px; padding-bottom:20px}
.gcard{display:block; background:#fff; border:1px solid var(--line); border-radius:12px; overflow:hidden}
.gcard .im{display:block; aspect-ratio:4/3; overflow:hidden; background:var(--soft)}
.gcard .im img{width:100%; height:100%; object-fit:cover; transition:transform .5s cubic-bezier(.2,.6,.2,1)}
.gcard:hover .im img{transform:scale(1.06)}
.gcard .tx{display:block; padding:16px 18px 18px}
.gcard h3{font-size:17px; line-height:1.25}
.gcard .meta{display:block; margin-top:6px; font-size:12.5px; color:var(--mut)}
.gcard .used{margin-top:11px; display:flex; align-items:center; gap:9px; font-size:14px; border-top:1px solid var(--line); padding-top:11px}
.gcard .used img{width:34px; height:26px; object-fit:cover; border-radius:5px; border:1px solid var(--line)}
.gcard .used b{font-weight:600}
.gcard .used span.go{margin-left:auto; color:var(--brand-d); font-weight:600}

.gempty{padding:10px 0 30px; color:var(--mut)}
.gmore{text-align:center; padding:10px 0 40px}
.gmore .btn[hidden]{display:none}
.gmore .btn.is-busy{opacity:.6; pointer-events:none}

/* ===== OBJEKTO PUSLAPIS ===== */
.obj-hero{border-radius:12px; overflow:hidden; border:1px solid var(--line); aspect-ratio:16/9; cursor:zoom-in}
.obj-hero img{width:100%; height:100%; object-fit:cover}
.obj-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:10px}
.obj-grid img{width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:9px; border:1px solid var(--line); cursor:zoom-in}
.obj-lay{display:grid; grid-template-columns:1fr 340px; gap:28px; align-items:start; padding:6px 0 20px}
/* Parks below the sticky header, not under it: top is the header height plus
   the 18px of air the source layout leaves. The layout itself used a bare 18px
   because its header markup was static there. */
.obj-side{border:1px solid var(--line); border-radius:12px; background:#fff; padding:20px; position:sticky; top:calc(var(--hdr-h) + 18px)}
.obj-side h2{font-size:18px; margin-bottom:12px}
.obj-side .row{display:flex; justify-content:space-between; gap:12px; padding:8px 0; font-size:14px; border-bottom:1px solid var(--line)}
.obj-side .row:last-of-type{border-bottom:none}
.obj-side .row .mut{color:var(--mut)}
.obj-txt{margin-top:22px; max-width:76ch}
.obj-txt p{margin:10px 0; color:#3d4136}

/* Lead product inside the sidebar, from the source layout: thumbnail, name and
   dimensions on one line, followed by the buy button. */
.obj-prod{display:flex; gap:11px; align-items:center; margin-top:14px; padding-top:14px; border-top:1px solid var(--line); color:var(--ink)}
.obj-prod img{width:56px; height:44px; object-fit:cover; border-radius:7px; border:1px solid var(--line); flex:0 0 56px}
.obj-prod b{display:block; font-size:14px; line-height:1.25}
.obj-prod span span{font-size:12.5px; color:var(--mut)}
.obj-prod:hover b{color:var(--brand-d)}
.obj-side .btn{width:100%; justify-content:center; margin-top:14px}

/* ===== ŠVIESDĖŽĖ (lightbox su navigacija) ===== */
.lb{position:fixed; inset:0; background:rgba(20,24,16,.9); display:none; align-items:center; justify-content:center; z-index:400; padding:36px}
.lb.open{display:flex}
.lb img{max-width:92vw; max-height:88vh; object-fit:contain; background:#fff; border-radius:10px}
.lb .x{position:absolute; top:22px; right:26px; width:42px; height:42px; border-radius:50%; border:none; background:rgba(255,255,255,.9);
       font-size:22px; cursor:pointer; line-height:1}
.obj-lb-nav{position:absolute; top:50%; transform:translateY(-50%); width:52px; height:52px; border-radius:50%;
  border:none; background:rgba(255,255,255,.14); color:#fff; font-size:34px; line-height:1; cursor:pointer}
.obj-lb-nav:hover{background:rgba(255,255,255,.26)}
.obj-lb-nav.prev{left:18px}
.obj-lb-nav.next{right:18px}
.obj-lb-nav[hidden]{display:none}
.obj-lb-count{position:absolute; bottom:22px; left:50%; transform:translateX(-50%); color:#fff; font-size:14px; opacity:.75}
.obj-lb-count[hidden]{display:none}

@media(max-width:1000px){
  .ggrid{grid-template-columns:repeat(2,1fr)}
  .obj-lay{grid-template-columns:1fr}
  .obj-side{position:static}
}
@media(max-width:640px){
  .ggrid{grid-template-columns:1fr}
  .obj-grid{grid-template-columns:repeat(2,1fr)}
  .obj-lb-nav{width:42px; height:42px; font-size:28px}
  .obj-lb-nav.prev{left:6px}
  .obj-lb-nav.next{right:6px}
}
