/* ────────────────────────────────────────────────────────────────────────────
   CLRD Portfolio — Estilos del portafolio
   Mansoka Theme — portfolio.css
──────────────────────────────────────────────────────────────────────────── */

/* ── Portafolio home: 3 cards de categoría ─────────────────────────────── */
/* Layout full-page: body flex para centrar cards y empujar copyright al fondo */
body.post-type-archive-clrd_portfolio {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.clrd-portfolio-home {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--header-height, 80px) + 2rem) 40px 2rem;
    box-sizing: border-box;
}

.clrd-portfolio-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    max-width: 1200px;
}

.clrd-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    gap: 0;
    min-height: 380px;
    padding: 40px 24px;
    background: #ffffff;
    border: 2px solid #0a0a0a;
    border-radius: 16px;
    text-decoration: none;
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
    color: #0a0a0a;
}

.clrd-cat-card:hover {
    background-color: var(--cat-hover-bg, #1a1a1a);
    color: var(--cat-hover-text, #ffffff);
    border-color: var(--cat-hover-bg, #1a1a1a);
}

/* Icono: centrado absoluto, invisible por defecto */
.clrd-cat-card__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

/* Hover: icono aparece blanco centrado */
.clrd-cat-card:hover .clrd-cat-card__icon {
    opacity: 1;
    filter: brightness(0) invert(1);
    transform: translate(-50%, -62%) scale(1.5);
}

/* Texto: centrado por defecto, baja en hover para dejar espacio al icono */
.clrd-cat-card__name {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    text-transform: none;
    letter-spacing: 0.04em;
    transition: transform 0.35s ease;
}

.clrd-cat-card:hover .clrd-cat-card__name {
    transform: translateY(70px);
}

/* ── Archivo de categoría ────────────────────────────────────────────────── */
.clrd-cat-archive {
    padding: 60px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.clrd-cat-archive__header {
    margin-bottom: 48px;
}

.clrd-back-link {
    display: inline-block;
    font-size: 0.875rem;
    text-decoration: none;
    color: #666;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.clrd-back-link:hover {
    color: #0a0a0a;
}

.clrd-cat-archive__title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
}

/* ── Grid de proyectos (3 columnas) ─────────────────────────────────────── */
.clrd-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.clrd-project-card {
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    position: relative;
}

.clrd-project-card__img {
    height: 600px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    transition: transform 0.4s ease;
    position: relative;
}

.clrd-project-card:hover .clrd-project-card__img {
    transform: scale(1.03);
}

/* Overlay + título dentro de la card */
.clrd-project-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.18);
    transition: background 0.3s ease;
}

.clrd-project-card:hover .clrd-project-card__overlay {
    background: rgba(0, 0, 0, 0.38);
}

.clrd-project-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

/* ── Single proyecto ────────────────────────────────────────────────────── */
.clrd-single-portfolio {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
}

.clrd-single-portfolio__header {
    margin-bottom: 40px;
}

.clrd-single-portfolio__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 12px 0 20px;
}

.clrd-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.clrd-tool-tag {
    display: inline-block;
    padding: 4px 14px;
    border: 1px solid #0a0a0a;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.clrd-single-portfolio__hero {
    height: 600px;
    background-size: cover;
    background-position: center;
    background-color: #e8e8e8;
    border-radius: 12px;
    margin-bottom: 48px;
}

.clrd-single-portfolio__desc {
    max-width: 720px;
    margin: 0 auto 60px;
    font-size: 1.05rem;
    line-height: 1.75;
}

/* ── Galería del proyecto ────────────────────────────────────────────────── */
.clrd-portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.clrd-gallery-item {
    cursor: pointer;
    overflow: hidden;
}

.clrd-gallery-item__img {
    height: 600px;
    background-size: cover;
    background-position: center;
    background-color: #e8e8e8;
    transition: transform 0.35s ease;
}

.clrd-gallery-item:hover .clrd-gallery-item__img {
    transform: scale(1.04);
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.clrd-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.clrd-lightbox.is-open {
    display: flex;
    opacity: 1;
}

.clrd-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.clrd-lightbox__close,
.clrd-lightbox__prev,
.clrd-lightbox__next {
    position: absolute;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 16px;
    line-height: 1;
    transition: opacity 0.2s;
    opacity: 0.75;
}

.clrd-lightbox__close:hover,
.clrd-lightbox__prev:hover,
.clrd-lightbox__next:hover {
    opacity: 1;
}

.clrd-lightbox__close { top: 16px;  right: 24px; font-size: 2.2rem; }
.clrd-lightbox__prev  { left: 24px; top: 50%; transform: translateY(-50%); font-size: 3rem; }
.clrd-lightbox__next  { right: 24px; top: 50%; transform: translateY(-50%); font-size: 3rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
/* ====================================================
   RESPONSIVE PORTFOLIO
   ==================================================== */

/* 1024px — tablet landscape */
@media (max-width: 1024px) {
    .clrd-portfolio-home {
        padding: calc(var(--header-height, 90px) + 1.5rem) 24px 1.5rem;
    }
    .clrd-portfolio-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .clrd-cat-card {
        min-height: 300px;
    }
    .clrd-projects-grid,
    .clrd-portfolio-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .clrd-project-card__img,
    .clrd-gallery-item__img {
        height: 420px;
    }
}

/* 768px — tablet portrait */
@media (max-width: 768px) {
    .clrd-portfolio-home {
        padding: calc(var(--header-height, 72px) + 1rem) 16px 1rem;
    }
    .clrd-portfolio-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .clrd-cat-card {
        min-height: 240px;
        padding: 24px 16px;
        border-radius: 12px;
    }
    .clrd-cat-card__name {
        font-size: 1.25rem;
    }
    .clrd-single-portfolio {
        padding: 48px 20px;
    }
    .clrd-single-portfolio__title {
        font-size: 1.8rem;
    }
    .clrd-single-portfolio__hero {
        height: 360px;
        border-radius: 8px;
    }
}

/* 640px — mobile */
@media (max-width: 640px) {
    .clrd-portfolio-categories {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .clrd-cat-card {
        min-height: 180px;
        padding: 20px 16px;
    }
    .clrd-cat-card:hover .clrd-cat-card__name {
        transform: translateY(50px);
    }
    .clrd-projects-grid,
    .clrd-portfolio-gallery {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .clrd-project-card__img,
    .clrd-gallery-item__img {
        height: 260px;
    }
    .clrd-single-portfolio__hero {
        height: 220px;
    }
    .clrd-single-portfolio {
        padding: 32px 16px;
    }
    .clrd-single-portfolio__title {
        font-size: 1.5rem;
    }
    .clrd-cat-archive {
        padding: 32px 16px;
    }
    .clrd-cat-archive__title {
        font-size: 1.75rem;
    }
    .clrd-lightbox__prev { left: 8px; }
    .clrd-lightbox__next { right: 8px; }
}
