/* ============================================================
   variables.css — CSS Custom Properties
   Pinion & Adams Fabricators
   ============================================================ */

:root {

  /* ----------------------------------------
     Colors
     ---------------------------------------- */
  --color-primary:        #ffffff;          /* page background */
  --color-surface:        #f5f5f5;          /* alternate section background */
  --color-surface-light:  #e8e9ec;          /* input background, icon boxes */
  --color-surface-dark:   #141c2e;          /* dark sections, overlays */

  --color-secondary:      #205785;          /* steel blue — primary accent / CTA */
  --color-secondary-hover:#164269;          /* steel blue hover */
  --color-accent:         #269dcc;          /* teal — secondary accent */
  --color-footer-bar:     #141c2e;          /* footer bottom bar */

  --color-text-primary:   #444a59;          /* body text */
  --color-text-heading:   #205785;          /* h1–h3 steel blue */
  --color-text-dark:      #141c2e;          /* dark headings / dark sections */
  --color-text-muted:     #5a6275;          /* secondary text */
  --color-text-on-dark:   #ffffff;          /* text on dark backgrounds */

  --color-border:         rgba(0, 0, 0, 0.10);
  --color-border-dark:    rgba(255, 255, 255, 0.10);
  --color-blue-glow:      rgba(32, 87, 133, 0.20);

  /* ----------------------------------------
     Typography
     ---------------------------------------- */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* ----------------------------------------
     Transitions
     ---------------------------------------- */
  --transition-fast:    0.2s ease;
  --transition-smooth:  0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-bounce:  0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-slow:    0.8s ease;

  /* ----------------------------------------
     Shadows
     ---------------------------------------- */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 40px rgba(32, 87, 133, 0.20);

  /* ----------------------------------------
     Border Radius
     ---------------------------------------- */
  --border-radius:    10px;
  --border-radius-lg: 16px;

  /* ----------------------------------------
     Spacing Scale
     ---------------------------------------- */
  --space-xs:   0.25rem;   /*  4px */
  --space-sm:   0.5rem;    /*  8px */
  --space-md:   1rem;      /* 16px */
  --space-lg:   1.5rem;    /* 24px */
  --space-xl:   2rem;      /* 32px */
  --space-2xl:  3rem;      /* 48px */
  --space-3xl:  5rem;      /* 80px */

  /* ----------------------------------------
     Container Max-Widths
     ---------------------------------------- */
  --container-sm:  640px;
  --container-md:  960px;
  --container-lg:  1280px;
  --container-xl:  1440px;

  /* ----------------------------------------
     Z-Index Scale
     ---------------------------------------- */
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-top:     400;

  /* ----------------------------------------
     Section Padding
     ---------------------------------------- */
  --section-pad: 160px;

}

/* ============================================================
   DARK MODE OVERRIDES
============================================================ */

[data-theme="dark"] {
  --color-primary:        #141c2e;          /* page background → dark navy */
  --color-surface:        #0f1520;          /* alternate section → deeper */
  --color-surface-light:  #1e2d42;          /* inputs, icon boxes */

  --color-text-primary:   #ffffff;          /* body text → white */
  --color-text-heading:   #ffffff;          /* headings → white */
  --color-text-dark:      #ffffff;          /* dark headings → white */
  --color-text-muted:     rgba(255, 255, 255, 0.60); /* secondary text → 60% white */
  --color-text-on-dark:   #ffffff;

  --color-border:         rgba(255, 255, 255, 0.08);
  --color-border-dark:    rgba(255, 255, 255, 0.12);
  --shadow-card:          0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow:          0 0 40px rgba(38, 157, 204, 0.25);

  color-scheme: dark;
}

/* Body base */
[data-theme="dark"] body {
  background-color: var(--color-primary);
  color: var(--color-text-primary);
}

/* Sections with hardcoded white background */
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"] {
  background-color: var(--color-primary) !important;
}

/* Sections with hardcoded #f5f5f5 or similar light */
[data-theme="dark"] [style*="background:#f5f5f5"],
[data-theme="dark"] [style*="background: #f5f5f5"] {
  background-color: var(--color-surface) !important;
}

/* Footer (white dot-grid → dark dot-grid) */
[data-theme="dark"] #site-footer {
  background-color: #0f1520;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

[data-theme="dark"] .footer-heading {
  color: #e2e8f0;
}

[data-theme="dark"] .footer-iso {
  border-color: rgba(255, 255, 255, 0.10);
  color: #8898aa;
}

[data-theme="dark"] .footer-tagline,
[data-theme="dark"] .footer-links a,
[data-theme="dark"] .footer-contact-text,
[data-theme="dark"] .footer-contact-text a,
[data-theme="dark"] .footer-bottom p,
[data-theme="dark"] .footer-bottom a {
  color: #8898aa;
}

[data-theme="dark"] .footer-links a:hover,
[data-theme="dark"] .footer-contact-text a:hover,
[data-theme="dark"] .footer-bottom a:hover {
  color: #cbd5e1;
}

[data-theme="dark"] .footer-newsletter-input {
  background: #1e2d42;
  border-color: rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
}

[data-theme="dark"] .footer-newsletter-input::placeholder {
  color: #8898aa;
}

[data-theme="dark"] .footer-newsletter-btn {
  background: #269dcc;
  border-color: #269dcc;
}

[data-theme="dark"] .footer-contact-icon {
  background: #1e2d42;
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .footer-social-circle {
  background: #1e2d42;
  border-color: rgba(255, 255, 255, 0.10);
  color: #8898aa;
}

[data-theme="dark"] .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* Project cards */
[data-theme="dark"] .project-card {
  background:
    linear-gradient(#1e2d42, #1e2d42) padding-box,
    conic-gradient(
      from var(--pcard-angle, 0deg),
      #030d1a 0%, #0d5fa8 22%, #269dcc 42%, #9ef8ff 50%,
      #269dcc 58%, #0d5fa8 78%, #030d1a 100%
    ) border-box !important;
}

/* Blog / content cards */
[data-theme="dark"] .blog-card,
[data-theme="dark"] .blog-card-inner,
[data-theme="dark"] .card,
[data-theme="dark"] .product-card,
[data-theme="dark"] .stat-card {
  background: var(--color-surface-light);
  border-color: var(--color-border);
}

/* Inputs & forms */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--color-surface-light);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

/* Scroll progress + buttons */
[data-theme="dark"] .scroll-top-btn {
  background: #1e2d42;
  border-color: rgba(255, 255, 255, 0.10);
  color: #e2e8f0;
}

/* ── Dark mode: hardcoded white sections ─────────────────────────
   Each page's inline <style> block sets background:#ffffff on white
   sections AND redefines local CSS variables for dark-on-white text.
   We must override both the background AND those local variables.
─────────────────────────────────────────────────────────────────── */

/* index.html white sections — also carry local --color-* overrides */
[data-theme="dark"] .home-sec-1,
[data-theme="dark"] .home-sec-3,
[data-theme="dark"] .home-sec-4 {
  background: var(--color-primary) !important;
  --color-text-primary:   #ffffff;
  --color-text-muted:     rgba(255, 255, 255, 0.60);
  --color-border:         rgba(255, 255, 255, 0.10);
  --color-surface-light:  rgba(255, 255, 255, 0.06);
  --color-surface:        rgba(255, 255, 255, 0.04);
}

/* home-sec-4: additional hardcoded dark text not using CSS vars */
[data-theme="dark"] .home-sec-4 .mie-number {
  /* "First" — was near-invisible on dark background */
  color: var(--color-accent) !important;
}
[data-theme="dark"] .home-sec-4 .mie-claim,
[data-theme="dark"] .home-sec-4 .mie-sub,
[data-theme="dark"] .home-sec-4 .mie-description,
[data-theme="dark"] .home-sec-4 .mie-description strong,
[data-theme="dark"] .home-sec-4 .process-step-label {
  color: #ffffff !important;
}
[data-theme="dark"] .home-sec-4 .process-step-num {
  /* 01–05 step numbers */
  color: var(--color-accent) !important;
}
[data-theme="dark"] .home-sec-4 .process-step-bubble {
  background: rgba(38, 157, 204, 0.12) !important;
  border-color: rgba(38, 157, 204, 0.35) !important;
}
[data-theme="dark"] .home-sec-4 .process-step-bubble svg {
  stroke: var(--color-accent) !important;
}
[data-theme="dark"] .home-sec-4 .process-step:not(:last-child)::after {
  background: rgba(255, 255, 255, 0.10) !important;
}
[data-theme="dark"] .home-sec-4 .btn--outline-dark {
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* home-sec-1: badge has hardcoded dark text */
[data-theme="dark"] .home-sec-1 .badge {
  border-color: rgba(255, 255, 255, 0.20) !important;
  color: rgba(255, 255, 255, 0.75) !important;
}

/* about.html white sections — no local CSS vars, background only */
[data-theme="dark"] .about-sec-1,
[data-theme="dark"] .about-sec-3,
[data-theme="dark"] .about-sec-5 {
  background: var(--color-primary) !important;
}

/* about-sec-5: hardcoded dark text colors */
[data-theme="dark"] .about-sec-5 .section-label,
[data-theme="dark"] .about-sec-5 .mie-number {
  color: var(--color-accent) !important;
}
[data-theme="dark"] .about-sec-5 .mie-claim,
[data-theme="dark"] .about-sec-5 .mie-sub,
[data-theme="dark"] .about-sec-5 .section-title {
  color: #ffffff !important;
}
[data-theme="dark"] .about-sec-5 .mie-description {
  color: rgba(255, 255, 255, 0.60) !important;
}
[data-theme="dark"] .about-sec-5 .mie-description strong {
  color: #ffffff !important;
}

/* services.html */
[data-theme="dark"] .svc-grid-section {
  background: var(--color-primary) !important;
}

/* Global: section-label uses --color-secondary (#205785) which is dark and unreadable in dark mode */
[data-theme="dark"] .section-label {
  color: var(--color-accent) !important;
}

/* facilities.html: stat numbers */
[data-theme="dark"] .facility-stat-number {
  color: var(--color-accent) !important;
}

/* Form labels — too faint at 60% white on small uppercase text */
[data-theme="dark"] .form-label {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* privacy-policy.html + terms.html — section headings → light blue in dark mode */
[data-theme="dark"] .policy-content h2 {
  color: var(--color-accent) !important;
}
