/* ============================================================
   Página do CPT Galeria (single-42wp_gallery) — mosaico vertical
   + lightbox + "mais galerias". Escopo: .gp-gallery-page.
   Fonte herdada do tema (Inter); sem uppercase nos títulos.
   ============================================================ */

.gp-gallery-page {
    --gp-red: #e5202a;
    --gp-ink: #14151a;
    --gp-muted: #71757e;
    --gp-line: #e6e6ea;
    --gp-photo-bg: #15171d;
}

/* ===== header editorial (chapéu + título + dek + autor) ===== */
.gp-ghead {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--gp-line);
}
.gp-ghead .gp-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.gp-chip {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12.5px;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    background: var(--gp-red);
}
.gp-kline {
    width: 26px;
    height: 2px;
    background: var(--gp-red);
    flex-shrink: 0;
}
.gp-kloc {
    color: var(--gp-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 13px;
}
.gp-ghead .gp-dek {
    font-size: clamp(16px, 1.6vw, 20px);
    color: #3a3d45;
    margin-top: 14px;
    max-width: 62ch;
    line-height: 1.5;
}
.gp-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.gp-meta .gp-author {
    display: flex;
    align-items: center;
    gap: 11px;
}
.gp-meta .gp-author img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #ececef;
}
.gp-meta .gp-author .n {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.1;
    color: var(--gp-ink);
}
.gp-meta .gp-author .s {
    font-size: 12.5px;
    color: var(--gp-muted);
    margin-top: 1px;
}
.gp-meta .gp-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d9dade;
}
.gp-meta .gp-when {
    font-size: 13.5px;
    color: var(--gp-muted);
}
.gp-share {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.gp-share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #d9dade;
    background: #fff;
    display: grid;
    place-items: center;
    color: #3a3d45;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gp-share-btn:hover {
    background: var(--gp-ink);
    color: #fff;
    border-color: var(--gp-ink);
}
.gp-share-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

/* ===== contador acima da grade ===== */
.gp-gal-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 0 16px;
}
.gp-gal-count .n {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
    font-size: 14px;
    color: var(--gp-ink);
}
.gp-gal-count .n svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--gp-red);
    stroke-width: 2;
}

/* ===== grade masonry (CSS columns — mosaico vertical) ===== */
.gp-gal-grid {
    column-count: 4;
    column-gap: 10px;
}
@media (max-width: 1100px) {
    .gp-gal-grid { column-count: 3; }
}
@media (max-width: 760px) {
    .gp-gal-grid { column-count: 2; column-gap: 6px; }
}

.gp-photo {
    position: relative;
    break-inside: avoid;
    margin: 0 0 10px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gp-photo-bg);
    cursor: zoom-in;
    display: block;
}
@media (max-width: 760px) {
    .gp-photo { margin-bottom: 6px; }
}
.gp-photo img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.gp-photo:hover img {
    transform: scale(1.045);
}

/* zoom hint */
.gp-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(13, 14, 18, 0.5);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.gp-zoom svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}
.gp-photo:hover .gp-zoom {
    opacity: 1;
    transform: scale(1);
}

/* legenda overlay */
.gp-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 30px 14px 12px;
    background: linear-gradient(180deg, transparent, rgba(8, 9, 12, 0.82));
    display: flex;
    flex-direction: column;
    gap: 3px;
    transform: translateY(101%);
    transition: transform 0.28s ease;
    pointer-events: none;
}
.gp-cap .t {
    color: #fff;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gp-cap .cr {
    color: rgba(255, 255, 255, 0.62);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gp-gal-grid[data-captions="hover"] .gp-photo:hover .gp-cap {
    transform: translateY(0);
}
@media (hover: none) {
    .gp-gal-grid[data-captions="hover"] .gp-cap {
        transform: translateY(0);
    }
    .gp-zoom { display: none; }
}

/* ===== "mais galerias" ===== */
.gp-related {
    margin-top: 48px;
}
.gp-related .head {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
}
.gp-related .head .bar {
    width: 6px;
    height: 26px;
    border-radius: 2px;
    background: var(--gp-red);
}
.gp-related .head h2 {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}
.gp-related .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 980px) {
    .gp-related .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .gp-related .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

.gp-rcard { cursor: pointer; }
.gp-rcard .ph {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(20, 21, 26, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    background: var(--gp-photo-bg);
}
.gp-rcard:hover .ph {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(20, 21, 26, 0.1);
}
.gp-rcard .ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gp-rcard .ph .scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(8, 9, 12, 0.7));
}
.gp-rcard .ph .cnt {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-weight: 700;
    font-size: 12.5px;
    background: rgba(8, 9, 12, 0.55);
    backdrop-filter: blur(3px);
    padding: 4px 9px;
    border-radius: 5px;
}
.gp-rcard .ph .cnt svg {
    width: 14px;
    height: 14px;
    fill: #fff;
}
.gp-rcard h3 {
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.28;
    color: var(--gp-ink);
    margin-top: 11px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s;
}
.gp-rcard:hover h3 {
    color: var(--gp-red);
}

/* ===================== LIGHTBOX ===================== */
.gp-lb {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(7, 8, 11, 0.985);
    display: none;
    flex-direction: column;
}
.gp-lb.open { display: flex; }
.gp-lb-prog-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 3;
}
.gp-lb-prog {
    height: 100%;
    width: 0;
    background: var(--gp-red);
    transition: width 0.3s ease;
}
.gp-lb-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px 10px;
}
.gp-lb-counter {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.06em;
    color: #fff;
}
.gp-lb-counter b { color: var(--gp-red); }
.gp-lb-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 13px;
}
.gp-lb-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gp-lb-brand .gp {
    width: 7px;
    height: 18px;
    background: var(--gp-red);
    border-radius: 2px;
}
.gp-lb-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.gp-lb-close:hover {
    background: var(--gp-red);
    transform: rotate(90deg);
}
.gp-lb-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

.gp-lb-stage {
    position: relative;
    flex: 1;
    display: grid;
    place-items: center;
    padding: 6px 18px;
    min-height: 0;
}
.gp-lb-frame {
    position: relative;
    max-width: min(1180px, 92vw);
    max-height: 100%;
    display: grid;
    place-items: center;
}
.gp-lb-img {
    max-width: 100%;
    max-height: calc(100vh - 280px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
    background: #101218;
}
.gp-lb-skel {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.gp-lb-skel span {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--gp-red);
    animation: gp-spin 0.8s linear infinite;
}
@keyframes gp-spin {
    to { transform: rotate(360deg); }
}

.gp-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    z-index: 4;
}
.gp-lb-nav:hover { background: var(--gp-red); }
.gp-lb-nav:active { transform: translateY(-50%) scale(0.92); }
.gp-lb-nav svg { width: 24px; height: 24px; fill: currentColor; }
.gp-lb-nav.prev { left: 18px; }
.gp-lb-nav.next { right: 18px; }

.gp-lb-cap-wrap {
    position: relative;
    z-index: 3;
    text-align: left;
    padding: 44px max(24px, calc((100% - 760px) / 2)) 12px;
    background: linear-gradient(180deg, transparent 0, rgba(7, 8, 11, 0.92) 44px);
}
.gp-lb-cap {
    color: #fff;
    font-size: 17px;
    line-height: 1.45;
}
/* Colapsado: corta em 2 linhas com reticências. A legenda completa abre na
   interação (clique na legenda ou no "ver mais"). */
.gp-lb-cap.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gp-lb-cap.is-clickable {
    cursor: pointer;
}
/* Indicador de que dá pra expandir. */
.gp-lb-cap-toggle {
    appearance: none;
    background: none;
    border: 0;
    padding: 2px 0 0;
    margin-top: 2px;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.gp-lb-cap-toggle:hover { opacity: 1; }
.gp-lb-cap-toggle[hidden] { display: none; }
.gp-lb-cap-toggle::after {
    content: '';
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transform: translateY(2px);
    transition: transform 0.18s;
}
.gp-lb-cap-toggle.is-open::after {
    transform: translateY(-1px) rotate(180deg);
}
.gp-lb-credit {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    margin-top: 7px;
}

.gp-lb-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 14px 22px 18px;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.gp-lb-thumbs::-webkit-scrollbar { display: none; }
.gp-lbt {
    flex: 0 0 auto;
    width: 96px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    opacity: 0.5;
    transition: opacity 0.18s, transform 0.18s;
    background: var(--gp-photo-bg);
}
.gp-lbt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gp-lbt:hover { opacity: 0.85; }
.gp-lbt.active {
    opacity: 1;
    transform: translateY(-2px);
    outline: 2.5px solid var(--gp-red);
    outline-offset: -2px;
}

@media (max-width: 680px) {
    .gp-lb-img { max-height: calc(100vh - 232px); }
    .gp-lb-nav { width: 42px; height: 42px; }
    .gp-lb-nav.prev { left: 6px; }
    .gp-lb-nav.next { right: 6px; }
    .gp-lb-nav svg { width: 20px; height: 20px; }
    .gp-lbt { width: 74px; height: 48px; }
    .gp-lb-cap { font-size: 14.5px; }
    .gp-lb-top { padding: 14px 16px 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .gp-photo img { transition: none; }
}
