/*
Theme Name: Altegra
Theme URI: https://altegra.se
Author: Altegra AB
Author URI: https://altegra.se
Description: A professional, modern WordPress theme for Altegra AB — a leading PLM consulting company in Sweden.
Version: 1.5.9
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: altegra
Tags: business, professional, consulting, minimal, responsive, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog, full-width-template, editor-style
*/

/* ================================================================
   CSS Custom Properties (Design Tokens)
   ================================================================ */
:root {
  /* Colors — Light Theme */
  --color-primary:       #0A1628;   /* deep navy — headings, logo */
  --color-primary-light: #1A2B45;
  --color-accent:        #1956C8;   /* blue — CTAs, links */
  --color-accent-hover:  #1244A8;
  --color-accent-light:  #EBF2FF;   /* very pale blue tint */
  --color-text:          #1C2333;   /* near-black body text */
  --color-text-muted:    #64748B;
  --color-text-light:    #94A3B8;
  --color-surface:       #FFFFFF;   /* card / widget bg */
  --color-bg:            #F7F9FC;   /* page background — off-white */
  --color-bg-alt:        #EEF2F8;   /* alternate section bg */
  --color-bg-dark:       #0A1628;   /* footer / dark accent */
  --color-border:        #DDE3ED;
  --color-border-dark:   #1E3A5F;
  --color-success:       #16A34A;
  --color-error:         #DC2626;
  --color-header-bg:     #FFFFFF;
  --color-header-shadow: rgba(10,22,40,0.08);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.82rem + 0.28vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.6vw,  1.375rem);
  --text-xl:   clamp(1.25rem,  1.1rem  + 0.75vw, 1.5rem);
  --text-2xl:  clamp(1.5rem,   1.25rem + 1.25vw, 2rem);
  --text-3xl:  clamp(1.875rem, 1.5rem  + 1.875vw, 2.625rem);
  --text-4xl:  clamp(2.25rem,  1.75rem + 2.5vw,  3.375rem);
  --text-5xl:  clamp(2.75rem,  2rem    + 3.75vw, 4.5rem);

  --font-weight-regular: 400;
  --font-weight-medium:  500;
  --font-weight-semibold:600;
  --font-weight-bold:    700;
  --font-weight-black:   800;

  --line-height-tight:  1.2;
  --line-height-snug:   1.375;
  --line-height-normal: 1.6;
  --line-height-relaxed:1.75;

  /* Spacing (8px grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --section-padding: clamp(4rem, 8vw, 7rem);
  --container-max:   1280px;
  --container-pad:   clamp(1rem, 4vw, 2.5rem);

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;
  --border-width: 1px;

  /* Shadows */
  --shadow-sm:  0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-below:   -1;
  --z-base:     0;
  --z-above:    10;
  --z-header:   100;
  --z-overlay:  200;
  --z-modal:    300;
  --z-toast:    400;
}

/* ================================================================
   CSS Reset & Base
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  text-decoration: none;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 1rem; }

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent-hover); }

/* Images */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol { list-style: none; }

/* Buttons reset */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

/* Forms reset */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ================================================================
   Typography
   ================================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); font-weight: var(--font-weight-black); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-primary { color: var(--color-primary); }
.text-white  { color: #fff; }

/* ================================================================
   Layout Utilities
   ================================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1440px;
}

.section {
  padding-block: var(--section-padding);
}

.section--bg-dark {
  background-color: var(--color-bg-dark);
  color: #fff;
}
.section--bg-dark h1,
.section--bg-dark h2,
.section--bg-dark h3,
.section--bg-dark h4 {
  color: #fff;
}

.section--bg-light { background-color: var(--color-bg); }
.section--bg-white { background-color: var(--color-surface); }
.section--bg-accent-light { background-color: var(--color-accent-light); }

/* Grid */
.grid {
  display: grid;
  gap: var(--space-8);
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* Flex utilities */
.flex { display: flex; }
.flex--center { align-items: center; justify-content: center; }
.flex--between { align-items: center; justify-content: space-between; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ================================================================
   Scroll Reveal Animation
   ================================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal-delay="100"] { transition-delay: 0.1s; }
[data-reveal-delay="200"] { transition-delay: 0.2s; }
[data-reveal-delay="300"] { transition-delay: 0.3s; }
[data-reveal-delay="400"] { transition-delay: 0.4s; }
[data-reveal-delay="500"] { transition-delay: 0.5s; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
