/* ==========================================================================
   CNCB News — CNBC-inspired design system.
   Loaded LAST (after the legacy Alith theme CSS) to override it.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --ink: #1a1a1a;
    --ink-2: #454b52;
    --muted: #6b7280;
    --rule: #e3e6e8;
    --rule-2: #d0d4d8;
    --bg: #ffffff;
    --bg-2: #f5f6f7;
    --blue: #0079b3;          /* CNBC blue */
    --blue-dark: #00537c;
    --dark: #0f1215;          /* top bar / footer */
    --up: #018f4f;            /* market green */
    --down: #d21a1a;          /* market red */
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---- base overrides (theme is Bootstrap/Alith) ---- */
body {
    font-family: var(--sans) !important;
    color: var(--ink);
    background: var(--bg);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body, p, h1, h2, h3, h4, h5, a, span, li, div, figcaption { font-family: var(--sans) !important; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.cnbc-wrap { max-width: 1260px; margin: 0 auto; padding: 0 18px; }

/* hide the legacy chrome bits we replace / don't want */
.gototop { display: none !important; }

/* ==========================================================================
   Top utility bar (black)
   ========================================================================== */
.cnbc-top { background: var(--dark); color: #fff; }
.cnbc-top__inner { display: flex; align-items: center; justify-content: space-between; height: 52px; gap: 20px; }
.cnbc-top__left, .cnbc-top__right { display: flex; align-items: center; gap: 18px; }
.cnbc-top__menu { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; color: #fff; }
.cnbc-top__menu i { font-size: 15px; }
.cnbc-logo { display: inline-flex; align-items: baseline; font-weight: 900; font-size: 24px; letter-spacing: -.02em; color: #fff; line-height: 1; }
.cnbc-logo b { color: #fff; }
.cnbc-logo .accent { color: var(--blue); }
.cnbc-logo .accent-bar { display:inline-block; width: 4px; height: 22px; background: var(--blue); margin-right: 8px; border-radius: 1px; }
.cnbc-top__date { font-size: 12px; color: #b6bcc2; letter-spacing: .02em; }
.cnbc-top__socials { display: flex; gap: 14px; }
.cnbc-top__socials a { color: #cfd4d8; font-size: 14px; }
.cnbc-top__socials a:hover { color: #fff; }
.cnbc-top__search { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; cursor: pointer; }
.cnbc-top__search input {
    background: #23282d; border: 1px solid #33383d !important; color: #fff;
    font-size: 13px; padding: 7px 12px; border-radius: 3px; width: 180px; font-family: var(--sans);
}
.cnbc-top__search input::placeholder { color: #8b9198; }
.cnbc-top__search button { background: var(--blue); color:#fff; border:0; padding: 7px 14px; border-radius:3px; font-size:12px; font-weight:700; text-transform:uppercase; cursor:pointer; }
.cnbc-top__pro { border: 1px solid #3a4046; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 3px; }
.cnbc-top__pro:hover { background: var(--blue); border-color: var(--blue); }

/* ==========================================================================
   Market ticker
   ========================================================================== */
.cnbc-ticker { background: #fff; border-bottom: 1px solid var(--rule); overflow: hidden; }
.cnbc-ticker__inner { display: flex; align-items: stretch; }
.cnbc-ticker__label {
    flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
    background: var(--dark); color: #fff; padding: 0 16px;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.cnbc-ticker__label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--down); box-shadow: 0 0 0 3px rgba(210,26,26,.2); }
.cnbc-ticker__track { flex: 1 1 auto; overflow: hidden; position: relative; }
.cnbc-ticker__row { display: flex; align-items: center; gap: 0; white-space: nowrap; animation: cnbc-ticker 60s linear infinite; }
.cnbc-ticker:hover .cnbc-ticker__row { animation-play-state: paused; }
@keyframes cnbc-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cnbc-quote { display: inline-flex; align-items: baseline; gap: 7px; padding: 12px 20px; border-right: 1px solid var(--rule); font-size: 13px; }
.cnbc-quote__sym { font-weight: 700; color: var(--ink); }
.cnbc-quote__val { color: var(--ink-2); }
.cnbc-quote__chg { font-weight: 600; font-size: 12px; }
.cnbc-quote.up .cnbc-quote__chg { color: var(--up); }
.cnbc-quote.down .cnbc-quote__chg { color: var(--down); }
.cnbc-quote.up .cnbc-quote__sym::after { content: "▲"; font-size: 9px; color: var(--up); margin-left: 3px; }
.cnbc-quote.down .cnbc-quote__sym::after { content: "▼"; font-size: 9px; color: var(--down); margin-left: 3px; }

/* ==========================================================================
   Masthead + section nav
   ========================================================================== */
.cnbc-mast { text-align: center; padding: 20px 0 6px; }
.cnbc-mast__logo { font-weight: 900; font-size: clamp(30px, 5vw, 46px); letter-spacing: -.02em; color: var(--ink); line-height: 1; display:inline-flex; align-items:baseline; }
.cnbc-mast__logo .accent { color: var(--blue); }
.cnbc-mast__tag { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

.cnbc-nav { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); background: #fff; position: relative; }
.cnbc-nav__inner { display: flex; align-items: center; gap: 4px; height: 48px; overflow-x: auto; }
.cnbc-nav a {
    font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    color: var(--ink); padding: 14px 14px; white-space: nowrap; border-bottom: 3px solid transparent;
}
.cnbc-nav a:hover { color: var(--blue); }
.cnbc-nav a.is-active { color: var(--blue); border-bottom-color: var(--blue); }
.cnbc-nav__inner::-webkit-scrollbar { height: 0; }

/* ==========================================================================
   Section headings (blue accent bar)
   ========================================================================== */
.cnbc-sechead { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 16px; border-bottom: 1px solid var(--rule); }
.cnbc-sechead__title { font-size: 15px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); padding-bottom: 8px; border-bottom: 3px solid var(--blue); margin-bottom: -1px; }
.cnbc-sechead__more { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.cnbc-sechead__more:hover { text-decoration: underline; }

/* ==========================================================================
   Home layout: hero + rail
   ========================================================================== */
.cnbc-home { padding: 22px 0 10px; }
.cnbc-hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 30px; }
.cnbc-hero__main { min-width: 0; }
.cnbc-hero__rail { min-width: 0; border-left: 1px solid var(--rule); padding-left: 30px; }

/* Lead story */
.cnbc-lead { display: block; margin-bottom: 20px; }
.cnbc-lead__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-2); display: block; }
.cnbc-lead__kicker { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 6px; display: inline-block; }
.cnbc-lead__title { font-size: clamp(24px, 2.7vw, 34px); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; color: var(--ink); }
.cnbc-lead:hover .cnbc-lead__title { color: var(--blue-dark); }
.cnbc-lead__dek { font-size: 16px; line-height: 1.5; color: var(--ink-2); margin-top: 10px; }
.cnbc-lead__meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 10px; }

/* Secondary story grid under lead */
.cnbc-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 22px; border-top: 1px solid var(--rule); }
.cnbc-scard__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-2); display: block; }
.cnbc-scard__kicker { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 10px 0 5px; display: inline-block; }
.cnbc-scard__title { font-size: 18px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.cnbc-scard:hover .cnbc-scard__title { color: var(--blue-dark); }
.cnbc-scard__meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 7px; }

/* Rail list (numbered / thumb) */
.cnbc-rail__item { display: grid; grid-template-columns: 1fr 92px; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.cnbc-rail__item:first-of-type { padding-top: 0; }
.cnbc-rail__title { font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.cnbc-rail__item:hover .cnbc-rail__title { color: var(--blue-dark); }
.cnbc-rail__meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }
.cnbc-rail__thumb { width: 92px; height: 62px; object-fit: cover; background: var(--bg-2); }
.cnbc-rank { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.cnbc-rank .n { font-size: 22px; font-weight: 800; color: var(--blue); line-height: 1; }
.cnbc-rank__title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.cnbc-rank:hover .cnbc-rank__title { color: var(--blue-dark); }
.cnbc-rank__meta { font-size: 11px; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .03em; }

/* Latest feed (list rows) */
.cnbc-feed__row { display: grid; grid-template-columns: 230px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); align-items: start; }
.cnbc-feed__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-2); }
.cnbc-feed__title { font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.cnbc-feed__row:hover .cnbc-feed__title { color: var(--blue-dark); }
.cnbc-feed__dek { font-size: 15px; color: var(--ink-2); line-height: 1.45; margin-top: 8px; }
.cnbc-feed__meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 9px; }
.cnbc-feed__meta .cat { color: var(--blue); font-weight: 700; }

/* Card grid (categories / related) */
.cnbc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.cnbc-card__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-2); display: block; }
.cnbc-card__kicker { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 10px 0 5px; display:inline-block; }
.cnbc-card__title { font-size: 16px; font-weight: 700; line-height: 1.22; color: var(--ink); }
.cnbc-card:hover .cnbc-card__title { color: var(--blue-dark); }
.cnbc-card__meta { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 7px; }

/* pagination */
.cnbc-pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 26px 0 6px; }
.cnbc-pager a, .cnbc-pager span { font-size: 13px; font-weight: 600; padding: 8px 13px; border: 1px solid var(--rule-2); color: var(--ink); background: #fff; }
.cnbc-pager a:hover { border-color: var(--blue); color: var(--blue); }
.cnbc-pager .active span { background: var(--blue); color: #fff; border-color: var(--blue); }
.cnbc-pager .disabled span { color: var(--rule-2); }

/* ==========================================================================
   Footer
   ========================================================================== */
.cnbc-footer { background: var(--dark); color: #cfd4d8; margin-top: 40px; padding: 40px 0 26px; }
.cnbc-footer__top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid #2a2f34; flex-wrap: wrap; gap: 14px; }
.cnbc-footer__brand { font-weight: 900; font-size: 26px; color: #fff; }
.cnbc-footer__brand .accent { color: var(--blue); }
.cnbc-footer__socials a { color: #cfd4d8; font-size: 16px; margin-left: 16px; }
.cnbc-footer__socials a:hover { color: #fff; }
.cnbc-footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; padding: 26px 0; }
.cnbc-footer__col h4 { color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 13px; }
.cnbc-footer__col ul { list-style: none; margin: 0; padding: 0; }
.cnbc-footer__col li { margin-bottom: 9px; }
.cnbc-footer__col a { font-size: 13px; color: #aeb4ba; }
.cnbc-footer__col a:hover { color: #fff; text-decoration: underline; }
.cnbc-footer__bottom { border-top: 1px solid #2a2f34; padding-top: 18px; font-size: 12px; color: #8b9198; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
    .cnbc-hero { grid-template-columns: 1fr; }
    .cnbc-hero__rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 24px; margin-top: 8px; }
    .cnbc-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .cnbc-top__date, .cnbc-top__socials, .cnbc-top__pro { display: none; }
    .cnbc-top__search input { width: 130px; }
    .cnbc-secondary { grid-template-columns: 1fr; }
    .cnbc-feed__row { grid-template-columns: 1fr; }
    .cnbc-feed__img { aspect-ratio: 16/9; }
    .cnbc-cards { grid-template-columns: 1fr; }
    .cnbc-ticker__label { display: none; }
}
