:root {
  color-scheme: light;
  --bg: #f6f4ee;
  --surface: #fffdf8;
  --surface-soft: #ece7dc;
  --text: #20251f;
  --muted: #626b5e;
  --line: rgba(40, 95, 72, 0.18);
  --brand: #285f48;
  --brand-deep: #173d2c;
  --accent: #b8893e;
  --shadow: 0 24px 70px rgba(38, 48, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

a {
  color: inherit;
}

.seo-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 244, 238, 0.92);
  backdrop-filter: blur(18px);
}

.seo-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

.seo-brand img {
  width: 34px;
  height: 34px;
}

.seo-topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.seo-topbar nav a {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.seo-topbar nav a:hover {
  border-color: var(--line);
  color: var(--brand-deep);
  background: rgba(255, 255, 255, 0.62);
}

.seo-hero {
  display: grid;
  min-height: 520px;
  padding: clamp(38px, 8vw, 96px) clamp(18px, 5vw, 64px) 56px;
  background:
    linear-gradient(90deg, rgba(20, 31, 24, 0.82) 0%, rgba(20, 31, 24, 0.58) 48%, rgba(20, 31, 24, 0.18) 100%),
    url("/assets/hero-meditation.png") center / cover;
  color: #fffaf0;
}

.hero-copy {
  align-self: end;
  max-width: 760px;
}

.seo-kicker,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
}

.seo-hero .seo-kicker {
  color: #f3c978;
}

.seo-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.seo-hero p {
  max-width: 660px;
  margin: 18px 0 0;
  color: rgba(255, 250, 240, 0.86);
  font-size: 1.12rem;
}

.seo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.seo-badges span,
.seo-counter {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.12);
  color: #fffaf0;
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.seo-share-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.seo-share-panel p {
  margin: 0;
  color: rgba(255, 250, 240, 0.76);
  font-size: 0.95rem;
}

.seo-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 250, 240, 0.3);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.1);
  color: #fffaf0;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.share-pill:hover {
  background: rgba(255, 250, 240, 0.18);
}

.share-copy {
  border-color: rgba(243, 201, 120, 0.44);
  color: #ffe0a0;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.primary-link {
  background: #fffaf0;
  color: var(--brand-deep);
}

.secondary-link {
  border: 1px solid rgba(255, 250, 240, 0.34);
  color: #fffaf0;
}

.seo-layout {
  display: grid;
  gap: 18px;
  width: min(960px, calc(100% - 32px));
  margin: -28px auto 64px;
}

.seo-section {
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.seo-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.25;
}

.seo-section > p,
.section-title-row p {
  color: var(--muted);
}

.section-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.section-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 700;
}

.chant-list {
  display: grid;
  gap: 10px;
}

.chant-line {
  padding: 16px;
  border: 1px solid rgba(31, 41, 31, 0.08);
  border-radius: 8px;
  background: #fbf8f0;
}

.chant-text {
  margin: 0;
  color: var(--brand-deep);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.72;
}

.meaning-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.seo-counter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  margin: 0 0 18px;
  border-color: var(--line);
  background: #eef3ed;
  color: var(--brand-deep);
}

.seo-counter a {
  color: var(--brand);
  font-weight: 700;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  border: 1px solid rgba(31, 41, 31, 0.08);
  border-radius: 8px;
  background: #fbf8f0;
}

summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--brand-deep);
  font-weight: 700;
}

details p {
  margin: 0;
  padding: 0 16px 16px;
  color: var(--muted);
}

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

.related-card {
  display: grid;
  gap: 6px;
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(31, 41, 31, 0.08);
  border-radius: 8px;
  background: #fbf8f0;
  text-decoration: none;
}

.related-card:hover {
  border-color: var(--brand);
}

.related-card span {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.related-card strong {
  color: var(--brand-deep);
  font-size: 1.08rem;
}

.related-card small {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.uposatha-table {
  display: grid;
  gap: 8px;
}

.uposatha-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(31, 41, 31, 0.08);
  border-radius: 8px;
  background: #fbf8f0;
}

.uposatha-row time {
  color: var(--brand);
  font-weight: 700;
}

.uposatha-row span {
  color: var(--muted);
}

.seo-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 28px 18px 42px;
  color: var(--muted);
  font-size: 0.94rem;
}

.seo-footer span {
  color: var(--brand-deep);
  font-weight: 700;
}

.seo-footer a {
  color: var(--muted);
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .seo-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

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

  .seo-hero {
    min-height: 560px;
    padding: 60px 18px 44px;
    background:
      linear-gradient(180deg, rgba(20, 31, 24, 0.28) 0%, rgba(20, 31, 24, 0.56) 44%, rgba(20, 31, 24, 0.9) 100%),
      url("/assets/hero-meditation.png") 62% center / cover;
  }

  .seo-hero h1 {
    font-size: 2.55rem;
  }

  .hero-actions,
  .seo-share-actions,
  .primary-link,
  .secondary-link,
  .share-pill {
    width: 100%;
  }

  .seo-share-actions {
    display: grid;
  }

  .section-title-row {
    grid-template-columns: 1fr;
  }

  .related-grid,
  .uposatha-row {
    grid-template-columns: 1fr;
  }
}
