/*
 Theme Name: Astra Child
 Theme URI: https://wpastra.com/
 Description: Astra Child Theme with Shrinking Sticky Header - Urdu
 Author: Muhammad Laraib
 Template: astra
 Version: 1.1.6
*/

/* ============================================
   IMPORT URDU FONT
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;500;600;700&display=swap');

/* ============================================
   FORCE URDU FONT EVERYWHERE
   Override Poppins from Astra parent theme
   ============================================ */
html body,
html body *,
html body *::before,
html body *::after {
    font-family: 'Noto Nastaliq Urdu', serif !important;
}

body,
p,
h1, h2, h3, h4, h5, h6,
.entry-title,
.entry-content,
.entry-content p,
.entry-content li,
.widget,
.widget *,
.ast-container,
.site-content,
.post-content,
.page-content,
.comment-content,
nav,
.main-navigation,
.main-navigation *,
.menu-item,
.menu-item a,
button,
input,
textarea,
select,
label,
span,
a,
li,
td, th,
blockquote,
.ast-above-header-bar,
.ast-below-header-bar,
.footer-widget-area,
.site-footer,
.site-footer * {
    font-family: 'Noto Nastaliq Urdu', serif !important;
}

/* Line height for Urdu readability */
body,
body p,
body li,
.entry-content,
.entry-content p {
    line-height: 2.4 !important;
}

/* ============================================
   RTL DIRECTION - content areas only
   ============================================ */
body {
    direction: rtl;
    text-align: right;
}

.site-content,
.entry-content,
.entry-header,
.widget,
.ast-container,
.ast-row,
.comment-content,
.page-content,
.post-content,
.woocommerce,
#secondary {
    direction: rtl;
    text-align: right;
}

/* Menu RTL */
.main-navigation ul {
    text-align: right;
}
.main-navigation li {
    float: right;
}
.main-navigation .sub-menu {
    right: 0;
    left: auto;
}

/* Logo spacing */
.site-logo-img {
    margin-left: 15px;
    margin-right: 0;
}

/* Lists */
ul, ol {
    padding-right: 20px;
    padding-left: 0;
}

/* ============================================
   PROTECT SLIDER & LTR WIDGETS FROM FONT+RTL
   ============================================ */
.am-slider-wrap,
.am-slider-wrap *,
.islamic-luxury-slider,
.islamic-luxury-slider *,
#almarifat-slider,
#almarifat-slider *,
#ams-wrap,
#ams-wrap *,
[class*="slick-"],
[class*="swiper-"],
[class*="owl-"],
iframe,
.map-container {
    font-family: 'DM Sans', 'Montserrat', sans-serif !important;
    direction: ltr !important;
}

/* ============================================
   PROTECT AUDIO PLAYER ICONS — Font Awesome Fix
   Problem: Noto Nastaliq overrides Font Awesome 6 Free
   causing icons to show as empty squares □
   Fix: explicitly restore Font Awesome on all
   sermon-controls elements and pseudo-elements
   ============================================ */
div.sermon-controls,
div.sermon-controls *,
div.sermon-controls button,
div.sermon-controls a,
div.sermon-controls span,
div.sermon-controls i {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands', sans-serif !important;
    direction: ltr !important;
}

div.sermon-controls *::before,
div.sermon-controls *::after {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands', sans-serif !important;
}

/* ============================================
   REMOVE ALL HEADER BORDERS
   ============================================ */
#masthead,
.site-header,
.ast-primary-header,
.ast-header-break-point #masthead,
.ast-header-break-point .site-header,
.main-header-bar,
.ast-header-sticked #masthead,
.site-branding,
.main-navigation {
    border: none !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
}

#masthead:before,
#masthead:after,
.main-header-bar:before,
.main-header-bar:after,
.ast-primary-header:before,
.ast-primary-header:after {
    display: none !important;
    content: none !important;
}

/* ============================================
   STICKY HEADER
   ============================================ */
#masthead.ast-sticky,
.site-header.ast-sticky {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

.ast-sticky,
.ast-sticky #masthead,
.ast-sticky .main-header-bar,
.ast-sticky .site-branding {
    border: none !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.ast-sticky .ast-above-header-bar,
.ast-sticky .ast-below-header-bar,
.ast-sticky .ast-primary-header-bar,
#masthead.ast-sticky .ast-above-header-bar,
#masthead.ast-sticky .main-header-bar {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none !important;
    outline: none !important;
}

.ast-sticky .ast-above-header-bar:before,
.ast-sticky .ast-above-header-bar:after,
.ast-sticky .ast-primary-header-bar:before,
.ast-sticky .ast-primary-header-bar:after {
    display: none !important;
    content: none !important;
}

/* ============================================
   SHRINKING STICKY HEADER
   ============================================ */
.ast-sticky .main-header-bar {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ast-sticky .site-logo-img img {
    max-height: 40px !important;
}

/* ============================================
   BODY PADDING WHEN STICKY
   ============================================ */
body {
    padding-top: 0 !important;
}

body.header-is-sticky {
    padding-top: 60px !important;
}

body.admin-bar.header-is-sticky #masthead.ast-sticky {
    top: 32px !important;
}

@media (max-width: 782px) {
    body.admin-bar.header-is-sticky #masthead.ast-sticky {
        top: 46px !important;
    }
}

/* ============================================
   TRANSITIONS
   ============================================ */
#masthead,
.main-header-bar,
.site-logo-img img {
    transition: all 0.3s ease !important;
}


/* ============================================================
   FIX 1: HERO SLIDER — MOBILE ONLY
   ============================================================ */
@media (max-width: 768px) {

    #ams-wrap,
    #ams-wrap *,
    .am-slider-wrap,
    .am-slider-wrap *,
    #almarifat-slider,
    #almarifat-slider * {
        direction: ltr !important;
        text-align: left !important;
    }

    #ams-wrap,
    .am-slider-wrap,
    #almarifat-slider {
        width: 100% !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }

    .ams-slide-content h1,
    .ams-slide-content h2,
    .am-slide-inner h1,
    .am-slide-inner h2,
    #almarifat-slider h1,
    #almarifat-slider h2 {
        font-size: clamp(1.2rem, 5vw, 2rem) !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        word-break: break-word !important;
    }

    .ams-slide-content p,
    .am-slide-inner p,
    #almarifat-slider p {
        font-size: clamp(0.8rem, 3.5vw, 1rem) !important;
        line-height: 1.7 !important;
    }

    .ams-prev, .ams-next,
    .am-prev, .am-next,
    [class*="slider-prev"],
    [class*="slider-next"] {
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 32px !important;
        height: 32px !important;
    }
}


/* ============================================================
   FIX 2: HEADINGS — PREVENT NOTO NASTALIQ CLIPPING
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    line-height: 2 !important;
    overflow: visible !important;
    white-space: normal !important;
}

h1 *, h2 *, h3 *, h4 * {
    overflow: visible !important;
}


/* ============================================================
   FIX 3: FOOTER — RESTORE FULL WIDTH
   ============================================================ */
.site-footer,
footer.site-footer,
#colophon {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
}

#colophon .ast-container,
.site-footer .ast-container,
#colophon > *,
.site-footer > * {
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.footer-widget-area,
.ast-footer-widget-area {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.ast-footer-bar,
.site-footer .ast-footer-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (max-width: 768px) {
    .site-footer,
    footer.site-footer,
    #colophon {
        overflow-x: hidden !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* ============================================================
   FIX 4: FOOTER COLUMN HEADING UNDERLINES
   ============================================================ */
span.afm-footer_col-title {
    position: relative !important;
    display: inline-block !important;
}

span.afm-footer_col-title::after {
    left: 0 !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
}


/* ============================================================
   MOBILE SLIDE MENU — v3.0.0
   All styles injected by bottom-nav.js
   Only Astra overrides here
   ============================================================ */

@media (max-width: 768px) {

    /* Hide Astra's default mobile menu elements */
    .ast-header-break-point .main-navigation,
    .ast-header-break-point #ast-mobile-header,
    .ast-mobile-header-wrap,
    .ast-header-break-point .ast-mobile-menu-trigger,
    button.menu-toggle,
    .menu-toggle {
        display: none !important;
    }

    /* PLACEHOLDER — keep closing brace below */
    body {
        padding-bottom: 0 !important;
    }

}