/**
 * Galerias de Fotos — Frontend CSS
 * Estilos para shortcodes e páginas do CPT.
 */

/* ── Grid ────────────────────────────────────────── */
.glf-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}
.glf-grid-1 { grid-template-columns: 1fr; }
.glf-grid-2 { grid-template-columns: repeat(2, 1fr); }
.glf-grid-3 { grid-template-columns: repeat(3, 1fr); }
.glf-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .glf-grid-3,
    .glf-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .glf-grid-2,
    .glf-grid-3,
    .glf-grid-4 { grid-template-columns: 1fr; }
}

/* ── Card ────────────────────────────────────────── */
.glf-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.glf-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}
.glf-card-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.glf-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.glf-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.glf-cat-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    border-radius: 20px;
}
.glf-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.glf-card-title a {
    color: inherit;
    text-decoration: none;
}
.glf-card-title a:hover { color: #4f46e5; }
.glf-card-excerpt {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}
.glf-card-link {
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    margin-top: auto;
    padding-top: 8px;
}
.glf-card-link:hover { color: #4338ca; }

/* ── Single ──────────────────────────────────────── */
.glf-single {
    max-width: 820px;
    margin: 0 auto;
}
.glf-single .glf-thumb {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 24px;
}
.glf-single .esp-excerpt {
    font-size: 18px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
    font-style: italic;
}
.glf-single .esp-content {
    font-size: 16px;
    line-height: 1.7;
    color: #1f2937;
}

/* ── Card Horizontal ─────────────────────────────── */
.glf-card--horizontal {
    flex-direction: row;
    align-items: stretch;
}
.glf-card--horizontal .glf-card-thumb-link {
    flex-shrink: 0;
    width: 160px;
}
.glf-card--horizontal .glf-card-thumb {
    width: 160px;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    display: block;
}
.glf-card--horizontal .glf-card-body {
    padding: 16px 20px;
}
@media (max-width: 600px) {
    .glf-card--horizontal { flex-direction: column; }
    .glf-card--horizontal .glf-card-thumb-link,
    .glf-card--horizontal .glf-card-thumb { width: 100%; height: 180px; }
}

/* ── Card Minimal ────────────────────────────────── */
.glf-card--minimal {
    box-shadow: none;
    border: 1px solid var(--fsp-gray-200, #e5e7eb);
    border-radius: 8px;
}
.glf-card--minimal:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transform: none;
}
.glf-card--minimal .glf-card-body {
    padding: 20px;
}
.glf-card-link--arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Single fullwidth ────────────────────────────── */
.glf-single-fullwidth { width: 100%; }
.glf-hero-thumb { position: relative; max-height: 480px; overflow: hidden; }
.glf-hero-thumb img { width: 100%; height: 480px; object-fit: cover; display: block; }
.glf-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.65));
    display: flex; align-items: flex-end;
}
.glf-hero-content { padding: 32px; max-width: 820px; }
.glf-single-title--light { color: #fff; }
.glf-cat-badge--light { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.glf-single-fullwidth-content { max-width: 820px; margin: 0 auto; padding: 32px 16px; }

/* ── Archive fullwidth ───────────────────────────── */
.glf-archive--fullwidth .glf-archive-banner {
    background: linear-gradient(135deg, #4f46e5, #818cf8);
    padding: 48px 24px;
    text-align: center;
    color: #fff;
}
.glf-archive--fullwidth .glf-archive-title { color: #fff; margin: 0 0 8px; font-size: 32px; }
.glf-archive--fullwidth .glf-archive-desc  { color: rgba(255,255,255,.85); font-size: 16px; margin: 0; }
.glf-archive-grid-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 16px; }

/* ── Paginação ───────────────────────────────────── */
.glf-archive-pagination { margin-top: 32px; display: flex; justify-content: center; }
.glf-archive-pagination .nav-links { display: flex; gap: 8px; }
.glf-archive-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 6px;
    border: 1px solid #e5e7eb; font-size: 14px; text-decoration: none; color: #4b5563;
    transition: all .15s;
}
.glf-archive-pagination .current { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.glf-archive-pagination .page-numbers:hover:not(.current) { border-color: #4f46e5; color: #4f46e5; }

/* ══════════════════════════════════════════════════
   DESTAQUE DA HOME — [galerias_destaque_home]
══════════════════════════════════════════════════ */

.glf-home-destaque {
    width: 100%;
    background-color: #ffffff; /* sobrescrito por inline se admin configurar */
}

.glf-home-destaque-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

/* Cabeçalho da seção */
.glf-home-destaque-header {
    text-align: center;
    margin-bottom: 40px;
}

.glf-home-destaque-titulo {
    /* Herda var(--ttl) do tema se não houver cor inline */
    color: var(--ttl, #1f2937);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
}

.glf-home-destaque-subtitulo {
    /* Herda var(--txt) do tema se não houver cor inline */
    color: var(--txt, #6b7280);
    font-size: clamp(0.95rem, 1.5vw, 1.125rem);
    margin: 0;
    line-height: 1.6;
}

/* ── Vídeo YouTube embed ─────────────────────────── */
.glf-video-wrap {
    margin-top: 28px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.glf-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ══════════════════════════════════════════════════
   GALERIA DE FOTOS — Frontend
══════════════════════════════════════════════════ */

.glf-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 32px;
}

@media (max-width: 600px) {
    .glf-gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

.glf-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    background: #f3f4f6;
    display: block;
}

.glf-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease, opacity .2s;
}

.glf-gallery-item:hover img {
    transform: scale(1.05);
    opacity: .9;
}

/* Ícone de zoom ao hover */
.glf-gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8' stroke='%23fff' stroke-width='2'/%3E%3Cpath d='m21 21-4.35-4.35' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M11 8v6M8 11h6' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat;
    opacity: 0;
    transition: background-color .2s, opacity .2s;
    border-radius: 8px;
    pointer-events: none;
}
.glf-gallery-item:hover::after {
    background-color: rgba(0,0,0,.25);
    opacity: 1;
}

/* ── Lightbox ────────────────────────────────────── */
.glf-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.glf-lightbox-overlay.glf-lb-open {
    opacity: 1;
    pointer-events: all;
}
.glf-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.glf-lightbox-inner img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    display: block;
    transition: opacity .2s;
}
.glf-lb-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    line-height: 1;
}
.glf-lb-btn:hover { background: rgba(255,255,255,.28); }
.glf-lb-prev { left: 16px; }
.glf-lb-next { right: 16px; }
.glf-lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    line-height: 1;
}
.glf-lb-close:hover { background: rgba(255,255,255,.28); }
.glf-lb-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-size: 13px;
    font-family: sans-serif;
    z-index: 100000;
    white-space: nowrap;
}
