:root {
    --accent: #e11d48;
    --accent-hover: #be123c;
    --accent-soft: rgba(225, 29, 72, .1);
    --surface: #f6f7f9;
    --card-border: rgba(15, 23, 42, .08);
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: #ffffff;
    --bs-link-color-rgb: 15, 23, 42;
    --heading-font: "Inter Tight", "Inter", system-ui, sans-serif;
    --nav-bg: rgba(255, 255, 255, .8);
}

[data-bs-theme="dark"] {
    --accent: #fb7185;
    --accent-hover: #fda4af;
    --accent-soft: rgba(251, 113, 133, .14);
    --surface: #151a23;
    --card-border: rgba(255, 255, 255, .08);
    --bs-body-bg: #0b0f16;
    --bs-body-color: #e5e7eb;
    --bs-link-color-rgb: 229, 231, 235;
    --nav-bg: rgba(11, 15, 22, .75);
}

body {
    background: var(--bs-body-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .brand { font-family: var(--heading-font); letter-spacing: -.02em; }
a { text-decoration: none; }
.text-accent { color: var(--accent) !important; }

.btn-accent {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: var(--accent-hover); --bs-btn-color: #fff; --bs-btn-hover-color: #fff;
}
.btn-icon {
    width: 40px; height: 40px; display: inline-grid; place-items: center;
    border-radius: 50%; color: var(--bs-body-color);
    transition: background .2s;
}
.btn-icon:hover { background: var(--accent-soft); color: var(--accent); }

/* Top bar & nav */
.topbar { background: var(--surface); }
.topbar a:hover { color: var(--accent) !important; }

.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.brand { font-weight: 800; font-size: 1.45rem; color: var(--bs-body-color); display: inline-flex; align-items: center; gap: .5rem; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), #f97316); color: #fff; font-size: 1.1rem;
}
.glass-nav .nav-link {
    font-weight: 600; font-size: .95rem; color: var(--bs-body-color);
    padding: .5rem .9rem !important; border-radius: 999px; transition: all .2s; white-space: nowrap;
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    .glass-nav .nav-link { padding: .5rem .6rem !important; font-size: .88rem; }
}
.glass-nav .nav-link:hover { color: var(--accent); }
.glass-nav .nav-link.active { background: var(--accent-soft); color: var(--accent); }

[data-bs-theme="dark"] .theme-icon-dark, [data-bs-theme="light"] .theme-icon-light { display: none; }

/* Breaking ticker */
.breaking { background: var(--bs-body-bg); border-bottom: 1px solid var(--card-border); padding: .6rem 0; }
.breaking-badge { background: var(--accent); font-weight: 700; letter-spacing: .06em; padding: .45em .8em; display: inline-flex; align-items: center; gap: .4rem; }
.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.ticker-track { display: inline-flex; gap: 3rem; white-space: nowrap; animation: ticker 40s linear infinite; }
.ticker-track a { color: var(--bs-body-color); font-weight: 500; font-size: .92rem; }
.ticker-track a:hover { color: var(--accent); }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: inline-block; animation: pulse 1.6s infinite; }
.text-body-secondary .live-dot { background: #22c55e; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } }

/* Hero */
.hero-grid { display: grid; gap: 1rem; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(3, 1fr); height: 560px; }
.hero-main { grid-row: span 3; }
.hero-card { position: relative; overflow: hidden; display: block; color: #fff; isolation: isolate; }
.hero-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); z-index: -1; }
.hero-card:hover img { transform: scale(1.05); }
.hero-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.85) 100%);
}
.hero-title { color: #fff; line-height: 1.2; text-wrap: balance; }
@media (max-width: 991.98px) {
    .hero-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 380px 200px; height: auto; }
    .hero-main { grid-column: span 2; grid-row: auto; }
    .hero-side:last-child { display: none; }
}
@media (max-width: 575.98px) {
    .hero-grid { grid-template-columns: 1fr; grid-template-rows: 340px; }
    .hero-main { grid-column: auto; }
    .hero-side { height: 200px; }
}

/* Category pills */
.cat-pill {
    display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: .3em .75em; border-radius: 999px; align-self: flex-start; position: relative; z-index: 2;
    background: var(--c-soft); color: var(--c);
}
.hero-card .cat-pill { background: var(--c); color: #fff; }
.cat-danger    { --c: #e11d48; --c-soft: rgba(225,29,72,.1); }
.cat-success   { --c: #059669; --c-soft: rgba(5,150,105,.1); }
.cat-primary   { --c: #2563eb; --c-soft: rgba(37,99,235,.1); }
.cat-warning   { --c: #d97706; --c-soft: rgba(217,119,6,.12); }
.cat-info      { --c: #7c3aed; --c-soft: rgba(124,58,237,.1); }
.cat-secondary { --c: #0891b2; --c-soft: rgba(8,145,178,.1); }
[data-bs-theme="dark"] .cat-pill:not(.hero-card .cat-pill) { filter: brightness(1.5); }
.cat-bar { display: inline-block; width: 6px; height: 1.1em; border-radius: 4px; background: var(--c); margin-right: .6rem; vertical-align: -.12em; }

/* Section titles */
.section-title { font-weight: 800; }

/* Cards */
.news-card { position: relative; }
.news-card-img { display: block; overflow: hidden; background: var(--surface); }
.news-card-img img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.news-card:hover .news-card-img img { transform: scale(1.06); }
.news-title { font-weight: 700; line-height: 1.3; margin-bottom: .5rem; text-wrap: pretty; }
.news-title a, .news-link { color: var(--bs-body-color); background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s, color .2s; }
.news-card:hover .news-title a, .news-link:hover { color: var(--accent); background-size: 100% 2px; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Sidebar */
.sticky-side { position: sticky; top: 90px; }
.side-box, .ad-box { background: var(--surface); border: 1px solid var(--card-border); }
.ad-box { border-style: dashed; }
.trending li { padding: .9rem 0; border-bottom: 1px solid var(--card-border); }
.trending li:last-child { border-bottom: 0; padding-bottom: 0; }
.trending li:first-child { padding-top: 0; }
.trend-num {
    font-family: var(--heading-font); font-weight: 800; font-size: 1.8rem; line-height: 1;
    min-width: 2rem; color: transparent; -webkit-text-stroke: 1.5px var(--accent);
}

/* Page head */
.page-head { background: var(--surface); border: 1px solid var(--card-border); position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: var(--c, var(--accent)); opacity: .12; filter: blur(10px); }
.cat-head-danger { --c: #e11d48; } .cat-head-success { --c: #059669; } .cat-head-primary { --c: #2563eb; }
.cat-head-warning { --c: #d97706; } .cat-head-info { --c: #7c3aed; } .cat-head-secondary { --c: #0891b2; }
.breadcrumb a { color: var(--bs-secondary-color); }
.breadcrumb a:hover { color: var(--accent); }

/* Article */
.article-title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); line-height: 1.15; text-wrap: balance; }
.article-body { font-size: 1.125rem; line-height: 1.8; }
.article-body p { margin-bottom: 1.4rem; }
.article-body .lead { font-size: 1.3rem; font-weight: 500; }
.article-body h2 { font-size: 1.6rem; font-weight: 800; margin: 2.2rem 0 1rem; }
.article-body blockquote {
    border-left: 4px solid var(--accent); padding: 1rem 1.5rem; margin: 2rem 0;
    background: var(--accent-soft); border-radius: 0 1rem 1rem 0; font-size: 1.2rem; font-style: italic;
}
.tag { background: var(--surface); border: 1px solid var(--card-border); border-radius: 999px; padding: .35rem .9rem; font-size: .85rem; font-weight: 500; }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), #f97316); z-index: 2000; transition: width .1s; }

/* Newsletter */
.newsletter { background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #881337 120%); color: #fff; position: relative; overflow: hidden; }
.newsletter::before { content: ""; position: absolute; width: 380px; height: 380px; right: -100px; bottom: -200px; border-radius: 50%; background: var(--accent); opacity: .35; filter: blur(60px); }
.newsletter > * { position: relative; }
.newsletter .form-control { border: 0; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--card-border); }
.footer-title { font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; color: var(--bs-secondary-color); margin-bottom: 1rem; }
.footer-links li { margin-bottom: .6rem; color: var(--bs-secondary-color); }
.footer-links a { color: var(--bs-body-color); }
.footer-links a:hover { color: var(--accent); }

/* Pagination */
.pagination { --bs-pagination-active-bg: var(--accent); --bs-pagination-active-border-color: var(--accent); --bs-pagination-color: var(--bs-body-color); --bs-pagination-border-radius: .75rem; gap: .3rem; }
.page-link { border-radius: .75rem !important; }

/* Back to top */
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; width: 48px; height: 48px; opacity: 0; visibility: hidden; transform: translateY(12px); transition: all .3s; z-index: 1030; }
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }

@media (max-width: 991.98px) {
    .sticky-side { position: static; }
}
@media (max-width: 575.98px) {
    .glass-nav .container { flex-wrap: nowrap; }
    .navbar-brand.brand { font-size: 1.15rem; gap: .35rem; margin-right: .25rem; }
    .brand-mark { width: 28px; height: 28px; font-size: .95rem; border-radius: 8px; }
    .glass-nav .btn-icon { width: 36px; height: 36px; }
    .glass-nav .navbar-toggler { padding: .25rem .4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .ticker-track { animation: none; }
    * { transition: none !important; }
}


/* Brand logo (image, light/dark) */
.brand-logo { height: 34px; width: auto; display: block; }
.site-footer .brand-logo { height: 42px; }
.brand-logo-dark { display: none; }
[data-bs-theme="dark"] .brand-logo-light { display: none; }
[data-bs-theme="dark"] .brand-logo-dark { display: block; }
