/* ====================================
   Responsive Banner Styles (Leaderboard 728x90)
   ==================================== */

.banner-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

/* Wrapper reserves space dengan correct aspect ratio untuk avoid layout shift */
.banner-wrapper {
    width: 100%;
    max-width: 728px;        /* desktop: original width */
    aspect-ratio: 728 / 90;  /* modern browsers keep correct ratio */
    overflow: hidden;
    border-radius: 4px;
}

/* Image fills wrapper dan preserves cover behavior */
.banner-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;           /* crop to fill wrapper while preserving ratio */
    object-position: center;
    transition: transform 0.3s ease;
}

.banner-link {
    display: block;
    text-decoration: none;
}

.banner-link:hover .banner-image {
    transform: scale(1.02);
}

.banner-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Provide smaller max-width pada tablet dan mobile untuk keep banner readable */
@media (max-width: 992px) {
    .banner-wrapper { 
        max-width: 468px; /* medium leaderboard fallback */
    }
}

@media (max-width: 768px) {
    .banner-wrapper { 
        max-width: 400px;
    }
}

@media (max-width: 576px) {
    .banner-wrapper { 
        max-width: 320px;
    }
    
    .banner-container {
        margin: 1rem 0;
    }
}

/* ====================================
   Fallback untuk browser lama (tanpa aspect-ratio support)
   Menggunakan padding-top trick (90/728 ≈ 12.36%)
   ==================================== */

@supports not (aspect-ratio: 728 / 90) {
    .banner-wrapper {
        position: relative;
        height: 0;
        padding-top: 12.36%; /* reserve space */
    }

    .banner-image {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }
}

/* ====================================
   ANIMATIONS
   ==================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   ACCESSIBILITY
   ==================================== */

.banner-link:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .banner-container {
        display: none !important;
    }
}
