/* ====================================
   🔤 SF PRO TYPOGRAPHY - Global System
   Apple-inspired typography perfettamente calibrata
   ==================================== */

/* ========================================
   BASE FONT STACK
   ======================================== */

:root {
  /* SF Pro Font Family */
  --font-sf-pro: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", 
                 "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  
  /* Playfair Display per titoli eleganti */
  --font-playfair: 'Playfair Display', Georgia, serif;
  
  /* Font Sizes - Scala perfetta */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 0.9375rem;  /* 15px - SF Pro optimal */
  --text-lg: 1.0625rem;    /* 17px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
}

/* ========================================
   BODY - SF Pro Text
   ======================================== */

body {
  font-family: var(--font-sf-pro);
  font-size: var(--text-base);
  line-height: 1.6;
  color: #1d1d1f; /* Apple text color */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em; /* SF Pro tracking */
}

/* Mobile */
@media (max-width: 767px) {
  body {
    font-size: 0.9375rem; /* 15px - evita zoom iOS */
  }
}

/* Desktop */
@media (min-width: 1024px) {
  body {
    font-size: 1rem; /* 16px */
  }
}

/* ========================================
   HEADINGS - Playfair Display + SF Pro
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-playfair);
  font-weight: 700;
  line-height: 1.2;
  color: #1d1d1f;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

/* H1 - Hero titles */
h1 {
  font-size: 2rem; /* 32px mobile */
  font-weight: 700;
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.5rem; /* 40px tablet */
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 3rem; /* 48px desktop */
  }
}

/* H2 - Section titles */
h2 {
  font-size: 1.75rem; /* 28px mobile */
  font-weight: 700;
}

@media (min-width: 768px) {
  h2 {
    font-size: 2.25rem; /* 36px tablet */
  }
}

@media (min-width: 1024px) {
  h2 {
    font-size: 2.5rem; /* 40px desktop */
  }
}

/* H3 - Subsection titles */
h3 {
  font-size: 1.5rem; /* 24px mobile */
  font-weight: 600;
}

@media (min-width: 768px) {
  h3 {
    font-size: 1.75rem; /* 28px tablet */
  }
}

@media (min-width: 1024px) {
  h3 {
    font-size: 2rem; /* 32px desktop */
  }
}

/* H4 - Card titles */
h4 {
  font-size: 1.25rem; /* 20px mobile */
  font-weight: 600;
}

@media (min-width: 768px) {
  h4 {
    font-size: 1.375rem; /* 22px tablet */
  }
}

@media (min-width: 1024px) {
  h4 {
    font-size: 1.5rem; /* 24px desktop */
  }
}

/* H5, H6 */
h5 {
  font-size: 1.125rem; /* 18px */
  font-weight: 600;
}

h6 {
  font-size: 1rem; /* 16px */
  font-weight: 600;
}

/* ========================================
   PARAGRAPHS - SF Pro Text
   ======================================== */

p {
  font-family: var(--font-sf-pro);
  font-size: var(--text-base);
  line-height: 1.6;
  color: #6e6e73; /* Apple secondary text */
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* Lead paragraph */
p.lead,
.text-xl {
  font-size: 1.125rem;
  line-height: 1.7;
  color: #1d1d1f;
}

@media (min-width: 768px) {
  p.lead,
  .text-xl {
    font-size: 1.25rem;
  }
}

/* Small text */
p.text-sm,
.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Extra small */
.text-xs {
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ========================================
   LINKS - SF Pro
   ======================================== */

a {
  font-family: var(--font-sf-pro);
  color: #C9A961;
  text-decoration: none;
  transition: color 0.15s ease;
  letter-spacing: -0.01em;
}

a:hover {
  color: #A88B4A;
}

/* ========================================
   BUTTONS - SF Pro Text
   ======================================== */

button,
.btn {
  font-family: var(--font-sf-pro);
  font-size: 0.9375rem; /* 15px */
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  button,
  .btn {
    font-size: 1rem; /* 16px */
  }
}

/* ========================================
   LISTS - SF Pro
   ======================================== */

ul, ol {
  font-family: var(--font-sf-pro);
  font-size: var(--text-base);
  line-height: 1.6;
  color: #6e6e73;
  letter-spacing: -0.01em;
}

li {
  margin-bottom: 0.5rem;
}

/* ========================================
   CODE & PREFORMATTED
   ======================================== */

code, pre {
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size: 0.875rem;
}

/* ========================================
   FONT WEIGHTS - Apple Scale
   ======================================== */

.font-light {
  font-weight: 300;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

/* ========================================
   LINE HEIGHTS - Optimal
   ======================================== */

.leading-tight {
  line-height: 1.2;
}

.leading-snug {
  line-height: 1.4;
}

.leading-normal {
  line-height: 1.6;
}

.leading-relaxed {
  line-height: 1.75;
}

.leading-loose {
  line-height: 2;
}

/* ========================================
   LETTER SPACING - SF Pro Optimized
   ======================================== */

.tracking-tighter {
  letter-spacing: -0.03em;
}

.tracking-tight {
  letter-spacing: -0.02em;
}

.tracking-normal {
  letter-spacing: -0.01em;
}

.tracking-wide {
  letter-spacing: 0.01em;
}

.tracking-wider {
  letter-spacing: 0.03em;
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Line clamp */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY UTILITIES
   ======================================== */

/* Desktop-only larger text */
@media (min-width: 1024px) {
  .lg\:text-6xl {
    font-size: 3.75rem;
    line-height: 1;
  }
  
  .lg\:text-5xl {
    font-size: 3rem;
    line-height: 1;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #C9A961;
  outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  body {
    color: #000000;
  }
  
  p {
    color: #000000;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
  body {
    color: #f5f5f7;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #f5f5f7;
  }
  
  p {
    color: #a1a1a6;
  }
  
  a {
    color: #D4AF37;
  }
  
  a:hover {
    color: #F7E7CE;
  }
}
