/*
 * Agribantu light theme layer.
 * Dark defaults live in css/tokens.css and component/page rules use those
 * variables. This file is loaded after the page-family stylesheet so light
 * mode only has to replace tokens and genuine light-mode exceptions.
 */

/* --------------------------------------------------------------------------
   Light theme: same Agribantu palette, lighter environment
   -------------------------------------------------------------------------- */

:root[data-theme="light"] {
  color-scheme: light;

  /* Cool neutral equivalents of the dark background and glass surfaces. */
  --bg: #f7f8ff;
  --bg-soft: #ecefff;
  --surface: rgba(255, 255, 255, 0.68);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --border: rgba(35, 40, 72, 0.13);
  --border-strong: rgba(35, 40, 72, 0.23);

  /* Dark ink equivalents of the existing white / lavender text hierarchy. */
  --text: #171a2c;
  --text-soft: #3d4565;
  --text-muted: #535c7a;

  /* Shared light-glass values used by the overrides below. */
  --light-glass: rgba(255, 255, 255, 0.66);
  --light-glass-strong: rgba(255, 255, 255, 0.9);
  --light-glass-hover: rgba(255, 255, 255, 0.82);
  --light-glass-subtle: rgba(255, 255, 255, 0.48);
  --light-shadow:
    0 18px 55px rgba(31, 36, 68, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --light-shadow-small:
    0 10px 30px rgba(31, 36, 68, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

/* Keep the same atmospheric composition as dark mode, but lift its luminance. */
:root[data-theme="light"] body {
  background:
    radial-gradient(
      ellipse 60% 40% at 15% 0%,
      rgba(102, 126, 234, 0.18),
      transparent 60%
    ),
    radial-gradient(
      ellipse 50% 35% at 85% 8%,
      rgba(255, 107, 157, 0.12),
      transparent 60%
    ),
    radial-gradient(
      circle at top left,
      #ffffff 0,
      var(--bg-soft) 45%,
      var(--bg) 100%
    );
}

/* Sticky navigation: one frosted layer across all page templates. */
:root[data-theme="light"] header {
  background: rgba(247, 248, 255, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] header::before {
  background: transparent;
}

/* Language menu uses an opaque-enough glass surface over page content. */
:root[data-theme="light"] .lang-menu-list {
  background: var(--surface-strong);
  box-shadow:
    0 20px 50px -18px rgba(31, 36, 68, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .lang-menu-item:hover {
  background: rgba(102, 126, 234, 0.09);
}

@media (max-width: 860px) {
  :root[data-theme="light"] .nav-links {
    background: var(--surface-strong);
    box-shadow: 0 18px 45px rgba(31, 36, 68, 0.12);
  }
}

:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .lang-toggle,
:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .nav-back {
  background: var(--light-glass-subtle);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .lang-toggle:hover,
:root[data-theme="light"] .btn-ghost:hover {
  background: rgba(102, 126, 234, 0.1);
}

/* --------------------------------------------------------------------------
   Buttons and focus treatment
   -------------------------------------------------------------------------- */

:root[data-theme="light"] .btn-primary {
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(102, 126, 234, 0.3);
}

:root[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 18px 42px rgba(102, 126, 234, 0.4);
}

:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .btn-outline {
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Glass panels, cards and documentation surfaces
   -------------------------------------------------------------------------- */

:root[data-theme="light"] .doc-card,
:root[data-theme="light"] .guide-card,
:root[data-theme="light"] .pillar-mini,
:root[data-theme="light"] .stat-figure,
:root[data-theme="light"] .chip,
:root[data-theme="light"] .chain-cloud li,
:root[data-theme="light"] .form-intro,
:root[data-theme="light"] .survey-summary,
:root[data-theme="light"] .optional-followup,
:root[data-theme="light"] .morpheme-card,
:root[data-theme="light"] .page-card,
:root[data-theme="light"] .callout,
:root[data-theme="light"] .table-wrap {
  background: var(--light-glass-subtle);
  box-shadow: var(--light-shadow-small);
}

:root[data-theme="light"] .doc-card:hover,
:root[data-theme="light"] .guide-card:hover {
  background: var(--light-glass-hover);
  box-shadow: var(--light-shadow);
}

:root[data-theme="light"] .doc-card.placeholder {
  box-shadow: none;
}

:root[data-theme="light"] .console {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.86),
    rgba(239, 242, 250, 0.68)
  );
  box-shadow:
    0 34px 80px -36px rgba(31, 36, 68, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

:root[data-theme="light"] .console-bar {
  background: rgba(236, 239, 248, 0.74);
}

:root[data-theme="light"] .prose thead th {
  background: rgba(102, 126, 234, 0.07);
}

:root[data-theme="light"] .prose pre {
  background: rgba(226, 230, 241, 0.72);
}

/* TOC cards are only boxed on the responsive layouts in the source pages. */
@media (max-width: 900px) {
  :root[data-theme="light"] .doc-toc {
    background: var(--light-glass-subtle);
    box-shadow: var(--light-shadow-small);
  }
}

/* --------------------------------------------------------------------------
   Survey and form controls
   -------------------------------------------------------------------------- */

:root[data-theme="light"] .field input,
:root[data-theme="light"] .field select,
:root[data-theme="light"] .field textarea,
:root[data-theme="light"] #levySurveyForm textarea,
:root[data-theme="light"] input:not([type]),
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] input[type="tel"],
:root[data-theme="light"] input[type="url"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] textarea,
:root[data-theme="light"] select {
  background-color: rgba(255, 255, 255, 0.78);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 2px rgba(31, 36, 68, 0.04);
}

:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field select:focus,
:root[data-theme="light"] .field textarea:focus,
:root[data-theme="light"] #levySurveyForm textarea:focus,
:root[data-theme="light"] input:not([type]):focus,
:root[data-theme="light"] input[type="text"]:focus,
:root[data-theme="light"] input[type="email"]:focus,
:root[data-theme="light"] input[type="search"]:focus,
:root[data-theme="light"] input[type="tel"]:focus,
:root[data-theme="light"] input[type="url"]:focus,
:root[data-theme="light"] input[type="password"]:focus,
:root[data-theme="light"] input[type="number"]:focus,
:root[data-theme="light"] textarea:focus,
:root[data-theme="light"] select:focus {
  background-color: rgba(255, 255, 255, 0.94);
}

:root[data-theme="light"] .field select option,
:root[data-theme="light"] select option {
  background: #ffffff;
  color: var(--text);
}

:root[data-theme="light"] input:not([type])::placeholder,
:root[data-theme="light"] input[type="text"]::placeholder,
:root[data-theme="light"] input[type="email"]::placeholder,
:root[data-theme="light"] input[type="search"]::placeholder,
:root[data-theme="light"] input[type="tel"]::placeholder,
:root[data-theme="light"] input[type="url"]::placeholder,
:root[data-theme="light"] input[type="password"]::placeholder,
:root[data-theme="light"] input[type="number"]::placeholder,
:root[data-theme="light"] textarea::placeholder {
  color: var(--text-muted);
}

:root[data-theme="light"] .option-item:hover,
:root[data-theme="light"] .permission-row:hover,
:root[data-theme="light"] .optional-followup:focus-within {
  background: rgba(255, 255, 255, 0.66);
}

:root[data-theme="light"] .option-item:has(input:checked),
:root[data-theme="light"] .permission-row:has(input:checked) {
  background: rgba(102, 126, 234, 0.1);
}

:root[data-theme="light"] .char-progress {
  background: rgba(35, 40, 72, 0.12);
}

:root[data-theme="light"] .levy-fact {
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

/* --------------------------------------------------------------------------
   Atmospheric details
   -------------------------------------------------------------------------- */

:root[data-theme="light"] .orbit,
:root[data-theme="light"] .glow {
  opacity: 0.3;
}

:root[data-theme="light"] .eyebrow::before {
  box-shadow: 0 0 8px 2px rgba(255, 107, 157, 0.38);
}

:root[data-theme="light"] .footer-placeholder {
  color: rgba(23, 26, 44, 0.38);
}

/*
 * Filmstrips and lightboxes intentionally remain dark. They are media-viewer
 * surfaces, and retaining their black frame preserves image contrast in both
 * themes.
 */
