/*
Theme Name: Edvigorate
Theme URI: https://www.edvigorate.com
Author: Edvigorate
Description: Premium redesign for Edvigorate education consulting. Forest palette (deep green, cool bone, amber accent), Outfit display type, restrained motion, dual light/dark mode.
Version: 1.0.4
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: edvigorate
*/

/* =====================================================
   1. DESIGN TOKENS
   Shape rule for the whole theme:
   buttons = full pill, surfaces/images = 18px, inputs = 10px.
   One accent (amber) across the entire page.
   ===================================================== */
:root {
  --bg: #f5f7f3;
  --surface: #fdfdfb;
  --tint: #e9efe6;
  --ink: #16211b;
  --muted: #515d55;
  --brand: #14432f;
  --brand-deep: #0c2b1e;
  --on-brand: #f2f5ef;
  --accent: #de9a33;
  --accent-text: #9a5f10;      /* darker amber, passes contrast for large text on light bg */
  --line: rgba(22, 33, 27, 0.14);
  --r-surface: 18px;
  --r-input: 10px;
  --shadow: 0 20px 50px -24px rgba(12, 43, 30, 0.35); /* green-tinted, never pure black */
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1411;
    --surface: #131c17;
    --tint: #182620;
    --ink: #e9efe9;
    --muted: #9fb0a5;
    --brand: #1e5b41;
    --brand-deep: #0c2b1e;
    --on-brand: #f2f5ef;
    --accent: #e0a248;
    --accent-text: #e8b159;
    --line: rgba(233, 239, 233, 0.16);
    --shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.55);
  }
}

/* =====================================================
   2. RESET / 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;
  overflow-x: clip; /* offset hero accent block extends past the container edge by design */
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  font-weight: 650;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  max-width: 65ch;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--brand-deep);
  color: var(--on-brand);
  border-radius: 0 0 var(--r-input) 0;
}

.skip-link:focus {
  left: 0;
}

/* =====================================================
   3. LAYOUT
   ===================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  padding-block: clamp(4.5rem, 9vw, 8rem);
}

/* =====================================================
   4. BUTTONS  (pill shape, locked)
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

/* On the deep green CTA band, the primary flips to amber for contrast */
.band-deep .btn-primary {
  background: var(--accent);
  color: #16211b; /* dark ink on amber passes WCAG AA in both modes */
}

.band-deep .btn-primary:hover {
  background: #eab04e;
}

/* =====================================================
   5. HEADER / NAV  (single line, 72px cap)
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  font-weight: 750;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.brand .custom-logo {
  max-height: 40px;
  width: auto;
}

.nav-primary ul {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-primary a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.nav-primary a:hover,
.nav-primary .current-menu-item > a {
  color: var(--ink);
}

.header-cta {
  display: inline-flex;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

/* =====================================================
   6. HERO  (asymmetric split, 7/5)
   ===================================================== */
.hero {
  padding-block: clamp(3rem, 6vw, 5.5rem) clamp(4rem, 8vw, 7rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.75rem, 6.5vw, 4.75rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero h1 .mark {
  font-style: normal;
  background-image: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 55%, transparent) 62%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

@media (prefers-color-scheme: dark) {
  .hero h1 .mark {
    background-image: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 32%, transparent) 62%);
  }
}

.hero-sub {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* Two hero images: workplace + field trip, second one offset down for rhythm */
.hero-media {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.7rem, 1.4vw, 1.1rem);
  align-items: start;
}

.hero-media::before {
  content: "";
  position: absolute;
  inset: 14% -5% -5% 5%;
  background: var(--tint);
  border-radius: var(--r-surface);
  z-index: 0;
}

.hero-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-surface);
  box-shadow: var(--shadow);
}

.hero-media .hero-img-b {
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

/* =====================================================
   7. STATEMENT  (editorial full-width)
   ===================================================== */
.statement {
  border-top: 1px solid var(--line);
}

.statement-text {
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 26ch;
  margin: 0;
}

.statement-text .mark {
  color: var(--accent-text);
  font-style: normal;
  font-weight: 650;
}

/* The three practice areas: deliberately prominent, one amber rule each */
.contexts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: clamp(2.75rem, 5vw, 4rem);
  padding: 0;
  list-style: none;
}

.contexts li {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
  padding-top: 1.1rem;
  border-top: 3px solid var(--accent);
}

/* =====================================================
   8. SERVICES  (two alternating split rows)
   ===================================================== */
.service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.service-row + .service-row {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.service-row.is-flipped .service-media {
  order: -1;
}

.section-heading {
  font-size: clamp(2rem, 4.2vw, 3rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

.section-heading.has-intro {
  margin-bottom: 1rem;
}

.section-intro {
  color: var(--muted);
  max-width: 55ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.service-copy h3 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin-bottom: 0.85rem;
}

.service-copy p {
  color: var(--muted);
}

.service-points {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.service-points li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-weight: 500;
}

.service-points li::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 2px;
  background: var(--accent);
  transform: translateY(-0.28em);
}

.service-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-surface);
  box-shadow: var(--shadow);
}

/* =====================================================
   8b. SEMINARS  (asymmetric 3-cell grid)
   One featured cell with photo, one deep green cell,
   one bordered cell. Cell count = content count.
   ===================================================== */
.seminars-grid {
  display: grid;
  grid-template-columns: 5fr 4fr;
  gap: 1.5rem;
}

.seminar-card {
  border-radius: var(--r-surface);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2rem;
  overflow: hidden;
}

.seminar-card h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.seminar-card p {
  color: var(--muted);
  margin: 0;
}

.seminar-card.is-featured {
  grid-row: span 2;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.seminar-card.is-featured img {
  width: 100%;
  flex: 1;
  min-height: 260px;
  object-fit: cover;
}

.seminar-card.is-featured .seminar-body {
  padding: 2rem;
}

.seminar-card.is-deep {
  background: var(--brand-deep);
  border-color: transparent;
  color: var(--on-brand);
}

.seminar-card.is-deep p {
  color: color-mix(in srgb, var(--on-brand) 76%, transparent);
}

/* =====================================================
   9. APPROACH  (tinted band, heading + stacked items)
   ===================================================== */
.approach {
  background: var(--tint);
}

.approach-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.approach h2 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  position: sticky;
  top: 6.5rem;
}

.approach-item {
  padding-block: 1.75rem;
}

.approach-item + .approach-item {
  border-top: 1px solid var(--line);
}

.approach-item h3 {
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
}

.approach-item p {
  color: var(--muted);
  margin: 0;
}

/* =====================================================
   10. CTA BAND  (deep green, the one dark moment)
   ===================================================== */
.band-deep {
  background: var(--brand-deep);
  color: var(--on-brand);
  text-align: center;
}

.band-deep h2 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin-bottom: 1rem;
}

.band-deep p {
  color: color-mix(in srgb, var(--on-brand) 78%, transparent);
  margin-inline: auto;
  margin-bottom: 2.25rem;
  max-width: 42ch;
}

/* =====================================================
   11. FOOTER
   ===================================================== */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3.5rem 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand .brand {
  font-size: 1.2rem;
}

.footer-mission {
  color: var(--muted);
  margin-top: 0.6rem;
  font-size: 0.98rem;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 0.9rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.98rem;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-legal {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* =====================================================
   12. GENERIC PAGE CONTENT  (page.php, index.php)
   ===================================================== */
.page-hero {
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(2rem, 4vw, 3rem);
}

.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
}

.entry-content {
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.entry-content > * {
  max-width: 65ch;
}

.entry-content img,
.entry-content .wp-block-image {
  border-radius: var(--r-surface);
}

.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="tel"],
.entry-content textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
}

.entry-content input:focus,
.entry-content textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--brand);
}

.entry-content input[type="submit"],
.entry-content button[type="submit"] {
  display: inline-flex;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  border: none;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* =====================================================
   12b. CONTACT PAGE  (info column + WPForms card)
   ===================================================== */
.page-hero-sub {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 50ch;
  margin: 0.5rem 0 0;
}

.section-tight {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4.5rem, 9vw, 8rem);
}

.contact-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact-info h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-step {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
}

.contact-step h3 {
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.contact-step p {
  color: var(--muted);
  margin: 0;
}

.contact-alt {
  margin-top: 2rem;
  color: var(--muted);
}

.contact-alt a {
  color: var(--ink);
  font-weight: 600;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-surface);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* WPForms skin: match theme tokens. Higher specificity than the
   plugin's base stylesheet, which loads after this file. */
.contact-form .wpforms-form .wpforms-field-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.35rem;
}

.contact-form .wpforms-form .wpforms-field-sublabel {
  color: var(--muted);
  font-size: 0.85rem;
}

.contact-form .wpforms-form input[type="text"],
.contact-form .wpforms-form input[type="email"],
.contact-form .wpforms-form input[type="tel"],
.contact-form .wpforms-form textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r-input);
}

.contact-form .wpforms-form input:focus,
.contact-form .wpforms-form textarea:focus {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--brand);
}

.contact-form .wpforms-form .wpforms-field {
  padding-block: 0.65rem;
}

.contact-form .wpforms-form button[type="submit"] {
  display: inline-flex;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  border: none;
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.contact-form .wpforms-form button[type="submit"]:hover {
  background: var(--brand-deep);
}

.contact-form .wpforms-form button[type="submit"]:active {
  transform: translateY(1px) scale(0.98);
}

.contact-form .wpforms-form em.wpforms-error {
  color: #b3261e;
  font-size: 0.85rem;
}

@media (prefers-color-scheme: dark) {
  .contact-form .wpforms-form em.wpforms-error {
    color: #f2b8b5;
  }
}

/* =====================================================
   13. REVEAL MOTION
   Hidden state only applies once JS confirms it will run
   (html.js.reveal-ready), so content is never lost without JS.
   Fully disabled under prefers-reduced-motion.
   ===================================================== */
@media (prefers-reduced-motion: no-preference) {
  html.js.reveal-ready [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  }

  html.js.reveal-ready [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================
   14. LEGACY BUILDER COMPATIBILITY
   The site runs BoldGrid page-builder plugins whose
   Bootstrap-era CSS loads after this stylesheet. Their
   .container clearfix (:before { display: table }) injects
   a phantom cell into our grids, and their .btn / .container
   rules override ours. Re-assert with higher specificity.
   ===================================================== */
div.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

div.container::before,
div.container::after {
  content: none;
  display: none;
}

a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  box-shadow: none;
  text-shadow: none;
  text-transform: none;
  top: auto;
}

.btn.btn-primary,
.btn.btn-primary:visited {
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
}

.btn.btn-primary:hover,
.btn.btn-primary:focus {
  background: var(--brand-deep);
  color: var(--on-brand);
}

.band-deep .btn.btn-primary,
.band-deep .btn.btn-primary:visited {
  background: var(--accent);
  color: #16211b;
}

.band-deep .btn.btn-primary:hover,
.band-deep .btn.btn-primary:focus {
  background: #eab04e;
  color: #16211b;
}

.btn.btn-ghost,
.btn.btn-ghost:visited {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.btn-ghost:hover,
.btn.btn-ghost:focus {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

/* =====================================================
   15. MOBILE COLLAPSE  (< 900px nav, < 768px grids)
   ===================================================== */
@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* Specificity must beat the a.btn rule in the legacy-compat section */
  a.btn.header-cta,
  .header-cta {
    display: none;
  }

  .nav-primary {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.75rem;
    display: none;
  }

  .nav-primary.is-open {
    display: block;
  }

  .nav-primary ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
  }

  .nav-primary a {
    font-size: 1.15rem;
  }
}

@media (max-width: 767px) {
  .hero-grid,
  .service-row,
  .seminars-grid,
  .approach-grid,
  .contact-grid,
  .contexts,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .contexts {
    gap: 1.25rem;
  }

  .contact-form {
    order: -1; /* form first on mobile; the reassurance copy follows */
  }

  .seminar-card.is-featured {
    grid-row: auto;
  }

  .seminar-card.is-featured img {
    aspect-ratio: 3 / 2;
    flex: none;
  }

  /* The image pair stays two-up on mobile so both audiences read at a glance */
  .hero-media {
    order: -1;
  }

  .hero-media .hero-img-b {
    margin-top: 1.25rem;
  }

  .service-row.is-flipped .service-media {
    order: 0;
  }

  .approach h2 {
    position: static;
  }
}
