/*
Theme Name: ActualStack Minimal
Author: OpenClaw
Description: Lightweight editorial theme for ActualStack.
Version: 0.2.0
Requires PHP: 8.1
*/

:root {
  --bg: #eef2f3;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --ink: #141c24;
  --ink-soft: #31404e;
  --muted: #697987;
  --line: #d7e0e6;
  --line-strong: #c4d0d8;
  --green: #14784f;
  --green-soft: #e7f3ec;
  --blue: #245d8f;
  --amber: #a8640d;
  --shadow: 0 20px 60px rgba(20, 28, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7fafb 0, var(--bg) 420px),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-color: rgba(20, 120, 79, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--green);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 76px;
}

.brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-width: 220px;
  color: var(--ink);
  text-decoration: none;
}

.brand strong {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.brand span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  text-decoration: none;
}

.nav a:hover {
  background: var(--green-soft);
  color: var(--green);
}

.front-desk {
  padding: 36px 0 18px;
}

.desk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.desk-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.desk-topics a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.desk-topics a:hover {
  border-color: var(--green);
  color: var(--green);
}

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 22px;
  align-items: stretch;
}

.lead-story,
.desk-feed {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 390px;
  padding: 34px;
  color: inherit;
  text-decoration: none;
}

.lead-link h1 {
  max-width: 780px;
  margin: 16px 0 18px;
  font-size: clamp(42px, 5.4vw, 74px);
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
}

.lead-link p:not(.post-meta) {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.55;
}

.read-more {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 40px;
  margin-top: 28px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.desk-feed {
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-shadow: none;
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.feed-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.feed-head a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.feed-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.feed-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.feed-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.feed-item strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.28;
}

.feed-item:hover strong {
  color: var(--green);
}

.hero {
  padding: 58px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 920px);
  gap: 22px;
  align-items: start;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 300px;
}

.eyebrow,
.panel-kicker,
.section-kicker,
.page-kicker,
.article-card .meta,
.post-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 10px 0 18px;
  font-size: clamp(42px, 5.5vw, 72px);
  line-height: 1.04;
  letter-spacing: 0;
  text-wrap: balance;
}

.hero-lede {
  max-width: 640px;
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.55;
}

.hero-actions,
.topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(20, 28, 36, 0.04);
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.topic-strip {
  margin-top: 24px;
}

.topic-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.article-card,
.card,
.page-card,
.side-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section {
  padding: 32px 0 58px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.15;
}

.lead-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.article-card {
  min-width: 0;
  min-height: 244px;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 22px 64px rgba(20, 28, 36, 0.12);
}

.article-card.is-featured {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(20, 120, 79, 0.08), rgba(36, 93, 143, 0.06)),
    var(--surface);
}

.card-link {
  display: flex;
  height: 100%;
  min-height: inherit;
  flex-direction: column;
  padding: 22px;
  color: inherit;
  text-decoration: none;
}

.article-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.article-card .meta span:first-child {
  color: var(--green);
}

.article-card h2 {
  display: -webkit-box;
  margin: 14px 0 12px;
  overflow: hidden;
  font-size: 24px;
  line-height: 1.18;
  text-wrap: balance;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-card.is-featured h2 {
  max-width: 620px;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.08;
}

.article-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-card.is-featured p {
  max-width: 560px;
  font-size: 17px;
}

.ad-slot {
  margin: 30px 0 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

.archive-hero {
  max-width: 760px;
  margin: 20px 0 28px;
}

.archive-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.06;
}

.archive-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
}

.pagination-wrap {
  margin-top: 26px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  padding: 36px 0 64px;
}

.post-main,
.page-main {
  min-width: 0;
}

.post-main article,
.page-card {
  padding: clamp(24px, 4vw, 46px);
}

.post-main h1,
.page-main h1 {
  margin: 10px 0 18px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  text-wrap: balance;
}

.post-content {
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 550;
}

.post-content h2,
.post-content h3 {
  color: var(--ink);
  line-height: 1.22;
}

.post-content h2 {
  margin-top: 34px;
}

.post-content p {
  margin: 0 0 18px;
}

.post-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 15px;
}

.post-content th,
.post-content td {
  padding: 11px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.post-content th {
  background: var(--surface-soft);
  color: var(--ink);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-box {
  padding: 18px;
  box-shadow: none;
}

.side-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.side-box p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-footer p {
  margin: 0;
}

.footer-legal {
  opacity: 0.72;
}

@media (max-width: 980px) {
  .desk-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .desk-topics {
    justify-content: flex-start;
  }

  .desk-grid,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 0;
  }

  .lead-grid,
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-card.is-featured {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 38px;
  }

  .front-desk {
    padding-top: 28px;
  }

  .lead-link {
    min-height: 0;
    padding: 24px;
  }

  .lead-link h1 {
    font-size: clamp(36px, 11vw, 50px);
  }

  .lead-link p:not(.post-meta) {
    font-size: 17px;
  }

  .hero h1 {
    font-size: clamp(38px, 12vw, 52px);
  }

  .hero-lede {
    font-size: 18px;
  }

  .lead-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .article-card.is-featured {
    grid-column: auto;
  }

  .article-card,
  .card-link {
    min-height: 0;
  }
}

@media (max-width: 420px) {
  .wrap {
    width: min(100% - 22px, 1180px);
  }

  .brand strong {
    font-size: 25px;
  }

  .button {
    width: 100%;
  }

  .article-card h2 {
    font-size: 22px;
  }
}
