/* ============================================================
   WP Digital Magazines — Magazine Widgets CSS
   Estilos para todos los widgets de páginas de revista
   ============================================================ */

/* ── Página de revista (container nativo marcado con data-wdm-page) ─── */

.wdm-page {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Doble página: los dos containers hijos se colocan en fila */
.wdm-page--spread {
    display: flex !important;
    flex-direction: row !important;
}

.wdm-page--spread > .e-con {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   PORTADA  (wdm-cover)
   ============================================================ */

.wdm-cover {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.wdm-cover__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.wdm-cover__body,
.wdm-cover__content {
    position: relative;
    z-index: 2;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.wdm-cover__logo img {
    max-height: 52px;
    max-width: 160px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: brightness(0) invert(1);
}

.wdm-cover__name {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin: 0;
    word-break: break-word;
}

.wdm-cover__rule {
    width: 48px;
    height: 3px;
    background: #e8c96d;
    margin: 4px 0;
    flex-shrink: 0;
}

.wdm-cover__tagline {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-cover__meta {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid currentColor;
    opacity: 0.7;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================================
   ARTÍCULO  (wdm-article)
   ============================================================ */

.wdm-article {
    background: #fff;
    color: #1a1a1a;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

/* Layout con imagen lateral */
.wdm-article--img-left  { flex-direction: row; gap: 16px; flex-wrap: wrap; }
.wdm-article--img-right { flex-direction: row-reverse; gap: 16px; flex-wrap: wrap; }
.wdm-article--img-left  .wdm-article__head,
.wdm-article--img-right .wdm-article__head { flex: 1 1 100%; }

.wdm-article--img-left  .wdm-article__figure,
.wdm-article--img-right .wdm-article__figure { flex: 0 0 42%; }
.wdm-article--img-left  .wdm-article__body,
.wdm-article--img-right .wdm-article__body   { flex: 1 1 50%; }

.wdm-article__head { }

.wdm-article__cat {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 2px solid currentColor;
    display: inline-block;
    margin-bottom: 10px;
}

.wdm-article__headline {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.wdm-article__deck {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #555;
    font-style: italic;
    margin: 0 0 8px;
}

.wdm-article__byline {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #777;
    padding-top: 8px;
    border-top: 1px solid currentColor;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wdm-article__figure {
    margin: 0;
}

.wdm-article__figure img {
    width: 100%;
    height: auto;
    display: block;
}

.wdm-article__caption {
    font-size: 0.68rem;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

.wdm-article__body {
    font-size: 0.82rem;
    line-height: 1.65;
    flex: 1;
}

.wdm-article__body p { margin: 0 0 8px; }

.wdm-article__body--2col {
    column-count: 2;
    column-gap: 18px;
    column-rule: 1px solid #e0e0e0;
}

.wdm-article__pullquote {
    font-size: 1.05rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1.4;
    border-left: 4px solid;
    padding: 6px 14px;
    margin: 8px 0;
}

/* ============================================================
   IMAGEN A SANGRE  (wdm-full-image)
   ============================================================ */

.wdm-full-image {
    background-size: cover;
    background-position: center;
    background-color: #333;
}

.wdm-full-image__overlay,
.wdm-full-image__gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.wdm-full-image__gradient { z-index: 2; }

.wdm-full-image__text {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.wdm-full-image__text p {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.wdm-full-image__caption {
    position: absolute;
    bottom: 10px;
    right: 12px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    z-index: 4;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ============================================================
   DOBLE PÁGINA EXTENDIDA  (wdm-spread-block)
   ============================================================ */

.wdm-spread-block {
    background-size: cover;
    background-position: center;
    flex-direction: row !important; /* sobreescribe el column del reset base */
    align-items: stretch;
}

.wdm-spread-block__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Línea de pliegue visual (solo en el editor) */
.wdm-spread-block__fold {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(to bottom,
        transparent 0%, rgba(255,255,255,0.3) 20%,
        rgba(255,255,255,0.3) 80%, transparent 100%);
    z-index: 10;
    pointer-events: none;
}

/* Semilados del spread — cada uno es una zona de drop */
.wdm-spread-block__left,
.wdm-spread-block__right {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* evita desbordamiento en flex */
}

.wdm-spread-block__right {
    border-left: 1px solid rgba(255,255,255,0.12);
}

.wdm-spread__eyebrow {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 2px solid;
    display: inline-block;
}

.wdm-spread__title {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
    border-left: 5px solid;
    padding-left: 14px;
}

.wdm-spread__body {
    font-size: 0.83rem;
    line-height: 1.6;
    opacity: 0.9;
    margin: 0;
}

.wdm-spread__footer {
    font-size: 0.68rem;
    opacity: 0.6;
    border-top: 1px solid;
    padding-top: 8px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* Spread: estilos en magazine-reader.css */

/* ============================================================
   CITA DESTACADA  (wdm-pullquote)
   ============================================================ */

.wdm-pullquote {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 28px;
    gap: 8px;
}

.wdm-pullquote--fullpage {
    align-items: center;
    text-align: center;
    padding: 40px 32px;
}

.wdm-pullquote__mark {
    font-size: 7rem;
    line-height: 0.7;
    font-family: Georgia, serif;
    opacity: 0.6;
    user-select: none;
}

.wdm-pullquote__mark--close {
    align-self: flex-end;
    line-height: 0;
    margin-top: -16px;
}

.wdm-pullquote--fullpage .wdm-pullquote__mark--close {
    align-self: center;
}

.wdm-pullquote__inner {
    margin: 0;
    padding: 0;
}

.wdm-pullquote--left-bordered .wdm-pullquote__inner {
    padding-left: 20px;
}

.wdm-pullquote__text {
    font-size: 1.6rem;
    font-style: italic;
    line-height: 1.45;
    margin: 0 0 16px;
    font-weight: 600;
}

.wdm-pullquote__author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid;
}

.wdm-pullquote__photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wdm-pullquote__author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wdm-pullquote__author-info strong {
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-pullquote__author-info span {
    font-size: 0.72rem;
    opacity: 0.7;
    font-style: italic;
}

/* ============================================================
   TABLA DE CONTENIDOS  (wdm-toc)
   ============================================================ */

.wdm-toc {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    overflow-y: auto;
}

.wdm-toc__head {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.wdm-toc__title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
}

.wdm-toc__issue {
    font-size: 0.7rem;
    opacity: 0.6;
    letter-spacing: 0.08em;
}

.wdm-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wdm-toc__item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.wdm-toc__section {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

/* Estilo dots */
.wdm-toc--dots .wdm-toc__row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.wdm-toc--dots .wdm-toc__entry-title {
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.wdm-toc--dots .wdm-toc__dots {
    flex: 1;
    border-bottom: 1px dotted rgba(0,0,0,0.3);
    margin-bottom: 3px;
}

.wdm-toc__pagenum {
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wdm-toc__author {
    font-size: 0.68rem;
    opacity: 0.55;
    font-style: italic;
    display: block;
    margin-top: 1px;
}

/* Estilo boxed */
.wdm-toc--boxed .wdm-toc__list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wdm-toc--boxed .wdm-toc__item { padding: 0; border: none; }
.wdm-toc--boxed .wdm-toc__card {
    background: rgba(0,0,0,0.04);
    border-top: 3px solid;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
}
.wdm-toc--boxed .wdm-toc__entry-title { font-size: 0.82rem; font-weight: 700; }

/* Estilo minimal */
.wdm-toc--minimal .wdm-toc__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
}
.wdm-toc__pagenum-big {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    min-width: 48px;
    text-align: right;
    flex-shrink: 0;
    font-family: Georgia, serif;
}
.wdm-toc__item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wdm-toc--minimal .wdm-toc__entry-title { font-size: 0.88rem; font-weight: 700; }

/* ============================================================
   CONTRAPORTADA  (wdm-backcover)
   ============================================================ */

.wdm-backcover {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdm-backcover__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.wdm-backcover__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding: 32px 24px;
    width: 100%;
}

.wdm-backcover__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wdm-backcover__logo {
    max-height: 70px;
    max-width: 180px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.wdm-backcover__name {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-backcover__rule {
    width: 60px;
    height: 2px;
}

.wdm-backcover__tagline {
    font-size: 0.82rem;
    opacity: 0.8;
    margin: 0;
    font-style: italic;
    font-family: Georgia, serif;
}

.wdm-backcover__contact {
    border-top: 1px solid;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    opacity: 0.85;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-backcover__web { font-weight: 600; }

.wdm-backcover__social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    font-size: 0.72rem;
    opacity: 0.75;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-backcover__social-item strong { display: block; }

.wdm-backcover__copy {
    font-size: 0.65rem;
    opacity: 0.45;
    margin: 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.03em;
}

/* ============================================================
   SEPARADOR DE SECCIÓN  (wdm-section-title)
   ============================================================ */

.wdm-section-title {
    background-color: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdm-section-title__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.wdm-section-title__body {
    position: relative;
    z-index: 2;
    padding: 40px 32px;
    width: 100%;
}

.wdm-section-title__num {
    display: inline-block;
    font-family: Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid;
    padding: 4px 10px;
    margin-bottom: 16px;
}

.wdm-section-title__rule {
    width: 44px;
    height: 3px;
    margin: 12px 0;
}

.wdm-section-title__name {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0 0 10px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.wdm-section-title__sub {
    font-size: 0.85rem;
    line-height: 1.55;
    opacity: 0.75;
    margin: 0;
    font-style: italic;
    max-width: 340px;
    font-family: Georgia, serif;
}

/* Variante split (número enorme) */
.wdm-section-title--split .wdm-section-title__body { padding: 24px; }
.wdm-section-title__split {
    display: flex;
    align-items: center;
    gap: 24px;
}
.wdm-section-title__num-big {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    opacity: 0.25;
    font-family: Georgia, serif;
    flex-shrink: 0;
}
.wdm-section-title__split-text {
    flex: 1;
}

/* ============================================================
   RESPONSIVO — los widgets dentro de pages se escalan
   con el flipbook, pero se pueden necesitar ajustes
   ============================================================ */

@media (max-width: 480px) {
    .wdm-cover__name        { font-size: 2.2rem; }
    .wdm-article__headline  { font-size: 1.1rem; }
    .wdm-pullquote__text    { font-size: 1.1rem; }
    .wdm-section-title__name{ font-size: 2rem; }
    .wdm-article__body--2col{ column-count: 1; }
    .wdm-toc--boxed .wdm-toc__list { grid-template-columns: 1fr; }
}

/* ============================================================
   TARJETA DE REVISTA
   Usada por carrusel y cuadrícula
   ============================================================ */

.wdm-mag-card {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.wdm-mag-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    text-decoration: none;
}

/* Portada — ratio 3:4 (portrait) */
.wdm-mag-card__cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: transparent;
    overflow: hidden;
}

/* Fallback para navegadores sin aspect-ratio */
@supports not (aspect-ratio: 3/4) {
    .wdm-mag-card__cover::before {
        content: '';
        display: block;
        padding-top: 133.33%;
    }
    .wdm-mag-card__cover img,
    .wdm-mag-card__placeholder,
    .wdm-cover-scale-wrap {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }
}

.wdm-mag-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.wdm-mag-card:hover .wdm-mag-card__cover img {
    transform: scale(1.05);
}

/* Miniatura escalada del container de portada de Elementor */
.wdm-cover-scale-wrap {
    position: absolute;
    inset: 0;                   /* rellena la portada antes de que el JS aplique el scale */
    transform-origin: top left;
    pointer-events: none;
    /* JS sobreescribe width/height con valores en px y aplica transform: scale() */
}

/* Reset que Elementor añade al wrapper raíz */
.wdm-cover-scale-wrap > .elementor {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ligero brillo al hover */
.wdm-mag-card:hover .wdm-cover-scale-wrap {
    filter: brightness(1.04);
    transition: filter 0.4s ease;
}

/* ── Cadena de altura dentro del scale-wrap ─────────────────────────────────
   Garantiza que el layout de Elementor ocupe el 100% de la altura sin
   destruir la estructura interna de grid/flex del usuario. */

.wdm-cover-scale-wrap > .elementor {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.wdm-cover-scale-wrap > .elementor > .e-con,
.wdm-cover-scale-wrap > .elementor > .elementor-section-wrap > .elementor-section,
.wdm-cover-scale-wrap > .elementor > .elementor-section {
    flex: 1 1 auto !important;
    min-height: 100% !important;
}

/* Permitir que los contenedores hijos crezcan sin forzar flex destructivo */
.wdm-cover-scale-wrap [data-wdm-page="cover"] {
    min-height: 100% !important;
}

/* Placeholder para iframes/videos en la vista previa */
.wdm-cover-media-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wdm-cover-media-placeholder::after {
    content: '▶';
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Ocultar loaders y overlays de JS de Elementor en la previsualización */
.wdm-cover-scale-wrap .elementor-loading,
.wdm-cover-scale-wrap .e-scroll-snap-container {
    display: none !important;
}

.wdm-mag-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: linear-gradient(135deg, #1c1c35 0%, #2d2d50 100%);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    box-sizing: border-box;
}

.wdm-mag-card__info {
    padding: 10px 12px 12px;
    background: #ffffff;
}

.wdm-mag-card__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a2e;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wdm-mag-card__btn {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 14px;
    background: #1a1a2e;
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.18s ease;
    cursor: pointer;
}

.wdm-mag-card:hover .wdm-mag-card__btn {
    background: #2d2d50;
}

/* ============================================================
   CARRUSEL
   .wdm-carousel          — contenedor flex-column
   .wdm-carousel__inner   — fila grid (btn | track | btn) en desktop;
                            bloque con botones en absoluto en móvil
   .wdm-carousel__dots    — fila de puntos debajo del inner
   ============================================================ */

.wdm-carousel {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
    padding-bottom: 4px; /* evita que la sección siguiente quede pegada */
    margin-bottom: 40px;
}

.wdm-carousel__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    column-gap: 8px;
    align-items: center;
    position: relative;
}

.wdm-carousel__track-wrap {
    overflow: hidden;
    min-width: 0;
}

.wdm-carousel__track {
    display: flex;
    transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.wdm-carousel__slide {
    flex: 0 0 calc(100% / var(--wdm-slides, 4));
    box-sizing: border-box;
    padding: 0 8px;
    min-width: 0;
}

/* Botones prev / next */
.wdm-carousel__btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 15, 30, 0.72);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
    padding: 0;
    flex-shrink: 0;
}

.wdm-carousel__btn:hover:not(:disabled) {
    background: rgba(15, 15, 30, 0.95);
    transform: scale(1.1);
}

.wdm-carousel__btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.wdm-carousel__btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
    flex-shrink: 0;
}

/* Dots */
.wdm-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    padding-top: 16px;
    flex-wrap: wrap;
}

.wdm-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.wdm-carousel__dot--active,
.wdm-carousel__dot:hover {
    background: #1a1a2e;
    transform: scale(1.3);
}

/* ============================================================
   CUADRÍCULA DE REVISTAS
   ============================================================ */

.wdm-mag-grid {
    display: grid;
    grid-template-columns: repeat(var(--wdm-cols, 4), 1fr);
    gap: var(--wdm-gap, 20px);
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .wdm-mag-grid { grid-template-columns: repeat(var(--wdm-cols, 3), 1fr); }
}

@media (max-width: 768px) {
    .wdm-mag-grid { grid-template-columns: repeat(var(--wdm-cols, 2), 1fr); }
    .wdm-carousel__inner { column-gap: 4px; }

    /* ── Carrusel móvil: 1 portada completa, botones solapados ── */
    .wdm-carousel__inner {
        display: block;
        position: relative;
    }

    .wdm-carousel__track-wrap {
        width: 100%;
    }

    /* Sin padding: la portada ocupa todo el ancho del carrusel */
    .wdm-carousel__slide { padding: 0; }

    /* Botones flotan sobre la portada, centrados verticalmente */
    .wdm-carousel__btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        width: 38px;
        height: 38px;
    }

    .wdm-carousel__btn--prev { left: 8px; }
    .wdm-carousel__btn--next { right: 8px; }

    /* Mantener translateY al hacer hover */
    .wdm-carousel__btn:hover:not(:disabled) {
        transform: translateY(-50%) scale(1.1);
    }

    .wdm-carousel__dots { padding-top: 12px; }

    /* Garantiza separación respecto a la sección siguiente */
    .wdm-carousel { padding-bottom: 16px; }
}

@media (max-width: 480px) {
    /* Grid: forzar 1 columna */
    .wdm-mag-grid { 
        grid-template-columns: 1fr;
    }

    /* Carrusel móvil: forzar altura automática y layout de bloque puro para evitar colapso flex en Chrome */
    .wdm-carousel {
        display: block !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: hidden; /* Garantiza que contenga los márgenes internos */
    }
    .wdm-carousel__slide { 
        padding: 0; 
    }

    /* Hacer la portada invulnerable a bugs de Chrome/Safari */
    .wdm-mag-card__cover {
        aspect-ratio: auto;
        width: 100%;
        display: block;
    }
    .wdm-mag-card__cover::before {
        content: '';
        display: block;
        padding-top: 150%; /* 2/3 aspect ratio */
    }
    .wdm-mag-card__cover img,
    .wdm-mag-card__placeholder,
    .wdm-cover-scale-wrap {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
    }

    /* Quitar sombreado, reducir tamaño visual con max-width y centrar */
    .wdm-mag-card {
        box-shadow: none !important;
        max-width: 70%;
        margin: 0 auto;
    }
    .wdm-mag-card:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Reducir altura del contenedor minimizando el área de info (título/botón) */
    .wdm-mag-card__info { padding: 6px 8px 8px; }
    .wdm-mag-card__title { font-size: 0.8rem; }
    .wdm-mag-card__btn { margin-top: 4px; padding: 4px 10px; }

    .wdm-carousel__btn { 
        width: 32px; 
        height: 32px; 
        margin-top: -50px;
    }
    .wdm-carousel__btn svg { width: 15px; height: 15px; }
}

/* ============================================================
   VISOR INLINE — sin barra de controles inferior
   ============================================================ */

.wdm-reader--no-controls .wdm-controls {
    display: none !important;
}

/* ============================================================
   ARCHIVO DE REVISTAS CON FILTROS
   ============================================================ */

/* Barra de filtros */
.wdm-archive__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 24px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.035);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.wdm-archive__filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.wdm-archive__filter-group--search {
    flex: 1 1 200px;
}

.wdm-archive__filter-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    line-height: 1;
}

/* Select con flecha personalizada */
.wdm-archive__select {
    height: 38px;
    padding: 0 32px 0 12px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    font-size: 0.875rem;
    color: #1a1a2e;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wdm-archive__select:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

/* Buscador */
.wdm-archive__search-wrap {
    position: relative;
}

.wdm-archive__search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #aaa;
    pointer-events: none;
    flex-shrink: 0;
}

.wdm-archive__search {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 34px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    color: #1a1a2e;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wdm-archive__search:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.1);
}

/* Botón limpiar filtros */
.wdm-archive__reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.18s ease;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.wdm-archive__reset--active {
    opacity: 1;
    pointer-events: auto;
}

.wdm-archive__reset:hover {
    border-color: #1a1a2e;
    color: #1a1a2e;
    background: rgba(26, 26, 46, 0.05);
}

/* Resumen de resultados */
.wdm-archive__summary {
    font-size: 0.78rem;
    color: #999;
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
}

/* Grid de tarjetas */
.wdm-archive-grid {
    display: grid;
    grid-template-columns: repeat(var(--wdm-cols, 4), 1fr);
    gap: var(--wdm-gap, 20px);
}

/* Animación de entrada al aparecer / ocultar */
.wdm-archive-grid__item {
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.wdm-archive-grid__item--hidden {
    display: none;
}

/* Mensaje sin resultados */
.wdm-archive__empty-msg {
    text-align: center;
    padding: 48px 20px;
    color: #aaa;
    font-size: 0.95rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
    .wdm-archive-grid { grid-template-columns: repeat(var(--wdm-cols, 3), 1fr); }
}

@media (max-width: 768px) {
    .wdm-archive-grid { grid-template-columns: repeat(var(--wdm-cols, 2), 1fr); }
    .wdm-archive__filters { padding: 14px; gap: 10px; }
    .wdm-archive__filter-group { min-width: calc(50% - 8px); flex: 1 1 calc(50% - 8px); }
    .wdm-archive__filter-group--search { flex: 1 1 100%; }
}

@media (max-width: 480px) {
    .wdm-archive-grid { grid-template-columns: 1fr; }
    .wdm-archive__filter-group { min-width: 100%; flex: 1 1 100%; }
    .wdm-archive__reset { width: 100%; justify-content: center; }
}
