/* ==========================================================
   GALLERY + LIGHTBOX (loaded on the Home page only)
   ========================================================== */
[hidden] { display: none !important; }

/* ---------- Category tabs ---------- */
.g-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 0 auto 2rem; }
.g-tab {
  font: 600 .9rem var(--font-body); min-height: 44px; padding: .5rem 1.3rem; border-radius: 999px;
  border: 1.5px solid rgba(33, 22, 95, .25); background: #fff; color: var(--primary); cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.g-tab:hover { transform: translateY(-1px); border-color: var(--primary); }
.g-tab[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Loading / empty / error message ---------- */
.g-state { text-align: center; color: var(--muted); padding: 2.6rem 1.2rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.g-state .btn { margin-top: 1rem; }

/* ---------- Slider ---------- */
.g-stage { position: relative; margin: 0 -.55rem; }
.g-frame { position: relative; }
.g-viewport { overflow: hidden; touch-action: pan-y; padding: .5rem 0 1.1rem; }
.g-track { display: flex; width: max-content; will-change: transform; }
.g-track.is-static { width: 100%; justify-content: center; }
.g-slide { flex: none; padding: 0 .55rem; }

.g-card {
  display: block; width: 100%; padding: 0; border: 0; position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; background: #EADFC7; border-radius: var(--radius); cursor: zoom-in;
  box-shadow: var(--shadow-sm); transition: transform .3s ease, box-shadow .3s ease;
}
.g-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.g-card img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; transition: transform .6s ease; }
.g-card:hover img { transform: scale(1.04); }

.g-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .96); color: var(--primary-dark);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
  transition: background .2s ease, color .2s ease;
}
.g-arrow:hover { background: var(--primary); color: #fff; }
.g-prev { left: .9rem; }
.g-next { right: .9rem; }

.g-meta { margin-top: .3rem; text-align: center; }
.g-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.g-dot { position: relative; width: 10px; height: 10px; padding: 0; border: 0; border-radius: 6px; background: rgba(33, 22, 95, .25); cursor: pointer; transition: width .3s ease, background .3s ease; }
.g-dot::after { content: ""; position: absolute; inset: -10px -4px; } /* larger tap area */
.g-dot[aria-current="true"] { width: 26px; background: var(--accent); }
.g-count { color: var(--muted); font-size: .92rem; font-weight: 500; }

.g-stage.is-static .g-arrow,
.g-stage.is-static .g-meta { display: none; }

@media (max-width: 699px) {
  .g-arrow { width: 40px; height: 40px; }
  .g-prev { left: .8rem; }
  .g-next { right: .8rem; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 3.6rem 1rem 2.6rem; background: rgba(15, 22, 36, .94); touch-action: pan-y;
  animation: lbIn .25s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
body.lb-open { overflow: hidden; }
.lb-figure { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); object-fit: contain; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.lb-figure figcaption { color: rgba(255, 255, 255, .82); font-size: .92rem; text-align: center; }
.lb-btn { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s ease; }
.lb-btn:hover { background: rgba(255, 255, 255, .3); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 699px) {
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
  .lb-prev { left: calc(50% - 58px); }
  .lb-next { right: calc(50% - 58px); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .g-card, .g-card img, .g-dot, .g-tab, .lightbox { transition: none !important; animation: none !important; }
}