/* ============================================
   NP-Law - Design System (main.css)
   Nikolov & Partners Law Firm
   ============================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --color-primary: #002871;
  --color-primary-light: #1a3a8a;
  --color-primary-dark: #001a4d;
  --color-accent: #D4A853;
  --color-accent-light: #e0bb6f;
  --color-accent-dark: #b89343;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F9FAFB;
  --color-bg-card: #FFFFFF;
  --color-text: #002871;
  --color-text-body: #6B7280;
  --color-text-muted: #9CA3AF;
  --color-text-inverse: #FFFFFF;
  --color-border: #E0E2E8;
  --color-border-light: #F3F4F6;

  /* Fonts */
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Font weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  /* Font sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */
  --text-hero: 3.5rem;    /* 56px */

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.1;
  --leading-snug: 1.375;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;
  --leading-loose: 2;

  /* Letter spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* Spacing */
  --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: 4rem;      /* 64px */
  --space-4xl: 5rem;      /* 80px */
  --space-5xl: 6rem;      /* 96px */

  /* Border radius */
  --radius-none: 0;
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --header-height: 80px;
  --container-max: 1280px;
  --container-wide: 1440px;
  --container-narrow: 960px;
  --container-pad: 1.5rem;
  --grid-gap: 1.5rem;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-overlay: 9999;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1070;
}

/* --- CSS Reset (Modern, Minimal) --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  line-height: 1.15;
  font-size: 100%; /* 16px base */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: var(--header-height);
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

/* Remove animations for people who prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* @font-face declarations are in fonts.css (loaded separately) */

/* --- Base Typography --- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-black);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-body);
}

p:last-child {
  margin-bottom: 0;
}

strong, b {
  font-weight: var(--weight-semibold);
}

small {
  font-size: var(--text-sm);
}

blockquote {
  border-left: 4px solid var(--color-accent);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  background-color: var(--color-bg-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text);
}

blockquote p {
  margin-bottom: 0;
  font-size: var(--text-lg);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-2xl) 0;
}

/* --- Layout --- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
}

.section--sm {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.section--lg {
  padding-top: var(--space-5xl);
  padding-bottom: var(--space-5xl);
}

/* Section backgrounds */
.section-white {
  background-color: var(--color-bg);
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-navy {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.section-navy h1,
.section-navy h2,
.section-navy h3,
.section-navy h4,
.section-navy h5,
.section-navy h6 {
  color: var(--color-text-inverse);
}

.section-navy p {
  color: rgba(255, 255, 255, 0.85);
}

.section-navy a {
  color: var(--color-accent);
}

.section-navy a:hover {
  color: var(--color-accent-light);
}

/* Section header (centered titles) */
.section-header {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-3xl);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-body);
  margin-top: var(--space-sm);
}

.section-label {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
  display: block;
}

/* --- Grid Helpers --- */

.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* --- Flex Helpers --- */

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* --- Button Styles --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.875rem 2rem;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Primary (Navy) */
.btn--primary {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-light);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* Accent (Gold) */
.btn--accent {
  background-color: var(--color-accent);
  color: var(--color-primary-dark);
  border-color: var(--color-accent);
}

.btn--accent:hover {
  background-color: var(--color-accent-light);
  border-color: var(--color-accent-light);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn--accent:active {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
}

/* Outline */
.btn--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--outline:hover {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

/* Outline White (for dark backgrounds) */
.btn--outline-white {
  background-color: transparent;
  color: var(--color-text-inverse);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--outline-white:hover {
  background-color: var(--color-text-inverse);
  color: var(--color-primary);
  border-color: var(--color-text-inverse);
}

/* Button sizes */
.btn--lg {
  padding: 1rem 2.25rem;
  font-size: var(--text-base);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-xs);
}

/* --- Utility Classes --- */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-inverse { color: var(--color-text-inverse); }

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

.fw-light { font-weight: var(--weight-light); }
.fw-regular { font-weight: var(--weight-regular); }
.fw-medium { font-weight: var(--weight-medium); }
.fw-semibold { font-weight: var(--weight-semibold); }
.fw-bold { font-weight: var(--weight-bold); }
.fw-extrabold { font-weight: var(--weight-extrabold); }
.fw-black { font-weight: var(--weight-black); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* Screen reader only */
.sr-only,
.visually-hidden {
  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: 0;
  z-index: 10000;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: var(--weight-bold);
}

.skip-link:focus {
  top: 0;
}

/* WordPress specific */
.wp-caption {
  max-width: 100%;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: var(--space-lg);
  margin-bottom: var(--space-md);
}

.alignright {
  float: right;
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

/* Site main wrapper */
.site-main {
  min-height: 60vh;
}
