:root {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-muted: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --accent: #b91c1c;
    --accent-dark: #991b1b;
    --accent-soft: #fef2f2;
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--accent);
}

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

[hidden] {
    display: none !important;
}

.page-shell {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 16px;
}

.copy-muted { color: var(--text-secondary); }
.copy-small { font-size: 0.875rem; }
.copy-tiny { font-size: 0.78rem; }
.text-center { text-align: center; }
.full-width { width: 100%; }
.spacing-top-medium { margin-top: 16px; }
.spacing-bottom-small { margin-bottom: 8px; }
.padding-top-medium { padding-top: 24px; }

/* Header & Sticky Category Carousel */
#site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.header-top-bar {
    border-bottom: 1px solid var(--border-color);
}

.header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 12px;
}

.header-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.header-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-primary);
}

.data-saver-btn {
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.data-saver-btn.active {
    background: #ecfdf5;
    border-color: #10b981;
    color: #065f46;
}

.header-category-bar {
    background: var(--bg-surface);
    transition: max-height 0.2s ease, opacity 0.2s ease;
    max-height: 48px;
    overflow: hidden;
}

#site-header.header-categories-hidden .header-category-bar {
    max-height: 0;
    opacity: 0;
}

.category-carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 44px;
}

.category-track {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}

.category-track::-webkit-scrollbar {
    display: none;
}

.category-filter-button {
    white-space: nowrap;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.category-filter-button.active {
    background: var(--accent);
    color: #ffffff;
}

.carousel-arrow, .carousel-arrow-small {
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px 8px;
    font-weight: 700;
}

.carousel-arrow:disabled, .carousel-arrow-small:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
}

.mobile-drawer.open {
    pointer-events: auto;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mobile-drawer.open .drawer-backdrop {
    opacity: 1;
}

.drawer-panel {
    position: relative;
    width: 270px;
    max-width: 82vw;
    height: 100%;
    background: var(--bg-surface);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
}

.mobile-drawer.open .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.drawer-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 10px 0;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.drawer-nav-item {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.drawer-nav-item:hover {
    background: var(--bg-muted);
}

/* Search Bar */
.search-bar-wrapper {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: 2px solid var(--accent);
    border-color: transparent;
}

.search-clear-btn {
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-weight: 600;
    cursor: pointer;
}

/* Breaking News Bar */
.breaking-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-soft);
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 16px;
}

.breaking-badge {
    background: var(--accent);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.breaking-link {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--accent-dark);
}

/* Badges & Media */
.card-meta-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-headline {
    background: var(--accent);
    color: #ffffff;
}

.badge-category {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.badge-country {
    background: #eff6ff;
    color: #1d4ed8;
}

.media-box {
    margin: 0;
    aspect-ratio: 16 / 9;
    background: var(--bg-muted);
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.media-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-placeholder,
body.data-saver .media-box {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: auto;
    min-height: 44px;
    padding: 10px;
    border: 1px dashed var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}

body.data-saver .media-box img {
    display: none;
}

body.data-saver .media-box:not(.media-placeholder)::after {
    content: attr(data-saver-text);
}

/* Hero Section */
.hero-card {
    display: grid;
    grid-template-columns: 1fr;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.hero-card .media-box {
    border-radius: 0;
}

.hero-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    margin: 0 0 10px;
    font-size: 1.4rem;
    line-height: 1.25;
}

.hero-summary {
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.hero-meta {
    margin: 0;
}

/* Highlights Horizontal Track */
.highlights-section {
    margin-bottom: 28px;
}

.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    margin: 0;
    font-size: 1.1rem;
}

.highlights-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.highlights-track::-webkit-scrollbar {
    display: none;
}

.highlight-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
}

.highlight-body {
    padding-top: 8px;
}

.highlight-title {
    margin: 6px 0;
    font-size: 0.95rem;
    line-height: 1.35;
}

/* Category Widgets & News Grids */
.category-widgets-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.category-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--text-primary);
}

.widget-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
}

.widget-more-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
}

.widget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.widget-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.compact-news-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.compact-news-item:first-child {
    padding-top: 0;
}

.compact-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.compact-title {
    margin: 0 0 4px;
    font-size: 0.96rem;
    line-height: 1.35;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.news-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.widget-grid .news-card {
    border: none;
}

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.widget-grid .card-body {
    padding: 12px 0 0;
}

.card-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.card-summary {
    margin: 0 0 10px;
    font-size: 0.88rem;
    flex: 1;
}

.card-footer-meta {
    margin: 0;
}

/* Category Archive & Country Chips */
.archive-header {
    margin: 18px 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.archive-title {
    margin: 6px 0;
    font-size: 1.65rem;
}

.archive-desc {
    margin: 0;
}

.country-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.country-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.country-chip.active {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

/* Article Detail */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0 10px;
}

.article-detail {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 28px;
}

.article-title {
    margin: 6px 0 12px;
    font-size: 1.6rem;
    line-height: 1.25;
}

.article-lead {
    font-size: 1.05rem;
    margin: 0 0 12px;
}

.article-byline {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.article-figure {
    margin: 0 0 20px;
}

.article-caption {
    margin-top: 6px;
}

.article-body {
    max-width: 65ch;
    font-size: 1.04rem;
    line-height: 1.72;
}

.article-body p {
    margin: 0 0 16px;
}

.inline-read-also {
    background: var(--bg-muted);
    border-left: 4px solid var(--accent);
    padding: 12px 14px;
    margin: 18px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
}

.read-also-label {
    font-weight: 800;
    color: var(--accent);
    margin-right: 6px;
}

.share-bar {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-whatsapp {
    background: #16a34a;
    color: #ffffff;
}

.btn-whatsapp:hover { color: #ffffff; opacity: 0.92; }

.btn-facebook {
    background: #1d4ed8;
    color: #ffffff;
}

.btn-facebook:hover { color: #ffffff; opacity: 0.92; }

.related-section {
    margin-bottom: 32px;
}

.state-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 36px 20px;
    margin: 24px 0;
}

/* Footer */
#site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    padding: 24px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.88rem;
    font-weight: 600;
}

/* Skeleton Loader */
.skeleton {
    background: #e2e8f0;
    border-radius: 4px;
    animation: pulse 1.4s infinite ease-in-out;
}

.skeleton-image { height: 150px; margin: 0; }
.skeleton-title { height: 20px; width: 90%; }
.skeleton-text { height: 14px; }
.three-quarter-width { width: 75%; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* Desktop Breakpoints */
@media (min-width: 768px) {
    .mobile-only { display: none; }
    .hero-card {
        grid-template-columns: 1.2fr 1fr;
    }
    .hero-title {
        font-size: 1.75rem;
    }
    .widget-grid {
        grid-template-columns: 1.1fr 1fr;
        gap: 20px;
    }
    .widget-grid.single-col {
        grid-template-columns: 1fr;
    }
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .article-detail {
        padding: 28px 36px;
    }
    .article-title {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .desktop-only { display: none; }
}
