/* [cfp_galeria] — mosaico (1 grande + 4 menores) que troca as fotos sozinho, e a foto ampliada. */
.cfpg { margin: 56px 0 8px; font-family: 'Inter', 'Segoe UI', Roboto, sans-serif; color: var(--cfp-tinta); }
.cfpg *, .cfpg *::before, .cfpg *::after { box-sizing: border-box; }
.cfpg.cfpg .cfpg-titulo { margin: 0 0 18px; text-align: center; font: 500 clamp(1.2rem, 2vw, 1.5rem)/1.25 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.01em; color: #2a4b7c; }
html.ceclimar-dark-mode .cfpg.cfpg .cfpg-titulo { color: #8fb4e8; }

/* mosaico */
.cfpg-mosaico { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: clamp(320px, 42vw, 500px); }
.cfpg-mosaico .cfpg-foto:first-child { grid-row: 1 / 3; }
.cfpg-n1 { grid-template-columns: 1fr; } .cfpg-n1 .cfpg-foto:first-child { grid-row: 1 / 3; }
.cfpg-n2, .cfpg-n3 { grid-template-columns: 2fr 1fr; }
.cfpg-n2 .cfpg-foto:nth-child(2) { grid-row: 1 / 3; }
.cfpg-n4 .cfpg-foto:nth-child(4) { grid-column: 2 / 4; }

.cfpg .cfpg-foto { position: relative; display: block; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; border: 0 !important; border-radius: 16px; overflow: hidden;
    background: rgba(128, 128, 128, 0.15) !important; cursor: zoom-in; }
.cfpg .cfpg-foto img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; margin: 0 !important; border-radius: 0 !important;
    opacity: 0; transform: scale(1.06); transition: opacity 1.2s ease, transform 6s ease; }
.cfpg .cfpg-foto img.is-vis { opacity: 1; transform: scale(1); }
.cfpg .cfpg-foto:hover img.is-vis { transform: scale(1.04); transition: opacity 1.2s ease, transform 0.6s ease; }
.cfpg .cfpg-foto::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 45%); opacity: 0; transition: opacity 0.3s ease; }
.cfpg-leg { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; font: 600 0.88rem/1.35 'Inter', sans-serif; color: #fff; text-align: left;
    opacity: 0; transform: translateY(6px); transition: opacity 0.3s ease, transform 0.3s ease; }
.cfpg-leg:empty { display: none; }
.cfpg .cfpg-foto:hover::after, .cfpg .cfpg-foto:focus-visible::after { opacity: 1; }
.cfpg .cfpg-foto:hover .cfpg-leg, .cfpg .cfpg-foto:focus-visible .cfpg-leg { opacity: 1; transform: none; }
.cfpg .cfpg-foto:focus-visible { outline: 3px solid var(--cfp-agua); outline-offset: 2px; }

/* setas do carrossel: trocam o mosaico inteiro */
.cfpg-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.cfpg .cfpg-nav button { display: grid; place-items: center; flex: none; width: 44px !important; height: 44px !important; min-width: 0; padding: 0 !important; line-height: 1 !important; border: 0 !important; border-radius: 50%;
    background: var(--cfp-tinta) !important; color: var(--cfpp-cartao, #fff) !important; font: 700 1.05rem 'Inter', sans-serif; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.cfpg .cfpg-nav button:hover { background: var(--cfp-agua) !important; color: #fff !important; transform: scale(1.06); }

/* foto ampliada */
.cfpg-janela { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.cfpg-janela::backdrop { background: rgba(4, 10, 16, 0.92); backdrop-filter: blur(6px); }
.cfpg-janela[open] { display: flex; align-items: center; justify-content: center; }
.cfpg-janela figure { margin: 0; max-width: calc(100vw - 150px); text-align: center; }
.cfpg-janela img { display: block; max-width: 100%; max-height: calc(100vh - 120px); margin: 0 auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.cfpg-janela figcaption { margin-top: 12px; font: 500 0.95rem/1.5 'Inter', sans-serif; color: rgba(255, 255, 255, 0.85); }
.cfpg-janela figcaption:empty { display: none; }
.cfpg-janela button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0 !important; border-radius: 50%;
    background: rgba(255, 255, 255, 0.14) !important; color: #fff !important; font: 400 1.4rem/1 'Inter', sans-serif; cursor: pointer; }
.cfpg-janela button:hover { background: rgba(255, 255, 255, 0.28) !important; }
.cfpg-fecha { top: 18px; right: 18px; font-size: 1.8rem !important; }
.cfpg-ant { left: 18px; top: 50%; transform: translateY(-50%); }
.cfpg-prox { right: 18px; top: 50%; transform: translateY(-50%); }
.cfpg-conta { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); font: 600 0.8rem 'Inter', sans-serif; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.6); }

@media (max-width: 760px) {
    .cfpg-mosaico { grid-template-columns: 1fr 1fr; grid-template-rows: 1.6fr 1fr 1fr; height: 560px; }
    .cfpg-mosaico .cfpg-foto:first-child { grid-row: auto; grid-column: 1 / 3; }
    .cfpg-n2, .cfpg-n3 { grid-template-columns: 1fr 1fr; }
    .cfpg-n2 .cfpg-foto:nth-child(2) { grid-row: auto; grid-column: 1 / 3; }
    .cfpg-n4 .cfpg-foto:nth-child(4) { grid-column: auto; }
    .cfpg-janela figure { max-width: calc(100vw - 24px); }
    .cfpg-ant, .cfpg-prox { top: auto; bottom: 12px; transform: none; }
    .cfpg-conta { bottom: 28px; }
}
@media (prefers-reduced-motion: reduce) { .cfpg * { transition: none !important; } }
