/* =================================================================*********
 *  Mobile News Theme - Main Stylesheet
 *  Version: 1.0.1
 *  Description: Core styles for the Mobile News theme.
 * =================================================================********* */

/* ------------------------------------------------------------------------- *
 *  1. Variables & Custom Properties
 * ------------------------------------------------------------------------- */
:root {
    /* Colors */
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --secondary-color: #6c757d;
    --accent-color: #ffd700;

    /* Backgrounds */
    --background-body: #f8f9fa;
    --background-white: #ffffff;
    --background-dark: #212529;

    /* Standardized Body & Surface (Tailwind Sync) */
    --background-body-light: #f8f9fa;
    --background-body-dark: #09090b;
    --background-surface-light: #ffffff;
    --background-surface-dark: #18181b;


    /* Text */
    --text-main: #333333;
    --text-light: #555555;
    --text-muted: #888888;
    --text-white: #ffffff;

    /* Typography */
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Lora', serif;
    --line-height-base: 1.6;
    --line-height-heading: 1.2;

    /* Spacing & Layout */
    --container-width: 1440px;
    --gap-sm: 1rem;
    --gap-md: 1.5rem;
    --gap-lg: 2rem;

    /* UI Elements */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.15);

    /* Border Colors Default */
    --border-color: #e9ecef;
}

/* ------------------------------------------------------------------------- *
 *  Detailed Dark Mode Variables
 * ------------------------------------------------------------------------- */
.dark {
    --text-main: #f4f4f5;           /* Zinc-100 */
    --text-light: #a1a1aa;          /* Zinc-400 */
    --text-muted: #71717a;          /* Zinc-500 */
    --text-white: #ffffff;

    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}



/* ------------------------------------------------------------------------- *
 *  2. Reset & Global Styles
 * ------------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-body);
    color: var(--text-main);
    line-height: var(--line-height-base);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--line-height-heading);
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-main);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

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

/* ------------------------------------------------------------------------- *
 *  3. Layout Utilities
 * ------------------------------------------------------------------------- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gap-md);
    width: 100%;
}

.site-main {
    padding-bottom: 4rem;
}

/* Grid System */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap-md);
    margin-bottom: 3rem;
}

/* Flex Utilities */
.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* ------------------------------------------------------------------------- *
 *  4. Site Header
 * ------------------------------------------------------------------------- */
.site-header {
    background: var(--background-white);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding .site-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-branding .site-title a {
    color: var(--text-main);
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--text-main);
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* ------------------------------------------------------------------------- *
 *  5. Hero Section
 * ------------------------------------------------------------------------- */
.hero-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.hero-post {
    position: relative;
    height: 500px;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background-color: var(--secondary-color);
    /* Fallback */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.hero-content {
    width: 100%;
    padding: 2.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    color: var(--text-white);
}

.hero-cat {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.hero-cat a {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

.hero-cat a:hover {
    background: var(--primary-dark);
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.1;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-title a {
    color: inherit;
    text-decoration: none;
}

.hero-meta {
    font-size: 0.9rem;
    opacity: 0.9;
    font-family: var(--font-heading);
}

/* ------------------------------------------------------------------------- *
 *  6. Components
 * ------------------------------------------------------------------------- */
/* Section Headers */
.section-header {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}


.section-title {
    font-size: 1.5rem;
    margin: 0;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.85rem;
    /* Matches padding + border width adjustment */
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

/* News Cards */
.news-card {
    background: var(--background-white);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.dark .news-card {
    background: linear-gradient(145deg, #18181b, #121214);
}


.news-card-image {
    position: relative;
    padding-top: 60%;
    /* Aspect Ratio */
    overflow: hidden;
}

.news-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.news-card-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
    font-weight: 700;
}

.news-card-title a {
    color: var(--text-main);
}

.news-card-title a:hover {
    color: var(--primary-color);
}

.news-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
}

/* Read More Button */
.btn-read-more {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    font-family: var(--font-heading);
}

/* ------------------------------------------------------------------------- *
 *  7. Site Footer
 * ------------------------------------------------------------------------- */
.site-footer {
    background: var(--background-dark);
    color: #adb5bd;
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.widget-title {
    color: var(--text-white);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.site-footer a {
    color: #ced4da;
}

.site-footer a:hover {
    color: var(--text-white);
}

.dark .site-footer {
    background: #09090b;
    border-top: 1px solid var(--border-color);
}


.site-info {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------------------- *
 *  8. Responsive Media Queries
 * ------------------------------------------------------------------------- */
@media (max-width: 992px) {
    :root {
        --container-width: 960px;
    }
}

@media (max-width: 768px) {
    :root {
        --container-width: 100%;
        --gap-md: 1rem;
    }

    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-navigation ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-post {
        height: 350px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------------- *
 *  9. Pagination
 * ------------------------------------------------------------------------- */
.navigation.pagination {
    margin-top: 3rem;
    text-align: center;
}

.nav-links {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a,
.nav-links span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.dark .nav-links a,
.dark .nav-links span {
    background: var(--background-white);
}


.nav-links a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-links span.current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ------------------------------------------------------------------------- *
 *  10. News Ticker Animation
 * ------------------------------------------------------------------------- */
.mobilenews-ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.mobilenews-ticker-move {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 40s linear infinite;
    padding-left: 100%;
    /* Start from outside */
}

/* If we duplicated content via PHP, we use a different strategy for seamless loop */
/* Overriding standard move for seamless loop since content IS duplicated in PHP */
.mobilenews-ticker-move {
    padding-left: 0;
    width: max-content;
    /* Ensure container fits all items */
}

@keyframes ticker-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

.mobilenews-ticker-move:hover {
    animation-play-state: paused;
}

/* ------------------------------------------------------------------------- *
 *  11. Mobile Native Experience (Sidebar Drawer)
 * ------------------------------------------------------------------------- */

/* Safe Area Support */
:root {
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

.pb-safe {
    padding-bottom: var(--safe-area-bottom);
}

/* Overlay Backdrop */
/* Overlay Backdrop handled by Tailwind */



/* Sidebar Drawer */
#mobile-menu-container {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

/* Sidebar Drawer handled partially by Tailwind */

/* Fix Mobile Header Alignment */
@media (max-width: 1279px) {
    .site-header .header-container {
        position: relative;
    }

    .site-branding {
        transition: all 0.3s ease;
    }

    body.overflow-hidden {
        overflow: hidden !important;
        touch-action: none;
    }
}

/* Drawer Navigation Styles */
#mobile-menu-container .menu-item {
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#mobile-menu-container .menu-item:active {
    background-color: rgba(59, 130, 246, 0.1);
    transform: scale(0.98);
}

/* Bottom Nav Fixes */
#mobile-bottom-nav {
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Adjust body padding for bottom nav */
@media (max-width: 1279px) {
    body {
        padding-bottom: calc(70px + var(--safe-area-bottom, 0px) + 1.5rem);
    }
}


/* Active State Indicator */
#mobile-bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 0 0 100px 100px;
    box-shadow: 0 4px 10px rgba(var(--color-primary-rgb), 0.3);
}

#mobile-bottom-nav a.active .material-symbols-outlined {
    transform: translateY(-2px);
    color: var(--color-primary);
}


/* --- Mobile Sidebar Premium Polish --- */

/* Utility: Hide Scrollbar */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Drawer Search Input */
#mobile-menu-container input[type="search"] {
    outline: none;
    box-shadow: none;
}

#mobile-menu-container input[type="search"]:focus {
    background-color: transparent;
    box-shadow: 0 0 0 2px rgba(22, 128, 152, 0.1);
}

.dark #mobile-menu-container input[type="search"]:focus {
    background-color: rgba(255, 255, 255, 0.03);
}

/* Menu Item Transitions */
#mobile-menu-container .menu-item > div {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-container .menu-item:active > div {
    transform: scale(0.97);
}

/* Submenu Icon Rotation */
.mobile-menu-toggle span {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Social Icon Hover Effects */
#mobile-menu-container .social-links a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#mobile-menu-container .social-links a:active {
    transform: scale(0.9);
}

/* User Profile Section Glow */
#mobile-menu-container .shrink-0.bg-primary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #fff);
    pointer-events: none;
}

.dark #mobile-menu-container .shrink-0.bg-primary::after {
    background: linear-gradient(to bottom, transparent, #18181b);
}
/* --- Archive Layout Variants --- */
.news-card-list {
    flex-direction: row;
    align-items: center;
    gap: var(--gap-md);
}

.news-card-list .news-card-image {
    width: 300px;
    padding-top: 180px; /* Fixed height for list view image */
    flex-shrink: 0;
}

.news-card-list .news-card-content {
    padding-left: 0;
}

.news-card-grid {
    flex-direction: column;
}

.news-card-grid .news-card-image {
    width: 100%;
    padding-top: 60%;
}

@media (max-width: 768px) {
    .news-card-list {
        flex-direction: column;
        align-items: stretch;
    }
    .news-card-list .news-card-image {
        width: 100%;
        padding-top: 60%;
    }
    .news-card-list .news-card-content {
        padding: 1.25rem;
    }
}

/* ========================================================================== *
 *  3. Premium UI Utilities
 * ========================================================================== */

/* Glassmorphism Overlays */
.glass-overlay {
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.light .glass-overlay {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Premium Card lifting */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.hero-grid-main {
    display: flex;
    flex-direction: column;
}

.hero-grid-main .glass-overlay {
    padding: 2rem 2.5rem !important; /* Larger padding for featured story */
    margin: 0 !important;
    border-radius: 1.5rem !important;
}

.hero-grid-main h2 {
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: -0.05em;
    font-weight: 900;
}

.hover-lift:hover {


    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
}

/* Section Header Premium Accent */
.section-title {
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 4px;
    background: #007bff; /* Primary Fallback */
    background: var(--primary-color);
    border-radius: 2px;
}

/* Floating Glass Bar for Social Sharing */
.floating-glass-bar {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1.5rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
    z-index: 45;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .floating-glass-bar {
    background: rgba(31, 31, 35, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Search Entry/Exit Animations */
@keyframes overlaySlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#mobilenews-search-overlay.active {
    display: flex !important;
    animation: overlayFadeIn 0.3s forwards;
}

#mobilenews-search-overlay.active .max-w-\[960px\] {
    animation: overlaySlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive Polish & Tuning --- */
@media (max-width: 768px) {
    /* Reduce aggressive rounding on mobile */
    .rounded-4xl { border-radius: 1.5rem !important; }
    .rounded-3xl { border-radius: 1rem !important; }
    
    /* Optimize Glass Overlays for small screens */
    .glass-overlay {
        padding: 1.25rem !important;
        margin: 1rem !important;
        border-radius: 1rem !important;
    }
    
    .hero-grid-main .glass-overlay {
        bottom: 1rem !important;
        left: 1rem !important;
        right: 1rem !important;
    }

    /* Category Blocks Spacing */
    .category-spotlight-block {
        margin-bottom: 2.5rem;
    }

    .flex-col.gap-16 {
        gap: 2.5rem !important;
    }

    /* Section Titles */
    .section-title {
        font-size: 1.5rem !important;
    }

    .flex.items-center.gap-4.mb-8 {
        margin-bottom: 1.5rem !important;
    }

    /* Latest Stream Spacing */
    .flex.flex-col.md\:flex-row.gap-6 {
        gap: 1rem !important;
        margin-bottom: 2rem !important;
    }
}

/* Global Widget Rounding */
.widget, .bg-white.dark\:bg-zinc-900.border.rounded-2xl {
    border-radius: 2rem !important;
}



/* Support for very small devices */
@media (max-width: 380px) {
    .floating-glass-bar {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }
    
    .floating-glass-bar span {
        display: none; /* Hide 'Bagikan' text to save space */
    }
}




/* 12. Premium Utility Effects */
.glass-overlay { background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.3s ease; }
.dark .glass-overlay { background: rgba(9, 9, 11, 0.6); border-color: rgba(255, 255, 255, 0.05); }
.hover-lift { transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* 13. News Card Components */
.news-card { background: var(--background-surface-light); border-radius: 1.5rem; overflow: hidden; border: 1px solid var(--border-color); transition: all 0.3s ease; display: flex; flex-direction: column; }
.dark .news-card { background: var(--background-surface-dark); }
.news-card-image { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.news-card-image img { width: 100%; h-full: 100%; object-fit: cover; transition: transform 0.5s ease; }
.news-card:hover .news-card-image img { transform: scale(1.1); }
.news-card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
.news-card-meta { display: flex; items-center: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--text-muted); }
.news-card-title { font-size: 1.25rem; font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.news-card-title a:hover { color: var(--primary-color); }
.news-card-excerpt { font-size: 0.875rem; color: var(--text-light); line-height: 1.6; margin-bottom: 1.5rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.btn-read-more { margin-top: auto; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--primary-color); tracking-wider: 0.05em; display: flex; items-center: center; gap: 0.25rem; }
@media (min-width: 768px) { .news-card-list { flex-direction: row; } .news-card-list .news-card-image { width: 40%; aspect-ratio: 4/3; } .news-card-list .news-card-content { width: 60%; } }


/* Boxed Layout Styles (Desktop Only) */
@media (min-width: 1280px) {
    .boxed-layout {
        background-color: #f1f5f9; /* Slate 100 for contrast */
    }

    .page-boxed-wrapper {
        max-width: 1440px;
        margin: 0 auto;
        background-color: white;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        border-right: 1px solid rgba(0, 0, 0, 0.05);
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
}


/* ROBUST FIX: Boxed Layout Centering */
@media (min-width: 1280px) {
    body.boxed-layout {
        background-color: #f1f5f9 !important;
        display: block !important;
    }

    .page-boxed-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 1440px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        background-color: white !important;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        min-height: 100vh !important;
    }
}




/* --- ROBUST LAYOUT RE-ORDER (Failsafe) --- */
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.text-center { text-align: center !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }

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

/* Desktop Specific Overrides (Must be last to win) */
@media (min-width: 1280px) {
    .xl\:hidden { display: none !important; }
    .hidden.xl\:flex { display: flex !important; }
    .hidden.xl\:block { display: block !important; }
    .hidden.xl\:grid { display: grid !important; }

    .page-boxed-wrapper {
        display: block !important;
        width: 1440px !important;
        max-width: 1440px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        background-color: white !important;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.1) !important;
        position: relative !important;
        min-height: 100vh !important;
        overflow: hidden !important;
    }
    
    .max-w-\[1440px\] {
        max-width: 1440px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }
}