/* =====================================================
   Al-Hujjah TV - Premium Desktop Layout
   ===================================================== */

:root {
    --brand-primary: #2d7a97;
    --brand-dark: #1e5367;
    --brand-light: #8cd3eb;
    --brand-glow: rgba(45, 122, 151, 0.1);
    --bg-white: #ffffff;
    --bg-body: #f8fafc;
    --txt-main: #1e293b;
    --txt-body: #475569;
    --txt-muted: #94a3b8;
    --border-light: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(45, 122, 151, 0.1);
    --glass-hover: rgba(45, 122, 151, 0.05);
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-premium: 0 20px 50px rgba(0,0,0,0.5);
}
/* 1. Header & Navigation Refinement */
.hj-top-bar {
    background: #000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hj-nav-bar {
    background: rgba(14, 26, 38, 0.85);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.main-portal-nav {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-portal-nav li a {
    color: #fff;
    padding: 18px 25px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.main-portal-nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--brand-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-portal-nav li a:hover::after {
    width: 40px;
}

.main-portal-nav li a:hover {
    color: var(--brand-light);
}

/* 2. News Ticker Bar (Hidden) */
.hj-news-ticker {
    display: none !important;
}

.ticker-title {
    background: var(--brand-primary);
    color: #fff;
    padding: 0 25px;
    display: flex;
    align-items: center;
    font-weight: 900;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    box-shadow: 10px 0 20px rgba(0,0,0,0.5);
}

.ticker-content {
    flex: 1;
    display: flex;
    align-items: center;
}

.ticker-scroll {
    display: flex;
    white-space: nowrap;
    animation: ticker-move 40s linear infinite;
    padding-right: 100%;
}

.ticker-item {
    color: var(--txt-main);
    padding: 0 30px;
    font-size: 0.95rem;
    font-weight: 600;
}

.ticker-item i {
    color: var(--brand-light);
    margin-left: 10px;
}

@keyframes ticker-move {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* 3. Redesigned Hero Section (Desktop) */
.hj-portal-hero.v2 {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 50px;
}

.hero-live-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    position: relative;
}

.hero-sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portal-widget {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 25px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    height: 100%;
}

.widget-h {
    border-bottom: 2px solid var(--bg-body);
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: var(--brand-primary);
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Specific styling for Frequency Widget */
.freq-widget-box {
    background: var(--brand-primary) !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(55, 122, 148, 0.3) !important;
}

.freq-widget-box .widget-h {
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.sat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sat-item strong {
    font-size: 1.3rem;
    color: #fff !important;
}

.sat-item span {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8) !important;
}

.freq-data {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.freq-data span {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

.freq-data strong {
    color: #fff !important;
    font-weight: 800;
}

/* 4. Multimedia Sections Layout */
.section-wrapper {
    margin-bottom: 80px;
}

.hj-sec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-light);
}

.hj-sec-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--brand-primary);
    margin: 0;
    position: relative;
}

.hj-sec-title::after {
    content: '';
    position: absolute;
    bottom: -17px;
    right: 0;
    width: 80px;
    height: 4px;
    background: var(--brand-primary);
}

.portal-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* 5. Premium Cinematic Cards */
.portal-news-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
}

.portal-news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.media-thumb-wrap {
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
}

.media-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.portal-news-card:hover .media-thumb-wrap img {
    transform: scale(1.1);
}

.media-type-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 50px;
    height: 50px;
    background: var(--brand-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 2;
}

.portal-news-card:hover .media-type-icon {
    opacity: 1;
    transform: scale(1);
}

.portal-news-body {
    padding: 20px;
}

.portal-news-cat {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--brand-primary);
    display: block;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.portal-news-h a {
    color: var(--txt-body);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.portal-news-card:hover .portal-news-h a {
    color: var(--brand-primary);
}

/* Fix View All Badge */
.portal-badge {
    background: var(--brand-primary) !important;
    color: #fff !important;
    padding: 6px 15px !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    display: inline-block;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.portal-badge:hover {
    background: var(--brand-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Audio Section Professional Strip */
.audio-strip-card {
    background: #fff;
    border: 1px solid var(--border-light);
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.audio-strip-card:hover {
    border-color: var(--brand-primary);
    background: var(--brand-glow);
    transform: translateX(-10px);
}

.audio-icon-box {
    width: 60px;
    height: 60px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Tablet & Smaller Desktop Adjustments */
@media (max-width: 1200px) {
    .hj-container { padding: 0 30px; }
    .portal-grid-4 { grid-template-columns: repeat(3, 1fr); }
    .hj-portal-hero.v2 { grid-template-columns: 1fr; }
    .hero-sidebar-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 992px) {
    .portal-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .main-portal-nav li a { padding: 15px; font-size: 0.9rem; }
}

/* Visibility Utilities */
.only-mobile { display: none !important; }
@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
    .only-mobile { display: block !important; }
    .only-mobile.flex { display: flex !important; }
}

/* =====================================================
   Al-Hujjah TV - Mobile layout updates
   ===================================================== */

@media (max-width: 768px) {
    /* --- Magazine Clean Canvas --- */
    body { background: #f4f7fa !important; color: #1e293b !important; }
    .hj-container { padding: 0 12px !important; }

    /* --- 1. Glass Header Details --- */
    .hj-top-bar { display: none !important; }
    .action-btn-glass { transition: transform 0.2s; }
    .action-btn-glass:active { transform: rotate(90deg) scale(0.9); }

    /* --- 2. Cover Hero Section --- */
    .hj-portal-hero.v2 {
        display: block !important;
        margin: 0 -12px 30px !important;
        padding: 0 !important;
    }

    .hero-live-container {
        border-radius: 0 0 35px 35px !important;
        overflow: hidden;
        border: none !important;
        box-shadow: 0 15px 40px rgba(0,0,0,0.12) !important;
    }

    .hero-sidebar-widgets {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 12px;
        margin-top: 25px;
    }

    .portal-widget {
        border-radius: 25px;
        background: #fff;
        padding: 22px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.03);
        border: 1px solid rgba(0,0,0,0.02);
    }

    /* --- 3. Magazine Section Titles (Centered) --- */
    .section-wrapper { 
        margin-bottom: 45px !important; 
    }
    
    .hj-sec-header {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        margin-bottom: 25px;
        border: none;
        padding: 0;
    }

    .hj-sec-title {
        font-size: 1.5rem;
        font-weight: 900;
        letter-spacing: -0.5px;
        color: #0f172a;
        position: relative;
        padding-bottom: 12px;
    }

    .hj-sec-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 20%;
        right: 20%;
        height: 3px;
        background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
    }

    /* --- 4. Vertical Magazine Grid (No Carousels) --- */
    .portal-grid-4 {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important; /* 2 Columns vertical */
        gap: 12px;
        padding: 0;
        margin: 0;
        overflow: visible !important;
    }

    .portal-news-card {
        flex: none !important;
        scroll-snap-align: none;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.02) !important;
        border: 1px solid rgba(0,0,0,0.04);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .portal-news-body { 
        padding: 12px; 
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .portal-news-h a { 
        font-size: 0.95rem; 
        font-weight: 700; 
        line-height: 1.3; 
        color: #1e293b; 
    }

    /* Magazine "View All" Button as Full-Width Link */
    .view-all-mob-card {
        display: flex !important;
        grid-column: 1 / -1; /* Across both columns */
        background: transparent !important;
        border: 1.5px solid var(--brand-primary);
        border-radius: 15px;
        margin-top: 10px;
        color: var(--brand-primary);
        padding: 12px;
        justify-content: center;
        font-weight: 800;
        box-shadow: none !important;
    }

    .view-all-content {
        flex-direction: row;
        gap: 10px;
    }
    .view-all-content i { font-size: 1.1rem; }

    /* Audio section Magazine Stack */
    .portal-grid-2-flex {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    /* --- 5. Clean White Menu --- */
    .mobile-menu-overlay {
        background: #fff !important; 
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: none !important; /* FORCED OFF BY DEFAULT */
        flex-direction: column;
        z-index: 9999;
        overflow-y: auto;
        padding: 60px 0;
    }
    
    .mobile-menu-inner {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .close-mobile-menu {
        position: absolute;
        top: 20px;
        left: 20px;
        font-size: 2.5rem;
        color: var(--brand-primary) !important;
        line-height: 1;
        z-index: 100;
    }

    .mobile-nav-logo {
        text-align: center;
        margin-bottom: 40px;
    }
    .mobile-nav-logo img { max-height: 80px; width: auto; }

    .mobile-nav-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-nav-list li a {
        color: #1e293b !important;
        font-size: 1.4rem;
        font-weight: 700;
        padding: 15px 30px;
        border-bottom: 1px solid #f8fafc;
        display: flex;
        justify-content: flex-start;
        text-decoration: none;
    }

    .hide-on-mobile { display: none !important; }
}

/* Small Device Adjustments */
@media (max-width: 480px) {
    .hj-sec-title {
        font-size: 1.3rem;
    }
    
    .ticker-title {
        font-size: 0.75rem;
        padding: 0 10px;
    }
}