:root {
  --ink: #1a1a2e;
  --ink-soft: #52526b;
  --line: #e6e6ec;
  --bg: #ffffff;
  --light: #f7f7fa;
  --accent: #0a6e5a;
  --accent-hover: #085847;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

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

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Header */
header.site-header { border-bottom: 1px solid var(--line); padding: 18px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.logo { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

nav.site-nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
nav.site-nav a { font-size: 15px; opacity: 0.75; }
nav.site-nav a:hover { opacity: 1; }
nav.site-nav a.active { opacity: 1; color: var(--accent); }

.search-box { display: flex; align-items: center; }
.search-box input { border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 14px; width: 160px; }
.search-box input:focus { outline: none; border-color: var(--accent); }

/* Mobile nav toggle (hamburger) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--ink); margin: 0 auto; transition: transform .15s ease, opacity .15s ease; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .site-header .container { flex-wrap: wrap; }
  .nav-toggle { display: flex; order: 2; }
  .logo { order: 1; }
  .search-box { order: 3; flex-basis: 100%; }
  nav.site-nav {
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .2s ease;
  }
  nav.site-nav.is-open { max-height: 400px; }
  nav.site-nav a { width: 100%; padding: 10px 0; border-top: 1px solid var(--line); opacity: 1; }
  nav.site-nav a:first-child { border-top: none; }
}

/* Hero */
.hero-section {
  background-image: var(--hero-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  min-height: clamp(380px, 34vw, 640px);
  display: flex;
  align-items: center;
}
.hero-section::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,26,46,.55) 0%, rgba(26,26,46,.72) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 48px 24px; text-align: center; color: #fff; }
.hero-subtitle { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 600; color: var(--accent-light, #4fd8bb); margin: 0 0 12px; }
.hero-title { font-size: 34px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -0.01em; }
.hero-text { font-size: 16px; color: rgba(255,255,255,.85); margin: 0 0 24px; }
.hero-section .btn-outline {
  display: inline-block; border: 1px solid #fff; color: #fff; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 600;
}
.hero-section .btn-outline:hover { background: #fff; color: var(--ink); }

@media (max-width: 768px) {
  .hero-section { min-height: 280px; background-image: var(--hero-mobile, var(--hero-desktop)); }
  .hero-title { font-size: 26px; }
}

/* Page intro — longhand padding only, so .container's horizontal padding survives
   (a `padding:` shorthand here would zero out left/right and go flush to the edge). */
.page-intro { padding-top: 40px; padding-bottom: 8px; }
.page-intro h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -0.01em; }
.page-intro p { color: var(--ink-soft); max-width: 65ch; margin: 0; }

/* Card grid */
.content-wrap { padding-top: 32px; padding-bottom: 56px; }

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
  background: var(--bg);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(26,26,46,.08); }
.card img { width: 100%; height: 190px; object-fit: cover; }
.card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }

.badge {
  display: inline-block;
  background: rgba(10,110,90,0.1);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  align-self: flex-start;
}

.card-title { font-size: 17px; margin: 0 0 8px; line-height: 1.35; }
.card-title a:hover { color: var(--accent); }
.card-text { font-size: 14px; color: var(--ink-soft); line-height: 1.6; flex: 1; margin: 0 0 10px; }
.card-byline { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.card-byline a { color: var(--ink-soft); text-decoration: underline; }
.card-byline a:hover { color: var(--accent); }

/* Author page header */
.author-header {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 32px;
}
.author-header .eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); margin: 0 0 6px;
}
.author-header h1 { font-size: 26px; margin: 0 0 10px; letter-spacing: -0.01em; }
.author-header p.author-header-bio { color: var(--ink-soft); margin: 0; max-width: 65ch; font-size: 15px; }

/* Author bio / index */
.author-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 20px;
}
.author-card-name { font-size: 17px; margin: 0 0 4px; }
.author-card-name a { color: var(--ink); }
.author-card-name a:hover { color: var(--accent); }
.author-card-bio { font-size: 14px; color: var(--ink-soft); margin: 0; line-height: 1.5; }

.author-bio-box {
  border: 1px solid var(--line); border-radius: 10px; padding: 20px;
  margin: 32px 0;
  max-width: 760px;
}
.author-bio-box .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin: 0 0 4px; }
.author-bio-box h3 { margin: 0 0 6px; font-size: 17px; }
.author-bio-box h3 a { color: var(--ink); }
.author-bio-box p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.post-byline { font-size: 14px; color: var(--ink-soft); margin: -4px 0 20px; }
.post-byline a { color: var(--accent); }

.btn-read-more {
  display: inline-block;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 14px;
}
.btn-read-more:hover { background: var(--accent); color: #fff; }

.empty-state { padding: 40px 0; color: var(--ink-soft); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 40px 0 0; }
.pagination a, .pagination span {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-soft); font-size: 13px; margin-top: 40px; }
footer a { color: var(--ink-soft); text-decoration: underline; }
footer .footer-links { margin-top: 6px; }

/* Single post */
.pg-article { max-width: 760px; margin: 0 auto; padding: 32px 0; }
.pg-article h1 { font-size: 28px; margin-bottom: 12px; }
.pg-article img { border-radius: 10px; margin: 16px 0; max-width: 100%; height: auto; }

/* Article body typography */
.pg-article h2 { font-size: 22px; margin: 32px 0 12px; letter-spacing: -0.01em; }
.pg-article h3 { font-size: 18px; margin: 24px 0 10px; }
.pg-article p { margin: 0 0 16px; line-height: 1.7; }
.pg-article ul, .pg-article ol { padding-left: 22px; margin: 0 0 16px; line-height: 1.7; }
.pg-article li { margin-bottom: 6px; }
.pg-article a { color: var(--accent); text-decoration: underline; }
.pg-article blockquote {
  margin: 24px 0; padding: 14px 18px;
  border-left: 3px solid var(--accent); background: var(--light);
  border-radius: 0 8px 8px 0; color: var(--ink-soft);
}
.pg-article blockquote p:last-child { margin-bottom: 0; }

/* Table of contents — blogs-tools emits <div id="toc_container" class="bd-callout"> */
#toc_container, .bd-callout {
  background: var(--light);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
  margin: 24px 0 28px;
  font-size: 15px;
}
#toc_container p, .bd-callout p:first-child { font-weight: 600; margin: 0 0 10px; }
#toc_container ul, #toc_container ol { margin: 0; padding-left: 20px; }
#toc_container li { margin-bottom: 6px; }
#toc_container a { color: var(--ink); text-decoration: none; }
#toc_container a:hover { color: var(--accent); text-decoration: underline; }
.bd-callout p:last-child { margin-bottom: 0; }

/* Tables — blogs-tools emits <table class="table"> */
.pg-article .table, .pg-article table {
  width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px;
  display: block; overflow-x: auto; white-space: nowrap;
}
.pg-article .table th, .pg-article table th {
  background: var(--ink); color: #fff; font-weight: 600;
  text-align: left; padding: 10px 12px;
}
.pg-article .table td, .pg-article table td {
  padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.pg-article .table tr:nth-child(even) td { background: var(--light); }

/* Video embeds — blogs-tools emits <div class="video-frame mt-3"> */
.video-frame { border-radius: 10px; overflow: hidden; margin: 24px 0; }
.video-frame iframe { display: block; width: 100%; aspect-ratio: 16/9; height: auto; border: 0; }

/* Figures (charts / infographics / inline images) */
.pg-article figure { margin: 28px 0; text-align: center; }
.pg-article figure img { margin: 0 auto; }
.pg-article figcaption {
  margin-top: 10px; font-size: 13px; color: var(--ink-soft); line-height: 1.5;
}

/* Spacing utilities blogs-tools output references */
.mt-3 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

@media (max-width: 700px) {
  .pg-article h2 { font-size: 20px; }
  .pg-article { padding: 24px 0; }
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .search-box input { width: 120px; }
}
