/*
 * Kabar Kabar — shared design system.
 * Tokens, page chrome (sidebar, header, trending bar, footer) and the article
 * components in app/Views/components. Page-specific styles live in pages/<page>.css.
 * Per-section accent colour comes from `--accent`, set on <body> by the layout.
 * Article components are scoped with :where([data-template="section"]) (zero specificity)
 * so they never leak into pages with their own design (front page, contributor pages).
 */
:root { color-scheme: light; --blue: #0878df; --ink: #20242b; --line: #edf0f3; --navy: #101a2c; --trending-gradient: linear-gradient(180deg,#4088d7 0%,#214f9f 100%); --accent: var(--blue); }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; font: 14px Inter,Arial,sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
.topbar, .main-nav, .trending, .topbar-left, .topbar-actions { display: flex; align-items: center; }
header { display: contents; }
.topbar { position: sticky; top: 0; z-index: 16; height: 90px; justify-content: space-between; padding: 0 50px 0 58px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar-left { gap: 20px; }
.icon-button { display: grid; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #505864; cursor: pointer; }
.icon-button:hover { background: #f0f5fa; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.date { color: #737b85; font-size: 18px; }
.topbar-actions { gap: 18px; }
.mobile-brand { display: none; }
.main-nav { position: sticky; top: 90px; z-index: 15; min-height: 108px; justify-content: space-between; gap: clamp(10px,1vw,20px); padding: 0 47px 0 54px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fff; white-space: nowrap; scrollbar-width: none; }
.main-nav::-webkit-scrollbar, .trending::-webkit-scrollbar { display: none; }
.main-brand { display: flex; width: 266px; flex: 0 0 auto; align-items: center; gap: 0; margin-right: 0; color: var(--blue); }
.brand-logo { display: block; max-width: 100%; height: auto; object-fit: contain; }
.main-brand .brand-logo { width: 100%; }
.mobile-brand .brand-logo { width: 133px; }
.main-nav>a:not(.main-brand) { color: #23272e; font-size: 21px; font-weight: 500; }
.main-nav>a:hover, .main-nav>a.active { color: var(--blue); }
.nav-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.small-action { display: inline-flex; height: 49px; align-items: center; gap: 9px; padding: 0 18px; border: 0; border-radius: 15px; background: linear-gradient(180deg,#2d60af,#4f96e1); color: #fff; font-size: 20px; font-weight: 600; }
.small-action:last-child { background: linear-gradient(180deg,#549de5,#85bff2); }
.small-action svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-actions .small-action:first-child { width: 166px; justify-content: center; }
.nav-actions .small-action:last-child { width: 174px; justify-content: center; }
.trending { min-height: 84px; gap: clamp(52px,4.25vw,80px); padding: 0 54px; overflow-x: auto; background: var(--trending-gradient); color: #fff; white-space: nowrap; scrollbar-width: none; }
.trending strong { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.trending strong svg { width: 28px; height: 28px; flex: 0 0 28px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.trending a { color: #e3f2ff; font-size: 21px; }
:where([data-template="section"]) .breadcrumb { margin-bottom: 22px; color: #737b85; font-size: 12px; }
:where([data-template="section"]) .page-heading h1 { display: flex; align-items: center; gap: 9px; margin: 0 0 7px; font-size: 30px; font-weight: 750; letter-spacing: -.6px; }
:where([data-template="section"]) .page-heading h1::before { width: 5px; height: 32px; border-radius: 3px; background: var(--accent); content: ""; }
:where([data-template="section"]) .page-heading p { max-width: 760px; margin: 0; color: #707782; font-size: 14px; line-height: 1.55; }
:where([data-template="section"]) .lead-image:hover img, :where([data-template="section"]) .story-card:hover .story-image img { transform: scale(1.035); }
:where([data-template="section"]) .lead-copy { padding-top: 12px; }
:where([data-template="section"]) .category { display: inline-block; margin: 0 0 6px; color: var(--blue); font-size: 11px; font-weight: 700; text-transform: uppercase; }
:where([data-template="section"]) .lead-copy h2 { margin: 0 0 6px; font-size: 25px; line-height: 1.3; }
:where([data-template="section"]) .lead-copy p { margin: 0 0 9px; color: #707782; font-size: 14px; line-height: 1.5; }
:where([data-template="section"]) .meta { display: flex; align-items: center; gap: 5px; color: #9299a2; font-size: 11px; }
:where([data-template="section"]) .section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
:where([data-template="section"]) .section-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.35px; }
:where([data-template="section"]) .section-heading h2::before { width: 4px; height: 25px; border-radius: 3px; background: var(--blue); content: ""; }
:where([data-template="section"]) .section-link { color: #656d78; font-size: 12px; }
:where([data-template="section"]) .news-section { margin-bottom: 42px; }
:where([data-template="section"]) .cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 26px; }
:where([data-template="section"]) .story-card { min-width: 0; }
:where([data-template="section"]) .story-image { display: block; overflow: hidden; aspect-ratio: 1.8; border-radius: 9px; background: #e4e8ed; }
:where([data-template="section"]) .story-card .category { margin: 10px 0 5px; font-size: 10px; }
:where([data-template="section"]) .story-card h3 { margin: 0 0 5px; font-size: 16px; font-weight: 700; line-height: 1.4; }
:where([data-template="section"]) .story-card p { margin: 0 0 8px; color: #7c838d; font-size: 12px; line-height: 1.45; }
footer { display: grid; grid-template-columns: 1.65fr repeat(3,1fr); gap: 42px; padding: 40px max(46px,calc((100vw - 1288px)/2)) 18px; background: #101a2c; color: #d8deea; }
.footer-brand .brand { display: flex; width: max-content; max-width: 100%; align-items: center; gap: 0; padding: 0; background: transparent; }
.footer-brand .brand-logo { width: 210px; max-width: 100%; }
.footer-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 20px; }
.footer-brand p { max-width: 250px; margin: 13px 0; color: #aab4c4; font-size: 12px; line-height: 1.55; }
.socials { display: flex; gap: 9px; }
.socials a { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #ffffff14; font-size: 12px; }
.footer-column h2 { margin: 2px 0 13px; color: #fff; font-size: 14px; }
.footer-column a { display: block; margin-bottom: 9px; color: #aab4c4; font-size: 12px; }
.footer-column a:hover { color: #fff; }
.copyright { display: flex; grid-column: 1/-1; justify-content: space-between; gap: 18px; padding-top: 14px; border-top: 1px solid #ffffff18; color: #9da8b8; font-size: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 250px; flex-direction: column; transform: translateX(-100%); background: #fff; border-right: 1px solid var(--line); box-shadow: 10px 0 30px #0001; }
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 19; border: 0; background: #101a2c66; cursor: pointer; }
.brand { display: flex; min-height: 72px; align-items: center; gap: 8px; padding: 0 17px; border-bottom: 1px solid var(--line); color: var(--blue); }
.brand-mark { display: grid; width: 31px; height: 32px; place-items: center; border-radius: 3px; background: var(--blue); color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -2px; }
.sidebar>.brand .brand-logo { width: 212px; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -.65px; line-height: 1; white-space: nowrap; }
.brand-tagline { margin-top: 4px; color: #78828e; font-size: 7px; font-weight: 500; letter-spacing: .15px; }
.sidebar-content { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.side-label { margin: 24px 18px 11px; color: #9ca3ad; font-size: 10px; font-weight: 700; letter-spacing: .45px; }
.side-section { margin-top: 17px; padding-top: 2px; border-top: 1px solid var(--line); }
.side-section .side-label { margin-top: 20px; }
.side-nav { display: grid; gap: 4px; padding: 0 10px; }
.side-nav a { display: flex; min-height: 43px; align-items: center; gap: 11px; padding: 0 9px; border-radius: 7px; color: #454b54; font-size: 14px; font-weight: 600; transition: background .18s,color .18s; }
.side-nav a.with-description { min-height: 48px; }
.side-link-copy { display: grid; gap: 3px; }
.side-link-copy small { color: #89919c; font-size: 10px; font-weight: 400; }
.side-nav a:hover, .side-nav a.active { background: #edf6ff; color: var(--blue); }
.nav-icon { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 7px; background: linear-gradient(145deg,#168cef,#0759b8); color: #fff; font-size: 12px; font-weight: 700; }
.nav-icon.multimedia { background: linear-gradient(145deg,#7bc5ff,#4b9eee); }
.side-text-links { display: grid; gap: 2px; padding: 4px 18px 12px; }
.side-text-links a { min-height: 24px; color: #454b54; font-size: 12px; font-weight: 500; }
.side-text-links a:hover { color: var(--blue); }
.side-bottom { flex: 0 0 auto; padding: 12px; border-top: 1px solid var(--line); color: #8b929c; font-size: 10px; line-height: 1.6; text-align: center; }
.side-stories { display: grid; align-content: start; gap: 20px; }
.footer-brand .brand { width: max-content; max-width: 100%; min-height: 0; padding: 0; border: 0; background: transparent; }
.footer-brand .brand-logo { width: 210px; max-width: 100%; }
.footer-brand .brand-mark { width: 27px; height: 27px; font-size: 18px; }
.footer-brand .brand-name { font-size: 16px; }
.site { min-height: 100vh; background: #fff; }
@media (min-width:761px) and (max-width:1450px) {
  .topbar { height: 72px; padding-inline: 24px; }
  .main-nav { top: 72px; min-height: 78px; gap: clamp(10px,1.15vw,16px); padding-inline: 24px; overflow-x: hidden; }
  .main-brand { width: 244px; margin-right: 0; font-size: 34px; }
  .main-brand .brand-mark { width: 40px; height: 40px; flex-basis: 40px; font-size: 24px; }
  .main-nav>a:not(.main-brand) { font-size: 15px; }
  .small-action { height: 38px; gap: 6px; padding-inline: 12px; font-size: 13px; }
  .small-action svg { width: 17px; height: 17px; flex-basis: 17px; }
  .nav-actions .small-action:first-child { width: 112px; }
  .nav-actions .small-action:last-child { width: 121px; }
  .trending { min-height: 54px; gap: clamp(24px,2.6vw,38px); padding-inline: 24px; }
  .trending strong { gap: 8px; font-size: 16px; }
  .trending strong svg { width: 22px; height: 22px; flex-basis: 22px; }
  .trending a { font-size: 15px; }
}

@media (min-width:761px) and (max-width:1150px) {
  .main-nav { justify-content: space-between; gap: 12px; padding-inline: 19px; }
  .main-brand { width: 200px; font-size: 26px; }
  .main-brand .brand-mark { width: 32px; height: 32px; flex-basis: 32px; font-size: 20px; }
  .main-nav>a:not(.main-brand) { font-size: 13px; }
}

@media (max-width:1050px) {
  footer { gap: 25px; }
}

@media (max-width:760px) {
  .topbar { height: 56px; padding: 0 14px; }
  .topbar-left { gap: 8px; }
  .icon-button { width: 32px; height: 32px; }
  .icon-button svg { width: 19px; height: 19px; }
  .date { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; font-weight: 800; }
  .mobile-brand .brand-mark { width: 25px; height: 25px; flex-basis: 25px; font-size: 16px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .icon-button:last-child { display: none; }
  .main-nav { top: 56px; min-height: 42px; justify-content: flex-start; gap: 19px; padding: 0 14px; overflow-x: auto; }
  .main-brand, .nav-actions { display: none; }
  .main-nav>a:not(.main-brand) { font-size: 12px; }
  .trending { min-height: 36px; gap: 17px; padding: 0 14px; }
  .trending strong { font-size: 12px; }
  .trending strong svg { width: 18px; height: 18px; flex-basis: 18px; }
  .trending a { font-size: 11px; }
  footer { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px 14px; padding: 20px 13px 13px; }
  .footer-brand { grid-column: 1/-1; }
  .footer-brand .brand { font-size: 19px; }
  .footer-brand .brand-mark { width: 22px; height: 22px; flex-basis: 22px; font-size: 14px; }
  .footer-brand p { margin: 8px 0; font-size: 9px; }
  .footer-column h2 { margin: 3px 0 8px; font-size: 10px; }
  .footer-column a { margin-bottom: 6px; font-size: 8px; }
  .copyright { gap: 8px; font-size: 7px; }
}

@media (max-width:420px) {
  .copyright { flex-direction: column; }
}

@media (max-width: 1050px) {
  .brand { padding-inline: 12px; }
  .brand-name { font-size: 15px; }
}

@media (min-width: 761px) and (max-width: 1150px) {
  .side-stories { gap: 28px; }
}

@media (max-width: 760px) {
  .side-stories { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
}

@media (max-width: 420px) {
  .side-stories { grid-template-columns: 1fr; }
}
