/* =========================================================
   ZENLYTA — UNIVERSAL PNP ADS
   Provider controls the actual advertisement.
   Zenlyta only controls spacing and safe layout.
   When no provider is active, containers stay collapsed.
   ========================================================= */


/* =========================================================
   01. AD SECTION
   ========================================================= */

.ad-section {
    width: 100%;
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
    transition: all 0.2s ease;
}


/* =========================================================
   02. UNIVERSAL AD CONTAINER
   ========================================================= */

.zenlyta-ad {
    width: 100%;
    max-width: 100%;

    margin-inline: auto;
    padding: 0;

    text-align: center;

    position: relative;

    box-sizing: border-box;

    overflow: hidden;
}


/* =========================================================
   03. AD LABEL
   ========================================================= */

.ad-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary, #94a3b8);
    margin-bottom: 0.375rem;
    text-align: center;
    user-select: none;
}


/* =========================================================
   04. PROVIDER CONTENT
   ========================================================= */

.zenlyta-ad > * {
    max-width: 100%;
}

.zenlyta-ad .ad-provider-container {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   05. GOOGLE ADSENSE
   ========================================================= */

.zenlyta-ad .adsbygoogle {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
}

.zenlyta-ad iframe {
    max-width: 100% !important;
}


/* =========================================================
   06. ADSTERRA
   ========================================================= */

.zenlyta-ad [data-provider="adsterra"] {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
}


/* =========================================================
   07. DUMMY AD (FALLBACK ONLY WHEN EXPLICITLY ENABLED)
   ========================================================= */

.zenlyta-dummy-ad {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    border: 1px dashed var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--surface-secondary, rgba(241, 245, 249, 0.6));
    color: var(--text-secondary, #64748b);
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
    gap: 0.35rem;
}

.dummy-ad-position {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    margin-bottom: 0.25rem;
}

.dummy-ad-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dummy-ad-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
}

.dummy-ad-description {
    font-size: 0.8125rem;
    color: var(--text-secondary, #64748b);
    max-width: 400px;
}

.dummy-ad-button {
    margin-top: 0.5rem;
    display: inline-block;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary, #3b82f6);
    border-radius: 6px;
    user-select: none;
}


/* =========================================================
   08. POSITION SPACING
   ========================================================= */

.zenlyta-ad[data-ad-position="top"] {
    margin-top: 0;
    margin-bottom: 0;
}

.zenlyta-ad[data-ad-position="content"] {
    margin-top: 0;
    margin-bottom: 0;
}

.zenlyta-ad[data-ad-position="bottom"] {
    margin-top: 0;
    margin-bottom: 0;
}


/* =========================================================
   09. DISABLED ADS & COLLAPSED STATE
   ========================================================= */

.ad-section.ad-disabled,
.ad-section:has(.zenlyta-ad.ad-disabled),
.ad-section:has(.zenlyta-ad:empty) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}

.zenlyta-ad.ad-disabled,
.zenlyta-ad:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
}


/* =========================================================
   10. THIRD-PARTY IMAGE PROTECTION
   ========================================================= */

.zenlyta-ad img {
    max-width: 100%;
    height: auto;
}


/* =========================================================
   11. RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {
    .ad-section:not(.ad-disabled) {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ad-section:not(.ad-disabled) {
        margin-top: 1.25rem;
        margin-bottom: 1.25rem;
    }
}


/* =========================================================
   12. ACCESSIBILITY & PRINT
   ========================================================= */

.zenlyta-ad:focus-within {
    outline: 1px solid var(--primary, currentColor);
    outline-offset: 3px;
}

@media print {
    .ad-section,
    .zenlyta-ad {
        display: none !important;
    }
}
