/*
Theme Name: Kernel
Theme URI: https://example.com/kernel
Author: Your Name
Description: A fast technology news theme. A dark immersive hero with overlapping story cards and a headline column, a rotating latest-headline bar, colour-coded topics, trending and most-read rankings from real view counts, keyboard-accessible topic tabs, follower counts and a topic explorer. Light and dark modes, self-hosted fonts and one-click demo content with original artwork.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kernel
Tags: news, blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eaedf2;
  --text: #141922;
  --text-2: #3c4452;
  --muted: #677183;
  --line: #dde2e9;
  --accent: #2f5bff;
  --accent-ink: #ffffff;
  --signal: #ffc83d;
  --carbon: #151a21;
  --carbon-2: #1d242e;
  --carbon-line: rgba(255,255,255,.1);
  --on-carbon: #edf0f5;
  --on-carbon-2: #a9b2c1;
  --font-display: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --w-display: 760;
  --track-display: -0.025em;
  --lh-display: 1.1;
  --radius: 14px;
  --radius-ui: 10px;
  --footer-bg: #151a21;
  --footer-text: #edf0f5;
  --footer-muted: #97a1b2;
  --footer-line: rgba(255,255,255,.1);
  --overlay: linear-gradient(180deg, rgba(12,15,20,0) 22%, rgba(12,15,20,.9) 100%);
  --accent-hover: #151a21;
  --accent-hover-ink: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #0f1318;
  --surface: #161b22;
  --surface-2: #1c222b;
  --text: #e9edf3;
  --text-2: #c1c8d3;
  --muted: #8a94a5;
  --line: #28303b;
  --accent: #7d9bff;
  --accent-ink: #0f1318;
  --carbon: #0b0e12;
  --carbon-2: #141920;
  --footer-bg: #0b0e12;
  --accent-hover: #e9edf3;
  --accent-hover-ink: #0f1318;
}

body { font-size: 16.5px; }

/* ---------- Utility bar ---------- */
.kn-util { background: #0d1116; color: #a9b2c1; font-size: .84rem; }
.kn-util__inner { display: flex; align-items: center; gap: 1.4rem; min-height: 40px; }
.kn-live { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; }
.kn-live__label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: #fff; white-space: nowrap; }
.kn-live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(255,200,61,.22); }
.kn-live__list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.kn-live__list li { display: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kn-live__list li.is-active { display: block; animation: kn-fade .5s ease; }
@keyframes kn-fade { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .kn-live__list li.is-active { animation: none; } }
.kn-live__list a { color: #e9edf3; }
.kn-live__list a:hover { color: var(--signal); }
.kn-util__date { margin: 0; white-space: nowrap; }
.kn-util .social { display: flex; gap: .15rem; }
.kn-util .social a { width: 28px; height: 28px; border: 0; color: #a9b2c1; background: transparent; }
.kn-util .social a:hover { color: #fff; }
@media (max-width: 760px) { .kn-util__date, .kn-util .social { display: none; } }

/* ---------- Header on carbon ---------- */
.site-header { background: var(--carbon); border-bottom: 1px solid var(--carbon-line); }
.site-header .brand__name { color: #fff; font-size: 1.6rem; font-weight: 800; letter-spacing: -.04em; }
.brand__mark { width: 36px; height: 36px; }
.primary-menu > li > a { color: var(--on-carbon-2); font-weight: 600; font-size: .95rem; }
.primary-menu > li > a:hover, .primary-menu .current-menu-item > a { color: #fff; background: rgba(255,255,255,.08); }
.site-header .icon-btn { color: var(--on-carbon); background: transparent; border-color: rgba(255,255,255,.16); }
.site-header .icon-btn:hover { background: rgba(255,255,255,.08); }
.header-cta { background: var(--signal); color: #151a21; }
.header-cta:hover { background: #fff; color: #151a21; }

/* ---------- Category badges ---------- */
.cat, .entry-cat { display: inline-block; align-self: flex-start; padding: .16rem .55rem; border-radius: 6px; font-size: .74rem; font-weight: 700; line-height: 1.4; background: hsl(var(--cat-hue, 225) 76% 42%); color: #fff; }
.cat:hover, .entry-cat:hover { text-decoration: none; filter: brightness(1.12); }
.section-title { font-size: clamp(1.45rem, 2.4vw, 1.85rem); letter-spacing: -.03em; }
.card__title { letter-spacing: -.02em; }
.meta__views { display: inline-flex; align-items: center; gap: .3rem; }
.meta__views .icon { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.kn-hero { background: var(--carbon); color: var(--on-carbon); padding-block: clamp(20px, 3vw, 32px) clamp(32px, 4vw, 52px); }
.kn-hero__grid { display: grid; gap: 28px; }
@media (min-width: 1100px) { .kn-hero__grid { grid-template-columns: minmax(0, 1fr) 350px; } }
.kn-lead.card-overlay { min-height: clamp(440px, 44vw, 590px); border-radius: 20px; }
.kn-lead .card__body { padding: clamp(22px, 3vw, 44px) clamp(22px, 3vw, 44px) clamp(96px, 9vw, 124px); gap: .8rem; }
.kn-lead .card__title { font-size: clamp(2rem, 4.2vw, 3.5rem); line-height: 1.03; letter-spacing: -.04em; max-width: 17ch; }
.kn-lead .card__excerpt { max-width: 56ch; font-size: 1.05rem; color: rgba(255,255,255,.84); }
.kn-hero__cards { position: relative; z-index: 2; display: grid; gap: 14px; margin: -80px 20px 0; }
@media (min-width: 700px) { .kn-hero__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kn-hero__cards .card-row { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(29,36,46,.84); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.1); }
.kn-hero__cards .media { border-radius: 10px; }
.kn-hero__cards .card__title { font-size: 1.02rem; line-height: 1.25; }
.kn-hero .card__title a, .kn-hero .mini__title a { color: #fff; }
.kn-hero .meta { color: var(--on-carbon-2); }
.kn-side-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: .7rem; border-bottom: 2px solid var(--signal); }
.kn-side-head h2 { font-size: 1.2rem; color: #fff; }
.kn-side-head a { color: var(--on-carbon-2); font-size: .88rem; font-weight: 600; }
.kn-side-head a:hover { color: #fff; }
.kn-more .mini { padding-block: .85rem; border-bottom: 1px solid var(--carbon-line); }
.kn-more .mini__title { font-size: 1rem; line-height: 1.3; }
.kn-more .media { border-radius: 10px; }

/* ---------- Trending, tabs, most read, topics ---------- */
.kn-trending__grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .kn-trending__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.kn-trending__main .card__title { font-size: clamp(1.45rem, 2.5vw, 1.95rem); line-height: 1.12; }
.kn-trending__list .mini { padding-block: .8rem; border-bottom: 1px solid var(--line); }
.kn-trending__list .mini:first-child { padding-top: 0; }
.kn-tabs { margin-top: clamp(44px, 5vw, 64px); }
.kn-tabs__list { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: 1.3rem; scrollbar-width: thin; }
.kn-tabs__tab { flex: 0 0 auto; padding: .5rem 1.05rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.kn-tabs__tab:hover { border-color: hsl(var(--cat-hue) 70% 50%); }
.kn-tabs__tab[aria-selected="true"] { background: hsl(var(--cat-hue) 76% 42%); border-color: transparent; color: #fff; }
.kn-tabs__tab:focus-visible, .kn-tabs__panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.kn-tabs__panel .card__title { font-size: 1.05rem; }
.kn-tabs__more { display: inline-block; margin-top: 1.2rem; }
.kn-week { background: var(--surface-2); }
.kn-week__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: wk; }
@media (min-width: 760px) { .kn-week__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .kn-week__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kn-week__list > li { counter-increment: wk; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .7rem; align-items: center; padding: 14px 16px 14px 14px; border-radius: 18px; background: var(--surface); }
.kn-week__list > li::before { content: counter(wk); font-weight: 800; font-size: 1.9rem; letter-spacing: -.05em; color: var(--accent); text-align: center; }
.kn-week .card-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; }
.kn-week .card-row .media { border-radius: 12px; }
.kn-week .card__title { font-size: 1rem; line-height: 1.28; }
.kn-explore__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
@media (min-width: 900px) { .kn-explore__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kn-topic { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.25rem 1.25rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid hsl(var(--cat-hue) 76% 46%); }
.kn-topic__name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; }
.kn-topic__count { font-size: .85rem; color: var(--muted); }
.kn-topic__latest { margin-top: .55rem; font-size: .93rem; line-height: 1.4; color: var(--text-2); }
.kn-topic:hover .kn-topic__name { color: hsl(var(--cat-hue) 70% 42%); }
[data-theme="dark"] .kn-topic:hover .kn-topic__name { color: hsl(var(--cat-hue) 80% 72%); }

/* ---------- Sidebar ---------- */
.kn-follow ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kn-follow__tile { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1rem; border-radius: 14px; background: var(--surface-2); }
.kn-follow__tile .icon { width: 20px; height: 20px; margin-bottom: .35rem; }
.kn-follow__tile strong { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; }
.kn-follow__tile span { font-size: .8rem; color: var(--muted); }
.kn-follow__tile:hover { background: var(--carbon); color: #fff; }
.kn-follow__tile:hover span { color: var(--on-carbon-2); }
.signup--sidebar { background: var(--carbon); color: var(--on-carbon); }
.signup--sidebar .signup__button { background: var(--signal); color: #151a21; }

/* ---------- Single ---------- */
.entry-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -.04em; }
.entry-media img { border-radius: 20px; }
.entry-content blockquote { border-left-color: var(--signal); font-weight: 600; }
.site-footer .signup { background: rgba(255,255,255,.05); color: var(--footer-text); padding: 1.4rem; }
.site-footer .signup__title { font-size: 1.15rem; }
.site-footer .signup__button { background: var(--signal); color: #151a21; }
