/*
Theme Name:   قناة الحجة الفضائية - النسخة المطورة
Description:  قالب احترافي مستوحى من كبريات القنوات الإخبارية - Child Theme for Astra
Author:       Al-Hujjah TV
Template:     astra
Version:      1.2.0
Text Domain:  astra-hujjah
*/

@import url("../astra/style.css");

:root {
    /* Brand Colors (Teal from Logo) */
    --brand-primary: #377a94;
    --brand-light: #5faac7;
    --brand-dark: #1d5b74;
    --brand-glow: rgba(55, 122, 148, 0.1);

    /* Portal Colors (Traditional News) */
    --bg-body: #f4f7f9;
    --bg-white: #ffffff;
    --bg-dark: #0e1a26;
    --txt-main: #2c3e50;
    --txt-muted: #7f8c8d;
    --txt-white: #ffffff;
    --border-light: #e1e8ed;

    /* Layout */
    --font-main: 'Cairo', sans-serif;
    --radius: 8px;
    --transition: all 0.3s ease;
    --container: 1300px;
}

/* =====================================================
   Global Resets
   ===================================================== */
body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--txt-main);
    direction: rtl;
    line-height: 1.6;
}

a {
    text-decoration: none;
    transition: var(--transition);
}

.hj-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 15px;
}

/* =====================================================
   Header - Professional News Layout
   ===================================================== */

/* Top Bar */
.hj-top-bar {
    background: var(--bg-dark);
    color: var(--txt-white);
    padding: 8px 0;
    font-size: 0.85rem;
}

.top-bar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
}

.hj-date-info {
    display: flex;
    gap: 20px;
}

.hj-date-info span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hijri-date-top {
    color: var(--brand-light);
    font-weight: 700;
}

.hj-prayer-times {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 15px;
    border-radius: 20px;
}

.hj-prayer-times span {
    color: var(--brand-light);
    font-weight: 700;
}

.hj-prayer-times i {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Main Header */
.hj-main-header {
    background: var(--bg-white);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

/* Main Header Components */
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.hj-brand-wrap {
    display: flex;
    align-items: center;
    gap: 25px;
}

.hj-logo img {
    max-height: 90px;
    width: auto;
}

.hj-calligraphy {
    display: flex;
    flex-direction: column;
    border-right: 2px solid var(--bg-body);
    padding-right: 25px;
}

.calligraphy-text {
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--brand-primary);
    line-height: 1.2;
}

.calligraphy-sub {
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--txt-muted);
    font-weight: 700;
}

.header-social-wrap {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px !important;
}

.header-social {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
}

.header-social a {
    width: 32px;
    height: 32px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-body);
    color: var(--brand-primary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.header-social a:hover {
    background: var(--brand-primary);
    color: #fff;
}

.header-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 15px;
    border-right: 2px solid var(--bg-body);
    padding-right: 20px;
    margin-right: 20px;
}

.action-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    color: var(--brand-primary);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn i {
    font-size: 1.1rem;
}

.action-btn:hover {
    color: var(--brand-light);
}

/* Navigation */
.hj-nav-bar {
    background: var(--brand-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hj-nav-bar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.hj-nav-bar li a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.hj-nav-bar li a:hover,
.hj-nav-bar li.current-menu-item a {
    background: var(--brand-dark);
}

/* =====================================================
   Homepage Sections - Phase 2 Refined
   ===================================================== */

/* Hero Grid V2 */
.hj-portal-hero.v2 {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
    margin-top: 30px;
}

.hero-programs-slider {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-main-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-main-card:hover img {
    transform: scale(1.03);
}

.slider-caption-portal {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: #fff;
}

.portal-badge {
    background: var(--brand-primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
}

.slider-caption-portal h2 {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 10px 0;
}

/* Widgets Styling */
.hero-sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portal-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.widget-h {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-body);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Prayer Times */
.prayer-times-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.prayer-item {
    background: var(--bg-body);
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.prayer-item span {
    color: var(--txt-muted);
}

.prayer-item strong {
    color: var(--brand-primary);
    font-weight: 900;
}

.widget-footer-date {
    margin-top: 20px;
    text-align: center;
    font-size: 0.82rem;
    color: #fff;
    font-weight: 700;
    background: var(--brand-primary);
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(55, 122, 148, 0.2);
}

.hj-date-sep {
    opacity: 0.5;
}

/* Frequency Widget */
.freq-widget-box {
    background: var(--brand-primary);
    color: #fff;
    border: none;
}

.freq-widget-box .widget-h {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.sat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sat-item strong {
    font-size: 1.2rem;
}

.freq-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Multimedia Grid Styles */
.media-thumb-wrap {
    position: relative;
    overflow: hidden;
}

.media-type-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Audio Strip */
.portal-grid-2-flex {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.audio-strip-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-body);
    border-radius: 8px;
    transition: var(--transition);
}

.audio-strip-card:hover {
    background: var(--brand-glow);
    transform: translateX(-5px);
}

.audio-icon-box {
    width: 50px;
    height: 50px;
    background: var(--bg-white);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.audio-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.audio-title a {
    color: var(--txt-main);
}

.audio-date {
    font-size: 0.75rem;
    color: var(--txt-muted);
}

/* =====================================================
   Homepage Sections
   ===================================================== */

/* Hero Slider */
.hj-portal-hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.main-slider {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 30px;
    color: #fff;
}

.side-news {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.side-news-item {
    background: var(--bg-white);
    padding: 10px;
    border-radius: var(--radius);
    display: flex;
    gap: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.side-news-thumb {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.side-news-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--txt-main);
}

/* Section Controls */
.section-wrapper {
    margin-top: 40px;
}

.hj-sec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.hj-sec-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--brand-primary);
    position: relative;
}

.hj-sec-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 0;
    width: 60px;
    height: 3px;
    background: var(--brand-primary);
}

/* Vertical News (Karbala style) */
.portal-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.portal-news-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border-bottom: 3px solid var(--brand-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.portal-news-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.portal-news-body {
    padding: 15px;
}

.portal-news-cat {
    display: inline-block;
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.portal-news-h {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.4;
}

/* =====================================================
   Footer - Solid Professional
   ===================================================== */
.portal-footer {
    background: var(--bg-dark);
    color: #fff;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-grid-4 {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    color: var(--brand-light);
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--brand-light);
    padding-right: 5px;
}

.footer-bottom {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 1024px) {

    .hj-portal-hero,
    .portal-grid-3,
    .footer-grid-4 {
        grid-template-columns: 1fr;
    }

    .side-news {
        flex-direction: row;
        overflow-x: auto;
    }

    .side-news-item {
        min-width: 280px;
    }
}

/* =====================================================
   Search Overlay
   ===================================================== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 26, 38, 0.98);
    backdrop-filter: blur(15px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-search {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: transform 0.3s;
}

.close-search:hover {
    transform: rotate(90deg) scale(1.1);
    color: var(--brand-light);
}

.search-overlay-content {
    width: 100%;
    max-width: 800px;
    padding: 0 20px;
    text-align: center;
    transform: translateY(30px);
    transition: transform 0.4s;
}

.search-overlay.active .search-overlay-content {
    transform: translateY(0);
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    font-size: 2.5rem;
    color: #fff;
    font-family: var(--font-main);
    transition: border-color 0.3s;
}

.search-field:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.search-submit {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    position: absolute;
    left: 0;
    cursor: pointer;
}

.search-hint {
    color: rgba(255, 255, 255, 0.4);
    margin-top: 20px;
    font-size: 0.95rem;
}

/* =====================================================
   Homepage Live Player
   ===================================================== */
.hero-live-player {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.live-badge-home {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #ff0000;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-weight: 900;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 0, 0, 0.3);
}

.live-badge-home span {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-live 1.2s infinite;
}

@keyframes pulse-live {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Video Logo Mask for SRT */
.hero-live-player { position: relative; overflow: hidden; }
.video-logo-mask {
    position: absolute;
    bottom: 45px;
    left: 20px;
    width: 250px;
    height: 80px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border-radius: 8px;
    z-index: 10;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .video-logo-mask {
        width: 150px;
        height: 50px;
        bottom: 35px;
        left: 10px;
    }
}

/* =====================================================
   Essential Layout Helpers (Fixed)
   ===================================================== */
.only-mobile { display: none !important; }
.hide-on-mobile { display: block; }

@media (max-width: 768px) {
    .only-mobile { display: flex !important; }
    .hide-on-mobile { display: none !important; }
}

/* Hide Mobile Menu by default on Desktop */
.mobile-menu-overlay {
    display: none;
}

.mobile-logo {
    max-width: 100px;
    height: auto;
}

/* =====================================================
   Portal Layout Components (Restored)
   ===================================================== */
.portal-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.portal-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.portal-news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-bottom: 3px solid var(--brand-primary);
    transition: var(--transition);
}

.portal-news-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }

.media-thumb-wrap { position: relative; height: 180px; overflow: hidden; }
.media-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.media-type-icon {
    position: absolute; top: 10px; right: 10px;
    width: 32px; height: 32px; background: rgba(0,0,0,0.5);
    color: #fff; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 0.8rem;
}

.portal-news-body { padding: 15px; }
.portal-news-cat { color: var(--brand-primary); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.portal-news-h { font-size: 1rem; margin-top: 8px; line-height: 1.4; }
.portal-news-h a { color: var(--txt-main); }

/* Audio Section */
.portal-grid-2-flex {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.audio-strip-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafb;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.audio-icon-box {
    width: 45px; height: 45px; background: var(--brand-primary);
    color: #fff; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 1.2rem;
}

.audio-title { font-size: 0.95rem; margin: 0; }
.audio-date { font-size: 0.75rem; color: var(--txt-muted); }

/* Widgets */
.hero-sidebar-widgets { display: flex; flex-direction: column; gap: 20px; }
.portal-widget { background: #fff; padding: 25px; border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.widget-h { font-size: 1.1rem; border-bottom: 2px solid var(--brand-glow); padding-bottom: 10px; margin-bottom: 15px; }

@media (max-width: 991px) {
    .portal-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .portal-grid-2-flex { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .portal-grid-4 { grid-template-columns: 1fr; }
}
