/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light only;
  --primary: #2CB0DA;
  --primary-dark: #00789a;
  --accent: #1863dc;
  --ink: #212121;
  --ink-soft: #4E4B66;
  --muted: #767676;
  --line: #ebebeb;
  --bg: #ffffff;
  --bg-soft: #f4f4f4;
  --red: #d6243a;
  --radius: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --font-sans: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --container: 1240px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #212121;
}
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Force light rendering even when OS/browser is in dark mode */
@media (prefers-color-scheme: dark) {
  html, body {
    background: #ffffff !important;
    color: #212121 !important;
    color-scheme: light;
  }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--font-serif); margin: 0 0 .4em; line-height: 1.25; color: var(--ink); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- Top bar ---------- */
.topbar {
  background: #111;
  color: #ddd;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 36px;
}
.topbar .date { color: #aaa; }
.topbar .socials a {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  color: #ddd;
  border-radius: 50%;
  margin-left: 4px;
  font-size: 12px;
  transition: background .2s;
}
.topbar .socials a:hover { background: var(--primary); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 24px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 36px;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.logo .dot { color: var(--primary); }
.logo small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.search {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  min-width: 280px;
}
.search input {
  border: 0;
  outline: 0;
  flex: 1;
  font: inherit;
  background: transparent;
  padding: 6px 8px;
}
.search button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
}

/* ---------- Nav ---------- */
.nav {
  background: #fff;
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.nav .container {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
.nav li { position: relative; }
.nav a {
  display: block;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--ink);
  transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--primary); }
.nav li.has-sub > a::after {
  content: " ▾";
  font-size: 10px;
  color: var(--muted);
}
.nav li.has-sub:hover > ul {
  display: block;
}
.nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  flex-direction: column;
  min-width: 200px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 6px 0;
  z-index: 100;
}
.nav li ul li { width: 100%; }
.nav li ul a {
  padding: 10px 16px;
  text-transform: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
}
.nav li ul a:hover { background: var(--bg-soft); }

/* Mobile hamburger (CSS-only via checkbox) */
.nav-toggle { display: none; }
.nav-toggle-btn {
  display: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 22px;
  user-select: none;
  color: var(--ink);
}
.nav-toggle-btn:hover { color: var(--primary); }
.nav-toggle-btn .close-x { display: none; }
.nav-toggle:checked ~ .nav-toggle-btn .open-burger { display: none; }
.nav-toggle:checked ~ .nav-toggle-btn .close-x { display: inline; }

/* ---------- Category labels ---------- */
.cat-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.cat-label.red { background: var(--red); }
.cat-label.blue { background: var(--accent); }
.cat-label.dark { background: #111; }

/* ---------- Hero ---------- */
.hero {
  padding: 28px 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.hero-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
  background: #111;
}
.hero-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: .85;
}
.hero-main .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.2) 60%, rgba(0,0,0,0) 100%);
}
.hero-main .meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  color: #fff;
}
.hero-main h1 {
  color: #fff;
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 10px;
}
.hero-main .byline { font-size: 13px; opacity: .85; }
.hero-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}
.hero-side .card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
}
.hero-side .card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: .8;
}
.hero-side .card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.1));
}
.hero-side .card .meta {
  position: absolute;
  bottom: 0;
  padding: 18px;
  color: #fff;
}
.hero-side .card h3 {
  color: #fff;
  font-size: 16px;
  margin: 0;
  line-height: 1.3;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  margin: 30px 0 20px;
  padding-bottom: 10px;
}
.section-head h2 {
  font-family: var(--font-sans);
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}
.section-head h2 span { color: var(--primary); }
.section-head a.more {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Main layout ---------- */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 20px 0 60px;
}

/* ---------- Article cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.card-article {
  display: flex;
  flex-direction: column;
}
.card-article .thumb {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 16/10;
  background: var(--bg-soft);
}
.card-article .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.card-article:hover .thumb img { transform: scale(1.04); }
.card-article h3 {
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.card-article .excerpt {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 10px;
}
.card-article .byline {
  color: var(--muted);
  font-size: 12px;
}
.card-article .byline span + span::before {
  content: "•";
  margin: 0 6px;
}

/* List card (sidebar / list view) */
.list-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.list-card:last-child { border-bottom: 0; }
.list-card .thumb {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1/1;
  background: var(--bg-soft);
}
.list-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.3;
  margin: 0 0 6px;
}
.list-card .byline {
  color: var(--muted);
  font-size: 12px;
}

/* Numbered list (most read) */
.ranked { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.ranked li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.ranked li:last-child { border-bottom: 0; }
.ranked li::before {
  content: counter(rank);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.ranked li h4 { font-size: 14px; margin: 0 0 4px; line-height: 1.3; }
.ranked li .byline { color: var(--muted); font-size: 12px; }

/* ---------- Sidebar ---------- */
.sidebar > .widget { margin-bottom: 36px; }
.widget-title {
  font-family: var(--font-sans);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.widget-title span { color: var(--primary); }

.ad-slot {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 60px 10px;
  margin-bottom: 28px;
}

/* ---------- Two-column block (category sections) ---------- */
.cat-block {
  margin: 40px 0;
}
.cat-block .row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}
.cat-block .lead .thumb { aspect-ratio: 16/10; }
.cat-block .lead h3 { font-size: 22px; }

/* ---------- Newsletter / CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 36px;
  border-radius: var(--radius);
  text-align: center;
  margin: 40px 0;
}
.cta h2 { color: #fff; font-size: 24px; margin-bottom: 8px; }
.cta p { margin: 0 0 18px; opacity: .9; }
.cta form { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.cta input {
  flex: 1;
  border: 0;
  padding: 12px 16px;
  font: inherit;
  border-radius: 4px;
}
.cta button {
  background: #111;
  color: #fff;
  border: 0;
  padding: 0 22px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #111;
  color: #bbb;
  padding: 50px 0 0;
  margin-top: 40px;
}
.site-footer .container {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.site-footer h4 {
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 5px 0; font-size: 14px; }
.site-footer a:hover { color: var(--primary); }
.site-footer .brand p { font-size: 14px; line-height: 1.7; color: #999; }
.foot-bottom {
  border-top: 1px solid #2a2a2a;
  padding: 18px 0;
  text-align: center;
  font-size: 12px;
  color: #888;
}

/* ---------- Article page ---------- */
.article-wrap { padding: 30px 0 60px; }
.article-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--primary); }
.article-head h1 {
  font-size: 36px;
  line-height: 1.2;
  margin: 8px 0 16px;
}
.article-head .lead {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  font-family: var(--font-serif);
  font-style: italic;
}
.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}
.article-meta .author { color: var(--ink); font-weight: 600; }
.share { margin-left: auto; display: flex; gap: 6px; }
.share a {
  display: inline-block;
  width: 30px; height: 30px; line-height: 30px;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 4px;
  color: var(--ink);
  font-size: 12px;
}
.share a:hover { background: var(--primary); color: #fff; }
.featured-img {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  aspect-ratio: 16/9;
  background: var(--bg-soft);
}
.featured-img img { width: 100%; height: 100%; object-fit: cover; }
.article-body p {
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.8;
  margin: 0 0 1.2em;
  color: #2a2a2a;
}
.article-body h2 {
  font-size: 24px;
  margin: 1.4em 0 .6em;
}
.article-body blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.5em 0;
  padding: 6px 20px;
  font-style: italic;
  color: var(--ink);
  font-size: 18px;
}
.tags { margin: 30px 0; }
.tags a {
  display: inline-block;
  background: var(--bg-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  margin: 0 4px 6px 0;
  color: var(--ink-soft);
}
.tags a:hover { background: var(--primary); color: #fff; }

/* ---------- Category / archive page ---------- */
.archive-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 50px 0;
  text-align: center;
}
.archive-hero h1 { color: #fff; font-size: 38px; margin: 0 0 8px; }
.archive-hero p { margin: 0; opacity: .9; }

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 30px 0 60px;
}
.archive-list .card-article { margin-bottom: 28px; }

.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 40px 0;
}
.pager a, .pager span {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ink);
}
.pager .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Responsive ---------- */

/* Laptop / small desktop (≤ 1200px) — tighten gaps, slightly smaller sidebar */
@media (max-width: 1200px) {
  .main-grid, .article-grid, .archive-grid {
    grid-template-columns: 1fr 280px;
    gap: 30px;
  }
  .hero-main h1 { font-size: 26px; }
  .article-head h1 { font-size: 32px; }
}

/* Tablet landscape / small laptop (≤ 1024px) — sidebar drops below, hero stacks */
@media (max-width: 1024px) {
  .main-grid, .article-grid, .archive-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .hero-main { min-height: 360px; }
  .cat-block .row { grid-template-columns: 1fr 1fr; }
  .cat-block .row .lead { grid-column: 1 / -1; }
  .site-footer .container { grid-template-columns: 1fr 1fr; }
  .sidebar { max-width: 100%; }
}

/* Tablet portrait (≤ 820px) — show hamburger, hide full nav */
@media (max-width: 820px) {
  .nav .container { flex-wrap: wrap; }
  .nav-toggle-btn { display: block; margin-left: auto; }
  .nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    flex-basis: 100%;
    border-top: 1px solid var(--line);
    max-height: 70vh;
    overflow-y: auto;
  }
  .nav-toggle:checked ~ ul { display: flex; }
  .nav li { width: 100%; border-bottom: 1px solid var(--line); }
  .nav a { padding: 14px 20px; }
  .nav li.has-sub > a::after { float: right; }
  .nav li ul {
    display: none;
    position: static;
    border: 0;
    box-shadow: none;
    padding-left: 16px;
    background: var(--bg-soft);
  }
  .nav li.has-sub:hover > ul { display: none; }
  .nav li.has-sub:focus-within > ul,
  .nav li.has-sub:active > ul { display: flex; }

  /* On tablet, brand label next to logo on toggle row */
  .nav-brand-label {
    display: flex !important;
    align-items: center;
    padding: 14px 16px;
    font-family: var(--font-serif);
    font-weight: 900;
    font-size: 20px;
  }
}

/* Phone landscape / large phone (≤ 640px) */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar .container { height: auto; padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
  .site-header .container {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 16px 16px;
    gap: 12px;
  }
  .logo { font-size: 28px; }
  .search {
    min-width: 0;
    width: 100%;
    order: 3;
    flex-basis: 100%;
  }
  .hero { padding: 18px 0; }
  .hero-side { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 14px; }
  .hero-main { min-height: 280px; }
  .hero-main .meta { padding: 18px; }
  .hero-main h1 { font-size: 20px; line-height: 1.25; }
  .hero-side .card .meta { padding: 14px; }
  .hero-side .card h3 { font-size: 14px; }

  .cards { grid-template-columns: 1fr; gap: 22px; }
  .cat-block .row { grid-template-columns: 1fr; }
  .cat-block .row .lead { grid-column: auto; }
  .card-article h3 { font-size: 17px; }

  .section-head h2 { font-size: 15px; }
  .section-head a.more { font-size: 12px; }

  .list-card { grid-template-columns: 90px 1fr !important; gap: 10px; }
  .list-card h4 { font-size: 14px !important; }

  .ranked li { grid-template-columns: 30px 1fr; }
  .ranked li::before { font-size: 22px; }

  .article-head h1 { font-size: 24px; }
  .article-head .lead { font-size: 16px; }
  .article-meta { flex-wrap: wrap; gap: 8px; font-size: 12px; }
  .share { margin-left: 0; width: 100%; padding-top: 6px; }
  .article-body p { font-size: 16px; line-height: 1.75; }
  .article-body h2 { font-size: 20px; }
  .article-body blockquote { font-size: 16px; padding: 4px 14px; }

  .archive-hero { padding: 32px 0; }
  .archive-hero h1 { font-size: 26px; }

  .cta { padding: 24px 18px; }
  .cta h2 { font-size: 20px; }
  .cta form { flex-direction: column; }
  .cta button { padding: 12px 22px; }

  .site-footer { padding-top: 36px; }
  .site-footer .container { grid-template-columns: 1fr; gap: 24px; padding-bottom: 24px; }
  .foot-bottom { font-size: 11px; padding: 14px 16px; line-height: 1.5; }

  .pager a, .pager span { padding: 6px 10px; font-size: 13px; }
}

/* Small phone (≤ 380px) — tighten further */
@media (max-width: 380px) {
  .logo { font-size: 24px; }
  .logo small { display: none; }
  .topbar { font-size: 12px; }
  .hero-main h1 { font-size: 18px; }
  .article-head h1 { font-size: 22px; }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .nav a, .topbar .socials a, .share a { min-height: 44px; display: inline-flex; align-items: center; }
}
