/* =========================================
   GAS - Google Ads Style Frontend
   ========================================= */

/* Wrapper utama iklan */
.gas-ad-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    margin: 16px auto;
    background: #fff;
    /* border: 1px solid #dadce0; <- Dihapus agar tidak dobel dengan gambar */
    border-radius: 4px;
    padding: 0;
    box-sizing: border-box;
    /* overflow: hidden; <- DIHAPUS agar logo tidak terpotong */
    text-align: left;
    font-family: Arial, sans-serif;
    z-index: 1; /* Pastikan di atas elemen lain */
}

/* =========================================
   Container Ikon (Pojok Kanan Atas)
   ========================================= */
.gas-ad-controls {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 999; /* Pastikan paling atas */
    display: flex;
    align-items: center;
    padding: 0;
    /* Jika iklan sangat kecil, paksa logo menempel di pojok */
    transform: translate(0, 0); 
}

/* --- MODEL 1: Ikon ⋮ dan ⓘ --- */
.gas-ad-model-1 {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-bottom-left-radius: 4px;
    padding: 2px 4px;
    gap: 2px;
    box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.06);
}

.gas-ad-wrapper .cbb {
    width: 15px;
    height: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.gas-ad-wrapper .cbb:hover {
    background: rgba(0, 0, 0, 0.08);
}

.gas-ad-wrapper .abgc {
    position: relative;
    width: 15px;
    height: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10%;
    transition: background 0.2s;
}

.gas-ad-wrapper .abgc:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* --- MODEL 2: Logo AdChoices ▷ --- */
.gas-ad-model-2 {
    display: flex;
    align-items: center;
    background: #f1f3f4; /* Warna abu-abu terang khas Google */
    border: 1px solid #dadce0;
    border-radius: 3px;
    padding: 1px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 2px;
    cursor: pointer;
    position: relative;
    /* Pastikan lebar minimum agar logo tidak terpotong */
    min-width: 77px; 
    height: 17px;
}

.gas-ad-model-2 img {
    display: block;
    max-width: 100%; /* Agar menyesuaikan container */
    height: 15px;
    object-fit: contain;
}

/* =========================================
   Popup "Why This Ad"
   ========================================= */
.gas-ad-wrapper .abgs {
    position: absolute;
    top: 22px; /* Geser sedikit ke bawah */
    right: 0;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 4px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    white-space: nowrap;
    display: none;
}

.gas-ad-wrapper .abgs .abgl {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.gas-ad-wrapper .abgs .abgl img {
    display: block;
    max-width: 60px;
    height: auto;
}

/* =========================================
   Gambar Iklan
   ========================================= */
.gas-ad-link {
    display: block;
    text-decoration: none;
    line-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Pindahkan overflow ke sini agar gambar rapi */
    border-radius: 4px;
}

.gas-ad-img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 50px; /* Fallback jika gambar kosong */
    background-color: #e0e0e0; /* Warna abu-abu placeholder */
    border: 0;
    margin: 0;
    padding: 0;
    object-fit: cover;
}

/* =========================================
   Sizing Containers
   ========================================= */
.gas-ad-300x250 { width: 300px; min-height: 250px; }
.gas-ad-336x280 { width: 336px; min-height: 280px; }
.gas-ad-728x90  { width: 728px; min-height: 90px; }
.gas-ad-160x600 { width: 160px; min-height: 600px; }
.gas-ad-300x600 { width: 300px; min-height: 600px; }
.gas-ad-320x50  { width: 320px; min-height: 50px; }

/* Responsif untuk mobile */
@media (max-width: 768px) {
    .gas-ad-728x90, .gas-ad-336x280 {
        width: 100%;
        max-width: 100%;
    }
}