/* ==========================================================================
   POLIMEDIA NEWS - MODERN EDITORIAL DESIGN SYSTEM (MAXX.NEWS INPIRED)
   ========================================================================== */

:root {
    --primary-color: #c9182b;
    --primary-hover: #a11020;
    --primary-light: #fef2f2;
    --accent-color: #0f172a;
    --accent-hover: #1e293b;
    
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --muted-color: #64748b;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --container-max: 1240px;
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #0b1120;
    --bg-alt: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-secondary: #cbd5e1;
    --muted-color: #94a3b8;
    --border-color: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Box Sizing & Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

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

ul, ol {
    list-style: none;
}

/* Layout Container */
.polimedia-container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

/* ==========================================================================
   HEADER ROW 1: BRAND, DARK MODE & SEARCH
   ========================================================================== */
.polimedia-main-header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

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

.header-icon-btn {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.header-icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.logo-text-main {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text-color);
    font-family: var(--font-sans);
}

.logo-dot {
    color: var(--primary-color);
    margin: 0 1px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   HEADER ROW 2: HORIZONTAL CATEGORIES BAR WITH ARROWS & DRAG
   ========================================================================== */
.polimedia-cat-navbar {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 0;
    position: relative;
}

.cat-navbar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.cat-nav-arrow {
    background: var(--bg-alt);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 2;
}

.cat-nav-arrow:hover {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.cat-nav-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    flex: 1;
    padding: 4px 0;
}

@media (max-width: 900px) {
    .cat-nav-scroll {
        justify-content: flex-start;
    }
}

.cat-nav-scroll.is-dragging {
    cursor: grabbing;
}

.cat-nav-scroll::-webkit-scrollbar {
    display: none;
}

.cat-nav-item {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    padding: 4px 6px;
    position: relative;
    flex-shrink: 0;
}

.cat-nav-item:hover,
.cat-nav-item.is-active {
    color: var(--primary-color);
}

/* ==========================================================================
   HEADER ROW 3: TRENDING / POPULAR TAGS BAR
   ========================================================================== */
.polimedia-trending-bar {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 0;
    font-size: 12.5px;
    width: 100%;
    overflow: hidden;
}

.trending-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

.trending-title {
    font-weight: 800;
    color: var(--text-color);
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px;
}

.trending-tags-scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

@media (max-width: 900px) {
    .trending-tags-scroll {
        justify-content: flex-start;
    }
}

.trending-tags-scroll::-webkit-scrollbar {
    display: none;
}

.trending-tag-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 3px 11px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    display: inline-block;
    transition: var(--transition);
}

.trending-tag-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.trending-tag-featured {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
}

/* ==========================================================================
   HEADER ROW 4: BREAKING NEWS TICKER (CONTINUOUS MARQUEE)
   ========================================================================== */
.polimedia-breaking-bar {
    background: var(--primary-light, #fee2e2);
    border-bottom: 1px solid #fecaca;
    padding: 6px 0;
    font-size: 13px;
    width: 100%;
    overflow: hidden;
}

[data-theme="dark"] .polimedia-breaking-bar {
    background: rgba(225, 29, 72, 0.12);
    border-bottom-color: rgba(225, 29, 72, 0.25);
}

.breaking-bar-inner,
.breaking-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.breaking-badge {
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(225, 29, 72, 0.3);
}

.breaking-pulse {
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

.breaking-marquee-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
}

.breaking-marquee-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: polimediaContinuousMarquee 35s linear infinite;
}

.breaking-marquee-container:hover .breaking-marquee-track,
.breaking-marquee-track:hover {
    animation-play-state: paused;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    padding-right: 32px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.marquee-cat {
    color: var(--primary-color);
    font-weight: 800;
    margin-right: 5px;
}

.marquee-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.marquee-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

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

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.85); }
}

/* ==========================================================================
   HEADLINE HERO SECTION (BIG OVERLAY & NUMBERED GHOST CARDS)
   ========================================================================== */
.headline-hero-wrapper {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
    align-items: stretch;
}

/* Main Large Headline Card */
.hero-main-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    min-height: 380px;
    display: flex;
}

.hero-image-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

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

.hero-main-card:hover .hero-main-img {
    transform: scale(1.04);
}

.hero-placeholder-img {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #94a3b8;
}

.hero-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.hero-overlay-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 24px;
    color: #ffffff;
}

.hero-meta-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.hero-cat-tag {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hero-date {
    font-size: 12.5px;
    color: #e2e8f0;
    font-weight: 500;
}

.hero-main-title {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.35;
    color: #ffffff;
}

.hero-main-title a:hover {
    color: #fca5a5;
}

/* Side Headline Numbered Grid (Exact Match with Reference Image) */
.hero-side-grid {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
}

.hero-side-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 6px 0;
    transition: var(--transition);
}

.hero-side-item:hover {
    transform: translateX(4px);
}

.side-rank-badge {
    font-size: 38px;
    font-weight: 900;
    color: #c9182b;
    line-height: 1;
    letter-spacing: -1.5px;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    flex-shrink: 0;
    min-width: 48px;
    padding-top: 2px;
}

.side-item-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.side-item-views {
    color: #c9182b;
    font-weight: 800;
    font-size: 13.5px;
    line-height: 1.2;
    margin-bottom: 4px;
}

.side-item-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.38;
    color: var(--text-color);
    margin: 0 0 5px 0;
}

.side-item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hero-side-item:hover .side-item-title a {
    color: #c9182b;
}

.side-item-date {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 500;
}

[data-theme="dark"] .side-rank-badge,
[data-theme="dark"] .side-item-views {
    color: #e11d48;
}

[data-theme="dark"] .side-item-date {
    color: #94a3b8;
}

/* ==========================================================================
   MAIN CONTENT & CARDS GRID
   ========================================================================== */
.polimedia-main-wrapper {
    padding: 20px 0 60px;
}

.polimedia-content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    position: relative;
}

.section-title {
    font-size: 19px;
    font-weight: 900;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
}

.section-more-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
}

.news-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.news-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-alt);
    overflow: hidden;
}

.news-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.news-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    z-index: 2;
}

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

.news-card-title {
    font-size: 15.5px;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-color);
}

.news-card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted-color);
    margin-top: auto;
}

/* ==========================================================================
   SIDEBAR & RANKED POPULAR ITEMS
   ========================================================================== */
.polimedia-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
}

.widget-title {
    font-size: 16.5px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.popular-ranked-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.popular-rank-badge {
    font-size: 22px;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
    min-width: 28px;
    font-family: var(--font-sans);
}

.popular-content {
    flex: 1;
}

.popular-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 3px;
    color: var(--text-color);
}

.popular-time {
    font-size: 11px;
    color: var(--muted-color);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.polimedia-site-footer {
    background-color: var(--accent-color);
    color: #cbd5e1;
    padding-top: 45px;
    border-top: 4px solid var(--primary-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    padding-bottom: 35px;
}

.footer-col-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 14px;
}

.footer-about p {
    font-size: 13px;
    line-height: 1.6;
    color: #94a3b8;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #94a3b8;
    font-size: 13px;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom-bar {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px 0;
    font-size: 12.5px;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ==========================================================================
   RESPONSIVE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 900px) {
    .headline-hero-wrapper {
        grid-template-columns: 1fr;
    }
    .hero-main-card {
        min-height: 300px;
    }
    .polimedia-content-layout {
        grid-template-columns: 1fr;
    }
    .news-cards-grid {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
}
