/*
=========================================================================
📁 ફાઈલ: ad.css
📍 પાથ: public_html/assets/css/ad.css
🎯 કામ: પબ્લિક એડ ડીઝાઇન (Native Ads) - બિલકુલ પોસ્ટ જેવો લુક (Isolated)
=========================================================================
*/
/* 🚀 1. મુખ્ય એડ કાર્ડ (માર્જિન ફિક્સ અને 100% હાઈટ સાથે) */
.native-ad-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    /* 🚀 માસ્ટર ફિક્સ: કમ્પ્યુટરમાં બાજુવાળી પોસ્ટ જેટલી જ હાઈટ લેશે પણ કપાશે નહિ */
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    margin-bottom: 0 !important;
    box-sizing: border-box;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.native-ad-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 🚀 1.1 કાર્ડના અંદરના ભાગને ફ્લેક્સ આપીને બટનને તળિયે ધક્કો મારવા માટે */
.native-ad-card .card-content {
    flex: 1;
    /* આનાથી ખાલી જગ્યા આ કન્ટેન્ટ લઈ લેશે */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* આનાથી બધી વસ્તુઓ ઊભી (vertically) સેન્ટરમાં આવશે */
}

/* જો બટન વાળા ભાગને નીચે ધક્કો મારવો હોય તો */
.native-ad-card .ad-btn-container {
    margin-top: auto;
    /* 🚀 આ જાદુ છે! બટનને હંમેશા નીચે તળિયે ચોંટાડી દેશે */
    display: flex;
    flex-direction: column;
    padding: 0 18px 18px;
}

/* 🚀 2. માસ્ટર ફિક્સ: ટોચની એડ (Top Ad) અને ગ્રીડ બહારની એડ્સ નીચે જગ્યા છોડવા */
.tachukdi-jaherat-space[data-placement="top"]:not(:empty),
.tachukdi-jaherat-space[data-placement="acomment"]:not(:empty),
.tachukdi-jaherat-space[data-placement="contact"]:not(:empty),
.tachukdi-jaherat-space[data-placement="footer"]:not(:empty) {
    margin-bottom: 15px;
    /* ટોચની એડ નીચે મસ્ત જગ્યા છૂટી જશે */
}


/* 🏷️ 3. સાવ ખૂણાનો Ad બેજ (જગ્યા નહિ રોકે) */
.ad-corner-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #f1f3f5;
    color: #888;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 0 20px 0 8px;
    /* જમણી બાજુના ખૂણાનો શેપ મેચ કરવા */
    border-bottom: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    z-index: 10;
}

/* 🔗 4. વધુ માહિતી લિંક ડીઝાઇન (Inline Link) */
.ad-public-link {
    color: #0ea318;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none !important;
    margin-left: 4px;
    transition: color 0.2s;
    white-space: nowrap;
}

.ad-public-link:hover {
    color: #075E54;
    text-decoration: underline !important;
}

/* 🚀 5. મુખ્ય ફોટો કન્ટેનર (ફ્લેક્સિબલ હાઈટ ફિક્સ) */
.ad-main-image-block {
    width: 100%;
    margin-bottom: 12px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

/* 🚀 ફોટો પોતે - પહોળાઈ ૧૦૦% અને ઊંચાઈ આખા ફોટા મુજબ */
.ad-main-image-block img {
    width: 100%;
    height: auto;
    /* 🚀 ઊંચાઈ ઓટોમેટિક સેટ થશે, ફોટો કપાશે નહિ */
    display: block;
    object-fit: contain;
    /* ફોટો આખો દેખાડવા માટે */
    transition: transform 0.3s ease;
}

/* 🎥 6. વિડીયો માટેનું સેટિંગ */
.ad-video-block {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    margin-bottom: 12px;
}

.ad-video-block iframe,
.ad-video-block video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    display: block;
}

/* 📝 7. કસ્ટમ HTML કોડ માટે */
.ad-custom-html {
    width: 100%;
    margin-bottom: 12px;
    overflow: hidden;
}

/* 🔘 8. સ્માર્ટ બટન્સની સિસ્ટમ (Rows Logic) */
.ad-btn-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ad-btn-row:last-child {
    margin-bottom: 0;
}

.ad-action-btn {
    flex: 1;

    padding: 14px;
    text-align: center;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    box-sizing: border-box;

    color: white;
    word-break: break-word;
    line-height: 1.2;
}

.ad-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* બટનના કલર્સ */
.ad-wa {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.ad-call {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* વધુ માહિતી બટન */
.ad-more-info {
    background: #075E54;
    color: white !important;
    border: none;
}

.ad-more-info:hover {
    background: #0ea318;
    box-shadow: 0 6px 15px rgba(14, 163, 24, 0.3);
}

/* 🚀 માસ્ટર ફિક્સ: જો ફોટો કે વિડીયો કાર્ડમાં છેલ્લો હોય, તો નીચેનું ડબલ માર્જિન ગાયબ થઈ જશે */
.card-content>.track-ad-action:last-child {
    margin-bottom: 3px !important;
}

/* 🚀 9. મોડલ (Modal) અને સ્ટીકી (Sticky) એડ્સ માટે સ્ટાઈલ */
.tachukdi-jaherat-space[data-placement="modal"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tachukdi-jaherat-space[data-placement="modal"] .native-ad-card {
    max-width: 450px;
    width: 100%;
    min-height: auto;
    /* Fix: do not stretch to 100% height */
    height: auto;
    max-height: 90vh;
    overflow: visible;
    /* Allow close button to overflow */
    animation: modalPopIn 0.3s ease-out;
}

.tachukdi-jaherat-space[data-placement="sticky"] {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 999998;
    background: transparent;
    box-shadow: none;
    padding: 0 15px;
    border-radius: 0;
    animation: slideUp 0.3s ease-out;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.tachukdi-jaherat-space[data-placement="sticky"] .native-ad-card {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    min-height: auto;
    height: auto;
    pointer-events: auto;
    overflow: visible;
    /* Allow close button to overflow */
}

.jaherat-close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 32px;
    height: 32px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 100;
    border: 2px solid white;
    line-height: 1;
}

.tachukdi-jaherat-space[data-placement="sticky"] .jaherat-close-btn {
    top: -15px;
    right: -10px;
}

.tachukdi-jaherat-space[data-placement="group"] .native-ad-card {
    overflow: visible;
}

.tachukdi-jaherat-space[data-placement="group"] .jaherat-close-btn {
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    font-size: 14px;
    z-index: 10;
    box-shadow: none;
    border: none;
}

/* વધુ જુઓ લિંક માટે લીટી કાઢવા */
.ad-public-link,
.ad-public-link:hover,
.ad-public-link:focus,
.ad-public-link:active {
    text-decoration: none !important;
}


@media (max-width: 600px) {
    .ad-action-btn {
        font-size: 0.95rem;
        padding: 12px 8px;
    }
}

@media (max-width: 400px) {
    .ad-action-btn {
        font-size: 0.9rem;
        padding: 10px 5px;
    }
}