/**
 * Heartland Simple Ad Slots - Ad Slot Styles
 * Container and placeholder styles for ad rendering
 */

/* Main ad slot container */
.hnf-ad-slot {
    position: relative;
    overflow: hidden;
    margin: 10px 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Ad slot primary container (where ad renders) */
.hnf-ad-slot .hnf-ad-primary {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Loading indicator */
.hnf-ad-slot .hnf-ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    color: #999;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: hnf-pulse 1.5s ease-in-out infinite;
}

@keyframes hnf-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Error container */
.hnf-ad-slot .hnf-ad-error {
    display: none;
    width: 100%;
    height: 100%;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    padding: 10px;
    box-sizing: border-box;
    color: #999;
    font-size: 11px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ad iframe styles */
.hnf-ad-slot iframe {
    border: none;
    display: block;
    width: 100%;
    height: 100%;
}

/* Ad slot sizing presets */

/* 300x250 - Medium rectangle (standard) */
.hnf-ad-slot[data-width="300"][data-height="250"] {
    width: 300px;
    min-height: 250px;
    max-width: 100%;
}

/* 970x90 - Leaderboard (desktop) */
.hnf-ad-slot[data-width="970"][data-height="90"] {
    width: 970px;
    min-height: 90px;
    max-width: 100%;
}

/* 970x250 - Billboard (desktop) */
.hnf-ad-slot[data-width="970"][data-height="250"] {
    width: 970px;
    min-height: 250px;
    max-width: 100%;
}

/* 728x90 - Leaderboard (tablet/desktop) */
.hnf-ad-slot[data-width="728"][data-height="90"] {
    width: 728px;
    min-height: 90px;
    max-width: 100%;
}

/* 300x600 - Wide skyscraper */
.hnf-ad-slot[data-width="300"][data-height="600"] {
    width: 300px;
    min-height: 600px;
    max-width: 100%;
}

/* 320x50 - Mobile banner */
.hnf-ad-slot[data-width="320"][data-height="50"] {
    width: 320px;
    min-height: 50px;
    max-width: 100%;
}

/* 320x100 - Mobile large banner */
.hnf-ad-slot[data-width="320"][data-height="100"] {
    width: 320px;
    min-height: 100px;
    max-width: 100%;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .hnf-ad-slot {
        margin: 8px 0;
    }

    .hnf-ad-slot[data-width="970"] {
        width: 100% !important;
        max-width: 100%;
    }

    .hnf-ad-slot[data-width="728"] {
        width: 100% !important;
        max-width: 100%;
    }

    .hnf-ad-slot[data-width="300"][data-height="600"] {
        width: 100% !important;
        height: auto !important;
        min-height: 250px;
    }
}

@media (max-width: 480px) {
    .hnf-ad-slot {
        width: 100% !important;
        max-width: 100%;
        margin: 5px 0;
    }

    .hnf-ad-slot .hnf-ad-loading,
    .hnf-ad-slot .hnf-ad-error {
        font-size: 10px;
    }
}

/* Within article/content area */
.entry-content .hnf-ad-slot,
.post-content .hnf-ad-slot {
    margin: 15px 0;
}

/* Sidebar placement */
.sidebar .hnf-ad-slot,
.aside .hnf-ad-slot {
    margin: 20px 0;
}

/* Header/footer placement */
.site-header .hnf-ad-slot,
.site-footer .hnf-ad-slot {
    margin: 10px 0;
}

/* Accessibility */
.hnf-ad-slot:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Ad label (ADVERTISEMENT) */
.hnf-ad-label {
    font-size: 11px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    text-align: center !important;
    display: block;
    margin: 0 0 5px 0;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
}

/* Print styles */
@media print {
    .hnf-ad-slot {
        display: none !important;
    }
}

/* Animation: Fade in loaded ad */
@keyframes hnf-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hnf-ad-slot.loaded {
    animation: hnf-fade-in 0.3s ease-in;
}

/* Clear floats after ad slots */
.hnf-ad-slot:after {
    content: "";
    display: table;
    clear: both;
}
