/* Positive Psychology for Life: site styles.
   Colours and fonts match the Wix site; Figtree replaces Avenir (licensed to Wix only). */

@font-face {
  font-family: "Forum";
  src: url("../fonts/forum-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --cream: #f0f1db;
  --sage: #d7dfc1;
  --olive-light: #cace90;
  --olive: #a7ab78;
  --olive-mid: #616648;
  --olive-dark: #3e4330;
  --white: #ffffff;

  --font-heading: "Forum", Georgia, serif;
  --font-body: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --container: 1160px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-space: clamp(3rem, 8vw, 6rem);
  --radius: 4px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--olive-dark);
  font-family: var(--font-body);
  font-weight: 400;   /* 300 matched Wix's Avenir Light but was too faint at small sizes */
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

p { margin: 0 0 1em; }
strong { font-weight: 600; }

a { color: inherit; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--olive-mid); outline-offset: 3px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.center { text-align: center; }
.narrow.center { margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--olive-dark); color: var(--cream); padding: 0.6rem 1rem;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--olive-mid); margin-bottom: 0.8rem;
}
.lead { font-size: clamp(1.1rem, 1.8vw, 1.25rem); font-weight: 300; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border: 1px solid var(--olive-dark);
  border-radius: var(--radius);
  background: var(--olive-dark);
  color: var(--cream);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.button:hover { background: var(--olive-mid); border-color: var(--olive-mid); }
.button--ghost { background: transparent; color: var(--olive-dark); }
.button--ghost:hover { background: var(--olive-dark); color: var(--cream); }
.button--light { background: var(--cream); color: var(--olive-dark); border-color: var(--cream); }
.button--light:hover { background: var(--olive-light); border-color: var(--olive-light); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.button-row--center { justify-content: center; }

.text-link { font-weight: 500; }
.text-link::after { content: " \2192"; }

/* ---------- Header & navigation ---------- */
.site-header { background: var(--cream); border-bottom: 1px solid var(--sage); position: relative; z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.8rem; }

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand img { width: 56px; height: 56px; }
.brand__name { font-family: var(--font-heading); font-size: 1.25rem; line-height: 1.1; }
.brand__name em { font-style: italic; color: var(--olive-mid); }

.site-nav__list,
.site-nav__sub { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; text-decoration: none; padding: 0.5rem 0.9rem; font-size: 0.95rem; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--olive); text-decoration-thickness: 2px; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent;
  cursor: pointer; position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  position: absolute; left: 10px; width: 24px; height: 2px; background: var(--olive-dark);
  content: ""; transition: transform 0.2s;
}
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { left: 0; top: -7px; }
.nav-toggle__bar::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 900px) {
  .site-nav__list { display: flex; }
  .site-nav__item { position: relative; }
  .has-children > a::after { content: " \25BE"; font-size: 0.75em; }
  .site-nav__sub {
    position: absolute; left: 0; top: 100%; min-width: 15rem;
    background: var(--white); border: 1px solid var(--sage); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgb(62 67 48 / 0.12); padding: 0.4rem 0;
    opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.15s, transform 0.15s;
  }
  .has-children:hover > .site-nav__sub,
  .has-children:focus-within > .site-nav__sub { opacity: 1; visibility: visible; transform: none; }
  .site-nav__sub a:hover { background: var(--cream); }
}

@media (max-width: 899px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-bottom: 1px solid var(--sage); padding: 0.5rem var(--gutter) 1rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--sage); }
  .site-nav__sub a { padding-left: 1.2rem; font-size: 0.9rem; }
}

/* ---------- Sections & layout ---------- */
.section { padding-block: var(--section-space); }
.section--tint { background: var(--sage); }
.section--olive { background: var(--olive-light); }
.section--dark { background: var(--olive-dark); color: var(--cream); }

.grid { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
@media (min-width: 700px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.split { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--media { grid-template-columns: 2fr 3fr; align-items: center; }
}

.card { background: var(--cream); padding: 1.8rem; border-radius: var(--radius); }
.card--light { background: var(--white); display: flex; flex-direction: column; }
.card--light .text-link { margin-top: auto; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Hero ---------- */
.hero { background: var(--olive-light); padding-block: clamp(2.5rem, 6vw, 5rem); }
.hero__inner { display: grid; gap: 2.5rem; align-items: center; }
.hero__image { margin: 0; }
.hero__image img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 3fr 2fr; }
  .hero__image img { aspect-ratio: 4 / 5; max-height: 34rem; }
}

/* ---------- Home: clients, lists, steps, quotes, portrait ---------- */
.clients__list {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem;
}
.clients__list li {
  background: var(--white); border-radius: var(--radius); padding: 0.8rem;
  display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2;
}
.clients__list img { max-height: 70px; width: auto; object-fit: contain; filter: grayscale(1); opacity: 0.85; }
@media (max-width: 599px) {
  /* 16 logos: an even 4 x 4 grid of short tiles instead of a long scroll */
  .clients__list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
  .clients__list li { aspect-ratio: auto; height: 3.75rem; padding: 0.4rem; }
  .clients__list img { max-height: 2.5rem; min-width: 0; }
}

.ticks { list-style: none; padding: 0; margin: 0 0 2rem; }
.ticks li { position: relative; padding-left: 1.8rem; margin-bottom: 0.9rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 0.7rem; height: 0.7rem;
  border-radius: 50%; background: var(--olive);
}

.steps { list-style: none; counter-reset: step; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(5, 1fr); } }
.steps li { counter-increment: step; border-top: 2px solid var(--olive-dark); padding-top: 1rem; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-heading); font-size: 1.6rem; color: var(--olive-mid); }
.steps h3 { margin: 0.3rem 0 0.4rem; }
.steps p { font-size: 0.95rem; margin: 0; }

.quote { margin: 0; background: var(--white); padding: 1.8rem; border-radius: var(--radius); display: flex; flex-direction: column; }
.quote blockquote { margin: 0 0 1rem; font-size: 1.02rem; }
.quote blockquote p::before { content: "\201C"; }
.quote blockquote p::after { content: "\201D"; }
.quote figcaption { margin-top: auto; font-weight: 600; font-size: 0.9rem; color: var(--olive-mid); }
.quote--wide { margin: 1.5rem auto 0; max-width: 46rem; text-align: center; background: transparent; }
.quote--wide blockquote { font-family: var(--font-heading); font-size: clamp(1.3rem, 2.5vw, 1.7rem); line-height: 1.35; }

.portrait { margin: 0; }
.portrait img { border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; max-width: 26rem; }

.cta p { margin-bottom: 2rem; }

/* ---------- Inner pages ---------- */
h4 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.8rem; }
.card h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
.card .ticks { margin-bottom: 0; }
.card .ticks li { font-size: 0.95rem; margin-bottom: 0.6rem; }

@media (min-width: 700px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
.section-subhead { margin-top: 3.5rem; }
.split > div > .quote + .quote { margin-top: 1rem; }
.split .narrow, .section .container > .narrow { margin-bottom: 2.5rem; }

.hero__note { font-size: 0.9rem; color: var(--olive-mid); margin: 1rem 0 0; }
.hero .narrow > p:last-child { margin-bottom: 0; }

/* In-page links (Services) */
.jump-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.8rem; }
.jump-links a {
  padding: 0.45rem 1.1rem; border: 1px solid var(--olive-dark); border-radius: 999px;
  text-decoration: none; font-weight: 500; font-size: 0.9rem;
}
.jump-links a:hover { background: var(--olive-dark); color: var(--cream); }
section[id] { scroll-margin-top: 1rem; }

/* Boundaries, crisis information, scope */
.notice { background: var(--white); border-left: 4px solid var(--olive-mid); border-radius: var(--radius); padding: 1.3rem 1.5rem; }
.notice.narrow { margin-inline: auto; }
.notice h3, .notice__title { font-size: 1.4rem; margin-bottom: 0.5rem; }
.notice ul { margin: 0; padding-left: 1.2rem; }
.notice li { margin-bottom: 0.4rem; }
.notice > :last-child { margin-bottom: 0; }

/* Data tables scroll sideways on small screens */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; }
.table { width: 100%; min-width: 36rem; border-collapse: collapse; background: var(--white); font-size: 0.95rem; }
.table th, .table td { text-align: left; vertical-align: top; padding: 0.85rem 1rem; border-bottom: 1px solid var(--sage); }
.table thead th { background: var(--olive-dark); color: var(--cream); font-weight: 500; }
.table tbody th { font-weight: 600; }

/* FAQs */
.faq { border-top: 1px solid var(--olive); }
.faq details { border-bottom: 1px solid var(--olive); }
.faq summary {
  display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none;
  padding: 1.1rem 0; font-weight: 500; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--olive-mid); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1.2rem; }

/* Events */
.gallery {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 800px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.event-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.event-list li { border-top: 1px solid var(--olive); padding-block: 1.5rem; }
.event-list h3 { margin-bottom: 0.3rem; }
.event-list p:last-child { margin: 0; }
.session-list { margin: 0; padding-left: 1.3rem; }
.session-list li { margin-bottom: 0.6rem; font-size: 0.95rem; }

/* ---------- Blog ---------- */
.post-meta { color: var(--olive-mid); font-size: 0.9rem; margin-bottom: 0.5rem; }

.post-card { background: var(--white); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card img,
.post-card__placeholder { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.post-card__placeholder {
  background: url("../img/logo-tree.png") center / auto 55% no-repeat,
              linear-gradient(135deg, var(--olive-light), var(--sage));
}
.post-card__body { padding: 1.4rem 1.5rem 1.6rem; }
.post-card__title { font-size: 1.45rem; margin-bottom: 0.5rem; }
.post-card__title a { text-decoration: none; }
/* Whole card is clickable via the title link */
.post-card { position: relative; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card:hover .post-card__title a { text-decoration: underline; }
.post-card p:last-child { margin: 0; font-size: 0.95rem; }

.post .eyebrow a { text-decoration: none; }
.post__cover { margin-block: 2rem 2.5rem; }
.post__cover img { width: 100%; max-height: 34rem; object-fit: cover; border-radius: var(--radius); }
.post__back { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--olive-light); }

.prose { font-size: 1.1rem; }
.prose h2 { font-size: clamp(1.6rem, 3vw, 2rem); margin-top: 2.2rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.2rem; border-left: 3px solid var(--olive); font-style: italic; }
.prose figure { margin: 2rem 0; }
.prose img { border-radius: var(--radius); }
.prose a { text-decoration-color: var(--olive); }

/* ---------- Forms ---------- */
@media (min-width: 900px) { .split--contact { grid-template-columns: 2fr 3fr; align-items: start; } }

.form-panel { background: var(--white); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.5rem); scroll-margin-top: 1.5rem; }
.form-panel form { display: flex; flex-wrap: wrap; gap: 0 1rem; }

.field { flex: 1 1 100%; margin-bottom: 1.2rem; }
@media (min-width: 560px) { .field--half { flex-basis: calc(50% - 0.5rem); } }
.field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.field input,
.field textarea {
  width: 100%; padding: 0.75rem 0.9rem; font: inherit; font-weight: 400; color: inherit;
  background: var(--cream); border: 1px solid var(--olive); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus,
.field textarea:focus { outline: 3px solid var(--olive-light); outline-offset: 0; border-color: var(--olive-dark); }
.field--error input,
.field--error textarea { border: 2px solid #9e3b1b; }
.field__error { color: #9e3b1b; font-size: 0.9rem; font-weight: 500; margin: 0 0 0.35rem; }

.form-errors { border-left: 4px solid #9e3b1b; background: #f8ece6; padding: 0.9rem 1.1rem; margin-bottom: 1.5rem; }
.form-errors p { margin: 0; }
.form-errors:focus { outline: none; }
.form-success h2 { margin-bottom: 0.4rem; }
.form-note { flex-basis: 100%; font-size: 0.9rem; color: var(--olive-mid); }

/* Spam trap: off-screen rather than display:none, which some bots detect */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer { background: var(--cream); border-top: 1px solid var(--sage); padding-block: 2.5rem; font-size: 0.9rem; }
.site-footer__inner { display: grid; gap: 1.5rem; justify-items: center; text-align: center; }
.site-footer__brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-heading); font-size: 1.1rem; }
.site-footer__brand p { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; }


/* ---------- Admin preview of a post (shown only to the logged-in admin) ---------- */
.preview-banner { background: #ece3c7; border-bottom: 1px solid var(--olive); padding: 0.7rem var(--gutter); text-align: center; font-size: 0.95rem; }
.preview-banner a { margin-left: 0.5rem; font-weight: 500; }
