/* ==========================================================================
   Green Spine Theme — CSS
   Inspired by the Directive template's visual DNA:
   - Central vertical spine line
   - Green accent (#4eb980) on clean white
   - Spacious, centered narrow-content layout
   - Uppercase letter-spaced headings (Source Sans Pro feel)
   - Alternating left/right content blocks
   - SVG wave-shaped section dividers
   - Dotted border links, ghost buttons
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { text-decoration: none; }
button, input, textarea { font: inherit; appearance: none; border: 0; background: none; }

/* ---------- Custom Properties ---------- */
:root {
  --c-bg: #ffffff;
  --c-bg-alt: #f7f9f8;
  --c-text: #6a6a6a;
  --c-heading: #4a454b;
  --c-accent: #4eb980;
  --c-accent-dark: #3d9a69;
  --c-accent-light: #e8f5ee;
  --c-border: rgba(210,215,212,.6);
  --c-line: rgba(210,215,212,.55);
  --c-white: #ffffff;

  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font-body);

  --w-narrow: 40em;
  --w-medium: 52em;
  --w-wide: 68em;

  --space-xs: .5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-xxl: 8rem;
}

/* ---------- Base ---------- */
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  color: var(--c-text);
  background: var(--c-bg);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--c-heading);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.5;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.6rem; margin-bottom: .8em; }
h3 { font-size: 1.15rem; margin-bottom: .6em; }
p { margin-bottom: 1.4em; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 600; color: var(--c-heading); }
em, i { font-style: italic; }

a {
  color: var(--c-accent);
  border-bottom: 1px dotted var(--c-accent);
  transition: color .2s, border-color .2s;
}
a:hover {
  color: var(--c-accent-dark);
  border-bottom-color: transparent;
}

/* ---------- Utility ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.container       { width: 90%; max-width: var(--w-wide); margin: 0 auto; }
.container--md   { max-width: var(--w-medium); }
.container--sm   { max-width: var(--w-narrow); }

/* ---------- Central Spine Line (Directive DNA) ---------- */
.spine-section {
  position: relative;
}
.spine-section::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--c-line);
  z-index: 0;
}

/* ---------- Buttons (ghost / filled, uppercase, letter-spaced) ---------- */
.btn {
  display: inline-block;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .9em 2.4em;
  border-radius: 4px;
  border: none;
  border-bottom: none;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
  text-align: center;
  min-width: 12em;
}
.btn--filled {
  background: var(--c-heading);
  color: var(--c-white);
}
.btn--filled:hover { background: #635c64; }
.btn--ghost {
  background: none;
  color: var(--c-heading);
  box-shadow: inset 0 0 0 1px var(--c-border);
}
.btn--ghost:hover { background: rgba(210,215,212,.15); }
.btn--accent {
  background: var(--c-accent);
  color: var(--c-white);
}
.btn--accent:hover { background: var(--c-accent-dark); }
.btn--white {
  background: var(--c-white);
  color: var(--c-accent);
}
.btn--white:hover { background: rgba(255,255,255,.85); }

/* ========================================================================
   HEADER / NAVIGATION
   ======================================================================== */
.site-header {
  position: relative;
  z-index: 100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.site-header__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  border-bottom: none;
}
.site-header__logo {
  height: 32px;
  width: auto;
}
.site-header__name {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-heading);
}

/* Desktop nav */
.main-nav { display: flex; gap: 1.8rem; align-items: center; }
.main-nav a {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-heading);
  border-bottom: 1px dotted transparent;
  transition: border-color .2s, color .2s;
  padding: .3em 0;
}
.main-nav a:hover {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 0;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--c-heading);
  border-radius: 1px;
  transition: transform .25s, opacity .25s;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  padding: 1rem 0;
  z-index: 99;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  padding: .7rem 5%;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-heading);
  border-bottom: none;
}
.mobile-nav a:hover { color: var(--c-accent); }

@media (max-width: 768px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
}

/* ========================================================================
   HERO — editorial style with central spine
   ======================================================================== */
.hero {
  position: relative;
  text-align: center;
  padding: var(--space-xxl) 0 calc(var(--space-xxl) + 3rem) 0;
  background: var(--c-bg);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--c-line);
  z-index: 0;
}
.hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2em;
  height: 3.2em;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-white);
  font-size: 1.6rem;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 1;
}
.hero__icon svg { width: 1.2em; height: 1.2em; fill: currentColor; }
.hero__content {
  position: relative;
  z-index: 1;
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.hero__title {
  font-size: 2.4rem;
  line-height: 1.35;
  margin-bottom: .5em;
  color: var(--c-heading);
}
.hero__subtitle {
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--c-text);
  margin-bottom: 1.8em;
  text-transform: none;
  letter-spacing: 0;
}
.hero__subtitle p { margin-bottom: .6em; }
.hero__cta { margin-top: .5rem; }

/* Wave divider after hero */
.wave-divider {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
  color: var(--c-bg-alt);
}
.wave-divider--green { color: var(--c-accent); }
.wave-divider--white { color: var(--c-bg); }

/* ========================================================================
   TOPICS — alternating left/right blocks (Directive feature blocks DNA)
   ======================================================================== */
.topics {
  padding: var(--space-xl) 0;
  background: var(--c-bg-alt);
}
.topics__header {
  text-align: center;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
  background: var(--c-bg-alt);
  padding: 1rem 0;
}
.topics__list {
  position: relative;
}

.topic-block {
  display: flex;
  align-items: stretch;
  min-height: 12rem;
  position: relative;
}
.topic-block::after { content: ''; display: block; clear: both; }

.topic-block__marker {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: var(--c-accent);
  border: 3px solid var(--c-bg-alt);
  z-index: 2;
}

.topic-block__content {
  width: 50%;
  padding: var(--space-md) var(--space-lg);
}
.topic-block__content h3 { text-align: inherit; }
.topic-block__content p:last-child { margin-bottom: 0; }

/* Alternate alignment */
.topic-block:nth-child(odd) {
  text-align: right;
  justify-content: flex-start;
}
.topic-block:nth-child(odd) .topic-block__content {
  padding-right: var(--space-lg);
}
.topic-block:nth-child(even) {
  text-align: left;
  justify-content: flex-end;
}
.topic-block:nth-child(even) .topic-block__content {
  padding-left: var(--space-lg);
}

/* ========================================================================
   LATEST POSTS — editorial list
   ======================================================================== */
.latest-posts {
  padding: var(--space-xl) 0;
  background: var(--c-bg);
}
.latest-posts__header {
  text-align: center;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
  background: var(--c-bg);
  padding: 1rem 0;
}

.post-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--c-border);
  align-items: flex-start;
}
.post-card:last-child { border-bottom: none; }

.post-card__image {
  flex-shrink: 0;
  width: 220px;
  height: 160px;
  overflow: hidden;
  border-radius: 3px;
}
.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-card__body { flex: 1; }
.post-card__date {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: .4rem;
}
.post-card__title {
  margin-bottom: .5rem;
}
.post-card__title a {
  color: var(--c-heading);
  border-bottom: none;
  transition: color .2s;
}
.post-card__title a:hover { color: var(--c-accent); }
.post-card__excerpt {
  font-size: .95rem;
  line-height: 1.7;
}
.post-card__excerpt p { margin-bottom: .6em; }

/* ========================================================================
   FAQ — clean accordion-style with dotted separators
   ======================================================================== */
.faq {
  padding: var(--space-xl) 0 var(--space-xxl);
  background: var(--c-bg);
}
.faq__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.faq-item {
  border-top: 1px dotted var(--c-border);
  padding: 1.4rem 0;
}
.faq-item:last-child { border-bottom: 1px dotted var(--c-border); }

.faq-item__question {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-heading);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  line-height: 1.6;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 0;
}
.faq-item__question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--c-accent);
  flex-shrink: 0;
  transition: transform .25s;
}
.faq-item.is-open .faq-item__question::after {
  transform: rotate(45deg);
}
.faq-item__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding-top: 0;
}
.faq-item.is-open .faq-item__answer {
  max-height: 40em;
  padding-top: 1rem;
}
.faq-item__answer p { margin-bottom: .8em; }

/* ========================================================================
   FOOTER — green background (Directive DNA)
   ======================================================================== */
.wave-divider--footer-top {
  display: block;
  width: 100%;
  margin-bottom: -1px;
}

.site-footer {
  background: var(--c-accent);
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
  position: relative;
}
.site-footer a {
  color: var(--c-white);
  border-bottom-color: rgba(255,255,255,.35);
}
.site-footer a:hover { border-bottom-color: transparent; }

.site-footer__brand {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: 1.6rem;
  display: block;
  border-bottom: none;
}
.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem 1.6rem;
  margin-bottom: 1.8rem;
}
.footer-nav a {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px dotted rgba(255,255,255,.3);
}
.footer-nav a:hover { border-bottom-color: transparent; }

.site-footer__contact {
  margin-bottom: 2rem;
  font-size: .92rem;
}
.site-footer__contact a { font-weight: 600; }

.site-footer__copy {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .06em;
}

/* ========================================================================
   PAGE / POST — content pages
   ======================================================================== */
.page-hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-lg);
  position: relative;
}
.page-hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  background: var(--c-line);
}
.page-hero h1 {
  position: relative;
  z-index: 1;
  background: var(--c-bg);
  display: inline-block;
  padding: 0 1.5rem;
}

.page-content {
  padding: 0 0 var(--space-xl);
}
.page-content .prose {
  max-width: var(--w-narrow);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Prose formatting */
.prose h1, .prose h2, .prose h3, .prose h4 { text-align: left; margin-top: 1.8em; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose ul, .prose ol { margin: 0 0 1.4em 1.6em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4em; }
.prose blockquote {
  border-left: 3px solid var(--c-accent);
  padding: .6em 0 .6em 1.5em;
  font-style: italic;
  margin: 0 0 1.4em;
  color: var(--c-heading);
}
.prose img { margin: 1.5em 0; border-radius: 3px; }
.prose table { width: 100%; margin-bottom: 1.4em; border-collapse: collapse; }
.prose th, .prose td {
  text-align: left;
  padding: .5em .8em;
  border-bottom: 1px solid var(--c-border);
}
.prose th {
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-heading);
}
.prose hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 2em 0;
}
.prose pre {
  background: var(--c-bg-alt);
  padding: 1.2em;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.4em;
  font-size: .9em;
  line-height: 1.6;
}
.prose code { font-size: .9em; }

/* Post meta */
.post-meta {
  text-align: center;
  margin-bottom: var(--space-md);
}
.post-meta__date {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.post-meta__excerpt {
  max-width: var(--w-narrow);
  margin: 1rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  font-weight: 300;
}

.post-cover {
  max-width: var(--w-medium);
  margin: 0 auto var(--space-lg);
  padding: 0 1.5rem;
}
.post-cover img {
  width: 100%;
  height: auto;
  border-radius: 3px;
}

/* ========================================================================
   BLOG INDEX
   ======================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.blog-card {
  border: 1px solid var(--c-border);
  border-radius: 3px;
  overflow: hidden;
  transition: box-shadow .2s;
}
.blog-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

.blog-card__image {
  height: 180px;
  overflow: hidden;
}
.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-card__body { padding: 1.4rem 1.6rem; }
.blog-card__date {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: .4rem;
}
.blog-card__title { margin-bottom: .5rem; font-size: 1.05rem; }
.blog-card__title a {
  color: var(--c-heading);
  border-bottom: none;
}
.blog-card__title a:hover { color: var(--c-accent); }
.blog-card__excerpt { font-size: .9rem; line-height: 1.7; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .4rem;
  margin-top: var(--space-lg);
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4em;
  height: 2.4em;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .06em;
  border-radius: 3px;
  color: var(--c-heading);
  border-bottom: none;
  transition: background .2s;
}
.pagination a:hover { background: var(--c-accent-light); }
.pagination .active {
  background: var(--c-accent);
  color: var(--c-white);
}
.pagination__prev, .pagination__next {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */
@media (max-width: 980px) {
  .hero { padding: var(--space-xl) 0 calc(var(--space-xl) + 2rem); }
  .hero__title { font-size: 2rem; }

  .topic-block { flex-direction: column; text-align: center !important; justify-content: center !important; }
  .topic-block__content { width: 100%; padding: var(--space-md) var(--space-sm) !important; text-align: center !important; }
  .topic-block__marker { display: none; }
  .topics::before { display: none; }
  .spine-section::before { display: none; }
}

@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }
  .hero__title { font-size: 1.6rem; }

  .post-card { flex-direction: column; }
  .post-card__image { width: 100%; height: 200px; }

  .blog-grid { grid-template-columns: 1fr; }

  .footer-nav { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  .hero { padding: var(--space-lg) 0 calc(var(--space-lg) + 1.5rem); }
  .hero__title { font-size: 1.35rem; }
  .btn { min-width: 0; width: 100%; }
  .page-hero { padding: var(--space-lg) 0 var(--space-md); }
}

/* ---------- Focus styles ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: .6em 1.2em;
  background: var(--c-accent);
  color: var(--c-white);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .8rem;
  border-radius: 0 0 4px 4px;
  z-index: 999;
  border-bottom: none;
}
.skip-link:focus { top: 0; }
