/* ============================================================
   theme.css
   Light / Dark mode support.
   The site is light by default (modern, airy, paper-toned).
   The original dark design is preserved as an opt-in alternate,
   activated when <html data-theme="dark"> is set by js/theme.js.
   Everything below only activates on that attribute and never
   alters the light-mode rules that live in the other component
   stylesheets.
   ============================================================ */

/* ---------- Toggle switch (unmistakable, labeled, always visible) ---------- */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  margin-left: 20px;
  padding: 0 14px 0 6px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  transition: var(--transition);
}
.theme-toggle:hover {
  border-color: var(--accent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.theme-toggle .switch-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1), background var(--transition);
}
.theme-toggle.is-light .switch-track {
  background: rgba(166,124,61,0.25);
  border-color: rgba(166,124,61,0.5);
}
.theme-toggle.is-light .switch-knob {
  transform: translateX(20px);
  background: var(--sky);
}
.theme-toggle .switch-knob::before { content: '🌙'; }
.theme-toggle.is-light .switch-knob::before { content: '☀️'; }

.theme-toggle .toggle-label {
  min-width: 3.2em;
  text-align: left;
}
.theme-toggle .label-dark { display: inline; }
.theme-toggle .label-light { display: none; }
.theme-toggle.is-light .label-dark { display: none; }
.theme-toggle.is-light .label-light { display: inline; }

@media (max-width: 860px) {
  .theme-toggle { margin-left: 0; margin-right: 10px; }
}
@media (max-width: 380px) {
  .theme-toggle .toggle-label { display: none; }
}

/* ================================================================
   LIGHT THEME OVERRIDES
   Strategy: the site's dark design uses a consistent token system
   (--white / --muted / --card-bg / --border for foreground+surfaces,
   --navy / --navy-mid for full-section backgrounds). We repoint the
   foreground tokens and add explicit background overrides so every
   existing component (already built on these tokens) reflows into a
   light theme with no edits to the original component CSS files.
   ================================================================ */

[data-theme="light"] {
  --white:   #101a2c;                 /* main ink */
  --muted:   #55637a;                 /* secondary ink */
  --card-bg: rgba(10,30,60,0.045);
  --border:  rgba(10,30,60,0.12);

  --page-bg:      #f7f8fa;            /* paper, near-white with a whisper of grey */
  --page-bg-alt:  #eef1f5;
  --page-bg-deep: #e6eaee;
}

/* Section backgrounds */
[data-theme="light"] body,
[data-theme="light"] #hero,
[data-theme="light"] #services-section,
[data-theme="light"] #contact-section {
  background: var(--page-bg);
}
[data-theme="light"] #about-section,
[data-theme="light"] #team-section {
  background: var(--page-bg-alt);
}
[data-theme="light"] #footer {
  background: var(--page-bg-deep);
}

/* Hero photo overlay — lighten the tint over the same photograph */
[data-theme="light"] .hero-bg {
  background:
    linear-gradient(135deg, rgba(247,248,250,0.93) 0%, rgba(61,90,115,0.20) 60%, rgba(247,248,250,0.95) 100%),
    url('https://images.unsplash.com/photo-1578356058390-f58c575337a2?w=1600&q=80') center/cover no-repeat;
}
[data-theme="light"] .hero-grid {
  background-image:
    linear-gradient(rgba(61,90,115,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,90,115,0.05) 1px, transparent 1px);
}
[data-theme="light"] .hero-title .line3 {
  -webkit-text-stroke: 1px rgba(16,26,44,0.35);
}
[data-theme="light"] .hero-desc {
  color: rgba(16,26,44,0.72);
}
[data-theme="light"] .hero-stats {
  background: rgba(16,26,44,0.04);
  border: 1px solid rgba(16,26,44,0.1);
}
[data-theme="light"] .stat-item {
  border-bottom-color: rgba(16,26,44,0.08);
}
[data-theme="light"] .hero-badges {
  border-top-color: rgba(16,26,44,0.1);
}

/* Navbar */
[data-theme="light"] #navbar.scrolled {
  background: rgba(247,248,250,0.95);
  box-shadow: 0 2px 30px rgba(16,26,44,0.1);
}
[data-theme="light"] .nav-links a {
  color: rgba(16,26,44,0.7);
}
[data-theme="light"] .nav-links.open {
  background: rgba(247,248,250,0.98);
  border-top-color: rgba(16,26,44,0.1);
}

/* About */
[data-theme="light"] #about-section::before {
  color: rgba(16,26,44,0.03);
}
[data-theme="light"] .about-text p {
  color: rgba(16,26,44,0.72);
}

/* Services */
[data-theme="light"] .services-desc {
  color: rgba(16,26,44,0.68);
}
[data-theme="light"] .tab-btn {
  color: var(--muted);
  border-color: var(--border);
}
[data-theme="light"] .tab-btn:hover {
  color: var(--white);
  border-color: rgba(16,26,44,0.25);
}
[data-theme="light"] .service-card:hover {
  box-shadow: 0 12px 32px rgba(16,26,44,0.12);
}

/* Team */
[data-theme="light"] .team-header p,
[data-theme="light"] .team-bio {
  color: rgba(16,26,44,0.65) !important;
}
[data-theme="light"] .team-card:hover {
  box-shadow: 0 16px 40px rgba(16,26,44,0.14);
}

/* Contact */
[data-theme="light"] .contact-tagline {
  color: rgba(16,26,44,0.65);
}
[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select,
[data-theme="light"] .form-group textarea {
  background: rgba(16,26,44,0.035);
  color: var(--white);
}
[data-theme="light"] .form-group select option {
  background: var(--white);
  color: var(--page-bg);
}

/* Footer */
[data-theme="light"] .footer-brand p,
[data-theme="light"] .footer-col ul li a,
[data-theme="light"] .footer-contact-item {
  color: rgba(16,26,44,0.55);
}
[data-theme="light"] .footer-bottom p {
  color: rgba(16,26,44,0.4);
}
[data-theme="light"] .footer-links a {
  color: rgba(16,26,44,0.45);
}

/* Buttons / misc borders that were hard-coded to white-based rgba */
[data-theme="light"] .btn-outline {
  color: var(--white);
  border-color: rgba(16,26,44,0.3);
}
[data-theme="light"] .nav-toggle span {
  background: var(--white);
}

/* ----------------------------------------------------------------
   Accessible text-color for small labels
   var(--accent) and var(--sky) stay vivid for buttons, borders, and
   large headline text (which only need a 3:1 contrast ratio against
   the page). The uses below are small (≤0.85rem) persistent text on
   the paper background, which needs 4.5:1 — so in light mode they
   get a darker tint of the same hue instead.
   ---------------------------------------------------------------- */
[data-theme="light"] .section-label,
[data-theme="light"] .hero-text .tag,
[data-theme="light"] .footer-col h4,
[data-theme="light"] .footer-bottom a,
[data-theme="light"] .footer-col ul li a::before,
[data-theme="light"] .footer-links a:hover,
[data-theme="light"] .contact-item-text a:hover,
[data-theme="light"] .news-card-readmore:hover,
[data-theme="light"] .article-back:hover,
[data-theme="light"] .verify-footnote a:hover,
[data-theme="light"] .team-expand-btn:hover {
  color: #8a6530;
}

[data-theme="light"] .team-expand-btn,
[data-theme="light"] .verify-status-banner.status-valid,
[data-theme="light"] .verify-authenticity-note strong,
[data-theme="light"] .verify-footnote a,
[data-theme="light"] .news-card-readmore,
[data-theme="light"] .article-category {
  color: #4a6a80;
}

/* Smooth theme transition — only touches color-related properties,
   scoped to the light-theme state so the original dark design's
   transition timing is never altered. */
[data-theme="light"] body,
[data-theme="light"] #navbar {
  transition: background-color 0.4s ease, color 0.4s ease;
}
