.pe-home-gallery-carousel{
    position:relative;
    width:100%;
    max-width:none;
    margin:clamp(28px,4vw,56px) 0;
    box-sizing:border-box;
    padding:clamp(18px,2.2vw,30px) clamp(18px,2.6vw,34px) clamp(22px,3vw,36px);
    border:1px solid rgba(255,255,255,.09);
    border-radius:30px;
    background:linear-gradient(180deg, rgba(255,255,255,.035) 0%, rgba(8,9,16,.20) 100%);
    overflow:hidden;
    box-shadow:0 18px 46px rgba(0,0,0,.22);
}

.pe-home-gallery-carousel::before{
    content:"";
    position:absolute;
    inset:0;
    background:
        linear-gradient(0deg, rgba(13,13,16,.70), rgba(13,13,16,.70)),
        radial-gradient(circle at top left, rgba(159,78,245,.14), transparent 34%),
        radial-gradient(circle at bottom right, rgba(70,178,224,.12), transparent 32%);
    pointer-events:none;
}

.pe-home-gallery-carousel::after{
    content:"";
    position:absolute;
    left:8%;
    right:8%;
    top:0;
    height:1px;
    background:linear-gradient(90deg, transparent, rgba(70,178,224,.55), rgba(159,78,245,.45), transparent);
    pointer-events:none;
}

.pe-home-gallery-carousel > *{
    position:relative;
    z-index:1;
}

.pe-home-gallery-carousel__intro{
    position:relative;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto;
    column-gap:24px;
    row-gap:8px;
    align-items:start;
    margin-bottom:16px;
    padding-right:0;
}

.pe-home-gallery-carousel__copy{
    grid-column:1 / -1;
    grid-row:1 / 3;
    width:100%;
    max-width:none;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    pointer-events:none;
}

.pe-home-gallery-carousel__eyebrow{
    display:inline-flex;
    align-items:center;
    align-self:flex-start;
    gap:8px;
    margin:0;
    padding:0;
    font-size:16px;
    line-height:1.2;
    font-weight:700;
    letter-spacing:.2em;
    text-transform:uppercase;
    color:#46B2E0;
}

.pe-home-gallery-carousel__eyebrow::before{
    content:"";
    width:38px;
    height:1px;
    background:rgba(70,178,224,.75);
}

/* El título secundario “Últimos momentos” ya no se imprime desde PHP.
   Esta regla queda solo como blindaje si una caché vieja lo conserva. */
.pe-home-gallery-carousel__title{
    display:none !important;
    margin:0 !important;
    padding:0 !important;
    height:0 !important;
    line-height:0 !important;
    overflow:hidden !important;
}

.pe-home-gallery-carousel__subtitle{
    width:100%;
    max-width:1130px;
    margin:20px 0 0px 20px;
    text-align:center;
    font-size:15px;
    line-height:1.55;
    color:rgba(255,255,255,.90);
    pointer-events:auto;
}

.pe-home-gallery-carousel__archive-btn{
    grid-column:2;
    grid-row:1;
    justify-self:end;
    align-self:start;
    position:relative;
    top:auto;
    right:auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:0 22px;
    border:1px solid rgba(159,78,245,.78);
    border-radius:999px;
    color:#9F4EF5;
    font-weight:700;
    text-decoration:none;
    white-space:nowrap;
    box-shadow:0 0 0 1px rgba(159,78,245,.08), 0 0 12px rgba(159,78,245,.12);
    transition:background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.pe-home-gallery-carousel__archive-btn:hover,
.pe-home-gallery-carousel__archive-btn:focus-visible{
    background:#9F4EF5;
    color:#fff;
    border-color:#9F4EF5;
    transform:translateY(-1px);
    box-shadow:0 0 14px rgba(159,78,245,.22);
}

.pe-home-gallery-carousel__shell{
    position:relative;
    padding-inline:54px;
}

.pe-home-gallery-carousel__viewport{
    overflow:hidden;
    border-radius:24px;
    outline:none;
}

.pe-home-gallery-carousel__track{
    display:flex;
    gap:18px;
    transition:transform .42s ease;
    will-change:transform;
}

.pe-home-gallery-card{
    flex:0 0 calc((100% - 54px) / 4);
    min-width:0;
}

.pe-home-gallery-card__link{
    position:relative;
    display:flex;
    min-height:420px;
    height:100%;
    border:1px solid rgba(255,255,255,.09);
    border-radius:24px;
    overflow:hidden;
    color:#fff;
    text-decoration:none;
    background:#121214;
    box-shadow:0 14px 34px rgba(0,0,0,.22);
    transform:translateZ(0);
    transition:transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.pe-home-gallery-card__media,
.pe-home-gallery-card__media img,
.pe-home-gallery-card__overlay{
    position:absolute;
    inset:0;
}

.pe-home-gallery-card__media img{
    width:100%;
    height:100%;
    object-fit:cover;
    transform:scale(1.002);
    transition:transform .44s ease, filter .44s ease;
}

.pe-home-gallery-card__overlay{
    background:
        linear-gradient(180deg, rgba(7,8,14,.02) 0%, rgba(7,8,14,.18) 42%, rgba(7,8,14,.88) 100%),
        radial-gradient(circle at top right, rgba(70,178,224,.12), transparent 32%);
}

.pe-home-gallery-card__badge{
    position:absolute;
    top:16px;
    left:16px;
    display:inline-flex;
    align-items:center;
    min-height:34px;
    padding:0 12px;
    border:1px solid rgba(70,178,224,.42);
    border-radius:999px;
    background:rgba(9,11,19,.42);
    color:#46B2E0;
    font-size:11px;
    font-weight:800;
    letter-spacing:.14em;
    text-transform:uppercase;
    backdrop-filter:blur(8px);
}

.pe-home-gallery-card__body{
    position:relative;
    z-index:2;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    width:100%;
    min-height:420px;
    padding:22px;
}

.pe-home-gallery-card__meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px 10px;
    margin-bottom:10px;
    font-size:12px;
    line-height:1.4;
    color:rgba(255,255,255,.72);
}

.pe-home-gallery-card__meta span{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:0 10px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:999px;
    background:rgba(255,255,255,.055);
}

.pe-home-gallery-card__title{
    display:block;
    margin:0;
    font-size:clamp(19px,1.6vw,25px);
    font-weight:800;
    line-height:1.12;
    color:#fff;
}

.pe-home-gallery-card__excerpt{
    display:block;
    margin-top:10px;
    font-size:14px;
    line-height:1.55;
    color:rgba(255,255,255,.72);
}

.pe-home-gallery-card__cta{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    min-height:44px;
    margin-top:16px;
    padding:0 18px;
    border:1px solid rgba(159,78,245,.82);
    border-radius:999px;
    color:#9F4EF5;
    font-size:14px;
    font-weight:700;
    letter-spacing:0;
    background:transparent;
    box-shadow:0 0 0 1px rgba(159,78,245,.05), 0 0 10px rgba(159,78,245,.12);
    transition:background-color .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.pe-home-gallery-card__cta::before{
    content:"";
    display:block;
    width:0;
    height:0;
    border-top:5px solid transparent;
    border-bottom:5px solid transparent;
    border-left:8px solid currentColor;
    margin-left:2px;
}

.pe-home-gallery-card:hover .pe-home-gallery-card__link,
.pe-home-gallery-card__link:focus-visible{
    transform:translateY(-3px);
    border-color:rgba(70,178,224,.42);
    box-shadow:0 18px 42px rgba(0,0,0,.28), 0 0 24px rgba(70,178,224,.12);
}

.pe-home-gallery-card:hover .pe-home-gallery-card__cta,
.pe-home-gallery-card__link:focus-visible .pe-home-gallery-card__cta{
    background:#9F4EF5;
    color:#fff;
    transform:translateY(-1px);
    box-shadow:0 0 14px rgba(159,78,245,.22);
}

.pe-home-gallery-card:hover .pe-home-gallery-card__media img,
.pe-home-gallery-card__link:focus-visible .pe-home-gallery-card__media img{
    transform:scale(1.055);
    filter:saturate(1.08) contrast(1.04);
}

.pe-home-gallery-carousel__nav{
    position:absolute;
    top:50%;
    z-index:3;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    border:1px solid rgba(255,255,255,.14);
    border-radius:999px;
    background:rgba(9,11,19,.58);
    color:#fff;
    font-size:34px;
    line-height:1;
    cursor:pointer;
    backdrop-filter:blur(8px);
    transform:translateY(-50%);
    transition:opacity .25s ease, background-color .25s ease, transform .25s ease, border-color .25s ease;
}

.pe-home-gallery-carousel__nav--prev{ left:0; }
.pe-home-gallery-carousel__nav--next{ right:0; }

.pe-home-gallery-carousel__nav:hover,
.pe-home-gallery-carousel__nav:focus-visible{
    background:rgba(159,78,245,.82);
    border-color:rgba(159,78,245,.92);
    transform:translateY(-50%) scale(1.04);
}

.pe-home-gallery-carousel__nav[disabled]{
    opacity:.32;
    cursor:not-allowed;
    pointer-events:none;
}

.pe-home-gallery-carousel__shell.is-static .pe-home-gallery-carousel__nav,
.pe-home-gallery-carousel__shell.is-static .pe-home-gallery-carousel__dots{
    display:none;
}

.pe-home-gallery-carousel__dots{
    display:flex;
    justify-content:center;
    gap:8px;
    margin-top:18px;
}

.pe-home-gallery-carousel__dot{
    width:9px;
    height:9px;
    padding:0;
    border:0;
    border-radius:999px;
    background:rgba(255,255,255,.28);
    cursor:pointer;
    transition:width .25s ease, background-color .25s ease, box-shadow .25s ease;
}

.pe-home-gallery-carousel__dot.is-active{
    width:28px;
    background:#46B2E0;
    box-shadow:0 0 12px rgba(70,178,224,.32);
}

.pe-home-gallery-carousel__bridge{
    margin:20px auto 0;
    max-width:780px;
    text-align:center;
    font-size:14px;
    line-height:1.65;
    color:rgba(255,255,255,.86);
}

/* Breakpoint 1: portátil / desktop compacto */
@media (max-width: 1279px){
    .pe-home-gallery-carousel__intro{
        column-gap:20px;
        row-gap:7px;
        margin-bottom:16px;
        padding-right:0;
    }

    .pe-home-gallery-carousel__subtitle{
        max-width:860px;
        margin:10px auto 0;
    }

    .pe-home-gallery-carousel__shell{
        padding-inline:50px;
    }

    .pe-home-gallery-card{
        flex-basis:calc((100% - 36px) / 3);
    }

    .pe-home-gallery-card__link,
    .pe-home-gallery-card__body{
        min-height:390px;
    }
}

/* Breakpoint 2: tablet horizontal / desktop pequeño */
@media (max-width: 1024px){
    .pe-home-gallery-carousel{
        border-radius:26px;
    }

    .pe-home-gallery-carousel__intro{
        display:flex;
        flex-direction:column;
        align-items:center;
        text-align:center;
        row-gap:0;
        margin-bottom:16px;
        padding-right:0;
    }

    .pe-home-gallery-carousel__copy{
        align-items:center;
        text-align:center;
        pointer-events:auto;
    }

    .pe-home-gallery-carousel__subtitle{
        max-width:720px;
        margin:4px auto 0;
        text-align:center;
    }

    .pe-home-gallery-carousel__archive-btn{
        position:static;
        width:auto;
        margin-top:14px;
    }

    .pe-home-gallery-carousel__shell{
        padding-inline:46px;
    }

    .pe-home-gallery-card{
        flex-basis:calc((100% - 18px) / 2);
    }

    .pe-home-gallery-card__link,
    .pe-home-gallery-card__body{
        min-height:370px;
    }
}

/* Breakpoint 3: tablet vertical */
@media (max-width: 880px){
    .pe-home-gallery-carousel__intro{
        margin-bottom:15px;
    }

    .pe-home-gallery-carousel__eyebrow::before{
        width:30px;
    }

    .pe-home-gallery-carousel__subtitle{
        max-width:640px;
        margin-top:4px;
    }

    .pe-home-gallery-carousel__archive-btn{
        margin-left:auto;
        margin-right:auto;
    }
}

/* Breakpoint 4: móvil */
@media (max-width: 767px){
    .pe-home-gallery-carousel{
        width:100%;
        padding:22px 14px;
        border-radius:24px;
    }

    .pe-home-gallery-carousel__intro{
        margin-bottom:14px;
        padding-right:0;
    }

    .pe-home-gallery-carousel__copy{
        align-items:center;
        text-align:center;
        pointer-events:auto;
    }

    .pe-home-gallery-carousel__eyebrow{
        font-size:14px;
    }

    .pe-home-gallery-carousel__eyebrow::before{
        width:26px;
    }

    .pe-home-gallery-carousel__subtitle{
        max-width:100%;
        margin:4px auto 0;
        font-size:14px;
        line-height:1.65;
        text-align:center;
    }

    .pe-home-gallery-carousel__archive-btn{
        position:static;
        width:100%;
        min-height:44px;
        margin-top:14px;
    }

    .pe-home-gallery-carousel__shell{
        padding-inline:0;
    }

    .pe-home-gallery-carousel__viewport{
        overflow-x:auto;
        scroll-snap-type:x mandatory;
        -webkit-overflow-scrolling:touch;
        scrollbar-width:none;
    }

    .pe-home-gallery-carousel__viewport::-webkit-scrollbar{
        display:none;
    }

    .pe-home-gallery-carousel__track{
        gap:14px;
        transition:none;
    }

    .pe-home-gallery-card{
        flex-basis:100%;
        scroll-snap-align:start;
    }

    .pe-home-gallery-card__link,
    .pe-home-gallery-card__body{
        min-height:390px;
    }

    .pe-home-gallery-card__body{
        padding:20px;
    }

    .pe-home-gallery-carousel__nav{
        display:none;
    }

    .pe-home-gallery-carousel__bridge{
        margin-top:16px;
        font-size:13px;
        color:rgba(255,255,255,.86);
    }
}
