/* Header Styles */
.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-urdu {
    font-family: var(--font-arabic);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-dark);
}

.logo-eng {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.main-nav ul {
    display: flex;
    gap: 2.5rem;
}

.main-nav a {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
    padding-bottom: 0.25rem;
}

.main-nav a:hover {
    color: var(--color-gold-primary);
}

.main-nav a.active {
    color: var(--color-gold-primary);
    border-bottom: 2px solid var(--color-gold-primary);
}

/* Mobile Hamburger Menu Button */
.mobile-menu-btn {
    display: none;
    background-color: #2a2015;
    color: var(--color-gold-light);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background-color: var(--color-gold-primary);
    color: #fff;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: max(100vh, 700px);
    max-height: 960px;
    display: flex;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero-bg-layer {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.hero-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(to right, var(--color-bg-cream) 0%, var(--color-bg-cream) 50%, rgba(244, 239, 230, 0) 100%);
}

.hero-container {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Hero Left Content */
.hero-content {
    max-width: 550px;
    padding-right: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 60px; /* Space above stats bar */
    position: relative;
    z-index: 10; /* Keep text above the card */
}

.hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(212, 195, 163, 0.25);
    border: 1px solid rgba(212, 195, 163, 0.45);
    padding: 0.4rem 1rem;
    border-radius: 30px;
    margin-bottom: 1.25rem;
    align-self: flex-start;
}

.hero-tagline .tagline-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-gold-subtitle);
    text-transform: uppercase;
}

.hero-tagline i {
    font-size: 1.15rem;
    color: var(--color-gold-primary);
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.08;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero-title .title-gold {
    color: var(--color-gold-primary);
}

.hero-title .title-dark {
    color: var(--color-text-dark);
}

/* Ornamental divider above calligraphy */
.hero-subtitle-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    width: 80px;
}

.hero-subtitle-divider .sub-line {
    flex: 1;
    height: 1px;
    background-color: var(--color-gold-subtitle);
    opacity: 0.7;
}

.hero-subtitle-divider i {
    font-size: 0.7rem;
    color: var(--color-gold-subtitle);
}

/* Arabic Calligraphy Image */
.hero-calligraphy {
    margin-bottom: 1.25rem;
    max-width: 440px;
}

.hero-calligraphy-img {
    width: 100%;
    max-width: 440px;
    height: auto;
    display: block;
    object-fit: contain;
}

.hero-desc {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.65;
    color: var(--color-text-desc);
    margin-bottom: 2rem;
    max-width: 520px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-circle-icon {
    width: 22px;
    height: 22px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    padding-left: 2px;
}

/* Hero Right Visuals */
.hero-visuals {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 55%; /* Take up the right 55% of the entire screen */
    height: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end; /* Anchors portrait flush to the bottom */
    z-index: 2;
    pointer-events: none; /* Let clicks pass through empty transparent areas */
}

.portrait-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: 100%;
    pointer-events: auto; /* Re-enable pointer events for the image and cards */
    transform: translateX(5%); /* Push slightly off the right edge of the screen */
}

.hero-portrait {
    max-height: min(85vh, 780px); /* Made slightly smaller and capped for tall screens */
    width: auto;
    max-width: 100vw; 
    object-fit: contain;
    object-position: bottom right;
    z-index: 2;
}

/* Combined Info Card (Arch) */
.info-card-tall {
    position: absolute;
    top: 50%;
    left: 35%;
    transform: translate(-50%, -70%);
    background-color: var(--color-bg-cream);
    border: 1px solid var(--color-gold-light);
    border-radius: 200px 200px 0 0;
    width: 210px; /* Reduced width as requested */
    padding: 2.5rem 1.25rem 1.5rem; /* Adjusted padding for smaller width */
    text-align: center;
    z-index: -1; /* Goes behind the portrait inside the wrapper's stacking context */
    box-shadow: 0 15px 35px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.info-card-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.badge-ornament {
    color: var(--color-gold-primary);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.badge-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.badge-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gold-primary);
    letter-spacing: 0.1em;
    line-height: 1.4;
}

.card-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-gold-light);
    margin: 1.5rem 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-divider i {
    background-color: var(--color-bg-cream);
    padding: 0 0.5rem;
    color: var(--color-gold-primary);
    font-size: 0.75rem;
}

.quote-content {
    text-align: center;
}

.quote-icon {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--color-gold-primary);
    line-height: 0.5;
    margin-bottom: 0.5rem;
}

.quote-text {
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    font-style: italic;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.quote-source {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-gold-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Stats Bar Section */
.stats-bar-section {
    position: relative;
    z-index: 20;
    margin-top: -60px; /* Pull up over hero */
    padding-bottom: 60px;
}

.stats-container {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    overflow: hidden;
}

.stats-left {
    flex: 2;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2.5rem 1rem;
}

.stat-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border: 1px solid var(--color-gold-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-dark);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-text-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
}

.stat-divider {
    width: 1px;
    height: 80px;
    background-color: rgba(0,0,0,0.05);
}

.stats-right {
    flex: 1;
    background-color: var(--color-stats-bg);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    position: relative;
}

.stats-arabic-text {
    font-family: var(--font-arabic);
    direction: rtl;
    color: var(--color-text-dark);
    z-index: 2;
}

.stats-arabic-small {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stats-arabic-large {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.stats-ornament {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-gold-primary);
    font-size: 1.25rem;
    opacity: 0.5;
}

/* Responsive & Layout Rules */

/* 1. Hide the tall arch card below 1700px */
@media (max-width: 1700px) {
    .info-card-tall {
        display: none !important;
    }
}

/* 2. Intermediate desktop scaling (1081px - 1300px) */
@media (max-width: 1300px) {
    .hero-title {
        font-size: 4rem;
    }
    .hero-content {
        max-width: 460px;
    }
    .hero-portrait {
        max-height: min(80vh, 680px);
    }
}

/* 3. Tablet and Mobile (<= 1080px OR portrait orientation on <= 1200px) */
@media (max-width: 1080px), (orientation: portrait) and (max-width: 1200px) {
    /* Header: Swap navigation with hamburger menu */
    .header-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 1.5rem !important;
    }

    .main-nav,
    .header-action {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    /* Hero Section: Flow text, then full-width portrait */
    .hero-section {
        flex-direction: column !important;
        min-height: auto !important;
        max-height: none !important;
        height: auto !important;
        padding-top: calc(var(--header-height) + 1.5rem) !important;
        padding-bottom: 0 !important;
        overflow: hidden !important;
    }

    .hero-bg-layer {
        width: 100%;
        height: 100%;
        opacity: 0.12;
    }
    
    .hero-bg-gradient {
        display: none;
    }

    /* Left-aligned text matching reference mockup */
    .hero-container {
        display: flex !important;
        flex-direction: column !important;
        text-align: left !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 1.5rem 1rem !important;
    }

    .hero-content {
        max-width: 600px !important;
        width: 100% !important;
        padding: 0 !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .hero-tagline {
        justify-content: flex-start !important;
        margin-bottom: 1rem !important;
    }

    .hero-title {
        font-size: clamp(2.75rem, 5vw, 3.75rem) !important;
        text-align: left !important;
        line-height: 1.12 !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-subtitle-divider {
        justify-content: flex-start !important;
        margin-bottom: 0.75rem !important;
    }

    .hero-subtitle {
        justify-content: flex-start !important;
        text-align: left !important;
        margin-bottom: 1.25rem !important;
    }

    .hero-subtitle::before, 
    .hero-subtitle::after {
        display: none !important;
    }

    .hero-desc {
        text-align: left !important;
        margin: 0 0 1.75rem 0 !important;
        max-width: 520px !important;
    }

    .hero-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Full-screen width author portrait: spans edge-to-edge with no cutoff gaps */
    .hero-visuals {
        position: relative !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
        pointer-events: auto !important;
    }

    .portrait-wrapper {
        position: relative !important;
        transform: none !important;
        width: 100% !important;
        display: block !important;
        height: auto !important;
        line-height: 0 !important;
    }

    .hero-portrait {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        display: block !important;
        object-fit: cover !important;
        object-position: bottom center !important;
    }

    .info-card-tall {
        display: none !important;
    }

    /* Stats Bar Section: Sits right below the author desk */
    .stats-bar-section {
        position: relative !important;
        z-index: 20 !important;
        margin-top: 0 !important;
        padding: 2rem 1.5rem 4rem !important;
        background-color: var(--color-bg-cream) !important;
    }

    .stats-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* Tablet Stats: 4 across in a single row */
    .stats-left {
        background-color: #fff !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        padding: 2.5rem 1rem !important;
        align-items: center !important;
    }

    .stat-divider {
        display: none !important;
    }

    .stat-item {
        border-right: 1px solid rgba(0,0,0,0.06);
    }
    
    .stat-item:last-of-type {
        border-right: none !important;
    }

    /* Arabic Hadith card below stats */
    .stats-right {
        background-color: var(--color-stats-bg) !important;
        border: 1px solid var(--color-gold-light) !important;
        border-radius: 12px !important;
        padding: 2rem 1.5rem !important;
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.04) !important;
    }
}

/* 4. Mobile Devices (< 768px): 2 stats per row, stacked buttons (matches reference mockup) */
@media (max-width: 767px) {
    .header-container {
        padding: 0 1.25rem !important;
    }

    .hero-container {
        padding: 0 1.25rem 0.5rem !important;
    }

    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.15 !important;
    }

    .hero-desc {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    .hero-buttons {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }

    .hero-buttons .btn {
        width: auto !important;
        min-width: 210px !important;
    }

    /* Mobile Stats: 2 per row */
    .stats-bar-section {
        padding: 1.5rem 1.25rem 3.5rem !important;
    }

    .stats-left {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem 1rem !important;
        padding: 2rem 1.25rem !important;
    }

    .stat-item {
        border-right: none !important;
    }

    .stat-item:nth-of-type(1),
    .stat-item:nth-of-type(3) {
        border-right: 1px solid rgba(0,0,0,0.06) !important;
    }

    .stats-right {
        padding: 1.75rem 1.25rem !important;
    }

    .stats-arabic-large {
        font-size: 1.25rem !important;
    }
}
