:root {
  --bg: #0f1419;
  --bg-elev: #1a222c;
  --bg-card: #1e2833;
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --accent-2: #e8b84a;
  --line: #2a3542;
  --radius: 12px;
  --font: "Source Serif 4", "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --wrap-max: 1100px;
  --card-pad: 1.05rem;
  --grid-gap: 1.1rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a3a5c 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #2a2418 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(var(--wrap-max), 92vw); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand span { color: var(--accent-2); }
.nav {
  display: flex;
  gap: 0.55rem 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  justify-content: flex-end;
}
.nav a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }

.lang-select {
  appearance: none;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.hero {
  padding: 2.75rem 0 1.5rem;
  animation: fadeUp 0.6s ease both;
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
  letter-spacing: -0.03em;
}
.hero p {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 1.5rem 0 1rem;
}
.section-head h2 {
  font-family: var(--font);
  font-size: 1.35rem;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--grid-gap);
  padding-bottom: 2rem;
}

.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: fadeUp 0.5s ease both;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #3a4d63;
}
.card-img {
  aspect-ratio: 16 / 9;
  background: #121820 center/cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.card-body { padding: var(--card-pad); flex: 1; display: flex; flex-direction: column; }
.card-meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}
.card h3 {
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.35;
  margin: 0 0 0.55rem;
  color: var(--text);
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card .summary {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
  animation: fadeUp 0.45s ease both;
}
.article .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.article h1 {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 1rem;
}
.article .cover {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin: 1rem 0 1.25rem;
  display: block;
}
.chart-figure {
  margin: 1rem 0 1.35rem;
  padding: 0;
}
.chart-figure .chart-img,
.body .chart-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #121820;
}
.chart-figure figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.article .body {
  font-family: var(--font);
  font-size: 1.12rem;
  color: #d5dde6;
}
.article .body .post-keywords {
  margin-top: 1.5rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
  font-size: 0.92rem;
  color: var(--muted);
  font-family: var(--sans);
}
.article .body .post-keywords strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 0.35rem;
}
.cta {
  display: inline-block;
  margin-top: 1.5rem;
  background: var(--accent);
  color: #061018 !important;
  font-weight: 600;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  text-decoration: none !important;
}
.cta:hover { filter: brightness(1.08); }

.pager {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  padding: 0 0 2.5rem;
  color: var(--muted);
}
.pager a {
  border: 1px solid var(--line);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
}
.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

[dir="rtl"] .header-inner,
[dir="rtl"] .nav,
[dir="rtl"] .section-head { direction: rtl; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Multi-column board */
.columns-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  padding-bottom: 2.5rem;
}
.column-block {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
}
.column-block .section-head {
  margin: 0 0 0.85rem;
  align-items: center;
}
.column-block .section-head h2 {
  font-size: 1.15rem;
}
.col-more {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}
.col-more:hover { color: var(--accent); text-decoration: none; }
.col-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.column-list { display: flex; flex-direction: column; gap: 0.85rem; }
.column-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: start;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.column-item:first-child {
  border-top: 0;
  padding-top: 0;
}
.column-item:not(:has(.column-thumb)) {
  grid-template-columns: 1fr;
}
.column-thumb {
  display: block;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  background: #121820 center/cover no-repeat;
  border: 1px solid var(--line);
}
.column-text h3 {
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.35;
  margin: 0 0 0.35rem;
}
.column-text h3 a { color: var(--text); text-decoration: none; }
.column-text h3 a:hover { color: var(--accent); }
.column-text .summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-latest { margin-bottom: 0.5rem; }

/* —— Ads (desktop + mobile) —— */
.ad-slot {
  width: min(var(--wrap-max), 92vw);
  margin: 0.75rem auto;
  padding: 0.45rem 0;
  text-align: center;
}
.ad-slot--top_bar {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.35rem 0;
  background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
  border-bottom: 1px solid var(--line);
}
.ad-slot--top_bar .ad-banner,
.ad-slot--below_nav .ad-banner {
  display: block;
  width: min(var(--wrap-max), 92vw);
  margin: 0 auto;
}
.ad-slot--sticky {
  position: sticky;
  top: 0;
  z-index: 30;
}
/* When sticky top ad is on, keep site header below it on desktop */
.ad-slot--sticky + .site-header {
  top: 0;
}
.ad-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
  opacity: 0.75;
}
.ad-banner {
  display: block;
  line-height: 0;
}
.ad-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.ad-slot--top_bar .ad-img { max-height: 90px; border-radius: 0; border-left: 0; border-right: 0; }
.ad-img--mobile { display: none; }
.ad-text {
  display: inline-block;
  padding: 0.55rem 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.9rem;
  background: var(--bg-elev);
  max-width: 100%;
}
.ad-text:hover { color: var(--accent); text-decoration: none; border-color: var(--accent); }
.ad-html {
  overflow: auto;
  max-width: 100%;
  line-height: normal;
}
.ad-html iframe,
.ad-html img {
  max-width: 100%;
  height: auto;
}
.ad-slot--in_feed {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0.75rem;
}
.ad-slot--footer {
  margin-bottom: 0;
  padding-bottom: 0.25rem;
}

@media (max-width: 900px) {
  .columns-board { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero { padding-top: 1.75rem; }
  .card .summary { -webkit-line-clamp: 2; }
  .column-item { grid-template-columns: 1fr; }
  .column-thumb { width: 100%; height: 120px; }

  /* Ads: prefer mobile creative; keep compact; no sticky cover */
  .ad-slot { margin: 0.55rem auto; padding: 0.35rem 0; }
  .ad-slot--top_bar { padding: 0.25rem 0; }
  .ad-slot--sticky {
    position: static;
    z-index: auto;
  }
  .ad-img { max-height: 100px; }
  .ad-slot--top_bar .ad-img { max-height: 72px; }
  .ad-img--desktop { display: none; }
  .ad-img--mobile { display: block; }
  .ad-text {
    display: block;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }
  .ad-html { font-size: 0.85rem; }
}
