/* ======== PROJECTS SECTION - ACCORDION SLIDER ======== */
:root {
    --proy-accent: #276E90;
    --proy-gap: 1.25rem;
    --proy-speed: 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --proy-closed: 5.5rem;
    --proy-open: 54rem;
}

#proyectos {
    background-color: #E2E7ED;
    overflow: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

/* Cabecera */
.proy-head {
    width: 100%;
    max-width: 1400px;
    padding: 2rem 20px 2.5rem;
    position: relative;
    text-align: center;
}

.proy-head h2 {
    font-size: 2.5rem;
    color: #1a1a1a;
    text-align: center;
    margin: 0 auto;
    position: relative;
}

.proy-head h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1a1a1a, #888);
    border-radius: 2px;
    display: block;
}

/* Botones navegación */
.proy-controls {
    position: absolute;
    right: 20px;
    bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.proy-nav-btn {
    width: 1.9rem;
    height: 1.9rem;
    min-width: 1.9rem;
    min-height: 1.9rem;
    flex-shrink: 0;
    border: 1px solid rgba(10, 49, 67, 0.25);
    border-radius: 50%;
    background: rgba(10, 49, 67, 0.06);
    color: rgba(10, 49, 67, 0.7);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1;
    padding: 0;
}

.proy-nav-btn:hover {
    background: var(--proy-accent);
    border-color: var(--proy-accent);
    color: #fff;
}

.proy-nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

/* Slider container */
.proy-slider {
    width: 100%;
    max-width: 1400px;
    overflow: hidden;
    padding: 0 20px;
}

.proy-track {
    display: flex;
    gap: var(--proy-gap);
    align-items: stretch;
    justify-content: center;
    padding-bottom: 1rem;
}

/* Cards */
.proy-card {
    position: relative;
    flex: 0 0 var(--proy-closed);
    height: 25rem;
    border-radius: 1rem;
    overflow: hidden;
    clip-path: inset(0 round 1rem);
    cursor: pointer;
    transition: flex-basis var(--proy-speed), transform var(--proy-speed), box-shadow var(--proy-speed);
}

.proy-card[active] {
    flex-basis: var(--proy-open);
}

/* Imagen de fondo */
.proy-card__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.55);
    transition: filter 0.35s ease;
}

.proy-card[active] .proy-card__bg {
    height: auto;
    object-fit: initial;
    filter: brightness(0.72);
}

.proy-card:hover .proy-card__bg {
    filter: brightness(0.88);
}

/* Overlay degradado */
.proy-card__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1.4rem;
    background: linear-gradient(transparent 15%, rgba(0, 0, 0, 0.85) 100%);
    z-index: 2;
    overflow: hidden;
}

/* Título: vertical centrado en closed, horizontal en active — sin animación */
.proy-card__title {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform: translateX(-50%) translateY(50%) rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    transition: none;
    z-index: 1;
}

.proy-card[active] .proy-card__title {
    left: 1.4rem;
    bottom: 5.2rem;
    transform: none;
    font-size: 1.6rem;
    white-space: normal;
    max-width: 60%;
    color: #fff;
    line-height: 1.2;
}

/* Tag — arriba a la derecha */
.proy-tag {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--proy-accent);
    background: rgba(39, 110, 144, 0.18);
    border: 1px solid rgba(39, 110, 144, 0.5);
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    opacity: 0;
    transition: opacity 0.25s ease 0.1s;
}

.proy-card[active] .proy-tag {
    opacity: 1;
}

/* Descripción — abajo a la izquierda, pegada al fondo */
.proy-card__desc {
    position: absolute;
    bottom: 1.4rem;
    left: 1.4rem;
    max-width: 58%;
    display: block;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    line-height: 1.45;
    opacity: 0;
    transition: opacity 0.25s ease 0.15s;
}

.proy-card[active] .proy-card__desc {
    opacity: 1;
}

/* Botón — abajo a la derecha */
.proy-card__btn {
    position: absolute;
    bottom: 1.4rem;
    right: 1.4rem;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: var(--proy-accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease 0.2s, background 0.2s;
}

.proy-card[active] .proy-card__btn {
    opacity: 1;
}

.proy-card__btn:hover {
    background: #1a5a7a;
}

/* Dots */
.proy-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 1.5rem 0 0;
}

.proy-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(10, 49, 67, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.proy-dot.active {
    background: var(--proy-accent);
    transform: scale(1.25);
}

/* Mobile */
@media (max-width: 767px) {
    :root {
        --proy-closed: 100%;
        --proy-open: 100%;
        --proy-gap: 0.8rem;
    }

    .proy-head {
        padding: 0 15px 2rem;
        text-align: center;
    }

    .proy-head h2 { font-size: 1.6rem; }

    .proy-controls {
        position: static;
        display: flex;
        justify-content: center;
        margin-top: 0.8rem;
        gap: 0.75rem;
    }

    .proy-nav-btn {
        width: 2.2rem;
        height: 2.2rem;
        min-width: 2.2rem;
        min-height: 2.2rem;
        font-size: 1.1rem;
    }

    .proy-slider { padding: 0 12px; }

    .proy-track {
        flex-direction: column;
        gap: 0.8rem;
    }

    .proy-card {
        height: auto;
        min-height: 65px;
        flex: 0 0 auto;
        width: 100%;
    }

    .proy-card[active] {
        min-height: 320px;
        transform: none;
    }

    .proy-card__title {
        left: 1.2rem;
        bottom: 1.2rem;
        transform: none;
        font-size: 0.9rem;
    }

    .proy-card[active] .proy-card__title {
        bottom: 4.5rem;
        font-size: 1.4rem;
    }

    .proy-card__desc { max-width: 65%; font-size: 0.8rem; }

    .proy-dots { display: none; }
}

/* ======== DARK MODE ======== */
body.dark-mode #proyectos {
    background-color: #0a0a0a !important;
}

body.dark-mode .proy-head h2 {
    color: #f5f5f5;
}

body.dark-mode .proy-head h2::after {
    background: linear-gradient(90deg, #444, #777);
}

body.dark-mode .proy-nav-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .proy-dot {
    background: rgba(255, 255, 255, 0.2);
}
