/* ================================================================
   PORTAFOLIO — variables (coherentes con el resto del sitio,
   se activan con html.svp-dark)
   ================================================================ */
:root {
    --svp-port-bg: #ffffff;
    --svp-port-ink: #16130F;
    --svp-port-muted: #6E6A61;
    --svp-port-accent: #aa804c;
    --svp-port-line: rgba(0, 0, 0, 0.12);
    --svp-port-hover-bg: rgba(170, 128, 76, 0.06);
    --svp-port-count-bg: rgba(0, 0, 0, 0.05);
    --svp-port-count-text: #6E6A61;
}

html.svp-dark {
    --svp-port-bg: #191919;
    --svp-port-ink: #F2EEE5;
    --svp-port-muted: #A39C8F;
    --svp-port-accent: #D4A15F;
    --svp-port-line: rgba(255, 255, 255, 0.12);
    --svp-port-hover-bg: rgba(212, 161, 95, 0.08);
    --svp-port-count-bg: rgba(255, 255, 255, 0.06);
    --svp-port-count-text: #A39C8F;
}

#page {
    background: var(--svp-port-bg);
    transition: background-color .35s ease, color .35s ease;

}

/* ================================================================
   HERO DEL PORTAFOLIO
   ================================================================ */
.svp-portfolio-hero {
    position: relative;
    overflow: hidden;
    padding: 120px 24px 90px;
    background:
        radial-gradient(circle at 15% 20%, var(--svp-port-hover-bg) 0%, transparent 45%),
        repeating-linear-gradient(
            45deg,
            var(--svp-port-line) 0px,
            var(--svp-port-line) 1px,
            transparent 1px,
            transparent 5px
        ),
        var(--svp-port-bg);
    color: var(--svp-port-ink);
    text-align: center;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: background-color .35s ease, color .35s ease;
}

.svp-portfolio-hero__inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.svp-portfolio-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--svp-port-accent);
}

.svp-portfolio-hero__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--svp-port-accent);
}

.svp-portfolio-hero__title {
    margin: 0 0 22px;
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.svp-portfolio-hero__title span {
    color: var(--svp-port-accent);
    font-style: italic;
}

.svp-portfolio-hero__desc {
    margin: 0 auto 44px;
    max-width: 520px;
    font-size: 17px;
    line-height: 1.7;
    color: var(--svp-port-muted);
}

.svp-portfolio-hero__stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-top: 1px solid var(--svp-port-line);
    padding-top: 28px;
}

.svp-portfolio-hero__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 32px;
}

.svp-portfolio-hero__stat:not(:last-child) {
    border-right: 1px solid var(--svp-port-line);
}

.svp-portfolio-hero__stat-num {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--svp-port-ink);
    font-variant-numeric: tabular-nums;
}

.svp-portfolio-hero__stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--svp-port-muted);
}

@media (max-width: 600px) {
    .svp-portfolio-hero {
        padding: 90px 20px 60px;
    }

    .svp-portfolio-hero__desc {
        font-size: 15.5px;
    }

    .svp-portfolio-hero__stats {
        gap: 0;
    }

    .svp-portfolio-hero__stat {
        padding: 0 20px;
    }

    .svp-portfolio-hero__stat-num {
        font-size: 24px;
    }
}

/* ================================================================
   PORTAFOLIO — estructura
   ================================================================ */
.svp-portfolio {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 24px;
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--svp-port-bg);
    color: var(--svp-port-ink);
    counter-reset: svp-index;
    transition: background .35s ease, color .35s ease;
}

.svp-category {
    counter-increment: svp-index;
    border-bottom: 1px solid var(--svp-port-line);
}

.svp-category:first-child {
    border-top: 1px solid var(--svp-port-line);
}

.svp-category__heading {
    margin: 0;
}

/* Botón de categoría */
.svp-category__title {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 34px 8px;
    font: inherit;
    color: var(--svp-port-ink);
    cursor: pointer;
    text-align: left;
    transition: background-color .3s ease, padding-left .3s ease;
}

/* theme.css define un hover/focus global para [type=button]/button
   (fondo rosa #c36). Lo neutralizamos y ponemos el estilo propio. */
.svp-portfolio button.svp-category__title:hover,
.svp-portfolio button.svp-category__title:focus {
    background-color: var(--svp-port-hover-bg) !important;
    color: var(--svp-port-ink) !important;
    text-decoration: none !important;
}

.svp-category__title:hover,
.svp-category__title:focus-visible {
    padding-left: 18px;
}

.svp-category__title:focus-visible {
    outline: none;
    box-shadow: inset 4px 0 0 0 var(--svp-port-accent);
}

/* Número editorial "01 / 02 / 03" antes del nombre */
.svp-category__name {
    display: flex;
    align-items: baseline;
    gap: 18px;
    text-transform: capitalize;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.svp-category__name::before {
    content: counter(svp-index, decimal-leading-zero);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--svp-port-accent);
    font-variant-numeric: tabular-nums;
}

.svp-category__meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-shrink: 0;
}

/* Contador de proyectos por categoría */
.svp-category__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--svp-port-count-text);
    background: var(--svp-port-count-bg);
    border-radius: 999px;
    transition: background-color .3s ease, color .3s ease;
}

.svp-category.active .svp-category__count {
    color: #ffffff;
    background: var(--svp-port-accent);
}

/* Ícono "+" en botón circular que se rellena al abrir */
.svp-category__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1px solid var(--svp-port-line);
    flex-shrink: 0;
    transition: background-color .3s ease, border-color .3s ease, transform .35s ease;
}

.svp-category__title:hover .svp-category__icon {
    border-color: var(--svp-port-accent);
}

.svp-category__icon::before,
.svp-category__icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: var(--svp-port-ink);
    border-radius: 2px;
    transition: background-color .3s ease;
}

.svp-category__icon::before {
    transform: translate(-50%, -50%);
}

.svp-category__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.svp-category.active .svp-category__icon {
    background: var(--svp-port-accent);
    border-color: var(--svp-port-accent);
    transform: rotate(45deg);
}

.svp-category.active .svp-category__icon::before,
.svp-category.active .svp-category__icon::after {
    background: #ffffff;
}

/* Panel colapsable — animado con grid-template-rows (sin height:auto ni JS de medición) */
.svp-category__panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .4s ease;
}

.svp-category.active .svp-category__panel {
    grid-template-rows: 1fr;
}

.svp-category__content {
    overflow: hidden;
}

/* ================================================================
   GALERÍA DE PROYECTOS — estilo "muro de fotos" sin bordes redondeados
   ================================================================ */
.svp-event-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 44px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 3px;
}

/* Tarjeta */
.svp-event {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    text-decoration: none;
    background: var(--svp-port-count-bg);
    isolation: isolate;
}

.svp-event__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.svp-event__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s cubic-bezier(.16, 1, .3, 1);
}

.svp-event__img--placeholder {
    background: linear-gradient(135deg, var(--svp-port-count-bg) 0%, var(--svp-port-hover-bg) 100%);
}

.svp-event:hover .svp-event__img,
.svp-event:focus-visible .svp-event__img {
    transform: scale(1.08);
}

/* Velo oscuro: legible en reposo, se pareja al pasar el mouse */
.svp-event::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .18) 45%, rgba(0, 0, 0, .05) 100%);
    transition: background .45s ease;
}

.svp-event:hover::before,
.svp-event:focus-visible::before {
    background: rgba(10, 9, 8, .58);
}

/* Contenido de texto */
.svp-event__content {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transform: translateY(6px);
    transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

.svp-event:hover .svp-event__content,
.svp-event:focus-visible .svp-event__content {
    transform: translateY(0);
}

.svp-event__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--svp-port-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity .35s ease;
}

.svp-event:hover .svp-event__eyebrow,
.svp-event:focus-visible .svp-event__eyebrow {
    opacity: 1;
}

.svp-event__title {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* Botón flecha circular flotante */
.svp-event__arrow {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--svp-port-accent);
    align-items: center;
    justify-content: space-evenly;
    font-size: 15px;
    opacity: 0;
    transform: translate(8px, 8px) scale(.7);
    transition: opacity .35s ease, transform .35s ease;
    display: flex;
    margin-bottom: 1.5px;
    transition: background-color .35s ease, color .35s ease;
}

.svp-event__arrow:hover {
    background: var(--svp-port-accent) ;
    color: #fff;
     
}

.svp-event:hover .svp-event__arrow,
.svp-event:focus-visible .svp-event__arrow {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.svp-event:focus-visible {
    outline: 2px solid var(--svp-port-accent);
    outline-offset: -3px;
}

.svp-event-empty {
    padding: 0 0 28px;
    color: var(--svp-port-muted);
    font-size: 15px;
}

/* Respeta a quienes prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .svp-category__panel,
    .svp-category__icon,
    .svp-category__icon::before,
    .svp-category__icon::after,
    .svp-category__title,
    .svp-event,
    .svp-event__img,
    .svp-event::before,
    .svp-event__content,
    .svp-event__eyebrow,
    .svp-event__arrow {
        transition: none !important;
    }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
    .svp-event-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 600px) {
    .svp-portfolio {
        margin: 48px auto;
        padding: 0 16px;
    }

    .svp-category__title {
        padding: 22px 4px;
    }

    .svp-category__title:hover,
    .svp-category__title:focus-visible {
        padding-left: 12px;
    }

    .svp-category__name {
        gap: 10px;
    }

    .svp-category__icon {
        width: 32px;
        height: 32px;
    }

    .svp-event-list {
        grid-template-columns: 1fr 1fr;
        gap: 2px;
    }

    .svp-event__content {
        padding: 14px;
    }

    .svp-event__title {
        font-size: 14px;
    }

    .svp-event__eyebrow {
        font-size: 9px;
    }

    .svp-event__arrow {
        width: 28px;
        height: 28px;
        right: 10px;
        bottom: 10px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .svp-event-list {
        grid-template-columns: 1fr;
    }

    .svp-event {
        aspect-ratio: 16 / 11;
    }
}