/**
 * Estilos do Bloco Gallery Strip — Fortunna Lusitanos
 * @package FortunnaLusitanosBlocks
 */

/* Container */
.flb-gallery-strip { position: relative; }

/* Grid */
.flb-gallery-strip__grid {
    display:               grid;
    grid-template-columns: repeat(5, 1fr);  /* sobrescrito por inline style */
    gap:                   3px;             /* sobrescrito por inline style */
    width:                 100%;
}

/* Thumb */
.flb-gallery-thumb {
    position:   relative;
    overflow:   hidden;
    margin:     0;
    background: var(--fl-noir, #141210);
    display:    block;
}

/* Filtro editorial v5 */
.flb-gallery-thumb--editorial img {
    filter:     var(--fl-img-filter-gallery, grayscale(45%) brightness(.82) sepia(12%));
    transition: filter 0.5s, transform 0.7s cubic-bezier(.16,1,.3,1);
}

.flb-gallery-thumb:hover img,
.flb-gallery-thumb__btn:hover img,
.flb-gallery-thumb__btn:focus img {
    filter:    var(--fl-img-filter-hover, grayscale(20%) brightness(.92) sepia(7%));
    transform: scale(1.07);
}

/* Sem filtro editorial */
.flb-gallery-thumb:not(.flb-gallery-thumb--editorial) img {
    filter:     none;
    transition: transform 0.7s cubic-bezier(.16,1,.3,1);
}

/* Overlay hover subtil */
.flb-gallery-thumb::after {
    content:    '';
    position:   absolute;
    inset:      0;
    background: rgba(20,18,16,.0);
    transition: background 0.35s;
    pointer-events: none;
    z-index:    1;
}

.flb-gallery-thumb:hover::after,
.flb-gallery-thumb__btn:focus + ::after {
    background: rgba(20,18,16,.18);
}

/* Ícone de zoom ao hover */
.flb-gallery-thumb__btn {
    position:   relative;
    display:    block;
    width:      100%;
    height:     100%;
    padding:    0;
    background: none;
    border:     none;
    cursor:     zoom-in;
    overflow:   hidden;
}

.flb-gallery-thumb__btn::before {
    content:           '';
    position:          absolute;
    top:               50%;
    left:              50%;
    transform:         translate(-50%,-50%) scale(0.6);
    width:             36px;
    height:            36px;
    background:        rgba(253,252,250,.9);
    border-radius:     50%;
    z-index:           2;
    opacity:           0;
    transition:        opacity 0.25s, transform 0.3s cubic-bezier(.16,1,.3,1);
    background-image:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23141210' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.flb-gallery-thumb__btn:hover::before {
    opacity:   1;
    transform: translate(-50%,-50%) scale(1);
}

.flb-gallery-thumb__btn:focus-visible {
    outline:        3px solid var(--fl-champagne, #D8CAAF);
    outline-offset: -3px;
    z-index:        3;
}

/* Caption */
.flb-gallery-thumb__caption {
    position:   absolute;
    bottom:     0;
    left:       0;
    right:      0;
    padding:    0.5rem 0.75rem;
    background: linear-gradient(to top, rgba(20,18,16,.8), transparent);
    font-family: var(--fl-font-body, 'Raleway', sans-serif);
    font-style:  italic;
    font-size:   11px;
    font-weight: 300;
    color:       rgba(253,252,250,.85);
    z-index:     3;
    transform:   translateY(100%);
    transition:  transform 0.3s;
}

.flb-gallery-thumb:hover .flb-gallery-thumb__caption {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1100px) {
    .flb-gallery-strip__grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 560px) {
    .flb-gallery-strip__grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Disposições: scroll horizontal e desvanecimento (v1.2.0) ── */
.flb-gallery-strip__stage { position: relative; }

/* Scroll horizontal com encaixe foto a foto */
.flb-gallery-strip__grid--scroll {
    display:                 flex;
    gap:                     var(--flb-gap, 3px);
    overflow-x:              auto;
    overscroll-behavior-x:   contain;
    scroll-snap-type:        x mandatory;
    scrollbar-width:         none;
    -webkit-overflow-scrolling: touch;
}
.flb-gallery-strip__grid--scroll::-webkit-scrollbar { display: none; }
.flb-gallery-strip__grid--scroll .flb-gallery-thumb {
    flex:             0 0 calc((100% - (var(--flb-cols, 5) - 1) * var(--flb-gap, 3px)) / var(--flb-cols, 5));
    scroll-snap-align: start;
}

/* Desvanecimento: N caixas lado a lado; de tempos a tempos uma caixa (ao acaso)
   troca de foto com uma das que não estão à vista */
.flb-gallery-strip__grid--fade { display: grid; }
.flb-gallery-cell {
    position:   relative;
    overflow:   hidden;
    background: var(--fl-noir, #141210);
}
.flb-gallery-cell .flb-gallery-thumb {
    position: absolute;
    inset:    0;
    z-index:  1;
}
/* foto a entrar: começa transparente e sobrepõe-se à que sai */
.flb-gallery-cell .flb-gallery-thumb.is-entering { z-index: 2; opacity: 0; }
.flb-gallery-cell .flb-gallery-thumb.is-entering.is-in { opacity: 1; transition: opacity var(--flb-fade, 1.2s) ease; }
.flb-gallery-strip__pool { display: none; }
/* Setas e pontos */
.flb-gallery-strip__nav {
    position:        absolute;
    top:             50%;
    transform:       translateY(-50%);
    z-index:         4;
    width:           2.75rem;
    height:          2.75rem;
    padding:         0 0 .15em;
    border:          none;
    border-radius:   50%;
    background:      rgba(253,252,250,.88);
    color:           var(--fl-noir, #141210);
    font-size:       1.6rem;
    line-height:     1;
    cursor:          pointer;
    opacity:         0;
    transition:      opacity .25s, background .25s;
}
.flb-gallery-strip__nav--prev { left: 1rem; }
.flb-gallery-strip__nav--next { right: 1rem; }
.flb-gallery-strip__stage:hover .flb-gallery-strip__nav,
.flb-gallery-strip__nav:focus-visible { opacity: 1; }
.flb-gallery-strip__nav:hover { background: #fff; }
.flb-gallery-strip__nav:disabled { opacity: 0 !important; pointer-events: none; }
.flb-gallery-strip__nav:focus-visible { outline: 3px solid var(--fl-champagne, #D8CAAF); outline-offset: 2px; }
@media (hover: none) { .flb-gallery-strip__nav { opacity: 1; } }

@media (max-width: 1100px) {
    .flb-gallery-strip__grid--scroll { --flb-cols: 3 !important; }
}
@media (max-width: 560px) {
    .flb-gallery-strip__grid--scroll { --flb-cols: 2 !important; }
}
@media (prefers-reduced-motion: reduce) {
    .flb-gallery-cell .flb-gallery-thumb.is-entering.is-in { transition: none; }
}

/* Desvanecimento em ecrãs pequenos: só as primeiras caixas (o JS ignora as escondidas) */
@media (max-width: 1100px) {
    .flb-gallery-strip__grid--fade { grid-template-columns: repeat(min(var(--flb-cells, 3), 3), 1fr) !important; }
    .flb-gallery-strip__grid--fade .flb-gallery-cell:nth-child(n+4) { display: none; }
}
@media (max-width: 560px) {
    .flb-gallery-strip__grid--fade { grid-template-columns: repeat(min(var(--flb-cells, 2), 2), 1fr) !important; }
    .flb-gallery-strip__grid--fade .flb-gallery-cell:nth-child(n+3) { display: none; }
}
