/* ==========================================================================
   style.css — Public theme for the PHP MVC website template
   --------------------------------------------------------------------------
   Contract: CONTRACT.md §12 (CSS contract), §13 (JS contract), §14 (presets).

   Design tokens live in :root ALONGSIDE (never overriding) the theme variables
   that are injected at runtime by theme_css():
     --color-primary, --color-secondary, --color-accent,
     --color-bg, --color-text, --color-heading,
     --btn-radius, --btn-style, --font-heading, --font-body
   Those are ONLY consumed here — never redeclared in :root.

   NOTE on --btn-style: the contract defines the variable, but there is no
   html/body data hook in the markup to select a filled vs. outline variant at
   runtime, and CSS cannot read a custom property into a selector.
   We therefore ship filled buttons as the default plus an explicit
   `.btn-outline` variant class (which the hero/settings markup uses directly).
   --btn-style is intentionally not consumed — documented here per contract.

   Motion policy: every transition / animation in this file is declared inside
   `@media (prefers-reduced-motion: no-preference)`. Under reduced motion
   everything is instantly visible, transforms are disabled globally and
   animations are switched off.

   Breakpoints: 640px / 900px / 1100px (mobile-first; the off-canvas nav uses
   max-width: 899.98px because the header itself switches at 900px).
   ========================================================================== */

/* ==========================================================================
   01. Modern reset
   ========================================================================== */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* clip (not hidden) so sticky header keeps working — no horizontal scroll */
  overflow-x: clip;
  tab-size: 4;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Inline SVG icons: sensible default size so an icon without its own
   component rule can never expand to fill its container.
   Component rules (e.g. .icon-card .icon) are more specific and override this. */
.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: -0.2em;
}

.icon-sm { width: 1em; height: 1em; }

.faq-caret {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--color-primary, #2563eb);
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
}

iframe {
  border: 0;
  max-width: 100%;
}

:target {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

/* ==========================================================================
   02. Design tokens (local — theme vars are injected by theme_css())
   ========================================================================== */

:root {
  /* spacing scale — 8px base */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;
  --sp-7: 96px;

  /* radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  /* shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.1);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.18);

  /* layout */
  --container: 1200px;
  --header-h: 72px;
  --topbar-h: 40px;
  --transition: 200ms ease;

  /* local semantic surfaces (light defaults; overridden in dark theme) */
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --muted: #64748b;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --info: #2563eb;

  /* soft brand tints (fallbacks; upgraded via color-mix when supported) */
  --tint-primary: #eef2ff;
  --tint-secondary: #f1f5f9;

  /* NOTE: --font-body / --font-heading / --btn-radius are provided at runtime
     by theme_css() — they are deliberately NOT redeclared here (this file is
     loaded after the injected <style>, so a redeclaration would win). Every
     usage site carries a fallback: var(--font-body, system-ui, …). */
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  :root {
    --tint-primary: color-mix(in srgb, var(--color-primary, #2563eb) 12%, #ffffff);
    --tint-secondary: color-mix(in srgb, var(--color-primary, #2563eb) 6%, #f1f5f9);
  }
}

/* ==========================================================================
   03. Base typography & elements
   ========================================================================== */

body {
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text, #334155);
  background-color: var(--color-bg, #ffffff);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading, system-ui, sans-serif);
  color: var(--color-heading, #0f172a);
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5, h6 { font-size: 1rem; }

small { font-size: 0.875em; }

strong, b { font-weight: 700; }

mark { background: color-mix(in srgb, var(--color-accent, #facc15) 45%, transparent); }

a {
  color: var(--color-primary, #2563eb);
}

a:hover {
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: var(--sp-4);
}

::selection {
  background: var(--color-primary, #2563eb);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--color-primary, #2563eb);
  outline-offset: 2px;
}

/* ==========================================================================
   04. Layout: container, section rhythm, grids, backgrounds
   ========================================================================== */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-3);
  width: 100%;
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
  position: relative;
}

.section-alt {
  background-color: var(--surface-2);
}

.section-head {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: var(--sp-5);
}

.section-head.is-left {
  margin-inline: 0;
  text-align: left;
}

.section-head .section-sub,
.section-subtitle {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  margin-top: var(--sp-2);
}

.section-kicker {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary, #2563eb);
  margin-bottom: var(--sp-1);
}

/* background image / overlay support (§6 common section setup) */
.section.has-bg-image,
.page-banner--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

.section-overlay,
.section-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.section > .container {
  position: relative;
  z-index: 2;
}

/* responsive layout helpers */
.grid-2 {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
}

.grid-3 {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

.grid-4 {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   05. Buttons
   --------------------------------------------------------------------------
   Filled buttons are the default; `.btn-outline` is the explicit outline
   variant (see file header note about --btn-style).
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  border: 2px solid transparent;
  border-radius: var(--btn-radius, var(--radius));
  padding: 11px 24px;
  min-height: 44px;
  font-family: var(--font-body, sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  vertical-align: middle;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background-color: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.btn-secondary {
  background-color: var(--color-secondary, #0f172a);
  border-color: var(--color-secondary, #0f172a);
  color: #fff;
}

.btn-accent {
  background-color: var(--color-accent, #facc15);
  border-color: var(--color-accent, #facc15);
  color: #0f172a;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--color-primary, #2563eb);
}

.btn-light {
  background-color: #fff;
  border-color: #fff;
  color: var(--color-heading, #0f172a);
}

.btn-dark {
  background-color: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.btn-lg {
  padding: 15px 34px;
  min-height: 54px;
  font-size: 1.0625rem;
}

.btn-sm {
  padding: 7px 16px;
  min-height: 36px;
  font-size: 0.8125rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

/* hover feedback lives inside the reduced-motion guard (08 Motion section) */

/* ==========================================================================
   06. Skip link + screen-reader helper
   ========================================================================== */

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-2);
  z-index: 9999;
  background: var(--color-primary, #2563eb);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  text-decoration: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   07. Topbar
   ========================================================================== */

.topbar {
  background-color: #0f172a;
  color: #cbd5e1;
  font-size: 0.8125rem;
  line-height: 1.4;
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .topbar {
    background-color: color-mix(in srgb, var(--color-secondary, #0f172a) 28%, #0f172a);
  }
}

.topbar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
  min-height: var(--topbar-h);
  padding-block: 6px;
}

.topbar-left,
.topbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-3);
}

.topbar a {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar a:hover {
  color: #fff;
  text-decoration: none;
}

.topbar .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.topbar .nav-list {
  display: flex;
  gap: var(--sp-3);
}

.topbar .social-list {
  gap: 6px;
}

@media (max-width: 639.98px) {
  .topbar { display: none; }
}

/* ==========================================================================
   08. Header + navigation (mobile-first: off-canvas < 900px, bar ≥ 900px)
   ========================================================================== */

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

.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}

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

/* --- logo --- */
.logo {
  display: inline-flex;
  align-items: center;
  max-height: calc(var(--header-h) - 24px);
  width: auto;
  font-family: var(--font-heading, sans-serif);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--color-heading, #0f172a);
  letter-spacing: -0.02em;
  flex: none;
}

.logo:hover { text-decoration: none; }

.logo img { width: auto; }

.logo-text { color: var(--color-primary, #2563eb); }

.logo-light { display: none; }
.logo-dark { display: none; }

html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: inline-flex; }
html:not([data-theme="dark"]) .logo-light { display: inline-flex; }
html:not([data-theme="dark"]) .logo-dark { display: none; }

/* --- burger --- */
.nav-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-heading, #0f172a);
}

.nav-burger .icon { width: 24px; height: 24px; }

/* icon swap when open (menu → close) — only when a close icon actually exists */
.nav-burger .icon-close { display: none; }
.site-header.nav-open .nav-burger .icon-close { display: block; }
.site-header.nav-open .nav-burger:has(.icon-close) .icon-menu { display: none; }

/* --- off-canvas panel (base = mobile) --- */
.main-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(84vw, 320px);
  background-color: var(--surface);
  z-index: 1200;
  padding: calc(var(--header-h) + 8px) var(--sp-3) var(--sp-4);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-100%);
  visibility: hidden;
  box-shadow: var(--shadow-lg);
}

.site-header.nav-open .main-nav {
  transform: translateX(0);
  visibility: visible;
}

/* dimmed backdrop, inside the header stacking context */
.site-header.nav-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: -1;
}

body.nav-open { overflow: hidden; }

.nav-list {
  display: block;
}

.nav-item { position: relative; }

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 10px 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-heading, #0f172a);
}

.nav-link:hover { color: var(--color-primary, #2563eb); text-decoration: none; }

.nav-link.is-active { color: var(--color-primary, #2563eb); }

.nav-caret {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
}

/* submenu — mobile: accordion */
.sub-menu {
  display: none;
  padding-left: var(--sp-2);
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
}

.nav-item.is-open > .sub-menu { display: block; }

.nav-item.is-open > .nav-list > .nav-link .nav-caret,
.nav-item.is-open > .nav-link .nav-caret {
  transform: rotate(180deg);
}

.sub-menu .nav-link {
  font-weight: 500;
  font-size: 0.875rem;
  min-height: 40px;
  color: var(--color-text, #334155);
}

/* --- theme toggle --- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--color-heading, #0f172a);
  background: transparent;
  flex: none;
}

.theme-toggle .icon { width: 18px; height: 18px; }

/* both icons are rendered; CSS swaps (class, data-icon or <use href> hints) */
.theme-toggle .icon-sun,
.theme-toggle [data-icon="sun"],
.theme-toggle [href*="sun"] { display: none; }

html[data-theme="dark"] .theme-toggle .icon-sun,
html[data-theme="dark"] .theme-toggle [data-icon="sun"],
html[data-theme="dark"] .theme-toggle [href*="sun"] { display: block; }

html[data-theme="dark"] .theme-toggle .icon-moon,
html[data-theme="dark"] .theme-toggle [data-icon="moon"],
html[data-theme="dark"] .theme-toggle [href*="moon"] { display: none; }

/* right-side header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* --- desktop navigation ≥ 900px --- */
@media (min-width: 900px) {
  .nav-burger { display: none; }

  .site-header.nav-open::after { display: none; }
  body.nav-open { overflow: visible; }

  .main-nav {
    position: static;
    top: auto;
    bottom: auto;
    width: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    visibility: visible;
    overflow: visible;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
  }

  .nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    white-space: nowrap;
  }

  .nav-link.is-active {
    color: var(--color-primary, #2563eb);
  }

  /* dropdown */
  .sub-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    padding: var(--sp-1);
    margin: 0;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    z-index: 50;
  }

  .nav-item.has-children:hover > .sub-menu,
  .nav-item.has-children:focus-within > .sub-menu,
  .nav-item.has-children.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
  }

  .sub-menu .nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    min-height: 40px;
  }

  .sub-menu .nav-link:hover,
  .sub-menu .nav-link.is-active {
    background: var(--tint-secondary);
    color: var(--color-primary, #2563eb);
    text-decoration: none;
  }

  /* nested dropdown */
  .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-left: 4px;
  }

  /* the toggle caret button behaves like part of the row */
  .nav-toggle { display: none; }
}

@media (min-width: 640px) and (max-width: 899.98px) {
  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 var(--sp-2);
  }
}

/* ==========================================================================
   09. Hero / slideshow (base crossfade — presets override under data-preset)
   ========================================================================== */

.section-hero {
  position: relative;
  overflow: hidden;
  padding: 0;
  background-color: #0b1220;
  display: flex;
  isolation: isolate;
}

.hero--full { min-height: 100svh; }
.hero--large { min-height: 78vh; min-height: 78svh; }
.hero--medium { min-height: 56vh; min-height: 56svh; }

.hero--full,
.hero--large,
.hero--medium {
  display: flex;
  align-items: stretch;
}

.slides {
  position: relative;
  flex: 1 1 auto;
  min-height: inherit;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  z-index: 0;
}

.slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.slide-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: #0b1220;
}

.slide-media picture,
.slide-media img,
.slide-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wrapper for the optional mobile focal crop (Home Sections → Hero →
   "On phones, zoom into the text side…"). It sits between .slide-media and
   the image so the crop-zoom transform below never touches .slide-media or
   .slide-image directly — those are exactly what the slideshow presets (§14)
   animate, so keeping this on its own layer means Ken Burns/parallax/etc.
   keep working underneath the crop instead of one transform stomping the
   other. Full-bleed and inert by default: with no *-focus-* class it's
   visually identical to the old markup on every screen size. */
.slide-media-inner {
  position: absolute;
  inset: 0;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-color: rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), var(--ov-a, 0));
}

/* Directional fade overlay (opt-in per slide, via "Overlay style"). Keeps
   the text side dark and fades to transparent toward the image's open
   side, instead of a flat tint muffling the whole photo.
   Mobile-first: the content stacks full-width there, so it always falls
   back to a bottom-weighted vertical fade regardless of content position. */
.slide-overlay--gradient {
  background: linear-gradient(
    to top,
    rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), var(--ov-a, 0)) 0%,
    rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), calc(var(--ov-a, 0) * 0.35)) 55%,
    rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), 0) 100%
  );
}

/* Wide screens: text on the left keeps the fade on the left, opening up
   toward the right where the image subject usually sits — and mirrored
   for text on the right. Centered content has no "open side" to fade
   toward, so it keeps the vertical fade above even on wide screens. */
@media (min-width: 900px) {
  .slide-overlay--gradient.slide-overlay--left {
    background: linear-gradient(
      to right,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), var(--ov-a, 0)) 0%,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), calc(var(--ov-a, 0) * 0.4)) 45%,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), 0) 75%
    );
  }

  .slide-overlay--gradient.slide-overlay--right {
    background: linear-gradient(
      to left,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), var(--ov-a, 0)) 0%,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), calc(var(--ov-a, 0) * 0.4)) 45%,
      rgba(var(--ov-r, 0), var(--ov-g, 0), var(--ov-b, 0), 0) 75%
    );
  }
}

.slide-content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding-block: calc(var(--header-h) + var(--sp-6)) var(--sp-7);
  width: 100%;
}

/* Optional full-slide click-through link (slides.link_url). Sits above the
   photo/overlay but below the content, and the content becomes click-through
   itself so the link is reachable everywhere except on its own buttons. */
.slide-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.slide-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
}

.slide.has-link .slide-content {
  z-index: 3;
  pointer-events: none;
}

.slide.has-link .slide-content a,
.slide.has-link .slide-content button {
  pointer-events: auto;
}

/* content position modifiers */
.slide-content.align-left { margin-right: auto; margin-left: max(0px, calc((100% - var(--container)) / 2)); }
.slide-content.align-center { margin-inline: auto; }
.slide-content.align-right { margin-left: auto; margin-right: max(0px, calc((100% - var(--container)) / 2)); }

.slide-content.text-left { text-align: left; }
.slide-content.text-center { text-align: center; }
.slide-content.text-right { text-align: right; }

.slide-title {
  color: #fff;
  /* Wide-screen size: set site-wide from Admin → Slideshow → settings
     (falls back to the original fluid clamp when at its default). */
  font-size: var(--slide-title-size-desktop, clamp(2.25rem, 5.5vw, 4rem));
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-shadow: 0 2px 18px rgba(2, 6, 23, 0.4);
}

.slide-content.align-center .slide-title,
.slide-content.text-center .slide-title { margin-inline: auto; }

.slide-content.align-right .slide-title,
.slide-content.text-right .slide-title { margin-left: auto; }

.slide-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--slide-subtitle-size-desktop, clamp(1rem, 1.6vw, 1.25rem));
  font-weight: 600;
  margin-top: var(--sp-2);
  text-shadow: 0 1px 12px rgba(2, 6, 23, 0.45);
}

.slide-text {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--slide-text-size-desktop, clamp(1rem, 1.5vw, 1.125rem));
  max-width: 58ch;
  margin-top: var(--sp-2);
  text-shadow: 0 1px 12px rgba(2, 6, 23, 0.45);
}

/* Mobile-phone sizes come from separate variables so wide-screen and phone
   sizes can be set independently in the text-size form. */
@media (max-width: 640px) {
  .slide-title { font-size: var(--slide-title-size-mobile, clamp(2.25rem, 5.5vw, 4rem)); }
  .slide-subtitle { font-size: var(--slide-subtitle-size-mobile, clamp(1rem, 1.6vw, 1.25rem)); }
  .slide-text { font-size: var(--slide-text-size-mobile, clamp(1rem, 1.5vw, 1.125rem)); }

  /* Mobile focal crop — phones only. object-fit:cover on a narrow, tall
     viewport shows a slice from the middle of the photo, which for a
     "subject on one side, plain area on the other" composition often lands
     right under the text. When the slide's Content position is left/right
     (see hero.php), shift the *anchor* that object-fit:cover crops around
     to that same side, via object-position — the browser still scales the
     photo exactly as much as a normal cover-fit needs and no more, it just
     starts the crop window from that edge instead of the centre. That pins
     the plain/background side into view and pushes the subject side toward
     (and usually past) the opposite edge, without the extra magnification
     an explicit transform:scale() would add on top of the cover-fit scale
     — which is what caused visible pixelation. Wide screens are completely
     untouched. */
  .slide-media-focus-left .slide-image {
    object-position: 0% 50%;
  }

  .slide-media-focus-right .slide-image {
    object-position: 100% 50%;
  }
}

.slide-content.text-center .slide-text { margin-inline: auto; }
.slide-content.text-right .slide-text { margin-left: auto; }

.slide-content .btn,
.slide-content .btn-row {
  margin-top: var(--sp-3);
}

.slide-content .btn + .btn {
  margin-left: 0;
}

.slide-content .btn {
  margin-right: var(--sp-2);
}

/* hero button variants over imagery: white outline / ghost */
.section-hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.section-hero .btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: transparent;
}

/* --- arrows --- */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

.slide-arrow .icon { width: 22px; height: 22px; }

.slide-arrow-prev { left: clamp(8px, 2vw, 24px); }
.slide-arrow-next { right: clamp(8px, 2vw, 24px); }

.slide-arrow:hover { background: var(--color-primary, #2563eb); border-color: transparent; }

/* --- dots --- */
.slide-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 4vh, 36px);
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 10px;
  align-items: center;
}

.slide-dots button {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0;
  cursor: pointer;
}

.slide-dots button.is-active,
.slide-dots button[aria-selected="true"] {
  background: #fff;
  width: 32px;
}

/* optional scroll cue rendered from hero scroll_text / scroll_url */
.hero-scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3vh, 28px);
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-hero:has(.hero-scroll) .slide-dots { bottom: clamp(56px, 9vh, 84px); }

/* fallback hero (no slides) */
.hero-fallback {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* ==========================================================================
   10. Page banner + breadcrumbs + pagination
   ========================================================================== */

.page-banner {
  position: relative;
  padding-block: clamp(40px, 6vw, 72px);
  background-color: var(--surface-2);
  overflow: hidden;
}

.page-banner h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: var(--sp-2);
}

.page-banner--image {
  background-size: cover;
  background-position: center;
  color: #fff;
}

.page-banner--image h1,
.page-banner--image .breadcrumbs,
.page-banner--image .breadcrumbs a,
.page-banner--image .breadcrumbs span {
  color: #fff;
}

.page-banner--color {
  color: #fff;
}

.page-banner--color h1,
.page-banner--color .breadcrumbs,
.page-banner--color .breadcrumbs a,
.page-banner--color .breadcrumbs span {
  color: #fff;
}

.page-banner-overlay {
  position: absolute;
  inset: 0;
  background-color: #0f172a;
  z-index: 1;
}

.page-banner .container {
  position: relative;
  z-index: 2;
}

.page-banner .section-sub { color: inherit; opacity: 0.85; }

/* Banner used by module pages (blog, portfolio, gallery, contact + details) */
.page-banner--module {
  background-image: linear-gradient(135deg, var(--color-secondary, #0f172a), var(--color-primary, #2563eb));
}

.page-banner--module .section-sub {
  max-width: 60ch;
  margin: 0 0 var(--sp-2);
}

/* --- breadcrumbs --- */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li + li::before {
  content: "/";
  color: currentColor;
  opacity: 0.6;
}

.breadcrumbs a { color: inherit; }
.breadcrumbs a:hover { color: var(--color-primary, #2563eb); }
.breadcrumbs [aria-current="page"] { font-weight: 600; }

/* --- pagination --- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: var(--sp-5);
  list-style: none;
  padding: 0;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--color-text, #334155);
  font-weight: 600;
  font-size: 0.9375rem;
}

.page-link:hover {
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.page-link.is-current {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ==========================================================================
   11. About section
   ========================================================================== */

.about-grid {
  display: grid;
  gap: var(--sp-5);
  align-items: center;
  grid-template-columns: 1fr;
}

.about-media {
  position: relative;
}

.about-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.about-media::after {
  content: "";
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 3px solid var(--color-primary, #2563eb);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.35;
}

.about-list {
  list-style: none;
  padding: 0;
  margin: var(--sp-3) 0;
  display: grid;
  gap: var(--sp-1);
}

.about-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.about-list .icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary, #2563eb);
  flex: none;
  margin-top: 4px;
}

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-6); }
}

/* ==========================================================================
   12. Icon cards (services) + feature cards
   ========================================================================== */

.icon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3);
  height: 100%;
}

.icon-card .icon-box,
.icon-card .icon-card-icon,
.icon-card > .icon:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  background: var(--tint-primary);
  color: var(--color-primary, #2563eb);
  margin-bottom: var(--sp-2);
}

.icon-card .icon { width: 26px; height: 26px; }
.icon-card .btn .icon,
.icon-card .card-link .icon { width: 16px; height: 16px; }

/* Services section grid: 1 col mobile, 2 tablet, 3 desktop */
.services-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .services-grid { grid-template-columns: repeat(3, 1fr); } }

.icon-card h3 {
  font-size: 1.1875rem;
  margin-bottom: var(--sp-1);
}

.icon-card p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.icon-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary, #2563eb);
}

.icon-card .card-link .icon { width: 16px; height: 16px; }

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
}

.img-placeholder .icon { width: 40px; height: 40px; }

.cards-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .cards-grid { grid-template-columns: repeat(4, 1fr); } }

/* ==========================================================================
   13. Portfolio
   ========================================================================== */

.portfolio-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: var(--sp-4);
}

.portfolio-filter button {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--color-text, #334155);
  font-weight: 600;
  font-size: 0.875rem;
}

.portfolio-filter button:hover {
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.portfolio-filter button.is-active {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.portfolio-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .portfolio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .portfolio-grid { grid-template-columns: repeat(3, 1fr); } }
.portfolio-grid[data-columns="4"] { grid-template-columns: 1fr; }

@media (min-width: 640px) { .portfolio-grid[data-columns="4"] { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .portfolio-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); } }

.portfolio-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.portfolio-card[hidden] { display: none !important; }

/* filtering: items fade/scale out before being hidden (JS adds .is-hiding) */
[data-category].is-hiding {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

[data-category][hidden] { display: none !important; }

.portfolio-card .portfolio-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}

.portfolio-card picture,
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-card .portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0) 35%, rgba(2, 6, 23, 0.82) 100%);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-3);
  color: #fff;
}

.portfolio-card:hover .portfolio-overlay,
.portfolio-card:focus-visible .portfolio-overlay { opacity: 1; }

.portfolio-card .portfolio-title {
  color: #fff;
  font-size: 1.125rem;
  margin: 0;
}

.portfolio-card .portfolio-category {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.portfolio-body {
  padding: var(--sp-2) var(--sp-3) var(--sp-3);
}

.portfolio-body h3 { font-size: 1.0625rem; }

.portfolio-body .portfolio-category {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-primary, #2563eb);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* ==========================================================================
   14. Gallery (CSS columns masonry)
   ========================================================================== */

.gallery-grid {
  columns: 1;
  column-gap: var(--sp-3);
}

@media (min-width: 640px) { .gallery-grid { columns: 2; } }
@media (min-width: 900px) { .gallery-grid { columns: 3; } }
@media (min-width: 1100px) { .gallery-grid.is-4, .gallery-grid[data-columns="4"] { columns: 4; } }

.gallery-thumb {
  display: block;
  width: 100%;
  margin-bottom: var(--sp-3);
  break-inside: avoid;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--surface-2);
  padding: 0;
  cursor: zoom-in;
}

.gallery-thumb img {
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.gallery-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.35);
  opacity: 0;
}

.gallery-thumb:hover::after,
.gallery-thumb:focus-visible::after { opacity: 1; }

/* Album index (gallery page): real grid instead of the masonry columns */
.gallery-grid.album-grid {
  columns: auto;
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .gallery-grid.album-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .gallery-grid.album-grid { grid-template-columns: repeat(3, 1fr); } }

.album-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.album-card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.album-card-media picture,
.album-card-media .album-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-card-media .img-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.album-card-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.65);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.4;
}

.album-card-badge .icon { width: 14px; height: 14px; }

.album-card-title {
  display: block;
  margin-top: var(--sp-2);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--color-heading, #0f172a);
}

.album-card-link:hover .album-card-title,
.album-card-link:focus-visible .album-card-title { color: var(--color-primary, #2563eb); }

/* ==========================================================================
   15. Team
   ========================================================================== */

.team-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .team-grid { grid-template-columns: repeat(3, 1fr); } }

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  padding-bottom: var(--sp-3);
}

.team-card .team-photo {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-2);
}

.team-card .team-photo picture,
.team-card .team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card h3 {
  font-size: 1.125rem;
  margin-top: var(--sp-2);
}

.team-card .team-role {
  color: var(--color-primary, #2563eb);
  font-size: 0.875rem;
  font-weight: 600;
}

.team-card .team-bio {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: var(--sp-1);
  padding-inline: var(--sp-3);
}

.team-card .social-list {
  justify-content: center;
  margin-top: var(--sp-2);
}

/* ==========================================================================
   16. Testimonials + carousel
   ========================================================================== */

.testimonials {
  position: relative;
}

.testimonial-track {
  position: relative;
  overflow: hidden;
}

.testimonial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.testimonial-card .quote-icon,
.testimonial-card > .icon {
  width: 36px;
  height: 36px;
  color: var(--color-primary, #2563eb);
  opacity: 0.5;
  margin-bottom: var(--sp-2);
}

.testimonial-card .stars {
  display: inline-flex;
  gap: 3px;
  margin-bottom: var(--sp-2);
  color: #f59e0b;
}

.testimonial-card .stars .icon,
.testimonial-card .stars svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.testimonial-card .stars .is-empty {
  color: #cbd5e1;
}

.testimonial-card blockquote {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text, #334155);
}

.testimonial-card figcaption,
.testimonial-card .testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.testimonial-card .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.testimonial-card .author-name {
  font-weight: 700;
  color: var(--color-heading, #0f172a);
}

.testimonial-card .author-role {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* carousel controls */
.carousel {
  position: relative;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.carousel-prev,
.carousel-next,
[data-carousel-prev],
[data-carousel-next] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--color-heading, #0f172a);
}

.carousel-prev:hover,
.carousel-next:hover,
[data-carousel-prev]:hover,
[data-carousel-next]:hover {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: var(--sp-2);
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  padding: 0;
}

.carousel-dots button.is-active {
  background: var(--color-primary, #2563eb);
  width: 26px;
}

/* stacked (no track) mode: one card visible at a time */
[data-carousel]:not(.has-track) .testimonial-card { display: none; }
[data-carousel]:not(.has-track) .testimonial-card.is-active { display: block; }

/* track mode: horizontal strip, JS moves it with translateX */
[data-carousel].has-track .testimonial-track {
  display: flex;
  align-items: stretch;
}

[data-carousel].has-track .testimonial-track > .testimonial-card {
  flex: 0 0 100%;
  width: 100%;
}

.testimonial-card[hidden] { display: none !important; }

/* ==========================================================================
   17. Stats / counters
   ========================================================================== */

.stats-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(2, 1fr);
  text-align: center;
}

@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat {
  padding: var(--sp-3) var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-number,
[data-counter] {
  display: block;
  font-family: var(--font-heading, sans-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-primary, #2563eb);
  letter-spacing: -0.02em;
}

.stat-number .suffix,
[data-counter] + .suffix {
  font-size: 0.6em;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 6px;
}

.section-hero .stat,
.stats-on-dark .stat {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ==========================================================================
   18. Pricing
   ========================================================================== */

.pricing-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 640px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.pricing-card.is-highlight {
  border-color: var(--color-primary, #2563eb);
  box-shadow: var(--shadow-lg);
}

.pricing-card .pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-card h3 {
  font-size: 1.125rem;
  text-align: center;
}

.pricing-card .price {
  text-align: center;
  margin: var(--sp-2) 0;
  font-family: var(--font-heading, sans-serif);
}

.pricing-card .price .amount {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--color-heading, #0f172a);
}

.pricing-card.is-highlight .price .amount {
  color: var(--color-primary, #2563eb);
}

.pricing-card .price .period {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  font-family: var(--font-body, sans-serif);
  font-weight: 500;
}

.pricing-card .features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-3);
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
}

.pricing-card .features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9375rem;
  color: var(--color-text, #334155);
}

.pricing-card .features .icon {
  width: 18px;
  height: 18px;
  color: var(--success);
  flex: none;
  margin-top: 3px;
}

.pricing-card .btn { margin-top: auto; }

/* ==========================================================================
   19. CTA banner
   ========================================================================== */

.cta-banner {
  position: relative;
  border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 56px);
  background: linear-gradient(120deg, var(--color-primary, #2563eb), var(--color-secondary, #0f172a));
  color: #fff;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cta-banner::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -180px;
  right: -120px;
  pointer-events: none;
}

.cta-banner h2,
.cta-banner h3 {
  color: #fff;
  position: relative;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
  margin: var(--sp-2) auto 0;
  position: relative;
}

.cta-banner .btn-row {
  justify-content: center;
  margin-top: var(--sp-3);
  position: relative;
}

.cta-banner .btn-light {
  background: #fff;
  border-color: #fff;
  color: var(--color-primary, #2563eb);
}

.cta-banner .btn-outline {
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   20. Partners
   ========================================================================== */

/* --cols comes from the admin "Columns" field (partners.php sets it inline
   per-section). Each breakpoint caps at min(--cols, N) so a bigger chosen
   count still steps down gracefully on narrow screens instead of squeezing
   every column onto a phone, but never shows MORE columns than the admin
   asked for once the viewport is wide enough for that count. */
.partners-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(min(var(--cols, 4), 2), 1fr);
  align-items: center;
}

@media (min-width: 640px) { .partners-grid { grid-template-columns: repeat(min(var(--cols, 4), 3), 1fr); } }
@media (min-width: 900px) { .partners-grid { grid-template-columns: repeat(min(var(--cols, 4), 4), 1fr); } }
@media (min-width: 1100px) { .partners-grid { grid-template-columns: repeat(var(--cols, 4), 1fr); } }

.partner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-height: 84px;
}

.partner img {
  max-height: 48px;
  width: auto;
  max-width: 100%;
  filter: grayscale(1);
  opacity: 0.6;
  object-fit: contain;
}

.partner .partner-name {
  font-weight: 700;
  color: var(--muted);
  font-size: 0.9375rem;
}

.partner:hover img,
.partner:hover .partner-name {
  filter: grayscale(0);
  opacity: 1;
  color: var(--color-primary, #2563eb);
}

/* ==========================================================================
   21. FAQ accordion
   ========================================================================== */

.faq-list {
  max-width: 820px;
  margin-inline: auto;
  display: grid;
  gap: var(--sp-2);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item.is-open {
  border-color: var(--color-primary, #2563eb);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  text-align: left;
  padding: 18px var(--sp-3);
  min-height: 56px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-heading, #0f172a);
}

.faq-question:hover { color: var(--color-primary, #2563eb); }

.faq-question .faq-icon {
  flex: none;
  width: 24px;
  height: 24px;
  color: var(--color-primary, #2563eb);
}

.faq-question .icon-minus { display: none; }
.faq-item.is-open .faq-question .icon-plus { display: none; }
.faq-item.is-open .faq-question .icon-minus { display: block; }

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
  visibility: visible;
}

.faq-answer > * {
  overflow: hidden;
  min-height: 0;
}

.faq-answer .faq-answer-inner,
.faq-answer > div,
.faq-answer > p {
  padding: 0 var(--sp-3) var(--sp-3);
  color: var(--muted);
}

/* ==========================================================================
   22. Blog / cards
   ========================================================================== */

.blog-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
}

.blog-card .blog-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.blog-card .blog-thumb picture,
.blog-card .blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card .blog-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.blog-meta span,
.blog-meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.blog-meta .icon { width: 14px; height: 14px; }

.blog-card h2,
.blog-card h3,
.blog-card-title {
  font-size: 1.1875rem;
  line-height: 1.3;
  margin: 0 0 var(--sp-1);
}

.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: var(--color-primary, #2563eb); }

/* Markup used by the home blog section (.blog-link/.blog-media/.blog-body)
   and by the blog index page (.blog-card-media/.blog-card-body) */
.blog-link {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  color: inherit;
  text-decoration: none;
}

.blog-link:hover h3 { color: var(--color-primary, #2563eb); }

.blog-media,
.blog-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}

.blog-media picture,
.blog-card-media picture,
.blog-media img,
.blog-card-media img,
.blog-image,
.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card-media .img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.blog-body,
.blog-card-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.blog-date,
.blog-card-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}

.blog-more,
.blog-card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.blog-more .icon,
.blog-card-more .icon { width: 16px; height: 16px; }

.blog-card-excerpt {
  color: var(--muted);
  font-size: 0.9375rem;
  flex: 1 1 auto;
}

.blog-card h3 a:hover { color: var(--color-primary, #2563eb); text-decoration: none; }

.blog-card .blog-excerpt {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: var(--sp-1);
  flex: 1 1 auto;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary, #2563eb);
}

.read-more .icon { width: 16px; height: 16px; }

/* featured / wide article card */
.post-card {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .post-card { grid-template-columns: 1.2fr 1fr; align-items: center; }
}

/* ==========================================================================
   23. Contact section
   ========================================================================== */

.contact-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: stretch;
}

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid.is-reversed .contact-form-wrap { order: -1; }
  .contact-grid.is-top { grid-template-columns: 1fr; }
  .contact-grid.is-full { grid-template-columns: 1fr; }
}

.contact-info {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-3);
}

.contact-info li {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

.contact-info .icon-box {
  flex: none;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--tint-primary);
  color: var(--color-primary, #2563eb);
}

.contact-info .icon { width: 20px; height: 20px; }

.contact-info .label {
  display: block;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

/* Dedicated Contact page details block (address/phone/email/hours). */
.contact-details-title,
.contact-form-title {
  margin: 0 0 var(--sp-3);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--sp-3);
}

@media (min-width: 900px) {
  .contact-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
  }
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.contact-item-icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--tint-primary);
  color: var(--color-primary, #2563eb);
}

.contact-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.contact-item-label {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.contact-item-value { color: inherit; }

.contact-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-height: 340px;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 340px;
  display: block;
}

.map-embed iframe { width: 100%; height: 340px; }

/* Contact layout (home section + the dedicated Contact page): the details/
   social blocks are short, so they get their own full-width row; the form
   and map are the two tall blocks, so they share the row beneath and sit
   side by side on wide screens, stretched to match each other's height. */
@media (min-width: 900px) {
  .contact-grid .contact-info,
  .contact-grid .contact-details,
  .contact-grid .contact-social {
    grid-column: 1 / -1;
  }

  /* "top"/"bottom" map position stays a full-width strip, as the name says. */
  .contact-grid.map-top .contact-map,
  .contact-grid.map-bottom .contact-map {
    grid-column: 1 / -1;
  }

  /* "left" swaps which side of the row the map sits on. */
  .contact-grid.map-left .contact-map { order: -1; }
}

/* ==========================================================================
   24. Footer
   ========================================================================== */

.site-footer {
  background-color: var(--surface-2);
  color: var(--color-text, #334155);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.site-footer h3,
.site-footer h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
  color: var(--color-heading, #0f172a);
}

.footer-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
  padding-block: var(--sp-6);
}

@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }

.footer-column {
  min-width: 0;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-column a {
  color: var(--muted);
}

.footer-column a:hover {
  color: var(--color-primary, #2563eb);
  text-decoration: none;
}

.footer-column p { color: var(--muted); font-size: 0.9375rem; }

.footer-column .contact-list {
  display: grid;
  gap: 10px;
}

.footer-column .contact-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.footer-column .contact-list .icon {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--color-primary, #2563eb);
  flex: none;
}

.footer-column .map-embed iframe,
.footer-column .contact-map iframe { height: 220px; }

/* simple footer */
.footer-simple {
  background-color: var(--surface-2);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-4);
}

.footer-simple .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.footer-simple .footer-copy {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-simple .social-list { justify-content: flex-end; }

/* bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: var(--sp-3);
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  justify-content: space-between;
}

.footer-bottom a { color: inherit; }

.footer-bottom .social-list { justify-content: flex-end; }

/* newsletter */
.newsletter {
  display: flex;
  gap: 8px;
  margin-top: var(--sp-2);
  max-width: 380px;
}

.newsletter .form-control {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
}

.newsletter .btn { flex: none; }

.newsletter .form-success {
  flex-basis: 100%;
  color: var(--success);
  font-size: 0.875rem;
  font-weight: 600;
}

.newsletter .form-error { flex-basis: 100%; }

@media (max-width: 639.98px) {
  .newsletter { flex-direction: column; max-width: none; }
}

/* social list */
.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tint-primary);
  color: var(--color-primary, #2563eb);
}

.social-list a:hover {
  background: var(--color-primary, #2563eb);
  color: #fff;
}

.social-list .icon { width: 18px; height: 18px; }

/* ==========================================================================
   25. Forms
   ========================================================================== */

.form-group {
  margin-bottom: var(--sp-3);
}

.form-group > label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 6px;
  color: var(--color-heading, #0f172a);
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.form-control {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius, var(--radius-sm));
  background-color: var(--surface);
  color: var(--color-heading, #0f172a);
  font-size: 1rem;
  line-height: 1.4;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-control::placeholder { color: #94a3b8; }

.form-control:focus,
.form-control:focus-visible {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #2563eb) 30%, transparent);
}

@supports not (box-shadow: 0 0 0 3px color-mix(in srgb, red 30%, blue)) {
  .form-control:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
}

.form-control[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-control[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.form-error {
  display: block;
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 5px;
  font-weight: 500;
}

.form-error:empty { display: none; }

.form-success {
  color: var(--success);
  font-size: 0.9375rem;
  font-weight: 600;
}

.form-success:empty { display: none; }

.hint {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 5px;
}

.form-row {
  display: grid;
  gap: 0 var(--sp-3);
}

@media (min-width: 640px) {
  .form-row { grid-template-columns: repeat(2, 1fr); }
}

/* honeypot must never show */
.hp-field { display: none !important; }

.contact-form .btn { margin-top: 4px; }

/* ==========================================================================
   26. Alerts / flash messages
   ========================================================================== */

.alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 44px 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: var(--sp-3);
  font-size: 0.9375rem;
}

.alert .icon { width: 20px; height: 20px; flex: none; margin-top: 2px; }

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.alert .alert-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: inherit;
  opacity: 0.7;
}

.alert .alert-close:hover { opacity: 1; }

/* ==========================================================================
   27. Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 4vw, 48px);
  background: rgba(2, 6, 23, 0.92);
}

.lightbox[hidden] { display: none !important; }

.lightbox-figure {
  margin: 0;
  max-width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-image,
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100svh - 140px);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: #e2e8f0;
  font-size: 0.9375rem;
  text-align: center;
  max-width: 60ch;
}

.lightbox-caption:empty { display: none; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
}

.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-primary, #2563eb);
  border-color: transparent;
}

.lightbox-close .icon,
.lightbox-prev .icon,
.lightbox-next .icon { width: 22px; height: 22px; }

@media (max-width: 639.98px) {
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* ==========================================================================
   28. Reveal on scroll (initial state only under no-preference)
   ========================================================================== */

[data-reveal] { will-change: auto; }

/* ==========================================================================
   29. Prose (rich text output)
   ========================================================================== */

.container-prose {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--sp-3);
}

.prose {
  color: var(--color-text, #334155);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.prose > * + * { margin-top: 1.15em; }

.prose h1,
.prose h2,
.prose h3,
.prose h4 { margin-top: 1.6em; margin-bottom: 0.5em; }

.prose h2 { font-size: 1.625rem; }
.prose h3 { font-size: 1.3125rem; }
.prose h4 { font-size: 1.125rem; }

.prose p { margin-top: 1.1em; }

.prose a {
  color: var(--color-primary, #2563eb);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose ul,
.prose ol { padding-left: 1.4em; }

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }

.prose li + li { margin-top: 0.4em; }

.prose li > ul,
.prose li > ol { margin-top: 0.4em; }

.prose blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px var(--sp-3);
  border-left: 4px solid var(--color-primary, #2563eb);
  color: var(--muted);
  font-style: italic;
}

.prose blockquote p + p { margin-top: 0.75em; }

.prose figure { margin: 1.6em 0; }

.prose figure img {
  width: 100%;
  border-radius: var(--radius);
}

.prose figcaption {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.prose img {
  border-radius: var(--radius);
  margin-inline: auto;
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: var(--sp-3);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}

.prose pre code { background: none; border: 0; padding: 0; color: inherit; }

.prose table {
  width: 100%;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.prose the th,
.prose tbody tr:nth-child(even) { background: var(--surface-2); }

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

.prose th { font-weight: 700; color: var(--color-heading, #0f172a); }

.prose hr { margin-block: 2em; }

/* ==========================================================================
   30. Utilities
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.text-primary { color: var(--color-primary, #2563eb); }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.full-width { width: 100%; }
.relative { position: relative; }
.no-margin { margin: 0; }

.img-rounded { border-radius: var(--radius); }
.img-circle { border-radius: 50%; }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

/* ==========================================================================
   31. Dark theme — swaps base colors, keeps brand colors, fixes surfaces
   ========================================================================== */

html[data-theme="dark"] {
  --color-bg: #0b1220;
  --color-text: #cbd5e1;
  --color-heading: #f1f5f9;

  --surface: #111a2e;
  --surface-2: #0f1725;
  --border: #1e293b;
  --muted: #94a3b8;
  --tint-primary: #1c2a4a;
  --tint-secondary: #16213b;
}

html[data-theme="dark"] body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* header */
html[data-theme="dark"] .site-header {
  background-color: #111a2e;
}

html[data-theme="dark"] .site-header.is-scrolled {
  border-bottom-color: var(--border);
}

/* off-canvas + dropdowns */
html[data-theme="dark"] .main-nav,
html[data-theme="dark"] .sub-menu {
  background-color: #111a2e;
}

html[data-theme="dark"] .nav-link { color: var(--color-heading); }

html[data-theme="dark"] .sub-menu .nav-link:hover,
html[data-theme="dark"] .sub-menu .nav-link.is-active {
  background: var(--tint-secondary);
  color: #7dd3fc;
}

/* cards & surfaces */
html[data-theme="dark"] .section-alt,
html[data-theme="dark"] .page-banner {
  background-color: #0f1725;
}

html[data-theme="dark"] .icon-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .blog-card,
html[data-theme="dark"] .portfolio-card,
html[data-theme="dark"] .faq-item,
html[data-theme="dark"] .partner,
html[data-theme="dark"] .pagination .page-link,
html[data-theme="dark"] .pricing-card {
  background-color: #111a2e;
  border-color: var(--border);
}

html[data-theme="dark"] .pricing-card.is-highlight {
  border-color: var(--color-primary, #2563eb);
}

/* inputs */
html[data-theme="dark"] .form-control {
  background-color: #0d1626;
  border-color: var(--border);
  color: var(--color-heading);
}

html[data-theme="dark"] .form-control::placeholder { color: #64748b; }

html[data-theme="dark"] select.form-control {
  background-color: #0d1626;
}

/* footer */
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .footer-simple {
  background-color: #111a2e;
  border-top-color: var(--border);
  color: var(--color-text);
}

html[data-theme="dark"] .footer-bottom {
  border-top-color: var(--border);
  color: var(--muted);
}

/* alerts stay readable on dark */
html[data-theme="dark"] .alert-success {
  background: #052e16;
  border-color: #14532d;
  color: #86efac;
}

html[data-theme="dark"] .alert-error {
  background: #450a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

html[data-theme="dark"] .alert-warning {
  background: #451a03;
  border-color: #78350f;
  color: #fcd34d;
}

html[data-theme="dark"] .alert-info {
  background: #172554;
  border-color: #1e40af;
  color: #93c5fd;
}

/* misc dark adjustments */
html[data-theme="dark"] a { color: #7dd3fc; }

html[data-theme="dark"] .social-list a {
  background: var(--tint-primary);
  color: #93c5fd;
}

html[data-theme="dark"] .logo-text { color: #7dd3fc; }

html[data-theme="dark"] .portfolio-filter button {
  background: #111a2e;
  border-color: var(--border);
  color: var(--color-text);
}

html[data-theme="dark"] .btn-light {
  background: #f1f5f9;
  border-color: #f1f5f9;
  color: #0f172a;
}

html[data-theme="dark"] .skip-link { color: #fff; }

/* ==========================================================================
   32. Motion — transitions & animations
   ALL of them live inside prefers-reduced-motion: no-preference.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* smooth scroll */
  html { scroll-behavior: smooth; }

  /* --- generic transitions --- */
  a,
  .btn,
  .nav-link,
  .page-link,
  .social-list a,
  .portfolio-filter button,
  .carousel-dots button,
  .slide-dots button,
  .faq-question,
  .theme-toggle,
  .nav-burger {
    transition: color var(--transition), background-color var(--transition),
                border-color var(--transition), box-shadow var(--transition),
                opacity var(--transition);
  }

  .btn { transition: color var(--transition), background-color var(--transition),
                     border-color var(--transition), box-shadow var(--transition),
                     transform 160ms ease, opacity var(--transition); }

  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-accent:hover,
  .btn-light:hover,
  .btn-dark:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
  }

  .btn-outline:hover {
    background: var(--color-primary, #2563eb);
    color: #fff;
    transform: translateY(-2px);
  }

  .btn-ghost:hover { background: var(--tint-secondary); }

  .btn:active { transform: translateY(0); }

  /* --- header --- */
  .site-header { transition: box-shadow var(--transition), border-color var(--transition); }

  /* --- nav dropdowns --- */
  .sub-menu { transition: opacity var(--transition), visibility var(--transition), transform var(--transition); }

  @media (min-width: 900px) {
    .nav-item.has-children:hover > .sub-menu,
    .nav-item.has-children:focus-within > .sub-menu,
    .nav-item.has-children.is-open > .sub-menu {
      transform: translateY(0);
    }
    .sub-menu { transform: translateY(8px); }
  }

  .nav-caret { transition: transform var(--transition); }

  /* --- off-canvas nav --- */
  @media (max-width: 899.98px) {
    .main-nav {
      transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                  visibility 0s linear 300ms;
    }
    .site-header.nav-open .main-nav {
      transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    }
    .site-header.nav-open::after { animation: wdt-fade-in 300ms ease both; }
  }

  /* --- slideshow base crossfade --- */
  .slide {
    transition: opacity var(--speed, 700ms) ease,
                visibility 0s linear var(--speed, 700ms);
  }
  .slide.is-active {
    transition: opacity var(--speed, 700ms) ease, visibility 0s;
  }

  .slide-arrow { transition: background-color var(--transition), transform var(--transition), border-color var(--transition); }
  .slide-arrow:hover { transform: translateY(-50%) scale(1.08); }

  .slide-dots button { transition: width 250ms ease, background-color var(--transition); }

  /* --- cards / media hover --- */
  .portfolio-card img,
  .blog-card img,
  .team-card img,
  .gallery-thumb img,
  .partner img {
    transition: transform 400ms ease, filter var(--transition), opacity var(--transition);
  }

  .portfolio-card:hover img,
  .blog-card:hover img,
  .team-card:hover img,
  .gallery-thumb:hover img {
    transform: scale(1.05);
  }

  .portfolio-card .portfolio-overlay { transition: opacity 300ms ease; }
  .gallery-thumb::after { transition: opacity var(--transition); }

  .portfolio-card,
  .icon-card,
  .blog-card,
  .team-card,
  .pricing-card,
  .testimonial-card,
  .stat,
  .partner {
    transition: transform 250ms ease, box-shadow 250ms ease,
                border-color var(--transition), opacity 250ms ease;
  }

  .portfolio-card:hover,
  .icon-card:hover,
  .blog-card:hover,
  .partner:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }

  .social-list a { transition: background-color var(--transition), color var(--transition), transform var(--transition); }
  .social-list a:hover { transform: translateY(-2px); }

  /* --- FAQ accordion (grid-template-rows trick) --- */
  .faq-answer {
    transition: grid-template-rows 320ms ease, visibility 0s linear 0ms;
  }
  .faq-item.is-open .faq-answer {
    transition: grid-template-rows 320ms ease, visibility 0s;
  }
  .faq-icon { transition: transform var(--transition); }
  .faq-item.is-open .faq-icon { transform: rotate(180deg); }

  /* --- forms --- */
  .form-control { transition: border-color var(--transition), box-shadow var(--transition); }

  /* --- reveal on scroll --- */
  [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
  }

  [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 700ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }

  [data-reveal="fade"] { transform: none; }
  [data-reveal="left"] { transform: translateX(-24px); }
  [data-reveal="right"] { transform: translateX(24px); }

  /* --- whole-section entrance (added by main.js → initSectionAnim) ---
     The section's background stays put; its content block fades and slides in
     as the section scrolls into view, alternating direction section to section. */
  .has-section-anim { overflow-x: clip; }

  .section-anim {
    opacity: 0;
    transition: opacity 900ms ease, transform 900ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  /* no transition until main.js arms it, so the hidden state applies instantly (no flash) */
  .section-anim:not(.is-armed) { transition: none; }

  .section-anim--up    { transform: translateY(56px); }
  .section-anim--left  { transform: translateX(-64px); }
  .section-anim--right { transform: translateX(64px); }

  .section-anim.is-in {
    opacity: 1;
    transform: none;
  }

  /* --- hero scroll cue --- */
  .hero-scroll .icon { animation: wdt-bounce 1.8s ease-in-out infinite; }

  /* --- keyframes --- */
  @keyframes wdt-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes wdt-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
  }

  @keyframes wdt-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes wdt-fade-in-only {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ==========================================================================
   33. Global reduced-motion fallback — no transforms, no animation
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
    scroll-behavior: auto !important;
  }

  /* content is always visible without reveal animations */
  [data-reveal] { opacity: 1 !important; }

  /* off-canvas nav relies on visibility, not transform, so it keeps working */
  @media (max-width: 899.98px) {
    .main-nav {
      visibility: hidden;
      transform: none;
    }
    .site-header.nav-open .main-nav {
      visibility: visible;
      transform: none;
    }
  }

  /* slideshow: instant cut between slides (visibility handles hiding) */
  .slide { visibility: hidden; opacity: 0; }
  .slide.is-active { visibility: visible; opacity: 1; }
}
