/**
 * Il Tasto Design System
 *
 * CSS variables, modern reset, base typography, and responsive breakpoints.
 * This file defines the visual foundation for the entire theme.
 */

/* ==========================================================================
   1. CSS Custom Properties
   ========================================================================== */

:root {
  /* Colors */
  --ilt-color-black: #050505;
  --ilt-color-white: #FFFFFF;
  --ilt-color-grey-bg: #F5F5F7;
  --ilt-color-grey-text: #6E6E73;
  --ilt-color-grey-border: #D2D2D7;
  --ilt-color-blue-cta: #0071E3;
  --ilt-color-green: #34C759;
  --ilt-color-red: #FF3B30;

  /* Typography */
  --ilt-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
                     "SF Pro Text", "Segoe UI", sans-serif;

  /* Border Radius */
  --ilt-radius-sm: 8px;
  --ilt-radius-md: 12px;
  --ilt-radius-lg: 16px;

  /* Shadows */
  --ilt-shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --ilt-shadow-md: 0 4px 16px rgba(0,0,0,0.12);

  /* Spacing */
  --ilt-space-xs: 4px;
  --ilt-space-sm: 8px;
  --ilt-space-md: 16px;
  --ilt-space-lg: 24px;
  --ilt-space-xl: 32px;
  --ilt-space-2xl: 48px;
  --ilt-space-3xl: 64px;

  /* Layout */
  --ilt-container-max: 1200px;

  /* Transitions */
  --ilt-transition-fast: 150ms;
  --ilt-transition-normal: 300ms;
}

/* ==========================================================================
   2. Modern CSS Reset
   ========================================================================== */

*,
*::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;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* Remove default fieldset styles */
fieldset {
  border: none;
}

/* Ensure hidden elements are hidden */
[hidden] {
  display: none !important;
}

/* Accessible screen-reader-only class */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  position: static;
  width: auto;
  height: auto;
  padding: var(--ilt-space-sm) var(--ilt-space-md);
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: var(--ilt-color-blue-cta);
  color: var(--ilt-color-white);
  font-size: 1rem;
  z-index: 100000;
}

/* Focus visible styles for accessibility */
:focus-visible {
  outline: 2px solid var(--ilt-color-blue-cta);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================================================
   3. Base Typography
   ========================================================================== */

body {
  font-family: var(--ilt-font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ilt-color-black);
  background-color: var(--ilt-color-white);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--ilt-color-black);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--ilt-space-md);
  color: var(--ilt-color-grey-text);
  line-height: 1.6;
}

a {
  color: var(--ilt-color-blue-cta);
  transition: color var(--ilt-transition-fast) ease;
}

a:hover {
  color: var(--ilt-color-black);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: 0.875rem;
}

/* ==========================================================================
   4. Responsive Breakpoints (Mobile-First)
   ========================================================================== */

/* Small devices (landscape phones) */
@media (min-width: 480px) {
  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 2.25rem;
  }
}

/* Medium devices (tablets) */
@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 1.75rem;
  }
}

/* Large devices (desktops) */
@media (min-width: 1024px) {
  h1 {
    font-size: 3.5rem;
  }

  h2 {
    font-size: 2.75rem;
  }

  h3 {
    font-size: 2rem;
  }

  h4 {
    font-size: 1.375rem;
  }
}

/* Extra large devices (large desktops) */
@media (min-width: 1280px) {
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 3rem;
  }
}

/* ==========================================================================
   5. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
