/* ═══════════════════════════════════════════════════════════════════
   Dunes Theme · gallery.css · ET 3.13.2 · Galería «Ver N fotos» + visor
   La galería la escribe Dunes AI 1.84.0 (figure.dai-galeria) y cualquier
   galería de WordPress con 3 o más fotos recibe el mismo formato (.et-gal).
   ═══════════════════════════════════════════════════════════════════ */

.dai-galeria, .et-gal {
    --g-ink: #0A0A0A; --g-blue: #33519F; --g-soft: #F1F0EB; --g-line: #E5E3DD;
    display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px !important;
    margin: 34px 0 !important; padding: 14px !important;
    background: var(--g-soft); border-radius: 6px; box-sizing: border-box;
    flex-wrap: initial !important; align-items: initial !important;
}
.dai-galeria > figure.wp-block-image, .et-gal > figure.wp-block-image,
.dai-galeria > figure, .et-gal > figure, .et-gal > .blocks-gallery-item {
    position: relative; margin: 0 !important; width: auto !important; max-width: none !important; flex: none !important;
    aspect-ratio: 16 / 10; overflow: hidden; border-radius: 4px; background: #DDDBD3; cursor: zoom-in;
}
.dai-galeria > figure img, .et-gal > figure img, .et-gal > .blocks-gallery-item img {
    display: block; width: 100% !important; height: 100% !important; max-width: none !important; margin: 0 !important;
    object-fit: cover !important; border-radius: 0 !important;
    transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .3s;
}
.dai-galeria > figure:hover img, .et-gal > figure:hover img { transform: scale(1.04); }
.dai-galeria > figure::after, .et-gal > figure::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(10, 10, 10, .06); border-radius: inherit;
}
/* los pies de cada foto solo se leen en el visor */
.dai-galeria > figure > figcaption, .et-gal > figure > figcaption { display: none !important; }
.dai-galeria a, .et-gal > figure > a { display: block; height: 100%; pointer-events: none; }

/* filas completas: 6 miniaturas; con 3 a 5 fotos, una fila de 3 */
.dai-galeria > figure:nth-of-type(n+7), .et-gal > figure:nth-of-type(n+7) { display: none !important; }
.dai-galeria[data-dai-n="3"] > figure:nth-of-type(n+4),
.dai-galeria[data-dai-n="4"] > figure:nth-of-type(n+4),
.dai-galeria[data-dai-n="5"] > figure:nth-of-type(n+4),
.et-gal.is-row > figure:nth-of-type(n+4) { display: none !important; }

/* «VER 18 FOTOS» */
.dai-galeria__ver, .et-gal__ver {
    grid-column: 1 / -1; order: 99; position: relative !important; inset: auto !important;
    display: flex !important; align-items: center; justify-content: center; gap: 12px;
    width: auto !important; height: 56px; margin: 4px 0 0 !important; padding: 0 20px !important;
    background: var(--g-blue) !important; color: #fff !important; border: 0 !important; border-radius: 4px; box-shadow: none !important;
    font: 300 18px/1 Inter, system-ui, sans-serif !important; letter-spacing: 2.6px; text-transform: uppercase; text-align: center !important;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; text-shadow: none !important;
    transition: background .25s; box-sizing: border-box; overflow: visible !important; max-height: none !important;
}
.dai-galeria__ver strong, .et-gal__ver strong { font-weight: 800 !important; letter-spacing: 1px; color: inherit !important; }
.dai-galeria__ver::before, .et-gal__ver::before {
    content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor; opacity: .9;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='3' width='7.5' height='7.5' rx='1'/%3E%3Crect x='13.5' y='3' width='7.5' height='7.5' rx='1'/%3E%3Crect x='3' y='13.5' width='7.5' height='7.5' rx='1'/%3E%3Crect x='13.5' y='13.5' width='7.5' height='7.5' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='3' y='3' width='7.5' height='7.5' rx='1'/%3E%3Crect x='13.5' y='3' width='7.5' height='7.5' rx='1'/%3E%3Crect x='3' y='13.5' width='7.5' height='7.5' rx='1'/%3E%3Crect x='13.5' y='13.5' width='7.5' height='7.5' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dai-galeria__ver:hover, .et-gal__ver:hover { background: #283F7C !important; }
.dai-galeria__ver:focus-visible, .et-gal__ver:focus-visible { outline: 2px solid var(--g-ink); outline-offset: 3px; }

@media (max-width: 700px) {
    .dai-galeria, .et-gal { gap: 6px !important; padding: 10px !important; margin: 26px 0 !important; }
    .dai-galeria > figure, .et-gal > figure { aspect-ratio: 4 / 3; border-radius: 3px; }
    .dai-galeria__ver, .et-gal__ver { height: 50px; font-size: 16px; letter-spacing: 2px; margin-top: 2px !important; }
}

/* ═════════════════════════ Visor ═════════════════════════ */
html.et-lb-open, html.et-lb-open body { overflow: hidden !important; }
.et-lb {
    position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-rows: auto 1fr auto auto;
    grid-template-columns: minmax(0, 1fr); background: #0A0A0A; color: #fff; font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
    opacity: 0; visibility: hidden; transition: opacity .28s, visibility 0s .28s;
}
.et-lb.is-open { opacity: 1; visibility: visible; transition: opacity .28s; }
.et-lb *, .et-lb *::before, .et-lb *::after { box-sizing: border-box; }
.et-lb button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.et-lb :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.et-lb__bar { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; height: 60px; padding: 0 20px; padding-top: env(safe-area-inset-top, 0px); }
.et-lb__prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .1); }
.et-lb__prog i { display: block; height: 100%; width: var(--p, 0%); background: #6F8BD6; transition: width .35s cubic-bezier(.2, .7, .2, 1); }
.et-lb__n { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; white-space: nowrap; }
.et-lb__n b { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -.4px; margin-right: 2px; }
.et-lb__t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .72); }
.et-lb__t small { display: inline; margin-right: 10px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #8EA5E3; }
.et-lb__x { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); transition: box-shadow .2s, background .2s; }
.et-lb__x:hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }

.et-lb__stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; }
.et-lb__track {
    display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
    scrollbar-width: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.et-lb__track::-webkit-scrollbar { display: none; }
.et-lb__s { flex: 0 0 100%; height: 100%; margin: 0; display: flex; align-items: center; justify-content: center; padding: 8px 76px; scroll-snap-align: center; scroll-snap-stop: always; }
.et-lb__s img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 2px; opacity: 0; transform: scale(.985); transition: opacity .35s, transform .5s cubic-bezier(.2, .7, .2, 1); user-select: none; -webkit-user-drag: none; }
.et-lb__s img.is-in { opacity: 1; transform: none; }
.et-lb__s.is-loading::after { content: ""; position: absolute; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: rgba(255, 255, 255, .7); animation: et-lb-spin .8s linear infinite; }
@keyframes et-lb-spin { to { transform: rotate(360deg); } }
.et-lb__nav {
    position: absolute; top: 50%; z-index: 2; width: 52px; height: 52px; margin-top: -26px;
    display: inline-flex; align-items: center; justify-content: center; border-radius: 4px;
    background: rgba(255, 255, 255, .06) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: background .2s, opacity .2s;
}
.et-lb__nav:hover { background: rgba(255, 255, 255, .14) !important; }
.et-lb__nav[disabled] { opacity: .25; cursor: default; }
.et-lb__nav--p { left: 14px; }
.et-lb__nav--n { right: 14px; }

.et-lb__cap { min-height: 64px; max-width: 820px; width: 100%; margin: 0 auto; padding: 14px 24px 10px; text-align: center; }
.et-lb__cap p { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .82); text-wrap: pretty; }
.et-lb__cap p span { color: rgba(255, 255, 255, .45); }

.et-lb__strip { display: flex; min-width: 0; gap: 6px; padding: 8px 20px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-x: auto; scrollbar-width: none; }
.et-lb__strip::-webkit-scrollbar { display: none; }
.et-lb__th { flex: 0 0 auto; width: 66px; height: 44px; padding: 0; border-radius: 3px; overflow: hidden; opacity: .4; transition: opacity .2s, box-shadow .2s; box-shadow: 0 0 0 0 #fff; }
.et-lb__th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.et-lb__th:first-child { margin-left: auto; }
.et-lb__th:last-child { margin-right: auto; }
.et-lb__th:hover { opacity: .8; }
.et-lb__th.is-on { opacity: 1; box-shadow: 0 0 0 2px #fff; }

@media (max-width: 760px) {
    .et-lb__bar { height: 54px; padding: 0 12px 0 16px; gap: 12px; }
    .et-lb__t { font-size: 12px; }
    .et-lb__t small { display: none; }
    .et-lb__s { padding: 0; }
    .et-lb__s img { border-radius: 0; }
    .et-lb__nav { display: none; }
    .et-lb__strip { display: none; }
    .et-lb__cap { padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 0px)); min-height: 80px; text-align: left; }
    .et-lb__cap p { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .et-lb, .et-lb *, .dai-galeria img, .et-gal img { transition: none !important; animation: none !important; }
}
/* pie propio de una galería hecha a mano: debajo del botón, discreto */
.et-gal > .blocks-gallery-caption:not(.et-gal__ver) { grid-column: 1 / -1; order: 100; position: static !important; margin: 2px 0 0 !important; padding: 0 !important; background: none !important; color: #757575 !important; font: 400 12.5px/1.45 Inter, sans-serif !important; text-align: left !important; }
