/* VANTIX theme layer (Stage 17).
   Dark values live in style.css :root (the mandated brand palette, unchanged).
   This file: the light palette, the theme toggle, shared footer + social icons,
   feature "Soon" markers, Coming Soon, and document-style pages (About, Contact,
   Privacy, Terms). Load it AFTER the other stylesheets. Mobile-first. */

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] {
  --color-primary: #F7F9FC;
  --color-secondary: #FFFFFF;
  --color-accent: #007496;            /* >= 5:1 on the light surfaces; primary buttons use --color-primary text on it */
  --color-accent-secondary: #00796B;
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-border: #D5DCE6;
  --control-border: #6F7E94;      /* >= 3:1 on white / #F7F9FC (WCAG 1.4.11) */
  --color-success: #15803D;
  --color-warning: #B45309;
  --color-error: #B91C1C;

  --surface-0: #F1F5F9;
  --surface-1: #FFFFFF;
  --surface-media: #E2E8F0;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-glass-2: rgba(255, 255, 255, 0.75);
  --line-1: #E2E8F0;
  --line-2: #CBD5E1;
  --text-strong: #0F172A;
  --text-soft: #1E293B;
  --text-muted: #475569;
  --text-faint: #64748B;
}

/* Light-mode corrections for rules that assume a dark page */
html[data-theme="light"] .section--light { background: #FFFFFF; }
html[data-theme="light"] .skeleton, html[data-theme="light"] .media-placeholder { background-color: var(--surface-media); }
html[data-theme="light"] img { filter: none; }

/* Smooth but modest theme change; never animate layout */
@media (prefers-reduced-motion: no-preference) {
  body, .site-header, .card, .site-footer { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ---- Theme toggle ------------------------------------------------------------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; color: var(--color-text-primary);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--color-accent); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }   /* shows the action: switch to light */
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---- Feature availability (see assets/js/site-config.js) ------------------------ */
html[data-feature-gadgets="closed"] [data-feature="gadgets"],
html[data-feature-ai="closed"] [data-feature="ai"] { display: none !important; }
html[data-feature-gadgets="closed"] [data-feature-link="gadgets"]::after,
html[data-feature-ai="closed"] [data-feature-link="ai"]::after {
  content: "Soon"; margin-left: 0.4em; padding: 0 0.45em; font-size: 0.65em; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle;
  color: var(--color-accent); border: 1px solid currentColor; border-radius: 999px;
}

/* ---- Shared footer ---------------------------------------------------------------- */
.site-footer .footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.site-footer .footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.site-footer .footer-col a, .footer-legal a { display: inline-flex; align-items: center; min-height: 36px; }
.footer-tag { color: var(--text-muted); max-width: 40ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.social-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.6rem;
  color: var(--text-muted); border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: var(--fs-200);
}
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover, .social-link:focus-visible { color: var(--color-accent); border-color: var(--color-accent); }
.footer-note { color: var(--text-faint); font-size: var(--fs-100); margin-top: var(--space-2); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
@media (min-width: 640px) { .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .site-footer .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

/* ---- Coming Soon ---------------------------------------------------------------------- */
.coming-soon { padding: var(--space-8) 0; }
.coming-soon-inner { max-width: 720px; }
.coming-soon-badge {
  display: inline-block; margin-bottom: var(--space-3); padding: 0.25rem 0.7rem; border: 1px solid var(--color-accent);
  border-radius: 999px; color: var(--color-accent); font-size: var(--fs-100); font-weight: 700; letter-spacing: 0.12em;
}
.coming-soon h1 { font-size: clamp(var(--fs-700), 6vw, var(--fs-800)); line-height: 1.1; margin: 0 0 var(--space-4); overflow-wrap: anywhere; }
.coming-soon p { color: var(--text-muted); font-size: var(--fs-400); max-width: 62ch; }
.coming-soon .closing { color: var(--text-strong); font-weight: 600; }
.coming-soon-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.coming-soon-actions .btn { min-height: 44px; }

/* ---- Document pages: About, Contact, Privacy, Terms ----------------------------------------- */
.doc-hero { padding: var(--space-7) 0 var(--space-5); border-bottom: 1px solid var(--line-1); }
.doc-hero h1 { font-size: clamp(var(--fs-700), 5.5vw, var(--fs-800)); line-height: 1.12; margin: var(--space-2) 0 var(--space-3); overflow-wrap: anywhere; }
.doc-hero .lead { color: var(--text-muted); font-size: var(--fs-400); max-width: 62ch; }
.doc-meta { color: var(--text-faint); font-size: var(--fs-200); margin-top: var(--space-3); }
.doc-body { padding: var(--space-6) 0 var(--space-8); }
.doc-body .prose { max-width: 72ch; }
.doc-body h2 { font-size: var(--fs-600); margin: var(--space-6) 0 var(--space-3); scroll-margin-top: calc(var(--header-height) + 1rem); }
.doc-body h3 { font-size: var(--fs-500); margin: var(--space-5) 0 var(--space-2); }
.doc-body p, .doc-body li { color: var(--text-soft); line-height: 1.75; }
.doc-body ul, .doc-body ol { padding-left: 1.4rem; display: grid; gap: var(--space-2); }
.doc-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.doc-toc { margin: var(--space-4) 0 var(--space-6); padding: var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-1); }
.doc-toc summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.doc-toc ol { margin: var(--space-2) 0 0; }
.principle-grid, .contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin: var(--space-4) 0; }
.principle-card, .contact-card { padding: var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-1); }
.principle-card h3, .contact-card h3 { margin: 0 0 var(--space-2); font-size: var(--fs-400); }
.principle-card p, .contact-card p { margin: 0; color: var(--text-muted); }
.doc-cta { margin-top: var(--space-7); padding: var(--space-6); border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-1); }
.doc-cta h2 { margin-top: 0; }
.doc-cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.doc-cta-actions .btn, .contact-form .btn { min-height: 44px; }
@media (min-width: 720px) { .principle-grid, .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Contact form ------------------------------------------------------------------------------ */
.contact-form { display: grid; gap: var(--space-4); max-width: 640px; margin-top: var(--space-4); }
.contact-form label { display: grid; gap: var(--space-1); font-size: var(--fs-200); color: var(--text-muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; min-height: 44px; padding: 0.6rem 0.8rem; font: inherit; font-size: var(--fs-300);
  color: var(--color-text-primary); background: var(--color-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-size: var(--fs-200); }
.form-status--error { color: var(--color-error); }
.form-status--ok { color: var(--color-success); }
.notice { padding: var(--space-4); border: 1px dashed var(--line-2); border-radius: var(--radius-md); color: var(--text-muted); }

/* ---- Form-control boundaries (WCAG 1.4.11 non-text contrast >= 3:1) ------------------ */
.public-site input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.public-site textarea,
.public-site select,
.search-overlay-inner input {
  border-color: var(--control-border);
}



/* Keep the Africa lettering solid white in dark mode; do not inherit opacity/filter from surrounding logo styles. */
html[data-theme="dark"] .brand-wordmark .wm-africa,
html:not([data-theme="light"]) .brand-wordmark .wm-africa {
  background-color: #FFFFFF !important;
  opacity: 1 !important;
  filter: none !important;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}
   Dark values live in style.css :root (the mandated brand palette, unchanged).
   This file: the light palette, the theme toggle, shared footer + social icons,
   feature "Soon" markers, Coming Soon, and document-style pages (About, Contact,
   Privacy, Terms). Load it AFTER the other stylesheets. Mobile-first. */

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

html[data-theme="light"] {
  --color-primary: #F7F9FC;
  --color-secondary: #FFFFFF;
  --color-accent: #007496;            /* >= 5:1 on the light surfaces; primary buttons use --color-primary text on it */
  --color-accent-secondary: #00796B;
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-border: #D5DCE6;
  --control-border: #6F7E94;      /* >= 3:1 on white / #F7F9FC (WCAG 1.4.11) */
  --color-success: #15803D;
  --color-warning: #B45309;
  --color-error: #B91C1C;

  --surface-0: #F1F5F9;
  --surface-1: #FFFFFF;
  --surface-media: #E2E8F0;
  --surface-glass: rgba(255, 255, 255, 0.94);
  --surface-glass-2: rgba(255, 255, 255, 0.75);
  --line-1: #E2E8F0;
  --line-2: #CBD5E1;
  --text-strong: #0F172A;
  --text-soft: #1E293B;
  --text-muted: #475569;
  --text-faint: #64748B;
}

/* Light-mode corrections for rules that assume a dark page */
html[data-theme="light"] .section--light { background: #FFFFFF; }
html[data-theme="light"] .skeleton, html[data-theme="light"] .media-placeholder { background-color: var(--surface-media); }
html[data-theme="light"] img { filter: none; }

/* Smooth but modest theme change; never animate layout */
@media (prefers-reduced-motion: no-preference) {
  body, .site-header, .card, .site-footer { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ---- Theme toggle ------------------------------------------------------------- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  background: transparent; color: var(--color-text-primary);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--color-accent); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }   /* shows the action: switch to light */
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---- Feature availability (see assets/js/site-config.js) ------------------------ */
html[data-feature-gadgets="closed"] [data-feature="gadgets"],
html[data-feature-ai="closed"] [data-feature="ai"] { display: none !important; }
html[data-feature-gadgets="closed"] [data-feature-link="gadgets"]::after,
html[data-feature-ai="closed"] [data-feature-link="ai"]::after {
  content: "Soon"; margin-left: 0.4em; padding: 0 0.45em; font-size: 0.65em; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle;
  color: var(--color-accent); border: 1px solid currentColor; border-radius: 999px;
}

/* ---- Shared footer ---------------------------------------------------------------- */
.site-footer .footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-6); }
.site-footer .footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.site-footer .footer-col a, .footer-legal a { display: inline-flex; align-items: center; min-height: 36px; }
.footer-tag { color: var(--text-muted); max-width: 40ch; }
.footer-social { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.social-link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.6rem;
  color: var(--text-muted); border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-size: var(--fs-200);
}
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link:hover, .social-link:focus-visible { color: var(--color-accent); border-color: var(--color-accent); }
.footer-note { color: var(--text-faint); font-size: var(--fs-100); margin-top: var(--space-2); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
@media (min-width: 640px) { .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .site-footer .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }

/* ---- Coming Soon ---------------------------------------------------------------------- */
.coming-soon { padding: var(--space-8) 0; }
.coming-soon-inner { max-width: 720px; }
.coming-soon-badge {
  display: inline-block; margin-bottom: var(--space-3); padding: 0.25rem 0.7rem; border: 1px solid var(--color-accent);
  border-radius: 999px; color: var(--color-accent); font-size: var(--fs-100); font-weight: 700; letter-spacing: 0.12em;
}
.coming-soon h1 { font-size: clamp(var(--fs-700), 6vw, var(--fs-800)); line-height: 1.1; margin: 0 0 var(--space-4); overflow-wrap: anywhere; }
.coming-soon p { color: var(--text-muted); font-size: var(--fs-400); max-width: 62ch; }
.coming-soon .closing { color: var(--text-strong); font-weight: 600; }
.coming-soon-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.coming-soon-actions .btn { min-height: 44px; }

/* ---- Document pages: About, Contact, Privacy, Terms ----------------------------------------- */
.doc-hero { padding: var(--space-7) 0 var(--space-5); border-bottom: 1px solid var(--line-1); }
.doc-hero h1 { font-size: clamp(var(--fs-700), 5.5vw, var(--fs-800)); line-height: 1.12; margin: var(--space-2) 0 var(--space-3); overflow-wrap: anywhere; }
.doc-hero .lead { color: var(--text-muted); font-size: var(--fs-400); max-width: 62ch; }
.doc-meta { color: var(--text-faint); font-size: var(--fs-200); margin-top: var(--space-3); }
.doc-body { padding: var(--space-6) 0 var(--space-8); }
.doc-body .prose { max-width: 72ch; }
.doc-body h2 { font-size: var(--fs-600); margin: var(--space-6) 0 var(--space-3); scroll-margin-top: calc(var(--header-height) + 1rem); }
.doc-body h3 { font-size: var(--fs-500); margin: var(--space-5) 0 var(--space-2); }
.doc-body p, .doc-body li { color: var(--text-soft); line-height: 1.75; }
.doc-body ul, .doc-body ol { padding-left: 1.4rem; display: grid; gap: var(--space-2); }
.doc-body a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.doc-toc { margin: var(--space-4) 0 var(--space-6); padding: var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-1); }
.doc-toc summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.doc-toc ol { margin: var(--space-2) 0 0; }
.principle-grid, .contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin: var(--space-4) 0; }
.principle-card, .contact-card { padding: var(--space-4); border: 1px solid var(--line-1); border-radius: var(--radius-md); background: var(--surface-1); }
.principle-card h3, .contact-card h3 { margin: 0 0 var(--space-2); font-size: var(--fs-400); }
.principle-card p, .contact-card p { margin: 0; color: var(--text-muted); }
.doc-cta { margin-top: var(--space-7); padding: var(--space-6); border: 1px solid var(--line-2); border-radius: var(--radius-md); background: var(--surface-1); }
.doc-cta h2 { margin-top: 0; }
.doc-cta-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.doc-cta-actions .btn, .contact-form .btn { min-height: 44px; }
@media (min-width: 720px) { .principle-grid, .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Contact form ------------------------------------------------------------------------------ */
.contact-form { display: grid; gap: var(--space-4); max-width: 640px; margin-top: var(--space-4); }
.contact-form label { display: grid; gap: var(--space-1); font-size: var(--fs-200); color: var(--text-muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; min-height: 44px; padding: 0.6rem 0.8rem; font: inherit; font-size: var(--fs-300);
  color: var(--color-text-primary); background: var(--color-secondary); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-size: var(--fs-200); }
.form-status--error { color: var(--color-error); }
.form-status--ok { color: var(--color-success); }
.notice { padding: var(--space-4); border: 1px dashed var(--line-2); border-radius: var(--radius-md); color: var(--text-muted); }

/* ---- Form-control boundaries (WCAG 1.4.11 non-text contrast >= 3:1) ------------------ */
.public-site input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.public-site textarea,
.public-site select,
.search-overlay-inner input {
  border-color: var(--control-border);
}


/* VANTIX.Africa wordmark — uses the supplied transparent artwork masks.
   Dark mode: VANTIX. cyan and Africa white. Light mode preserves the
   established accent treatment for VAN/dot and dark text for TIX/Africa. */
:root {
  --logo-van: var(--color-accent);
  --logo-tix: var(--color-accent);
  --logo-dot: var(--color-accent);
  --logo-africa: #FFFFFF;
  --logo-tagline: var(--color-text-secondary);
  --wm-h: 13px;
}
html[data-theme="light"] {
  --logo-van: var(--color-accent);
  --logo-tix: var(--color-text-primary);
  --logo-dot: var(--color-accent);
  --logo-africa: var(--color-text-primary);
}
.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1;
  direction: ltr;
}
.brand-wordmark { display: flex; align-items: flex-end; height: var(--wm-h); }
.wm {
  display: block;
  flex: none;
  height: var(--wm-h);
  background-color: var(--wm-c);
  -webkit-mask-image: var(--wm-img);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-image: var(--wm-img);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 100% 100%;
  mask-mode: alpha;
}
.wm-van { --wm-c: var(--logo-van); --wm-img: url("../images/brand/wordmark-van.png"); width: calc(var(--wm-h) * 3.7241); }
.wm-tix { --wm-c: var(--logo-tix); --wm-img: url("../images/brand/wordmark-tix.png"); width: calc(var(--wm-h) * 2.8103); }
.wm-dot { --wm-c: var(--logo-dot); --wm-img: url("../images/brand/wordmark-dot.png"); width: calc(var(--wm-h) * 0.3966); }
.wm-africa { --wm-c: var(--logo-africa); --wm-img: url("../images/brand/wordmark-africa.png"); width: calc(var(--wm-h) * 5.3448); }
.brand-tagline {
  display: none;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--logo-tagline);
  white-space: nowrap;
}
.mobile-nav-tagline {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--fs-200);
  color: var(--logo-tagline);
  direction: ltr;
  text-align: start;
}
@media (min-width: 600px) {
  :root { --wm-h: 15px; }
  .brand-tagline { display: block; }
}
@media (min-width: 1024px) { :root { --wm-h: 17px; } .brand-tagline { font-size: 11.5px; } }
.site-footer { --wm-h: 20px; }
.site-footer .brand-tagline { display: none; }
@media (max-width: 359px) { :root { --wm-h: 10px; } }
@media (forced-colors: active) { .wm { background-color: CanvasText; forced-color-adjust: none; } }
@media print { .wm { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Brand color hotfix: the Africa wordmark must be fully white in dark mode.
   The PNG is a black alpha mask; this rule colors its opaque glyph pixels white. */
html[data-theme="dark"] .brand-wordmark .wm-africa,
html:not([data-theme="light"]) .brand-wordmark .wm-africa {
  --wm-c: #FFFFFF;
  background-color: #FFFFFF !important;
  opacity: 1 !important;
  filter: none !important;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}
