/**
 * Geek Educativo · Monetización Controlada
 * GE-04.9
 * Version: 1.2.4
 *
 * Los espacios publicitarios reales NO reservan altura
 * mientras Google no entregue un anuncio.
 *
 * Las vistas previas privadas para administradores
 * sí mantienen una altura visible para auditoría.
 */


/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

.gemc-slot {
    width: min(100% - 32px, 1180px);
    margin: 34px auto;
    padding: 0;
    box-sizing: border-box;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* =========================================================
   INTERIOR
   ========================================================= */

.gemc-slot__inner {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}


/* =========================================================
   ETIQUETA PUBLICIDAD
   ========================================================= */

.gemc-slot__label {
    display: none;
    margin: 0 0 8px;
    color: #7b8798;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .12em;
    text-align: center;
    text-transform: uppercase;
}


/* =========================================================
   CÓDIGO ADSENSE
   ========================================================= */

.gemc-slot__code {
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;

    display: block;

    box-sizing: border-box;
    text-align: center;
}


/*
 * La unidad necesita ancho real para que AdSense
 * pueda calcular correctamente su tamaño.
 */

.gemc-slot__code .adsbygoogle {
    width: 100%;
    min-width: 0;
    margin: 0 auto;

    display: block;

    box-sizing: border-box;
}


/* =========================================================
   SLOT REAL — ESTADO PENDIENTE
   ========================================================= */

/*
 * MUY IMPORTANTE:
 *
 * No usamos display:none antes de que AdSense procese
 * la unidad porque eso produciría availableWidth=0.
 *
 * Tampoco imponemos una altura mínima.
 *
 * Resultado:
 * - AdSense conserva todo el ancho necesario.
 * - La página no muestra un rectángulo vacío gigante.
 */

.gemc-slot.is-live {
    min-height: 0;
    border: 0;
    background: transparent;
}

.gemc-slot.is-live .gemc-slot__inner {
    min-height: 0;
    border: 0;
    background: transparent;
}

.gemc-slot.is-live .gemc-slot__label {
    display: none;
}


/* =========================================================
   ANUNCIO LLENO
   ========================================================= */

.gemc-slot.is-live.is-filled {
    margin-top: 34px;
    margin-bottom: 34px;
}

.gemc-slot.is-live.is-filled .gemc-slot__label {
    display: block;
}


/* =========================================================
   ANUNCIO SIN INVENTARIO
   ========================================================= */

/*
 * Si Google marca la unidad como unfilled,
 * desaparece por completo.
 */

.gemc-slot.is-live.is-unfilled {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

.gemc-slot.is-live.is-unfilled .gemc-slot__inner,
.gemc-slot.is-live.is-unfilled .gemc-slot__code,
.gemc-slot.is-live.is-unfilled .gemc-slot__label {
    display: none !important;
}


/* =========================================================
   HOME
   ========================================================= */

.gemc-slot--home {
    width: min(100% - 32px, 1180px);
}


/*
 * El HOME real tampoco reserva altura previamente.
 */

.gemc-slot--home.is-live .gemc-slot__inner {
    min-height: 0;
}


/* =========================================================
   ARTÍCULOS
   ========================================================= */

.gemc-slot--article {
    width: 100%;
    max-width: 100%;
}


/*
 * Esta regla sustituye la antigua reserva obligatoria
 * de 250 px.
 */

.gemc-slot--article.is-live .gemc-slot__inner {
    min-height: 0;
}


/* =========================================================
   VISTA PREVIA PRIVADA
   ========================================================= */

/*
 * Solo administradores necesitan ver dónde se encuentra
 * una posición aunque no tenga anuncio.
 */

.gemc-slot.is-preview {
    margin-top: 34px;
    margin-bottom: 34px;
}

.gemc-slot.is-preview .gemc-slot__inner {
    min-height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px dashed #bfc9d8;
    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 253, .98),
            rgba(243, 247, 252, .98)
        );

    overflow: hidden;
}

.gemc-slot.is-preview .gemc-slot__label {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;

    display: block;

    margin: 0;

    color: #7b8798;
}


/* =========================================================
   PLACEHOLDER ADMINISTRATIVO
   ========================================================= */

.gemc-slot__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 28px;

    color: #657184;
    text-align: center;
}

.gemc-slot__placeholder strong {
    color: #172033;
    font-size: 14px;
    line-height: 1.35;
}

.gemc-slot__placeholder span {
    color: #7b8798;
    font-size: 11px;
    line-height: 1.35;
    letter-spacing: .05em;
    text-transform: uppercase;
}


/* =========================================================
   IFRAMES GENERADOS POR GOOGLE
   ========================================================= */

.gemc-slot iframe {
    max-width: 100%;
}

.gemc-slot ins {
    max-width: 100%;
}


/* =========================================================
   SEGURIDAD DE LAYOUT
   ========================================================= */

.gemc-slot,
.gemc-slot *,
.gemc-slot *::before,
.gemc-slot *::after {
    box-sizing: border-box;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .gemc-slot {
        width: min(100% - 28px, 1180px);
        margin-top: 28px;
        margin-bottom: 28px;
    }

    .gemc-slot.is-live.is-filled {
        margin-top: 28px;
        margin-bottom: 28px;
    }

    .gemc-slot.is-preview {
        margin-top: 28px;
        margin-bottom: 28px;
    }

    .gemc-slot.is-preview .gemc-slot__inner {
        min-height: 160px;
    }
}


/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 720px) {

    .gemc-slot {
        width: 100%;
        max-width: 100%;

        margin-top: 24px;
        margin-bottom: 24px;

        padding-left: 0;
        padding-right: 0;
    }

    /*
     * IMPORTANTE:
     * anteriormente el artículo obligaba min-height:250px.
     * Ya no ocurre en publicidad real.
     */

    .gemc-slot--article.is-live .gemc-slot__inner {
        min-height: 0;
    }

    .gemc-slot--home.is-live .gemc-slot__inner {
        min-height: 0;
    }

    .gemc-slot.is-live.is-filled {
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .gemc-slot.is-preview {
        margin-top: 24px;
        margin-bottom: 24px;
    }

    .gemc-slot.is-preview .gemc-slot__inner {
        min-height: 140px;
        border-radius: 12px;
    }

    .gemc-slot__placeholder {
        padding: 22px 16px;
    }
}


/* =========================================================
   MÓVIL PEQUEÑO
   ========================================================= */

@media (max-width: 420px) {

    .gemc-slot {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .gemc-slot.is-live.is-filled {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .gemc-slot.is-preview {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .gemc-slot.is-preview .gemc-slot__inner {
        min-height: 120px;
    }
}


/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .gemc-slot,
    .gemc-slot * {
        animation: none !important;
        transition: none !important;
    }
}