/* ==========================================================================
   The Coaching Room — EduImpact blog article template (website 2 / production).
   Loaded AFTER styles.css. Reuses production's brand + theme tokens (--teal,
   --copper, --gold, --cream, --warm-white, --charcoal) which already flip in
   dark mode via [data-theme] / prefers-color-scheme. This file only adds the
   article's editorial design + Quicksand body. All wrappers are cr-prefixed to
   avoid colliding with the site's .nav / .footer / .btn / .wrap.
   ========================================================================== */

.cr {
  /* Article-local semantic tokens, derived from production's flipping tokens.
     --warm-white is #FAFAF7 in light and #1e1e1e in dark (set by styles.css),
     so anything mapped to it auto-adapts. */
  --cr-page: var(--warm-white);
  --cr-ink: var(--charcoal);            /* #4A4A4A light, #e8e2d6 dark */
  --cr-ink-soft: var(--text-muted);
  --cr-ink-faint: var(--text-faint);
  --cr-heading: var(--teal);            /* see dark override below */
  --cr-card: #ffffff;
  --cr-card-2: #fdfcf8;
  --cr-card-border: rgba(193, 122, 62, 0.42);
  --cr-card-num-bg: var(--warm-white);
  --cr-rule: rgba(193, 122, 62, 0.28);
  --cr-quote: var(--teal);
  --cr-related-bg: rgba(232, 226, 214, 0.34);
  --cr-related-bg-hover: rgba(232, 226, 214, 0.6);
  --cr-related-border: rgba(29, 122, 110, 0.16);
  --cr-image-frame: rgba(74, 74, 74, 0.10);
  --cr-grain-blend: multiply;
  --cr-grain-opacity: 0.045;

  --cr-serif: 'Aleo', Georgia, serif;
  --cr-sans: 'Quicksand', system-ui, sans-serif;
  --cr-script: 'Lora', Georgia, serif;

  /* Reading measure for body text inside the sheet (keeps line length comfortable). */
  --cr-col: 62ch;
  --cr-col-wide: 62ch;
  --cr-pad: clamp(20px, 5vw, 40px);

  /* Paper-canvas layout: a centered warm-white "sheet" on a cream backdrop. */
  --cr-canvas: var(--cream);           /* backdrop framing the empty space (flips in dark) */
  --cr-sheet-max: 1080px;              /* max sheet width on large screens */
  --cr-sheet-pad: clamp(22px, 5vw, 72px);

  background: var(--cr-canvas);
  color: var(--cr-ink);
  font-family: var(--cr-sans);
  font-weight: 450;
  font-size: 18px;
  line-height: 1.72;
}

/* ---- Dark-theme refinements (warm). Headings/links/quote use light teal,
   which reads better than deep teal on a dark canvas. Copper holds. ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr {
    --cr-heading: var(--teal-light);
    --cr-quote: var(--teal-light);
    --cr-card: #26231D;
    --cr-card-2: #221F1A;
    --cr-card-border: rgba(193, 122, 62, 0.55);
    --cr-card-num-bg: #1E1C18;
    --cr-rule: rgba(193, 122, 62, 0.34);
    --cr-related-bg: rgba(38, 35, 29, 0.7);
    --cr-related-bg-hover: rgba(48, 44, 36, 0.9);
    --cr-related-border: rgba(59, 181, 165, 0.22);
    --cr-image-frame: rgba(0, 0, 0, 0.45);
    --cr-grain-blend: screen;
    --cr-grain-opacity: 0.05;
  }
}
:root[data-theme="dark"] .cr {
  --cr-heading: var(--teal-light);
  --cr-quote: var(--teal-light);
  --cr-card: #26231D;
  --cr-card-2: #221F1A;
  --cr-card-border: rgba(193, 122, 62, 0.55);
  --cr-card-num-bg: #1E1C18;
  --cr-rule: rgba(193, 122, 62, 0.34);
  --cr-related-bg: rgba(38, 35, 29, 0.7);
  --cr-related-bg-hover: rgba(48, 44, 36, 0.9);
  --cr-related-border: rgba(59, 181, 165, 0.22);
  --cr-image-frame: rgba(0, 0, 0, 0.45);
  --cr-grain-blend: screen;
  --cr-grain-opacity: 0.05;
}

/* paper grain over the article only */
.cr-article { position: relative; }
.cr-article::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: var(--cr-grain-opacity); mix-blend-mode: var(--cr-grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.cr ::selection { background: rgba(193, 122, 62, 0.22); }
.cr-article a { color: var(--cr-heading); text-decoration: none; }
.cr-article a:hover { color: var(--copper); }

/* ---------- paper-canvas layout ---------- */
/* Backdrop: cream, frames the empty space on wide screens. */
.cr-article {
  background: var(--cr-canvas);
  padding: clamp(16px, 3vw, 48px) clamp(12px, 3vw, 40px) clamp(40px, 6vw, 80px);
}
/* The sheet: centered warm-white page that holds the article. */
.cr-sheet {
  max-width: var(--cr-sheet-max);
  margin: 0 auto;
  background: var(--cr-page);
  border-radius: 18px;
  box-shadow: 0 30px 70px -44px rgba(74, 74, 74, .5), 0 1px 0 rgba(193, 122, 62, .12);
  overflow: hidden;
  padding: 0 var(--cr-sheet-pad) clamp(28px, 4vw, 52px);
}
/* On phones the sheet goes edge-to-edge (no framing margin) so mobile stays clean. */
@media (max-width: 600px) {
  .cr-article { padding: 0; }
  .cr-sheet { border-radius: 0; box-shadow: none; padding: 0 var(--cr-pad) 32px; }
}

/* Content wrappers: centered reading measure INSIDE the sheet. */
.cr-wrap { max-width: var(--cr-col); margin: 0 auto; padding: 0; }
.cr-wrap-wide { max-width: 100%; margin: 0 auto; padding: 0; }

/* reading progress */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--copper); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .05s linear;
}

/* ---------- hero (type-led, no photo behind title) ---------- */
.cr-hero { position: relative; overflow: hidden; padding: clamp(40px, 6vw, 76px) 0 clamp(32px, 4vw, 52px); isolation: isolate; margin: 0 calc(-1 * var(--cr-sheet-pad)); padding-left: var(--cr-sheet-pad); padding-right: var(--cr-sheet-pad); }
@media (max-width: 600px) { .cr-hero { margin: 0 calc(-1 * var(--cr-pad)); padding-left: var(--cr-pad); padding-right: var(--cr-pad); } }
.cr-hero::before {
  content: ""; position: absolute; inset: -10% -20% auto -20%; height: 120%; z-index: -2;
  background:
    radial-gradient(60% 70% at 72% 8%, rgba(212, 168, 85, .30), rgba(212, 168, 85, 0) 60%),
    radial-gradient(80% 90% at 50% -10%, rgba(193, 122, 62, .16), rgba(193, 122, 62, 0) 55%),
    linear-gradient(180deg, rgba(232, 226, 214, .55), rgba(250, 250, 247, 0) 70%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cr-hero::before {
    background:
      radial-gradient(60% 70% at 72% 8%, rgba(212, 168, 85, .18), rgba(212, 168, 85, 0) 60%),
      radial-gradient(80% 90% at 50% -10%, rgba(193, 122, 62, .14), rgba(193, 122, 62, 0) 55%),
      linear-gradient(180deg, rgba(42, 42, 42, .8), rgba(30, 30, 30, 0) 70%);
  }
}
:root[data-theme="dark"] .cr-hero::before {
  background:
    radial-gradient(60% 70% at 72% 8%, rgba(212, 168, 85, .18), rgba(212, 168, 85, 0) 60%),
    radial-gradient(80% 90% at 50% -10%, rgba(193, 122, 62, .14), rgba(193, 122, 62, 0) 55%),
    linear-gradient(180deg, rgba(42, 42, 42, .8), rgba(30, 30, 30, 0) 70%);
}
.cr-hero-mark {
  position: absolute; z-index: -1; top: clamp(-40px, -3vw, -10px); right: clamp(-90px, -2vw, 2vw);
  width: clamp(260px, 40vw, 520px); height: auto; display: block; opacity: .5; pointer-events: none;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cr-hero-mark { opacity: .7; } }
:root[data-theme="dark"] .cr-hero-mark { opacity: .7; }

.cr-article .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase;
  color: var(--copper); white-space: nowrap; font-family: var(--cr-sans);
}
.cr-article .eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--copper); flex: none; }

.cr-hero h1 {
  font-family: var(--cr-serif); font-weight: 700; color: var(--cr-heading);
  font-size: clamp(2.2rem, 5.4vw, 3.85rem); line-height: 1.08; letter-spacing: -.012em;
  margin: .5em 0 0; max-width: 16ch; text-wrap: balance;
}
.cr-article .dek {
  font-family: var(--cr-sans); font-weight: 450; color: var(--cr-ink);
  font-size: clamp(1.12rem, 2.1vw, 1.4rem); line-height: 1.5; margin: 1.05em 0 0; max-width: 52ch;
}
.cr-article .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 1.7em;
  font-size: 14px; font-weight: 500; color: var(--cr-ink-faint); letter-spacing: .01em; font-family: var(--cr-sans);
}
.cr-article .meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--copper); opacity: .5; }
.cr-article .meta strong { color: var(--cr-ink); font-weight: 600; }
.cr-article .hairline { height: 0; border: none; border-top: 1.5px solid var(--copper); width: 64px; margin: 1.9em 0 0; opacity: .85; }

/* ---------- image slots ---------- */
.lead-figure { margin: clamp(28px, 5vw, 44px) 0 0; }
.lead-figure .frame {
  width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 18px; background: var(--cream);
  box-shadow: 0 1px 0 var(--cr-image-frame), 0 30px 60px -40px rgba(74, 74, 74, .4);
}
.lead-figure img, .inset-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.figure-cap {
  font-family: var(--cr-sans); font-size: 13.5px; font-style: italic; color: var(--cr-ink-faint);
  margin: 12px auto 0; max-width: var(--cr-col); padding: 0 var(--cr-pad); text-align: center; line-height: 1.5;
}
.frame.is-placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--cr-card-border); background: var(--cr-related-bg);
}
.frame.is-placeholder span {
  font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--cr-ink-faint); font-weight: 600; font-family: var(--cr-sans);
}
.inset-figure { margin: clamp(34px, 5vw, 52px) auto; max-width: 32rem; }
.inset-figure .frame {
  width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 14px; background: var(--cream);
  box-shadow: 0 20px 44px -34px rgba(74, 74, 74, .42);
}

/* ---------- article body ---------- */
.cr-article article { padding: clamp(40px, 6vw, 64px) 0 0; }
.cr-article .lead { font-size: clamp(1.18rem, 2vw, 1.35rem); line-height: 1.62; color: var(--cr-ink); margin: 0 0 1.4em; }
.cr-article .lead::first-letter {
  font-family: var(--cr-serif); font-weight: 700; color: var(--copper);
  float: left; font-size: 3.55em; line-height: .78; padding: .06em .12em 0 0; margin: .02em 0 -.04em;
}
.cr-article article p { margin: 0 0 1.35em; font-family: var(--cr-sans); }
.cr-article article p:last-child { margin-bottom: 0; }
.cr-article .section { margin-top: clamp(40px, 5.5vw, 60px); }
.cr-article .section-kicker { display: block; width: 100%; height: 1px; background: var(--copper); opacity: .45; margin: 0 0 clamp(28px, 4vw, 38px); }
.cr-article .section:first-of-type .section-kicker { display: none; }
.cr-article article h2 {
  font-family: var(--cr-serif); font-weight: 700; color: var(--cr-heading);
  font-size: clamp(1.55rem, 3vw, 2.05rem); line-height: 1.18; letter-spacing: -.01em; margin: 0 0 .7em; text-wrap: balance;
}
.cr-article em { font-style: italic; }
.cr-article .quiet { color: var(--cr-ink-soft); }
.cr-article .cr-accent { font-weight: 600; color: var(--cr-heading); }

/* ---------- summary card ---------- */
.summary {
  position: relative;
  /* Break out a touch wider than the reading column, but stay inside the sheet. */
  width: auto; margin: clamp(34px, 5vw, 48px) calc(-1 * clamp(0px, 4vw, 60px)) clamp(8px, 2vw, 16px);
  background: linear-gradient(180deg, var(--cr-card), var(--cr-card-2));
  border: 1px solid var(--cr-card-border); border-radius: 16px; padding: clamp(26px, 4vw, 40px);
  box-shadow: 0 1px 0 rgba(193, 122, 62, .18), 0 26px 50px -34px rgba(74, 74, 74, .35); overflow: hidden;
}
.summary::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 4px; background: linear-gradient(180deg, var(--copper), var(--gold)); }
.summary-mark { position: absolute; right: -26px; bottom: -34px; width: 170px; height: auto; opacity: .5; pointer-events: none; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .summary-mark { opacity: .65; } }
:root[data-theme="dark"] .summary-mark { opacity: .65; }
.summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-label { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--copper); white-space: nowrap; font-family: var(--cr-sans); }
.summary-time { font-size: 12.5px; font-weight: 500; color: var(--cr-ink-faint); letter-spacing: .06em; font-family: var(--cr-sans); }
.summary h3 {
  font-family: var(--cr-serif); font-weight: 700; color: var(--cr-heading);
  font-size: clamp(1.4rem, 2.4vw, 1.72rem); line-height: 1.2; margin: .05em 0 1.3em; letter-spacing: -.01em; text-wrap: balance;
}
.summary-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 34px; }
.summary-list li { position: relative; padding-left: 42px; font-size: 15.5px; line-height: 1.55; color: var(--cr-ink); font-family: var(--cr-sans); }
.summary-list .num {
  position: absolute; left: 0; top: -2px; font-family: var(--cr-sans); font-weight: 700; font-size: 14px; color: var(--copper);
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(193, 122, 62, .5);
  display: flex; align-items: center; justify-content: center; background: var(--cr-card-num-bg);
}
.summary-list strong { display: block; color: var(--cr-heading); font-weight: 600; margin-bottom: 2px; font-size: 16px; }

/* ---------- pull quote ---------- */
.pull { margin: clamp(48px, 6vw, 68px) 0; text-align: center; position: relative; padding: 0 clamp(8px, 4vw, 40px); }
.pull .qmark { font-family: var(--cr-script); font-style: italic; font-size: 5.5rem; line-height: 0; color: var(--copper); opacity: .5; display: block; height: .4em; }
.pull blockquote {
  margin: .2em 0 0; font-family: var(--cr-script); font-style: italic; font-weight: 500; color: var(--cr-quote);
  font-size: clamp(1.6rem, 4.2vw, 2.5rem); line-height: 1.28; letter-spacing: -.005em; text-wrap: balance;
}
.pull .rule { width: 54px; height: 2px; background: var(--copper); margin: 1.1em auto 0; opacity: .8; }

/* ---------- related reading ---------- */
.related {
  display: flex; align-items: center; gap: 18px; margin: 1.9em 0; background: var(--cr-related-bg);
  border: 1px solid var(--cr-related-border); border-left: 3px solid var(--copper); border-radius: 0 12px 12px 0; padding: 16px 20px;
  text-decoration: none; transition: background .18s ease, transform .18s ease;
}
.related:hover { background: var(--cr-related-bg-hover); transform: translateX(2px); }
.related .ricon { flex: none; width: 30px; height: auto; display: block; }
.related .rbody { flex: 1; min-width: 0; }
.related .rlabel { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--copper); margin-bottom: 3px; font-family: var(--cr-sans); }
.related .rtitle { font-family: var(--cr-serif); font-weight: 500; font-size: 1.08rem; color: var(--cr-heading); line-height: 1.3; }
.related .rarrow { flex: none; color: var(--copper); font-size: 20px; transition: transform .18s ease; }
.related:hover .rarrow { transform: translateX(3px); }

/* ---------- CTA (deep teal panel, holds in dark) ---------- */
.cta-shell { padding: clamp(40px, 6vw, 72px) clamp(12px, 3vw, 40px) 0; }
.cta-shell .cr-wrap-wide { max-width: var(--cr-sheet-max); margin: 0 auto; }
.cta {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #1D7A6E 0%, #155a51 100%);
  color: #FAFAF7; border-radius: 22px; padding: clamp(40px, 6vw, 64px) clamp(28px, 5vw, 60px); text-align: center; isolation: isolate;
}
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .85; background: radial-gradient(70% 90% at 18% 0%, rgba(212, 168, 85, .22), rgba(212, 168, 85, 0) 60%); }
.cta-mark { position: absolute; z-index: -1; right: -50px; top: 50%; transform: translateY(-50%); width: 300px; height: auto; opacity: .5; pointer-events: none; display: block; filter: brightness(0) invert(1); }
.cta .eyebrow { color: var(--gold); }
.cta h2 { color: #FAFAF7; font-family: var(--cr-serif); font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.7rem); margin: .4em auto .35em; max-width: 16ch; line-height: 1.18; }
.cta p { color: rgba(250, 250, 247, .86); max-width: 42ch; margin: 0 auto 1.7em; font-size: 1.08rem; line-height: 1.55; font-family: var(--cr-sans); }
.btn-cta {
  display: inline-flex; align-items: center; gap: 10px; background: var(--copper); color: #FAFAF7;
  font-family: var(--cr-sans); font-weight: 600; font-size: 1.02rem; padding: 15px 30px; border-radius: 999px; letter-spacing: .01em;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .5); transition: transform .18s ease, background .18s ease; text-decoration: none;
}
.btn-cta:hover { background: #a9692f; color: #FAFAF7; transform: translateY(-2px); }
.btn-cta .arr { transition: transform .18s ease; }
.btn-cta:hover .arr { transform: translateX(3px); }
.cta .tagline { margin-top: 1.7em; font-family: var(--cr-script); font-style: italic; color: var(--teal-light); font-size: 1.05rem; letter-spacing: .01em; }

/* ---------- index / post list (hub) ---------- */
/* Responsive grid: fills 2-3 cards across as posts grow. Cards keep a comfortable
   width and left-align, so one or two posts look intentional (not stretched or
   stranded in a thin column). */
.cr-postlist {
  margin: clamp(28px, 5vw, 44px) calc(-1 * clamp(0px, 5vw, 90px)) 0;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 360px));
  justify-content: start;
}
@media (max-width: 700px) {
  .cr-postlist { margin: clamp(24px, 5vw, 36px) 0 0; grid-template-columns: 1fr; }
}
.cr-postcard {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none;
  background: linear-gradient(180deg, var(--cr-card), var(--cr-card-2));
  border: 1px solid var(--cr-card-border); border-left: 4px solid var(--copper);
  border-radius: 0 16px 16px 0; padding: clamp(22px, 3.5vw, 32px);
  box-shadow: 0 18px 40px -34px rgba(74, 74, 74, .35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.cr-postcard:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -32px rgba(74, 74, 74, .42); }
.cr-postcard__eyebrow { font-family: var(--cr-sans); font-size: 12px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--copper); }
.cr-postcard__title { font-family: var(--cr-serif); font-weight: 700; font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.2; color: var(--cr-heading); letter-spacing: -.01em; text-wrap: balance; }
.cr-postcard__dek { font-family: var(--cr-sans); font-size: 1rem; line-height: 1.55; color: var(--cr-ink); }
.cr-postcard__meta { font-family: var(--cr-sans); font-size: 13.5px; font-weight: 500; color: var(--cr-ink-faint); display: flex; align-items: center; gap: 8px; }
.cr-postcard__arrow { color: var(--copper); font-size: 18px; transition: transform .18s ease; }
.cr-postcard:hover .cr-postcard__arrow { transform: translateX(3px); }

/* ---------- responsive ---------- */
@media (max-width: 680px) {
  .summary-list { grid-template-columns: 1fr; gap: 18px; }
  .cr-article .eyebrow { white-space: normal; align-items: flex-start; }
  .cr-article .eyebrow .dot { margin-top: 6px; }
  .related { flex-wrap: nowrap; }
  .lead-figure .frame { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) { .cr * { transition: none !important; } }
