/* ==========================================================================
   LuceSemplice Design System
   ========================================================================== */

/* ========================================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ======================================================================== */

:root {
  /* Colors - Primary */
  --color-primary: #164E63;
  --color-primary-dark: #0E3B4C;
  --color-primary-light: #EAF3F2;

  /* Colors - Secondary */
  --color-secondary: #287D62;
  --color-accent: #287D62;

  /* Colors - Neutral */
  --color-white: #FFFFFF;
  --color-bg-light: #F3F7F4;
  --color-bg-alt: #E8F1ED;
  --color-border: #CFDDD7;
  --color-text-primary: #17323B;
  --color-text-secondary: #4E646B;
  --color-text-tertiary: #6C7E83;

  /* Colors - Semantic */
  --color-success: #287D62;
  --color-warning: #F59E0B;
  --color-error: #A52336;

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-family-fallback: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Font Sizes */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-base: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2rem; /* 32px */
  --font-size-5xl: 2.5rem; /* 40px */

  /* Line Heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  --line-height-loose: 1.75;

  /* Spacing Scale (4px base) */
  --space-xs: 0.25rem; /* 4px */
  --space-sm: 0.5rem; /* 8px */
  --space-md: 0.75rem; /* 12px */
  --space-base: 1rem; /* 16px */
  --space-lg: 1.5rem; /* 24px */
  --space-xl: 2rem; /* 32px */
  --space-2xl: 3rem; /* 48px */
  --space-3xl: 4rem; /* 64px */
  --space-4xl: 6rem; /* 96px */

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-base: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(14, 59, 76, 0.06);
  --shadow-base: 0 4px 14px rgba(14, 59, 76, 0.08);
  --shadow-md: 0 10px 28px rgba(14, 59, 76, 0.1);
  --shadow-lg: 0 18px 44px rgba(14, 59, 76, 0.12);
  --shadow-xl: 0 24px 64px rgba(14, 59, 76, 0.16);

  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-base: 0.2s ease-in-out;
  --transition-slow: 0.3s ease-in-out;

  /* Z-index */
  --z-dropdown: 1000;
  --z-fixed: 1020;
  --z-modal-backdrop: 1040;
  --z-modal: 1060;
  --z-popover: 1070;
  --z-tooltip: 1080;
}

/* ========================================================================
   2. RESET & NORMALIZATION
   ======================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-white);
}

/* ========================================================================
   3. TYPOGRAPHY BASE STYLES
   ======================================================================== */

/* Headings */
h1,
.h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.5px;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

h2,
.h2 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
}

h3,
.h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  margin-bottom: var(--space-base);
  color: var(--color-text-primary);
}

h4,
.h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  margin-bottom: var(--space-base);
  color: var(--color-text-primary);
}

h5,
.h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

h6,
.h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
}

/* Paragraphs & Text */
p {
  margin-bottom: var(--space-base);
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

/* Lead text */
.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

/* Small text */
small,
.small {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}

/* Mark & Highlight */
mark {
  background-color: #FFFACD;
  color: inherit;
  padding: 0.125rem 0.25rem;
  border-radius: var(--radius-sm);
}

/* Strong & Bold */
strong,
b {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

/* Emphasis */
em,
i {
  font-style: italic;
}

/* Code */
code,
kbd,
pre,
samp {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

code {
  padding: 0.125rem 0.35rem;
  background-color: var(--color-bg-light);
  border-radius: var(--radius-sm);
  color: var(--color-error);
}

/* Blockquote */
blockquote {
  margin: var(--space-xl) 0;
  padding-left: var(--space-base);
  border-left: 4px solid var(--color-border);
  color: var(--color-text-secondary);
  font-style: italic;
}

/* Lists */
ul,
ol {
  margin-bottom: var(--space-base);
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: var(--line-height-relaxed);
}

/* List unstyled */
.list-unstyled {
  list-style: none;
  padding-left: 0;
}

.list-unstyled li {
  margin-bottom: var(--space-sm);
}

/* Description list */
dt {
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-base);
  margin-bottom: 0.25rem;
}

dd {
  margin-bottom: var(--space-base);
  margin-left: 0;
  padding-left: 1rem;
  color: var(--color-text-secondary);
}

/* Horizontal Rule */
hr {
  margin: var(--space-xl) 0;
  border: none;
  border-top: 1px solid var(--color-border);
  height: 1px;
  background: none;
}

/* ========================================================================
   4. LINKS
   ======================================================================== */

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-base), text-decoration var(--transition-base);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

a:focus {
  outline: 3px solid rgba(22, 78, 99, 0.55);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

a:active {
  color: var(--color-primary-dark);
}

/* ========================================================================
   5. IMAGES & MEDIA
   ======================================================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

/* Responsive images */
.img-fluid {
  max-width: 100%;
  height: auto;
}

/* Figure */
figure {
  margin-bottom: var(--space-lg);
}

figcaption {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
}

/* ========================================================================
   6. TABLES
   ======================================================================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
}

thead {
  background-color: var(--color-bg-light);
}

th,
td {
  padding: var(--space-md) var(--space-base);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

th {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

tbody tr:hover {
  background-color: var(--color-bg-light);
}

/* ========================================================================
   7. FAQ MEDIA PATTERN
   ======================================================================== */

.faq-media-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.faq-media-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 1rem;
}

@media (max-width: 899.98px) {
  .faq-media-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }

  .faq-media-image {
    width: min(100%, 16rem);
    justify-self: center;
  }
}

/* ========================================================================
   8. PRINT STYLES
   ======================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    max-width: 100% !important;
  }

  @page {
    margin: 0.5cm;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }
}

/* ========================================================================
   9. ACCESSIBILITY
   ======================================================================== */

/* Focus visible */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@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;
  }
}

/* High contrast mode */
@media (prefers-contrast: more) {
  :root {
    --color-primary: #0B3A4B;
    --color-text-primary: #000;
    --color-border: #000;
  }
}
