/* ==========================================================
   Eco Hermet — galería (galeria.html)
   ========================================================== */

.gal-hero { padding: 36px 0 28px; background: linear-gradient(180deg, var(--soft), #fff); }
.crumbs { display: flex; gap: 8px; font-size: .88rem; color: var(--ink-3); margin-bottom: 28px; }
.crumbs a { color: var(--ink-2); }
.gal-hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; align-items: end; }
.gal-hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4rem); font-weight: 750; color: var(--navy); }
.gal-lead { font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem); color: var(--ink-2); max-width: 60ch; margin: 16px 0 0; }
.gal-total { margin: 0; color: var(--ink-3); font-weight: 600; }
.gal-total strong { display: block; font-size: 2.6rem; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .gal-hero-grid { grid-template-columns: 1fr; } .gal-total strong { display: inline; font-size: 1.4rem; } }

/* Filtros fijos al hacer scroll */
.gal-filters-bar { position: sticky; top: calc(var(--header-h) + 1px); z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.gal-filters { display: flex; gap: 6px; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.gal-filters::-webkit-scrollbar { display: none; }
.gal-filters .filter { flex: none; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease; }
.gal-filters .filter span { font-size: .74rem; font-weight: 700; color: var(--ink-3); background: var(--soft); border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.gal-filters .filter.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.gal-filters .filter.is-active span { background: rgba(255,255,255,.16); color: #fff; }
@media (hover: hover) and (pointer: fine) { .gal-filters .filter:not(.is-active):hover { border-color: var(--navy); color: var(--navy); } }

/* Flechas, degradados en los bordes y arrastre con el ratón */
.gf-box { position: relative; }
.gf-box::before, .gf-box::after { content: ""; position: absolute; top: 0; bottom: 0; width: 72px; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 200ms ease; }
.gf-box::before { left: 0; background: linear-gradient(90deg, #fff 35%, rgba(255,255,255,0)); }
.gf-box::after { right: 0; background: linear-gradient(270deg, #fff 35%, rgba(255,255,255,0)); }
.gf-box.gf-fade-l::before, .gf-box.gf-fade-r::after { opacity: 1; }
.gf-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(35,40,37,.14); cursor: pointer; transition: border-color 200ms ease, transform 200ms ease; }
.gf-arrow[hidden] { display: none; }
.gf-arrow svg { width: 18px; height: 18px; fill: none; stroke: var(--navy); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gf-prev { left: 0; }
.gf-next { right: 0; }
.gf-arrow:active { transform: translateY(-50%) scale(.94); }
@media (hover: hover) and (pointer: fine) {
  .gf-arrow:hover { border-color: var(--navy); }
  .gal-filters { cursor: grab; }
}
.gal-filters.is-dragging { cursor: grabbing; user-select: none; }
.gal-filters.is-dragging .filter { pointer-events: none; }
.gal-filters { position: relative; scroll-behavior: auto; }
@media (hover: none) { .gf-arrow { width: 32px; height: 32px; } .gf-box::before, .gf-box::after { width: 48px; } }

/* Mosaico: columnas que respetan la proporción de cada foto */
.gal-section { padding-top: 28px; }
.gal-grid { list-style: none; margin: 0; padding: 0; columns: 4 240px; column-gap: 12px; }
.gal-grid li { break-inside: avoid; margin-bottom: 12px; }
.gal-grid li[hidden] { display: none; }
.gal-item { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: #e5e9e2; }
.gal-item img { width: 100%; height: auto; transition: transform 600ms var(--ease-out), opacity 300ms ease; }
.gal-item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(35,40,37,.35)); opacity: 0; transition: opacity 250ms ease; }
@media (hover: hover) and (pointer: fine) {
  .gal-item:hover img { transform: scale(1.03); }
  .gal-item:hover::after { opacity: 1; }
}
@media (max-width: 600px) { .gal-grid { columns: 2; column-gap: 8px; } .gal-grid li { margin-bottom: 8px; } }
.gal-more { display: flex; justify-content: center; margin-top: 28px; }
.gal-more [hidden] { display: none; }

/* Visor con pie de foto */
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 12px; }
.lb-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; width: min(1200px, 92vw); color: #dde3dc; font-size: .95rem; }
.lb-meta { display: flex; gap: 16px; align-items: center; }
.lb-pos { color: #98a29a; font-variant-numeric: tabular-nums; }
.lb-link { color: #a8d65e; font-weight: 650; }
.lightbox .lb-figure img { max-height: 78dvh; }
@media (max-width: 600px) { .lb-caption { padding: 0 16px; } .lightbox .lb-figure img { max-width: 100vw; border-radius: 0; } }
