/**
 * ISIT-Neperis Website - Base Styles
 * Reset, typography, and global base styles
 */

/* ============================================
   CSS RESET
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
  background-color: var(--color-white);
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-dark);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: var(--font-size-4xl);
}

h3 {
  font-size: var(--font-size-3xl);
}

h4 {
  font-size: var(--font-size-2xl);
}

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-gray-600);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid var(--color-focus, #0e7490);
  outline-offset: 2px;
}

/* Navigation links don't need underlines */
nav a,
.nav__link,
.mega-menu__link,
.footer__link,
.btn {
  text-decoration: none;
}

nav a:hover,
.nav__link:hover,
.mega-menu__link:hover,
.footer__link:hover {
  text-decoration: underline;
}

ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-sm);
  color: var(--color-gray-600);
}

strong {
  font-weight: var(--font-weight-semibold);
  color: var(--color-dark);
}

em {
  font-style: italic;
}

/* ============================================
   CODE & PRE
   ============================================ */

code {
  font-family: var(--font-family-code);
  font-size: 0.875em;
  padding: 0.125rem 0.375rem;
  background-color: var(--color-light);
  border-radius: var(--border-radius-sm);
  color: var(--color-primary-dark);
}

pre {
  font-family: var(--font-family-code);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  padding: var(--spacing-lg);
  background-color: var(--color-code-bg);
  color: var(--color-code-text);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-md);
}

pre code {
  padding: 0;
  background-color: transparent;
  color: inherit;
  font-size: inherit;
}

/* ============================================
   IMAGES
   ============================================ */

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   BUTTONS & FORMS (Base)
   ============================================ */

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   UTILITIES
   ============================================ */

.container {
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip to content link for accessibility - legacy class */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-dark);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  z-index: 9999;
  border-radius: 0 0 var(--border-radius-sm) 0;
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--color-focus, #0e7490);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

@media (max-width: 1023px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: var(--font-size-4xl);
  }

  h2 {
    font-size: var(--font-size-3xl);
  }

  h3 {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 767px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: var(--font-size-3xl);
  }

  h2 {
    font-size: var(--font-size-2xl);
  }

  h3 {
    font-size: var(--font-size-xl);
  }

  h4 {
    font-size: var(--font-size-lg);
  }

  .container {
    --container-padding: 1rem;
  }
}
