/**
 * @file
 * Typography system for NBVT Base theme
 * Modern typography based on system fonts with NBVT branding
 */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&display=swap');

:root {
  /* Font families */
  --font-family-sans: 'Open Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif;
  --font-family-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* 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: 2.25rem;   /* 36px */
  --font-size-5xl: 3rem;      /* 48px */
  --font-size-6xl: 3.75rem;   /* 60px */

  /* Line heights */
  --line-height-none: 1;
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

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

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

/* Base typography */
html {
  font-size: 16px;
  line-height: var(--line-height-normal);
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin: 0 0 1rem 0;
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: var(--letter-spacing-tight);
}

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

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

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

h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

/* Responsive headings */
@media (max-width: 767px) {
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
  
  h3 {
    font-size: var(--font-size-xl);
  }
}

/* Paragraphs and text */
p {
  margin: 0 0 1rem 0;
  line-height: var(--line-height-relaxed);
}

.lead {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
}

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

.large {
  font-size: var(--font-size-lg);
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

a:visited {
  color: var(--color-link-visited);
}

a:focus {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove underline from specific link types */
.site-logo a,
.site-name a,
.menu a {
  text-decoration: none;
}

.site-logo a:hover,
.site-name a:hover,
.menu a:hover {
  text-decoration: none;
}

/* Lists */
ul, ol {
  margin: 0 0 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

ul ul, ol ol, ul ol, ol ul {
  margin-bottom: 0;
}

/* Definition lists */
dl {
  margin: 0 0 1rem 0;
}

dt {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.25rem;
}

dd {
  margin: 0 0 1rem 1.5rem;
}

/* Blockquotes */
blockquote {
  margin: 0 0 1rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid var(--color-primary);
  background-color: var(--color-bg-alt);
  font-style: italic;
}

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

/* Code and preformatted text */
code, kbd, samp {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-muted);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
}

pre {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg-muted);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 1rem 0;
}

pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem 0;
  font-size: var(--font-size-sm);
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-table-border);
}

th {
  background-color: var(--color-table-header-bg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-table-header-text);
}

tbody tr:nth-child(even) {
  background-color: var(--color-table-stripe);
}

tbody tr:hover {
  background-color: var(--color-table-hover);
}

/* Utility classes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

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

.leading-none { line-height: var(--line-height-none); }
.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

.tracking-tighter { letter-spacing: var(--letter-spacing-tighter); }
.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

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

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.italic { font-style: italic; }
.not-italic { font-style: normal; }

.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: black;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: black;
    page-break-after: avoid;
  }
  
  p, blockquote {
    orphans: 3;
    widows: 3;
  }
  
  blockquote {
    page-break-inside: avoid;
  }
}
