/* CPDSE — Sectioned page layout system
 * ─────────────────────────────────────────────────────────────────
 * Editors control everything from YAML front matter in .md files.
 * No HTML required. See _includes/page-section.html for reference.
 *
 * Section background colors (with headline pairing):
 *   soft-white   → forest green headlines, charcoal text
 *   mint-gray    → ivory gold tint headlines, charcoal text
 *   sage-green   → warm sand headlines, soft-white text
 *   forest-green → antique gold headlines, soft-white text
 *   ivory        (legacy, same rules as soft-white)
 *
 * Layout types (choose one per section):
 *   (default)  plain markdown content
 *   cards      card grid — control columns (2|3) and card color
 *   columns    two-column text split
 *   image      image + text (image left or right)
 * ----------------------------------------------------------------- */

/* ── Base section ─────────────────────────────────────────────── */
.page-section {
  padding: var(--space-lg) 0;
}

/* ── Colour variants ──────────────────────────────────────────── */
/* Light backgrounds — charcoal body text */
.page-section--soft-white   { background: var(--color-soft-white, #F9F9F9); color: var(--color-charcoal, #333333); }
.page-section--ivory        { background: var(--color-ivory, #F6F1DC); color: var(--color-charcoal, #333333); }
.page-section--mint-gray    { background: var(--color-mint-gray, #A9BBAA); color: var(--color-charcoal, #333333); }

/* Dark backgrounds — soft-white body text */
.page-section--sage-green   { background: var(--color-sage-green, #5F7D61); color: var(--color-soft-white, #F9F9F9); --muted: rgba(249,249,249,0.75); }
.page-section--forest-green { background: var(--color-forest-green, #3C5E3E); color: var(--color-soft-white, #F9F9F9); --muted: #F9F9F9; }

/* Headline + eyebrow pairings */
.page-section--soft-white h2,
.page-section--soft-white h3,
.page-section--soft-white h4 { color: var(--color-forest-green, #3C5E3E); }

.page-section--mint-gray h2,
.page-section--mint-gray h3,
.page-section--mint-gray h4 { color: var(--color-ivory-gold-tint, #F6F1DC); }

.page-section--sage-green h2,
.page-section--sage-green h3,
.page-section--sage-green h4 { color: var(--color-warm-sand, #E4D7A1); }

.page-section--forest-green h2,
.page-section--forest-green h3,
.page-section--forest-green h4 { color: var(--color-antique-gold, #D6C17C); }

.page-section--sage-green a   { color: rgba(249,249,249,0.85); }
.page-section--mint-gray a    { color: var(--color-forest-green, #3C5E3E); }
.page-section--forest-green a { color: var(--color-warm-sand, #E4D7A1); }

.page-section--sage-green   .btn-primary,
.page-section--forest-green .btn-primary { color: var(--color-forest-green, #3C5E3E) !important; }

/* ── Section header ───────────────────────────────────────────── */
.page-section__header {
  margin-bottom: var(--space-md, 2.5rem);
}

.page-section__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-forest-green, #3C5E3E);
  opacity: 0.65;
  margin: 0 0 0.6rem;
}
.page-section--mint-gray .page-section__eyebrow {
  color: var(--color-ivory-gold-tint, #F6F1DC);
  opacity: 0.85;
}
.page-section--sage-green .page-section__eyebrow {
  color: var(--color-warm-sand, #E4D7A1);
  opacity: 0.85;
}
.page-section--forest-green .page-section__eyebrow {
  color: var(--color-antique-gold, #D6C17C);
  opacity: 0.85;
}

.page-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-forest-green, #3C5E3E);
  margin: 0 0 0.6rem;
}
.page-section--mint-gray .page-section__title    { color: var(--color-ivory-gold-tint, #F6F1DC); }
.page-section--sage-green .page-section__title   { color: var(--color-warm-sand, #E4D7A1); }
.page-section--forest-green .page-section__title { color: var(--color-antique-gold, #D6C17C); }

.page-section__intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted, #8a9490);
  max-width: 68ch;
  margin: 0;
}
.page-section--mint-gray .page-section__intro    { color: var(--color-charcoal, #333333); opacity: 0.8; }
.page-section--sage-green .page-section__intro   { color: rgba(249,249,249,0.85); }
.page-section--forest-green .page-section__intro { color: rgba(249,249,249,0.75); }

/* ── Plain content ────────────────────────────────────────────── */
.page-section__content {
  max-width: 72ch;
}
.page-section__content h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.5rem); color: var(--color-forest-green, #3C5E3E); margin: 1.5rem 0 0.5rem; line-height: 1.15; }
.page-section__content h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.4rem, 2.5vw, 2rem); color: var(--color-forest-green, #3C5E3E); margin: 1.5rem 0 0.5rem; line-height: 1.2; }
.page-section__content h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; color: var(--color-forest-green, #3C5E3E); margin: 1.2rem 0 0.4rem; }
.page-section__content p  { margin: 0.75rem 0; line-height: 1.7; }
.page-section__content ul,
.page-section__content ol { margin: 0.75rem 0 0.75rem 1.4rem; line-height: 1.7; }
.page-section__content li { margin-bottom: 0.3rem; }

.page-section--mint-gray .page-section__content h1,
.page-section--mint-gray .page-section__content h2,
.page-section--mint-gray .page-section__content h3,
.page-section--mint-gray .page-section__content h4 { color: var(--color-ivory-gold-tint, #F6F1DC); }
.page-section--sage-green .page-section__content h1,
.page-section--sage-green .page-section__content h2,
.page-section--sage-green .page-section__content h3,
.page-section--sage-green .page-section__content h4 { color: var(--color-warm-sand, #E4D7A1); }
.page-section--forest-green .page-section__content h1,
.page-section--forest-green .page-section__content h2,
.page-section--forest-green .page-section__content h3,
.page-section--forest-green .page-section__content h4 { color: var(--color-antique-gold, #D6C17C); }

/* ── Cards layout ─────────────────────────────────────────────── */
.page-section__cards {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Column count */
.page-section__cards--2col { grid-template-columns: repeat(2, 1fr); }
.page-section__cards--3col { grid-template-columns: repeat(3, 1fr); }

.page-section__card {
  padding: 1.5rem;
  border: 1px solid var(--card-border, #D9D9D9);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.page-section__card:hover {
  box-shadow: none;
  transform: translateY(-2px);
}

/* Card background colors */
.page-section__cards--soft-white .page-section__card { background: var(--color-soft-white, #F9F9F9); }
.page-section__cards--ivory      .page-section__card { background: var(--color-soft-white, #F9F9F9); }

/* Cards on mint-gray section */
.page-section--mint-gray .page-section__card {
  background: rgba(249,249,249,0.45);
  border-color: rgba(51,51,51,0.15);
}
.page-section--mint-gray .page-section__card-title  { color: var(--color-forest-green, #3C5E3E); }
.page-section--mint-gray .page-section__card-body   { color: var(--color-charcoal, #333333); }

/* Soft-white cards explicitly on a dark section — override dark-section defaults */
.page-section--sage-green   .page-section__cards--soft-white,
.page-section--forest-green .page-section__cards--soft-white {
  --muted: var(--color-charcoal, #333333); /* re-scope so li/muted text is visible on white cards */
}
.page-section--sage-green   .page-section__cards--soft-white .page-section__card,
.page-section--forest-green .page-section__cards--soft-white .page-section__card {
  background: var(--color-soft-white, #F9F9F9);
  border-color: var(--card-border, #D9D9D9);
  color: var(--color-charcoal, #333333);
}
.page-section--sage-green   .page-section__cards--soft-white .page-section__card-title,
.page-section--forest-green .page-section__cards--soft-white .page-section__card-title {
  color: var(--color-forest-green, #3C5E3E);
}
.page-section--sage-green   .page-section__cards--soft-white .page-section__card-body,
.page-section--forest-green .page-section__cards--soft-white .page-section__card-body {
  color: var(--color-charcoal, #333333);
}
.page-section--sage-green   .page-section__cards--soft-white .page-section__card-link,
.page-section--forest-green .page-section__cards--soft-white .page-section__card-link {
  color: var(--color-forest-green, #3C5E3E);
}

/* Cards on sage-green section */
.page-section--sage-green .page-section__card {
  background: rgba(249,249,249,0.12);
  border-color: rgba(249,249,249,0.2);
}
.page-section--sage-green .page-section__card-title  { color: var(--color-warm-sand, #E4D7A1); }
.page-section--sage-green .page-section__card-body  { color: rgba(249,249,249,0.8); }
.page-section--sage-green .page-section__card-num   { color: rgba(249,249,249,0.55); }
.page-section--sage-green .page-section__card-link  { color: rgba(249,249,249,0.9); }

/* Cards on forest-green section */
.page-section--forest-green .page-section__card {
  background: rgba(249,249,249,0.1);
  border-color: rgba(249,249,249,0.18);
}

.page-section__card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-forest-green, #3C5E3E);
  margin: 0;
}
.page-section--forest-green .page-section__card-title { color: var(--color-antique-gold, #D6C17C); }

.page-section__card-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted, #8a9490);
  margin: 0;
}
.page-section--forest-green .page-section__card-body { color: rgba(249,249,249,0.75); }

/* Card link */
.page-section__card-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--color-forest-green, #3C5E3E);
  text-decoration: none;
  line-height: 1.3;
}
.page-section__card-link:hover { opacity: 0.7; }
.page-section--forest-green .page-section__card-link { color: var(--color-antique-gold, #D6C17C); }
.page-section__card--filled .page-section__card-link { color: var(--color-antique-gold, #D6C17C); }

/* Filled (forest-green) card variant — used with card_style: alternating */
.page-section__card--filled {
  background: var(--color-forest-green, #3C5E3E);
  border-color: var(--color-forest-green, #3C5E3E);
  color: #F9F9F9;
}
.page-section__card--filled .page-section__card-title { color: var(--color-antique-gold, #D6C17C); }
.page-section__card--filled .page-section__card-body  { color: rgba(249,249,249,0.8); }
.page-section__card--filled .page-section__card-num   { color: rgba(249,249,249,0.5); }

/* Card number badge */
.page-section__card-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-forest-green, #3C5E3E);
  opacity: 0.55;
}

/* Card icon */
.page-section__card-icon {
  width: 2rem;
  height: 2rem;
  color: var(--color-forest-green, #3C5E3E);
  margin-bottom: 0.25rem;
}
.page-section__card-icon svg { width: 100%; height: 100%; }

/* ── Two-column layout ────────────────────────────────────────── */
.page-section__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md, 2.5rem);
  align-items: start;
}

.page-section__column h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.8rem); color: var(--color-forest-green, #3C5E3E); margin-bottom: 0.75rem; line-height: 1.2; }
.page-section__column h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--color-forest-green, #3C5E3E); margin-bottom: 0.5rem; }
.page-section__column p  { margin: 0.6rem 0; line-height: 1.7; font-size: 0.95rem; }
.page-section__column ul,
.page-section__column ol { margin: 0.6rem 0 0.6rem 1.3rem; line-height: 1.7; font-size: 0.95rem; }

.page-section--sage-green   .page-section__column h2,
.page-section--sage-green   .page-section__column h3 { color: var(--color-warm-sand, #E4D7A1); }
.page-section--forest-green .page-section__column h2,
.page-section--forest-green .page-section__column h3 { color: var(--color-antique-gold, #D6C17C); }
.page-section--mint-gray    .page-section__column h2,
.page-section--mint-gray    .page-section__column h3 { color: var(--color-ivory-gold-tint, #F6F1DC); }

/* ── Image + text layout ──────────────────────────────────────── */
.page-section__image-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md, 2.5rem);
  align-items: center;
}
.page-section__image-text--right .page-section__image-wrap { order: 2; }

.page-section__image-wrap img {
  border-radius: 0;
  width: 100%;
  height: auto;
  object-fit: cover;
  box-shadow: none;
}

.page-section__image-body h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.5rem); color: var(--color-forest-green, #3C5E3E); margin: 1.5rem 0 0.5rem; line-height: 1.15; }
.page-section__image-body h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.3rem, 2.2vw, 1.8rem); color: var(--color-forest-green, #3C5E3E); margin-bottom: 0.75rem; line-height: 1.2; }
.page-section__image-body h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.1rem; color: var(--color-forest-green, #3C5E3E); margin-bottom: 0.5rem; }

.page-section--sage-green .page-section__image-body h1,
.page-section--sage-green .page-section__image-body h2,
.page-section--sage-green .page-section__image-body h3 { color: var(--color-warm-sand, #E4D7A1); }

.page-section--forest-green .page-section__image-body h1,
.page-section--forest-green .page-section__image-body h2,
.page-section--forest-green .page-section__image-body h3 { color: var(--color-antique-gold, #D6C17C); }

.page-section--mint-gray .page-section__image-body h1,
.page-section--mint-gray .page-section__image-body h2,
.page-section--mint-gray .page-section__image-body h3 { color: var(--color-ivory-gold-tint, #F6F1DC); }
.page-section__image-body p  { margin: 0.6rem 0; line-height: 1.7; }
.page-section__image-body ul,
.page-section__image-body ol { margin: 0.6rem 0 0.6rem 1.3rem; line-height: 1.7; }

/* ── Stats strip (homepage forest-green band) ────────────────── */
.page-section__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: var(--space-sm, 1rem) 0;
}

.page-section__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
}

.page-section__stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  color: var(--color-antique-gold, #D6C17C);
}

/* Higher specificity to beat .stat-number { color: #3C5E3E } in main.css */
.page-section--forest-green .page-section__stat-number,
.page-section--forest-green .stat-number {
  color: var(--color-antique-gold, #D6C17C);
}

.page-section__stat-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(249,249,249,0.75);
}

/* Higher specificity for labels too */
.page-section--forest-green .page-section__stat-label,
.page-section--forest-green .stat-label {
  color: rgba(249,249,249,0.75);
}

@media (max-width: 560px) {
  .page-section__stats { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
}

/* ── Card body — markdown list support ────────────────────────── */
.page-section__card-body ul,
.page-section__card-body ol {
  margin: 0.4rem 0 0 1.2rem;
  padding: 0;
  line-height: 1.65;
}
.page-section__card-body li {
  margin-bottom: 0.25rem;
  font-size: 0.88rem;
  color: var(--muted, #8a9490);
}
.page-section--forest-green .page-section__card-body li {
  color: rgba(249,249,249,0.72);
}

/* ── Blockquote in content sections ──────────────────────────── */
.page-section__content blockquote,
.page-section--forest-green .page-section__content blockquote {
  border-left: 3px solid var(--color-antique-gold, #D6C17C);
  margin: 1.5rem 0;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.45;
  color: inherit;
  font-style: italic;
}
.page-section--forest-green .page-section__content blockquote {
  color: var(--color-antique-gold, #D6C17C);
}

/* ── Competency pills ─────────────────────────────────────────── */
.approach-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.approach-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  background: var(--color-soft-white, #F9F9F9);
  border: 1px solid var(--card-border, #D9D9D9);
  color: var(--color-forest-green, #3C5E3E);
  white-space: nowrap;
}
.approach-pill--n { /* numbered variant */
  gap: 0.55rem;
}
.approach-pill__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--color-forest-green, #3C5E3E);
  color: var(--color-antique-gold, #D6C17C);
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .page-section__cards--3col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .page-section { padding: var(--space-md) 0; }
  .page-section__cards--2col,
  .page-section__cards--3col  { grid-template-columns: 1fr; }
  .page-section__columns      { grid-template-columns: 1fr; }
  .page-section__image-text   { grid-template-columns: 1fr; }
  .page-section__image-text--right .page-section__image-wrap { order: 0; }
  .approach-pill { font-size: 0.72rem; padding: 0.5rem 0.9rem; }
}
