/**
 * FoodJot Google AdSense Monetization Stylesheet
 * 
 * Production CSS framework for zero-CLS ad containers, native In-Feed recipe grid cards,
 * sidebar display units, in-article contextual placements, and policy-compliant badges.
 *
 * @package FoodJot_AdSense_Monetization
 * @version 1.0.0
 */

/* ==========================================================================
   1. GLOBAL ZERO-CLS BASE CONTAINERS & PLACEHOLDERS
   ========================================================================== */

.fj-ad-container {
    position: relative;
    box-sizing: border-box;
    display: block;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    contain: layout;
}

/* Skeleton background for layout reservation before creative rendering */
.fj-ad-placeholder-bg {
    background-color: #fcfbf9;
    background-image: linear-gradient(90deg, #fcfbf9 0px, #f5efe6 40px, #fcfbf9 80px);
    background-size: 600px 100%;
    animation: fj-shimmer 2.2s infinite ease-out;
}

@keyframes fj-shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

/* Standard policy-compliant label for non-card ad placements */
.fj-ad-badge {
    display: block;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #a39582;
    margin: 0 0 6px;
    text-align: center;
    user-select: none;
}

/* ==========================================================================
   2. TOP HERO LEADERBOARD AD PLACEMENT
   ========================================================================== */

.fj-hero-ad-container {
    margin: 20px auto 24px;
    max-width: 728px;
    min-height: 90px;
    text-align: center;
    contain: layout size;
    box-sizing: border-box;
}

.fj-hero-ad-wrapper {
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border: 1px solid #eadfca;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    contain: layout;
}

.fj-hero-ad-wrapper ins.adsbygoogle {
    display: block;
    width: 100%;
    min-height: 90px;
}

/* ==========================================================================
   3. IN-FEED RECIPE GRID AD CARD (MATCHING .featured-card)
   ========================================================================== */

.fj-ad-feed-col {
    margin-bottom: 30px;
    box-sizing: border-box;
    display: flex;
}

.fj-ad-feed-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 380px;
    background: #ffffff;
    border: 1px solid #eadfca;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    contain: layout size;
}

.fj-ad-feed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 25, 22, 0.12);
}

/* Policy Badge for In-Feed Cards */
.fj-ad-feed-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: rgba(255, 255, 255, 0.95);
    color: #b5621a;
    border: 1px solid rgba(234, 223, 202, 0.9);
    border-radius: 20px;
    font-family: 'Inter', 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    user-select: none;
}

/* 3:2 Aspect Ratio Thumbnail Container matching recipe images */
.fj-ad-feed-thumb {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 Aspect Ratio */
    background: #fbf8f2;
    overflow: hidden;
}

.fj-ad-feed-thumb ins.adsbygoogle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* In-Feed Card Body */
.fj-ad-feed-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 14px;
    box-sizing: border-box;
}

.fj-ad-feed-source {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    color: #999999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.fj-ad-feed-title {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #222222;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fj-ad-feed-desc {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #666666;
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.fj-ad-feed-cta {
    display: inline-flex;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #edba3d;
    letter-spacing: 1px;
    text-decoration: none;
    margin-top: auto;
    transition: color 0.2s ease;
}

.fj-ad-feed-cta:hover {
    color: #c9a02e;
    text-decoration: none;
}

/* Category archive landing card variant (.fj-category-landing__card) */
.fj-category-landing__grid .fj-ad-feed-card {
    border-radius: 18px;
    border: 1px solid rgba(20, 16, 11, 0.08);
    box-shadow: 0 12px 28px rgba(20, 16, 11, 0.05);
    min-height: 390px;
}

.fj-category-landing__grid .fj-ad-feed-body {
    padding: 18px 18px 20px;
}

.fj-category-landing__grid .fj-ad-feed-title {
    font-size: 22px;
    line-height: 1.25;
    color: #18130d;
}

/* ==========================================================================
   4. SIDEBAR DISPLAY AD UNITS
   ========================================================================== */

.fj-sidebar-ad-wrapper {
    margin: 24px auto;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.fj-ad-sidebar-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border: 1px solid #eadfca;
    border-radius: 8px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

/* 300x250 Medium Rectangle */
.fj-ad-sidebar-300x250, .fj-ad-slot-sidebar-300x250 {
    width: 300px;
    min-height: 250px;
    max-width: 100%;
    contain: layout size;
}

/* 300x600 Half Page Skyscraper */
.fj-ad-sidebar-300x600, .fj-ad-slot-sidebar-300x600 {
    width: 300px;
    min-height: 600px;
    max-width: 100%;
    contain: layout size;
}

/* 160x600 Wide Skyscraper */
.fj-ad-sidebar-160x600, .fj-ad-slot-sidebar-160x600 {
    width: 160px;
    min-height: 600px;
    max-width: 100%;
    margin: 0 auto;
    contain: layout size;
}


/* Responsive sidebar slot */
.fj-ad-sidebar-responsive {
    width: 100%;
    min-height: 250px;
    contain: layout style;
}

/* The slot is a flex container: an auto-width empty <ins> collapses to 0px,
   which makes adsbygoogle.push() fail with
   "No slot size for availableWidth=0". Give the unit a real width. */
.fj-ad-sidebar-responsive ins.adsbygoogle,
.fj-ad-sidebar-slot ins.adsbygoogle {
    display: block;
    width: 100%;
    min-height: 250px;
    flex: 0 0 auto;
    box-sizing: border-box;
}

/* ==========================================================================
   5. IN-ARTICLE CONTEXTUAL & CONCLUSION AD PLACEMENT
   ========================================================================== */

.fj-in-article-ad-container, .fj-ad-slot-inarticle {
    margin: 32px auto;
    max-width: 728px;
    width: 100%;
    min-height: 280px;
    clear: both;
    text-align: center;
    box-sizing: border-box;
    contain: layout;
}

.fj-in-article-ad-wrapper {
    min-height: 280px;
    background: #ffffff;
    border: 1px solid #eadfca;
    border-radius: 10px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 14px rgba(26, 25, 22, 0.04);
    box-sizing: border-box;
    contain: layout;
}

.fj-in-article-ad-wrapper ins.adsbygoogle {
    width: 100%;
    min-height: 250px;
    display: block;
    margin: 0 auto;
}

/* Late Review Conclusion Ad Placement */
.fj-conclusion-ad-container {
    margin: 36px auto;
    max-width: 728px;
    width: 100%;
    min-height: 280px;
    clear: both;
    text-align: center;
    box-sizing: border-box;
    contain: layout;
}

/* Dedicated post-ad1 slot */
.fj-post-ad1-wrapper {
    margin: 36px 0 24px;
    padding: 18px;
    background: #fffdf9;
    border: 1px solid #eadfca;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   6. UNFILLED AD HANDLING — SAFE ZERO-CLS COLLAPSE
   ========================================================================== */

.fj-ad-unfilled,
.fj-ad-unfilled *,
.fj-ad-collapsed-empty,
.fj-ad-container:has(ins[data-ad-status="unfilled"]),
.fj-ad-container:has(ins[data-ad-status="unfilled"]) *,
.fj-sidebar-ad-wrapper:has(ins[data-ad-status="unfilled"]),
.fj-sidebar-ad-wrapper:has(ins[data-ad-status="unfilled"]) *,
.google-auto-placed:has(ins[data-ad-status="unfilled"]),
.google-auto-placed:has(ins[data-ad-status="unfilled"]) * {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

.fj-ad-fallback,
.fj-ad-fallback-inner {
    display: none !important;
    background: transparent !important;
    background-image: none !important;
    color: transparent !important;
}

/* Runtime fallback markup from the retired v1.0.0 loader must never be visible */
.fj-ad-fallback .fj-ad-fallback-inner,
.fj-ad-placeholder-bg > .fj-ad-fallback-inner {
    display: none !important;
    background: transparent !important;
    color: transparent !important;
}


/* ==========================================================================
   7. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablets and small desktops */
@media (max-width: 991px) {
    .fj-ad-feed-card {
        min-height: 360px;
    }
    
    .fj-in-article-ad-container {
        margin: 24px auto;
    }
}

/* Mobile Devices (max-width: 768px for full viewport rule match) */
@media (max-width: 768px) {
    .fj-in-article-ad-container,
    .fj-ad-slot-inarticle,
    .fj-conclusion-ad-container {
        min-height: 250px;
        max-width: 300px;
    }

    .fj-ad-feed-card {
        min-height: 320px;
    }

    .fj-hero-ad-container {
        min-height: 50px;
        max-width: 320px;
    }

    .fj-hero-ad-wrapper {
        min-height: 50px;
    }
}

/* Mobile Devices */
@media (max-width: 767px) {
    .fj-ad-feed-col {
        margin-bottom: 24px;
    }

    .fj-ad-feed-card {
        min-height: 320px;
    }

    .fj-ad-sidebar-300x250,
    .fj-ad-sidebar-300x600 {
        width: 100%;
        max-width: 300px;
    }

    .fj-in-article-ad-wrapper {
        min-height: 250px;
        padding: 10px 6px;
    }

    .fj-in-article-ad-wrapper ins.adsbygoogle {
        min-height: 250px;
    }

    .fj-hero-ad-wrapper {
        min-height: 50px;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .fj-ad-feed-card {
        min-height: 300px;
    }

    .fj-ad-feed-badge {
        font-size: 9px;
        padding: 2px 7px;
    }

    .fj-hero-ad-container {
        min-height: 50px;
    }
}

/* ==========================================================================
   8. MOBILE BOTTOM ANCHOR AD & STICKY OVERLAY SUPPRESSION
   ========================================================================== */
/* Suppress broken/sticky bottom anchor overlays that block mobile reading */
div[id^="aswift_"][style*="bottom: 0px"],
div[id^="aswift_"][style*="bottom:0px"],
div[id^="google_ads_iframe"][style*="bottom: 0px"],
div[id^="google_ads_iframe"][style*="bottom:0px"],
.google-anchor-ad,
.google-anchor-container,
div[aria-label="Advertisement"][style*="bottom: 0px"],
div[aria-label="Advertisement"][style*="bottom:0px"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

/* ==========================================================================
   9. STRICT PRODUCT BOX & RECIPE CARD ISOLATION GUARDS
   ========================================================================== */
.product-box-container .google-auto-placed,
.product-box-container .adsbygoogle,
.fjtp-product-card .google-auto-placed,
.fjtp-product-card .adsbygoogle,
.wprm-recipe-container .google-auto-placed,
.wprm-recipe-container .adsbygoogle,
.postgenius-recipe-card .google-auto-placed,
.postgenius-recipe-card .adsbygoogle,
.foodjot-cta-wrapper .google-auto-placed,
.foodjot-cta-wrapper .adsbygoogle {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* ==========================================================================
   10. FIXED-SIZE IN-ARTICLE UNITS (336x280 / 300x250)
   ========================================================================== */
/* The container only centers the unit: it stays transparent and keeps the
   <ins> at its declared pixel size instead of stretching it to 100%. */
.fj-ad-fixed {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: transparent;
    border: 0;
    box-shadow: none;
    min-height: 0;
}

.fj-ad-fixed .fj-in-article-ad-wrapper {
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    flex: 0 0 auto;
}

.fj-ad-fixed ins.adsbygoogle {
    width: auto;
    max-width: 100%;
    min-height: 0;
    flex: 0 0 auto;
}

/* No empty ad chrome before a creative exists (kills the show/hide flicker). */
.fj-ad-container,
.fj-sidebar-ad-wrapper,
.fj-in-article-ad-container,
.fj-hero-ad-container,
.fj-conclusion-ad-container {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.fj-ad-placeholder-bg {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Badge and border only appear once AdSense actually filled the slot. */
.fj-ad-badge {
    display: none !important;
}

.fj-ad-filled .fj-ad-badge {
    display: block !important;
}

.fj-ad-filled .fj-in-article-ad-wrapper,
.fj-ad-filled.fj-sidebar-ad-wrapper {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}
