.page-title {
    margin: 0 0 8px;
}
.page-lead {
    margin: 0 0 18px;
    color: var(--color-muted);
}

.portfolio-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.chip-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    color: inherit;
    font-weight: 800;
}
.chip-link:hover {
    opacity: 0.85;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.to-top {
    text-decoration: none;
    color: inherit;
    opacity: 0.8;
    font-weight: 800;
}
.to-top:hover {
    opacity: 1;
}

/* GRID editorial */
.portfolio-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 220px;
    gap: 16px;
}

/* Cada item es un button para NO navegar a ninguna página */
.portfolio-item {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.45);
    padding: 0;
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition:
        transform 240ms ease,
        filter 240ms ease;
}

.portfolio-item:hover img {
    transform: scale(1.03);
    filter: brightness(0.92);
}

.portfolio-item:focus-visible {
    outline: 3px solid rgba(119, 197, 213, 0.9);
    outline-offset: 3px;
}

/* Vertical (ocupa 2 filas) */
.portfolio-item.is-vertical {
    grid-row: span 2;
}

/* Lightbox (modal) */
.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.lightbox.is-open {
    display: block;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.lightbox-dialog {
    position: relative;
    width: min(1100px, calc(100% - 32px));
    margin: 36px auto;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.lightbox-figure {
    margin: 0;
}

.lightbox-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    background: rgba(0, 0, 0, 0.35);
}

.lightbox-caption {
    padding: 12px 14px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.35);
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav.prev {
    left: 12px;
}
.lightbox-nav.next {
    right: 12px;
}

.lightbox-nav:hover,
.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.65);
}

/* Responsive */
@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 200px;
    }
}

@media (max-width: 520px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .portfolio-item,
    .portfolio-item.is-vertical {
        grid-row: auto;
    }

    .portfolio-item img {
        height: auto;
    }

    .lightbox-dialog {
        margin: 20px auto;
    }
}

/* ===== Reels / Vídeo en Portfolio ===== */

.portfolio-video-block {
    margin-top: 28px;
}

.portfolio-subtitle {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 800;
}

.reels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    max-width: 720px; /* evita que se vean gigantes */
}

.reels-grid video {
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: var(--radius-sm);
    background: #000;
    object-fit: cover;
    border: 1px solid var(--color-border);
}
