/* plugins/gallery/public/assets/css/gallery.css */
/* Photo gallery: /fotos masonry + filters, homepage mosaic, hero slideshow, lightbox. Uses main.css tokens. */

/* ---------- /fotos ---------- */
.gl-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.gl-filter {
    border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text);
    border-radius: var(--radius-pill); padding: 8px 16px; font: inherit; font-size: 0.9rem; cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.gl-filter:hover { border-color: var(--accent); color: var(--accent); }
.gl-filter.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.gl-masonry { columns: 3 280px; column-gap: 16px; }
.gl-item { break-inside: avoid; margin: 0 0 16px; }
.gl-item[hidden] { display: none; }
.gl-link {
    display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-3);
    box-shadow: var(--shadow-sm);
}
.gl-link img { display: block; width: 100%; height: auto; transition: transform .6s var(--ease); }
.gl-link:hover img, .gl-link:focus-visible img { transform: scale(1.035); }
.gl-link::after {
    content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.22), transparent 45%);
    opacity: 0; transition: opacity .3s var(--ease);
}
.gl-link:hover::after { opacity: 1; }
.gl-item figcaption { font-size: 0.86rem; color: var(--text-muted); padding: 8px 4px 0; }
.gl-empty { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* ---------- homepage mosaic ---------- */
.gl-home-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.gl-home-head .section-head { margin-bottom: 32px; }
.gl-home-head .btn { margin-bottom: 32px; }
.gl-mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 200px; gap: 14px; }
.gl-tile { margin: 0; min-height: 0; }
.gl-tile .gl-link { height: 100%; }
.gl-tile .gl-link img { width: 100%; height: 100%; object-fit: cover; }
.gl-tile figcaption { display: none; }
.gl-mosaic .gl-tile:first-child { grid-column: span 2; grid-row: span 2; }
.gl-mosaic-1 { grid-template-columns: 1fr; grid-auto-rows: 420px; }
.gl-mosaic-1 .gl-tile:first-child { grid-column: auto; grid-row: auto; }
.gl-mosaic-2 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 380px; }
.gl-mosaic-2 .gl-tile:first-child, .gl-mosaic-3 .gl-tile:first-child { grid-column: auto; grid-row: auto; }
.gl-mosaic-3 { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 360px; }
.gl-mosaic-4 .gl-tile:nth-child(4) { grid-column: span 2; }
@media (max-width: 900px) {
    .gl-mosaic, .gl-mosaic-3 { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
    .gl-mosaic .gl-tile:nth-child(n) { grid-column: auto; grid-row: auto; }
    .gl-mosaic .gl-tile:first-child { grid-column: span 2; grid-row: span 2; }
    .gl-mosaic-1 { grid-template-columns: 1fr; grid-auto-rows: 340px; }
    .gl-mosaic-1 .gl-tile:first-child { grid-column: auto; grid-row: auto; }
    .gl-mosaic-2 .gl-tile:first-child { grid-column: auto; grid-row: auto; }
    .gl-mosaic-2 { grid-auto-rows: 260px; }
}

/* ---------- hero slideshow (inside .phone-frame) ---------- */
.hero-slides { position: relative; width: 100%; height: 100%; border-radius: 28px; overflow: hidden; background: var(--bg-3); }
.hero-slides img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0;
    opacity: 0; transform: scale(1.06); transition: opacity 1.2s var(--ease), transform 6s linear;
}
.hero-slides img.is-active { opacity: 1; transform: scale(1); }
.hero-slides img:first-child { opacity: 1; }
.hero-slides.is-running img:first-child:not(.is-active) { opacity: 0; }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; gap: 6px; z-index: 3; }
.hero-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55); transition: width .3s var(--ease), background .3s; }
.hero-dots span.is-active { width: 18px; border-radius: 3px; background: #fff; }
@media (prefers-reduced-motion: reduce) {
    .hero-slides img { transition: opacity .01s; transform: none !important; }
    .gl-link img { transition: none; }
}

/* ---------- hero play button (opens portfolio lightbox) ---------- */
.hero-play {
    position: absolute; inset: 10px; z-index: 3; border: 0; padding: 0; border-radius: 28px; cursor: pointer;
    background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,0) 45%); display: grid; place-items: center;
}
.hero-play .play-icon { position: relative; transform: none; transition: transform .3s var(--ease); animation: hero-pulse 2.6s var(--ease) infinite; }
.hero-play:hover .play-icon, .hero-play:focus-visible .play-icon { transform: scale(1.08); animation: none; }
.hero-play:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.hero-play-label {
    position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); max-width: 82%;
    color: #fff; font-size: 0.85rem; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.45);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phone-frame.has-video .play-dot { display: none; }
.phone-frame.has-video .hero-dots { bottom: 12px; }
@keyframes hero-pulse { 0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,.25), 0 0 0 0 rgba(255,255,255,.45); } 60% { box-shadow: 0 10px 30px rgba(0,0,0,.25), 0 0 0 16px rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .hero-play .play-icon { animation: none; } }

.phone-frame .play-dot { display: none; }      /* decorative play hidden: real button = .hero-play */
.phone-frame .phone-badge { display: none; }   /* 9:16 label hidden on request */

/* ---------- lightbox ---------- */
.gl-lb {
    position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
    background: rgba(12, 14, 18, 0.94); opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
    touch-action: pan-y;
}
.gl-lb.is-open { opacity: 1; visibility: visible; }
.gl-lb-figure { margin: 0; max-width: min(92vw, 1400px); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gl-lb-img { max-width: 100%; max-height: 82vh; width: auto; height: auto; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); background: #222; }
.gl-lb-cap { color: #f1f1f1; font-size: 0.95rem; text-align: center; max-width: 720px; margin: 0; }
.gl-lb-count { position: absolute; top: 20px; left: 22px; color: rgba(255,255,255,.7); font-size: 0.85rem; }
.gl-lb-btn {
    position: absolute; border: 0; background: rgba(255,255,255,.1); color: #fff; width: 48px; height: 48px; border-radius: 50%;
    font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .2s;
}
.gl-lb-btn:hover, .gl-lb-btn:focus-visible { background: rgba(255,255,255,.22); }
.gl-lb-close { top: 14px; right: 16px; }
.gl-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.gl-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.gl-lb[data-single] .gl-lb-prev, .gl-lb[data-single] .gl-lb-next, .gl-lb[data-single] .gl-lb-count { display: none; }
@media (max-width: 640px) {
    .gl-lb-prev, .gl-lb-next { top: auto; bottom: 18px; transform: none; }
    .gl-lb-img { max-height: 72vh; }
}
body.gl-lb-open { overflow: hidden; }
