:root {
  --bg: #f7f4ec;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: #ffffff;
  --text: #1e1d1a;
  --muted: #5c584d;
  --line: rgba(30, 29, 26, 0.12);
  --accent: #0f766e;
  --accent-strong: #0a5b55;
  --highlight: #f4b400;
  --shadow: 0 20px 50px rgba(17, 24, 39, 0.08);
  --radius: 22px;
  --container: 1180px;
}

body.dark {
  --bg: #111315;
  --surface: rgba(21, 25, 30, 0.86);
  --surface-strong: #161c20;
  --text: #f3f2ee;
  --muted: #b7b4aa;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #6ee7d8;
  --accent-strong: #a7f3d0;
  --highlight: #ffd166;
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(244, 180, 0, 0.1), transparent 22%),
    var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(247, 244, 236, 0.8);
  border-bottom: 1px solid var(--line);
}

body.dark .site-header {
  background: rgba(17, 19, 21, 0.82);
}

.header-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.logo strong,
h1,
h2,
h3 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.1;
}

.logo-mark {
  width: 2.8rem;
  height: 2.8rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  color: #fff;
  font-weight: 700;
}

.logo small {
  display: block;
  color: var(--muted);
  text-transform: lowercase;
}

.search-form,
.newsletter-form,
.comment-form,
.admin-form {
  display: grid;
  gap: 0.75rem;
}

.search-form {
  grid-template-columns: 1fr auto;
}

input,
textarea,
button,
.button {
  border-radius: 999px;
  border: 1px solid var(--line);
  min-height: 48px;
}

textarea {
  border-radius: 18px;
  padding: 0.9rem 1rem;
}

input {
  padding: 0 1rem;
  background: var(--surface-strong);
  color: var(--text);
}

button,
.button {
  padding: 0 1.1rem;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.secondary,
.theme-toggle {
  color: var(--text);
  background: var(--surface-strong);
}

.theme-toggle {
  justify-self: start;
}

.hero {
  padding: 3rem 0 2rem;
}

.hero-grid,
.footer-grid,
.article-layout {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  align-items: start;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  margin: 0.2rem 0 1rem;
  max-width: 12ch;
}

.hero-copy,
.section-heading p,
.article-deck,
.post-card p,
.sidebar-card p {
  color: var(--muted);
}

.hero-panel,
.post-card,
.sidebar-card,
.newsletter-box,
.faq-section,
.comments-box,
.admin-card,
.not-found,
.affiliate-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel,
.sidebar-card,
.newsletter-box,
.faq-section,
.comments-box,
.admin-card,
.affiliate-box,
.not-found {
  padding: 1.35rem;
  margin-bottom: 20px;
}

.hero-actions,
.affiliate-links,
.category-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.featured-strip,
.page-header,
.post-grid,
.footer-grid,
.admin-layout {
  padding: 1rem 0 2rem;
}

.featured-grid,
.post-grid {
  display: grid;
  gap: 1.25rem;
}

.post-card {
  overflow: hidden;
}

.post-card-image img,
.article-cover {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #d9eae7;
}

.post-card-content {
  padding: 1rem 1.15rem 1.2rem;
}

.post-card h2 {
  margin: 0.4rem 0 0.7rem;
  font-size: 1.4rem;
}

.post-meta,
.breadcrumbs,
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs {
  padding: 1rem 0 0;
}

.article-layout {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: 3rem;
}

.article-main {
  min-width: 0;
}

.article-header h1 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  margin: 0.3rem 0 0.8rem;
  max-width: 14ch;
}

.article-body {
  font-size: 1.1rem;
}

.article-body p,
.article-body ul,
.article-body blockquote {
  margin: 1rem 0;
}

.article-body h2,
.article-body h3 {
  margin-top: 2.2rem;
}

.article-body ul {
  padding-left: 1.1rem;
}

.article-body blockquote,
.highlight-card {
  border-left: 5px solid var(--highlight);
  padding: 1rem 1rem 1rem 1.2rem;
  background: rgba(244, 180, 0, 0.09);
}

.inline-cta {
  margin: 1.5rem 0;
  padding: 1.2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(244, 180, 0, 0.12));
  border: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--highlight), var(--accent));
  z-index: 80;
}

.related-link {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.related-link:last-child {
  border-bottom: 0;
}

.ad-slot {
  margin: 1.4rem 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.4);
}

body.dark .ad-slot {
  background: rgba(255, 255, 255, 0.03);
}

.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.form-feedback {
  min-height: 1.5rem;
  color: var(--muted);
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: grid;
  gap: 0.75rem;
}

.pagination {
  justify-content: center;
  align-items: center;
  padding-top: 1rem;
}

details {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

@media (min-width: 780px) {
  .header-shell {
    grid-template-columns: auto 1fr auto;
  }

  .theme-toggle {
    justify-self: end;
  }

  .hero-grid {
    grid-template-columns: 1.3fr 0.7fr;
  }

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

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

@media (min-width: 1040px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }

  .article-sidebar {
    position: sticky;
    top: 6.5rem;
    display: grid;
  }
}
