/* --- TelecomByte - Master Components Styles (Optimized & Consolidated) --- */

/* ==========================================================================
    1. GLOBAL RESET & STRICT CONTAINMENT
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box !important;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative;
}

body {
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    font-size: 15px;
    line-height: 1.5;
    color: #1f2124;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
    2. HEADER & NAVIGATION (Desktop UI Layer)
   ========================================================================== */
.site-header {
    background: #0F172A;
    padding: 8px 0;
    border-bottom: 2px solid #ffffff;
    position: relative;
}

.header-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-logo img, .custom-logo {
    display: block;
    max-height: 36px;
    width: auto;
}

.main-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    display: block;
    padding: 10px 0;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    transition: color .25s ease;
}

.nav-menu li a:hover {
    color: #60a5fa;
}

.current-menu-item > a, .current-menu-parent > a {
    color: #3b82f6 !important;
}

.current-menu-item > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 3px;
    background: #3b82f6;
    border-radius: 2px;
}

.mobile-menu-toggle {
    display: none !important;
}

/* ==========================================================================
    3. FRONT PAGE LAYOUT & HIGH-CONTRAST CARDS
   ========================================================================== */
.magazine-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    align-items: start;
}

.magazine-content {
    min-width: 0;
}

.hero-link {
    display: block;
    width: 100%;
}

.hero-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 480px;
    background-color: #0f172a;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.hero-image-wrapper {
    width: 100%;
    height: 100%;
}

.hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-link:hover .hero-card img {
    transform: scale(1.02);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 40%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    z-index: 3;
}

.hero-meta-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.category-tag {
    background: #2563eb;
    color: #ffffff;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.hero-date {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 500;
}

.hero-title {
    color: #ffffff !important;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 38px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0;
    max-width: 90%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 35px;
}

.grid-link {
    display: block;
    height: 100%;
}

.grid-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.05);
}

.grid-thumb-holder {
    width: 100%;
    height: 160px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.grid-card-body h4 {
    margin: 0 0 8px 0;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    color: #0f172a;
}

.grid-card-body .date {
    margin-top: auto;
    font-size: 12px;
    color: #64748b;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-wrapper a, .pagination-wrapper span {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-family: var(--font-display, system-ui, sans-serif);
    background: #ffffff;
}

.pagination-wrapper .current {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* ==========================================================================
    4. TIMELINE & TRENDING SIDEBAR ARCHITECTURE
   ========================================================================== */
.trending-sidebar-wrapper {
    min-width: 0;
    box-sizing: border-box;
}

.trending-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.sidebar-title {
    margin: 0 0 20px 0;
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    position: relative;
    padding-bottom: 8px;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: #2563eb;
    border-radius: 2px;
}

.trending-sidebar ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

.trending-sidebar li {
    margin-bottom: 20px !important;
    position: relative !important;
    padding-left: 24px !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

.trending-sidebar li:last-child {
    margin-bottom: 0 !important;
}

.trending-sidebar li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #cbd5e1;
    z-index: 2;
}

.trending-sidebar li a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    font-family: var(--font-display, system-ui, sans-serif) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: #1e293b;
    text-decoration: none;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    box-sizing: border-box;
    transition: color 0.2s ease;
}

.trending-sidebar li a:hover {
    color: #2563eb;
}

.trending-sidebar .date {
    margin-bottom: 4px;
    font-size: 11px;
    color: #64748b;
    font-family: var(--font-body, system-ui, sans-serif);
    font-weight: 500;
}

@media (min-width: 993px) {
    .trending-sidebar {
        position: sticky;
        top: 24px;
    }
}

/* ==========================================================================
    5. FOOTER
   ========================================================================== */
.site-footer {
    background-color: #0F172A;
    color: #94a3b8;
    padding: 40px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
    font-size: 13px;
}

.footer-links li a {
    color: #94a3b8 !important;
}

/* ==========================================================================
    6. MOBILE RESPONSIVENESS & CLS DEFENSE MATRIX
   ========================================================================== */
@media (max-width: 1024px) {
    .magazine-wrapper {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    .hero-card {
        height: 400px;
    }
    .hero-title {
        font-size: 30px;
    }
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-main-row {
        padding: 12px 20px !important;
    }

    /* CLS DEFENSE ENGINE: MOBILE ACCORDION STABILIZATION */
    .discover-more-container, 
    .mobile-accordion-wrapper {
        display: block !important;
        width: 100% !important;
        min-height: 295px !important; 
        contain-intrinsic-size: 295px !important;
        content-visibility: auto !important; 
        background-color: #ffffff;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-sizing: border-box;
    }

    .single-hero {
        margin-top: 20px !important;
        contain: layout style;
    }

    /* Pure CSS Hamburger Menu UI */
    .mobile-menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 24px;
        height: 18px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 9999;
        position: relative;
    }

    .mobile-menu-toggle::before,
    .mobile-menu-toggle::after,
    .mobile-menu-toggle span {
        content: "";
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: #ffffff;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-menu-toggle.is-active::before {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-toggle.is-active span {
        opacity: 0;
        transform: translateX(-10px);
    }
    .mobile-menu-toggle.is-active::after {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    .main-navigation {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #0F172A;
        padding: 10px 0;
        z-index: 9998;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-navigation.is-active {
        display: block !important;
    }

    .main-navigation.is-active .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .nav-menu li {
        width: 100% !important;
        display: block !important;
    }

    .nav-menu li a {
        display: block !important;
        padding: 16px 24px !important;
        width: 100% !important;
        color: #ffffff !important;
        font-family: var(--font-display, system-ui, sans-serif) !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-sizing: border-box !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .nav-menu li a:hover {
        background: rgba(255, 255, 255, 0.05) !important;
        color: #60a5fa !important;
    }

    .current-menu-item > a::after {
        display: none !important;
    }

    .post-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (min-width: 769px) {
    .main-navigation {
        display: flex !important;
    }
}