/* ==========================================================================
   EDHAAS DIGISOFT — GLOBAL DESIGN SYSTEM  (assets/css/custom.css)
   --------------------------------------------------------------------------
   Tailwind (Play CDN) handles layout/utilities in the markup. This file is
   the design-system layer: brand tokens, typography, and reusable component
   classes (buttons, cards, hero/slideshow, CTA, FAQ, forms, nav, footer).

   Plain CSS only (no @apply) so it is framework-independent and portable.
   Kept intentionally lean — every block maps to a section of the brand kit.

   CONTENTS
     1.  Design tokens (CSS variables)
     2.  Base + typography
     3.  Layout (container, section spacing)
     4.  Buttons
     5.  Cards
     6.  Navigation (navbar, dropdowns, mobile menu)
     7.  Hero + slideshow
     8.  CTA block
     9.  FAQ accordion
     10. Forms
     11. Footer
     12. Brand background patterns
     13. Utilities (scroll reveal, a11y, focus, reduced motion)
   ========================================================================== */

/* ----------------------------------------------------------------------------
   1. DESIGN TOKENS
---------------------------------------------------------------------------- */
:root {
  /* Brand colors */
  --orange:       #F07F2F;
  --orange-dark:  #d96a1c;
  --teal:         #167F77;
  --teal-dark:    #0f5f59;
  --navy:         #0C3B3A;
  --navy-light:   #155650;
  --sky:          #D9EEF5;
  --grey:         #F5F7FA;
  --charcoal:     #2E2E2E;
  --white:        #FFFFFF;
  --border:       #E6EBF1;        /* light grey form/card borders */

  /* Fonts */
  --font-heading: "Poppins", "Montserrat", system-ui, sans-serif;
  --font-body:    "Inter", "Open Sans", system-ui, sans-serif;

  /* Radius */
  --radius-sm: 8px;     /* buttons, inputs (brand spec) */
  --radius:    12px;    /* cards (brand spec 10–12px) */
  --radius-lg: 16px;

  /* Soft elevation (brand: subtle) */
  --shadow:       0 6px 24px -8px rgba(12, 59, 58, 0.18);
  --shadow-hover: 0 18px 40px -12px rgba(12, 59, 58, 0.28);

  /* Spacing scale (brand: 8 / 16 / 32, section gap 80–100) */
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 32px;
  --container: 1200px;
}

/* ----------------------------------------------------------------------------
   2. BASE + TYPOGRAPHY
   Headings → Poppins (Teal/Navy). Body → Inter (Charcoal). Highlight → Orange.
---------------------------------------------------------------------------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  font-size: 1.0625rem;          /* ~17px, brand body 16–18px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.18;
  color: var(--navy);
  margin: 0;
}

/* Optional heading-size helpers (use when not sizing via Tailwind utilities).
   Matches brand scale: H1 40 / H2 30 / H3 22. Fluid for responsiveness. */
.h1 { font-size: clamp(2rem, 4.5vw, 2.5rem); font-weight: 800; }
.h2 { font-size: clamp(1.6rem, 3.2vw, 1.875rem); }
.h3 { font-size: 1.375rem; font-weight: 600; }
.lead { font-size: 1.125rem; line-height: 1.7; }
.eyebrow {                                   /* small uppercase label above H2 */
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}
.text-highlight { color: var(--orange); }    /* highlight words in orange */

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

/* ----------------------------------------------------------------------------
   3. LAYOUT — container + section spacing (section gap 80–100px)
---------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 640px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

.section       { padding-block: clamp(3.5rem, 8vw, 7rem); }   /* ~56–112px */
.section--tight{ padding-block: clamp(2.5rem, 5vw, 4rem); }

/* ----------------------------------------------------------------------------
   4. BUTTONS
   Primary: orange bg / white text / 8px radius / darker on hover.
   Secondary: teal outline, transparent bg. Light: for dark sections.
---------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease,
              border-color .2s ease, transform .2s ease, box-shadow .2s ease;
  white-space: normal;
  text-align: center;
}
.btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.btn svg { width: 1.15em; height: 1.15em; }

.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 4px 14px -6px rgba(240,127,47,.6); }
.btn-primary:hover { background: var(--orange-dark); color: #fff; }

.btn-secondary { border-color: var(--teal); color: var(--teal); background: transparent; }
.btn-secondary:hover { background: var(--teal); color: #fff; }

.btn-light { border-color: rgba(255,255,255,.45); color: #fff; background: transparent; }
.btn-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

.btn-lg    { font-size: 1.0625rem; padding: 0.95rem 1.75rem; }
.btn-block { width: 100%; }

/* ----------------------------------------------------------------------------
   5. CARDS — white, soft shadow, 12px radius, generous padding
---------------------------------------------------------------------------- */
.card {
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2vw, 1.5rem);
  box-shadow: var(--shadow);
}
.card--flat { box-shadow: none; background-color: var(--grey); }
.card-hover { transition: transform .25s ease, box-shadow .25s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* Icon chip used inside cards */
.icon-chip {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: 0.75rem;
}
.icon-chip--teal   { background: rgba(22,127,119,.10); color: var(--teal); }
.icon-chip--orange { background: rgba(240,127,47,.12); color: var(--orange); }
.icon-chip svg { width: 1.5rem; height: 1.5rem; }

/* ----------------------------------------------------------------------------
   6. NAVIGATION — navbar (white / teal text / orange CTA), dropdowns, mobile
---------------------------------------------------------------------------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--grey);
}
.nav-link {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.5rem 1rem;
  font-weight: 500; font-size: 0.95rem;
  color: var(--navy);
  border-radius: 6px;
  transition: color .2s ease;
}
.nav-link:hover, .nav-link[aria-expanded="true"] { color: var(--teal); }
.nav-caret { width: 1rem; height: 1rem; transition: transform .2s ease; }

/* Laptop range (lg 1024–1279px): tighten so the full horizontal menu fits
   on one row without wrapping or overflowing next to the logo + CTA. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .navbar .nav-link { padding: 0.5rem 0.6rem; font-size: 0.875rem; gap: 0.15rem; }
  .navbar .nav-caret { width: 0.85rem; height: 0.85rem; }
}
[aria-expanded="true"] > .nav-caret { transform: rotate(180deg); }

/* Desktop dropdown panel */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute; left: 0; top: calc(100% + 4px);
  min-width: 20rem;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  z-index: 100;
}
/* JS adds .is-open on click; CSS removes hidden-attr interference */
.nav-dropdown-menu.is-open { display: block !important; }
.nav-dropdown-item {
  display: block; padding: 0.6rem 0.75rem; border-radius: 0.5rem;
  color: var(--navy); font-size: 0.9rem; white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--grey); color: var(--navy); }
.nav-dropdown-item small { display: block; color: rgba(46,46,46,.65); font-size: 0.78rem; }

/* Mobile menu */
.mobile-menu { border-top: 1px solid var(--grey); background: #fff; }
.mobile-menu[hidden] { display: none; }
.mobile-link {
  display: flex; align-items: center;
  padding: 0.75rem 1rem; border-radius: 0.5rem;
  font-weight: 500; color: var(--navy);
  text-align: left; width: 100%;
  line-height: 1.4;
}
.mobile-link:hover { background: var(--grey); color: var(--navy); }

/* Accordion trigger — text left, caret right */
button.mobile-link {
  justify-content: space-between;
}
button.mobile-link .nav-caret {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* Sub-menu items */
[data-collapse] .mobile-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--charcoal);
  padding: 0.55rem 0.75rem;
}
[data-collapse] .mobile-link:hover { color: var(--navy); }

/* Generic collapse (used by mobile submenus) */
[data-collapse][hidden] { display: none; }

/* ----------------------------------------------------------------------------
   7. HERO + SLIDESHOW
   Slides crossfade; only .is-active is visible. JS toggles the class.
---------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
}

/* ── Slideshow container ────────────────────────────────────────────────────
   aspect-ratio: 16/9 matches the SVG viewBox (1600×900) so the full
   dashboard is always visible without cropping, at every screen width.
   min-height prevents it shrinking too small on narrow phones.
   max-height caps it on large screens so it does not dominate the page.
   object-fit: contain (below) fills the remaining bars with --navy so
   the brand colour shows through — no white or grey gaps.             */
[data-slides] {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  max-height: 440px;
  overflow: hidden;
  background: var(--navy);
}

/* Tablets — allow slightly taller */
@media (min-width: 600px) {
  [data-slides] { max-height: 480px; }
}

/* Desktop/laptop — comfortable height, not too tall */
@media (min-width: 1024px) {
  [data-slides] { max-height: 500px; }
}

.slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .7s ease-in-out;
}
.slide.is-active { opacity: 1; pointer-events: auto; }

/* contain so full dashboard is always visible; navy fills letterbox bars */
.slide-art {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center center;
  background: var(--navy);
}


/* Slow Ken-Burns drift on the active slide's artwork */
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }
.slide.is-active .slide-art { animation: kenburns 9s ease-out forwards; }

/* Carousel controls — hidden on mobile (dots remain accessible) */
@media (max-width: 639px) {
  .hero-arrow { display: none !important; } /* hides arrows on phones; dots still navigate */
}
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10;
  width: 2.75rem; height: 2.75rem;
  display: grid; place-items: center;
  border-radius: 9999px;
  background: rgba(255,255,255,.15);
  color: #fff; border: 0; cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color .2s ease;
}
.hero-arrow:hover { background: rgba(255,255,255,.3); }
.hero-arrow--prev { left: 0.75rem; }
.hero-arrow--next { right: 0.75rem; }
@media (min-width: 640px) { .hero-arrow--prev { left: 1.25rem; } .hero-arrow--next { right: 1.25rem; } }

.hero-dots {
  position: absolute; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; gap: 0.625rem;
}
.hero-dot {
  height: 0.625rem; width: 0.625rem;
  border-radius: 9999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.5);
  transition: width .25s ease, background-color .25s ease;
  position: relative;     /* anchor for tap-area pseudo-element */
}
/* WCAG 2.5.5 — extend tap area to 44×44px without changing visual */
.hero-dot::after {
  content: ''; position: absolute; inset: -17px;
}
.hero-dot:hover { background: rgba(255,255,255,.8); }
.hero-dot.is-active { width: 2rem; background: var(--orange); }

/* ----------------------------------------------------------------------------
   8. CTA BLOCK — teal/navy band, white text, orange button
---------------------------------------------------------------------------- */
.cta-block { position: relative; overflow: hidden; background: var(--teal); color: #fff; }
.cta-block--navy { background: var(--navy); }
.cta-block h2, .cta-block h3 { color: #fff; }

/* ----------------------------------------------------------------------------
   9. FAQ ACCORDION
   Panel animates via max-height (set to scrollHeight by site.js when open).
---------------------------------------------------------------------------- */
.faq-item {
  background: #fff;
  border: 1px solid var(--grey);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq-item + .faq-item { margin-top: 0.75rem; }
.faq-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  text-align: left;
  padding: 1.15rem 1.5rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
  color: var(--navy);
}
.faq-icon { width: 1.25rem; height: 1.25rem; color: var(--teal); flex-shrink: 0; transition: transform .25s ease; }
.faq-trigger[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-panel {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.faq-panel-inner { padding: 0 1.5rem 1.25rem; color: rgba(46,46,46,.82); font-size: 0.95rem; }

/* ----------------------------------------------------------------------------
   10. FORMS — light-grey border, teal focus, charcoal labels
---------------------------------------------------------------------------- */
.form-label { display: block; margin-bottom: 0.4rem; font-size: 0.875rem; font-weight: 600; color: var(--charcoal); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-body); font-size: 0.95rem; color: var(--charcoal);
  transition: border-color .2s ease, box-shadow .2s ease;
}
/* Custom select arrow — overrides browser default across all engines */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23167F77' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}
.form-input::placeholder, .form-textarea::placeholder { color: rgba(46,46,46,.45); }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22,127,119,.18);
}
.form-textarea { min-height: 8rem; resize: vertical; }
.form-hint  { font-size: 0.8rem; color: rgba(46,46,46,.6); margin-top: 0.3rem; }
.form-group { margin-bottom: 1.1rem; }

/* ----------------------------------------------------------------------------
   11. FOOTER — navy bg, sky text, orange link hover
---------------------------------------------------------------------------- */
.site-footer { background: var(--navy); color: #fff; }
.site-footer h2 { color: #fff; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.06em; }
.footer-link { color: rgba(217,238,245,.8); }
.footer-link:hover { color: var(--orange); }

/* ----------------------------------------------------------------------------
   12. BRAND BACKGROUND PATTERNS (keep opacity low — 5–10%)
---------------------------------------------------------------------------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(22,127,119,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(22,127,119,.06) 1px, transparent 1px);
  background-size: 44px 44px;
}
.bg-grid-dark {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
.bg-dots-dark {
  background-image: radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ----------------------------------------------------------------------------
   13. UTILITIES — scroll reveal, a11y, focus, reduced motion
---------------------------------------------------------------------------- */
/* Scroll reveal (site.js adds .reveal-in when element enters viewport) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }   /* fallback if JS is off */

/* Screen-reader-only text */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Consistent keyboard focus ring on interactive brand elements */
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide { transition: none; }
  .slide.is-active .slide-art { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Article prose styles ─────────────────────────────────── */
.prose-article h2 {
  font-family: var(--font-heading, 'Poppins', system-ui, sans-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.prose-article h2:first-child { margin-top: 0; }
.prose-article p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(46,46,46,.85);
  margin-top: 1rem;
}
.prose-article p strong { color: var(--navy); font-weight: 600; }
.prose-article p:first-child { margin-top: 0; }
