/* Creekside CBT
   Forest green, Flatiron sandstone, and meadow gold. */

/* ---------- Tokens ---------- */

:root {
  --color-forest: #1f4d3a;
  --color-pine: #14302a;
  --color-sandstone: #b5653a;
  --color-sandstone-dark: #94502c;
  --color-gold: #d9a441;
  --color-cream: #f6f1e7;
  --color-paper: #fffdf8;
  --color-ink: #1d2420;
  --color-muted: #55615a;
  --color-line: #e2dacb;

  --font-heading: "Lora", Georgia, serif;
  --font-body: "Work Sans", system-ui, sans-serif;

  --radius: 0.75rem;
  --space: clamp(4rem, 8vw, 7rem);
  --container: 72rem;
  --measure: 42rem;
  --header-height: 4.5rem;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 1rem); }

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font: 400 1.0625rem/1.65 var(--font-body);
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--color-forest); }
a:hover { color: var(--color-sandstone-dark); }

:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Utilities ---------- */

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--color-ink);
  color: #fff;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons & links ---------- */

.button {
  display: inline-block;
  padding: 0.8em 1.4em;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.button-primary { background: var(--color-forest); color: #fff; }
.button-primary:hover { background: var(--color-pine); color: #fff; }
.button-accent { background: var(--color-gold); color: var(--color-pine); }
.button-accent:hover { background: #e6b65c; color: var(--color-pine); }
.button-ghost { border-color: rgb(255 255 255 / 0.8); color: #fff; }
.button-ghost:hover { background: rgb(255 255 255 / 0.12); color: #fff; }

.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.eyebrow {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-sandstone-dark);
}

.text-link { font-weight: 600; }
.text-link::after { content: " →"; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--color-forest);
  text-decoration: none;
}
.brand:hover { color: var(--color-forest); }
.brand-mark { width: 2.75rem; height: 2.75rem; flex: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font: 600 1.35rem var(--font-heading); }
.brand-sub {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav ul a {
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
}
.site-nav ul a:hover { color: var(--color-sandstone-dark); }
.site-nav ul a[aria-current="page"] {
  color: var(--color-forest);
  text-decoration: underline;
  text-decoration-color: var(--color-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.nav-toggle { display: none; }

@media (max-width: 54rem) {
  .nav-toggle {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    position: relative;
    display: block;
    width: 1.5rem;
    height: 2px;
    background: var(--color-forest);
    content: "";
  }
  .nav-toggle-bar::before { position: absolute; top: -7px; }
  .nav-toggle-bar::after { position: absolute; top: 7px; }

  .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--color-cream);
    border-bottom: 1px solid var(--color-line);
  }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 0.75rem 0; }
  .site-nav .button { text-align: center; }
  .js .site-nav:not(.is-open) { display: none; }
}

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  align-items: end;
  min-height: min(88vh, 46rem);
  padding-block: var(--space);
  color: #fff;
  background:
    linear-gradient(to top, rgb(20 48 42 / 0.9), rgb(20 48 42 / 0.45) 60%, rgb(20 48 42 / 0.2)),
    url("../images/flatirons-hero.jpg") center 40% / cover;
}
.hero .eyebrow { color: var(--color-cream); text-shadow: 0 1px 8px rgb(20 48 42 / 0.6); }
.hero h1 { max-width: 14ch; font-size: clamp(2.6rem, 6vw, 4.75rem); }
.hero h1 em { color: var(--color-gold); }
.hero-lede { max-width: 38rem; margin-bottom: 2rem; font-size: 1.15rem; }

@media (max-width: 40rem) {
  .hero {
    background-image:
      linear-gradient(to top, rgb(20 48 42 / 0.9), rgb(20 48 42 / 0.45) 60%, rgb(20 48 42 / 0.2)),
      url("../images/flatirons-hero-1200.jpg");
  }
}

/* ---------- Inner page header ---------- */

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(5rem, 14vw, 9rem) clamp(2.5rem, 5vw, 4rem);
  color: #fff;
  background: var(--color-pine);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(20 48 42 / 0.88), rgb(20 48 42 / 0.3));
}
.page-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-hero .eyebrow { color: var(--color-gold); }
.page-hero h1 { margin: 0; font-size: clamp(2.5rem, 6vw, 4rem); }
.page-hero p:last-child { max-width: 38rem; margin: 1rem 0 0; font-size: 1.15rem; }

/* ---------- Sections ---------- */

.section { padding-block: var(--space); }
.section-alt { background: var(--color-cream); }
.section-title { font-size: clamp(2rem, 4vw, 2.75rem); color: var(--color-forest); }
.section-title-center { margin-bottom: 2.5rem; text-align: center; }

.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }

/* Two-column layout: image beside text */
.media-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.media-split-top { align-items: start; }

.portrait { margin: 0; }
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12rem 12rem var(--radius) var(--radius);
}
.portrait figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.card {
  padding: 2rem;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}
.card h3 { font-size: 1.4rem; color: var(--color-forest); }
.card p { margin: 0; color: var(--color-muted); }
.card-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  fill: none;
  stroke: var(--color-sandstone);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.explore-card {
  position: relative;
  overflow: hidden;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}
.explore-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.explore-card h3 { margin: 1.25rem 1.25rem 0.25rem; font-size: 1.3rem; }
.explore-card h3 a { color: var(--color-forest); text-decoration: none; }
/* Make the whole card clickable through the heading link */
.explore-card h3 a::after { content: ""; position: absolute; inset: 0; }
.explore-card p { margin: 0 1.25rem 1.5rem; font-size: 0.95rem; color: var(--color-muted); }
.explore-card:hover h3 a { color: var(--color-sandstone-dark); }

/* ---------- Resources ---------- */

.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.resource {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-sandstone);
  border-radius: var(--radius);
}
.resource-source {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-sandstone-dark);
}
.resource h3 { flex: 1; font-size: 1.35rem; }
.resource h3 a { color: var(--color-forest); text-decoration: none; }
/* Make the whole card clickable through the heading link */
.resource h3 a::after { content: ""; position: absolute; inset: 0; }
.resource:hover h3 a { color: var(--color-sandstone-dark); }
.resource-meta { margin: 0; font-size: 0.95rem; color: var(--color-muted); }

/* ---------- Coming soon ---------- */

.coming-soon {
  max-width: var(--measure);
  margin-inline: auto;
  text-align: center;
}
.coming-soon p:first-child {
  font: 500 italic clamp(2rem, 4vw, 2.75rem)/1.2 var(--font-heading);
  color: var(--color-forest);
}

/* ---------- Call to action ---------- */

.cta-band {
  padding-block: var(--space);
  background: var(--color-forest);
  color: #fff;
  text-align: center;
}
.cta-inner { max-width: 40rem; }
.cta-band h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
.cta-band p { margin-bottom: 2rem; opacity: 0.9; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2.5rem;
  background: var(--color-pine);
  color: rgb(255 255 255 / 0.8);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--color-gold); }
.credits {
  flex-basis: 100%;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 0.15);
  font-size: 0.8rem;
  color: rgb(255 255 255 / 0.6);
}
