/* ==========================================================================
   CORO LA VALLE — Base styles (reset + tipografia + layout di base)
   ========================================================================== */

/* Reset minimale, moderno */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); margin-top: var(--sp-8); margin-bottom: var(--sp-4); }
h3 { font-size: var(--fs-lg); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
h4 { font-size: var(--fs-md); margin-top: var(--sp-5); margin-bottom: var(--sp-2); }

h2:first-child, h3:first-child { margin-top: 0; }

p { margin-bottom: var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-primary-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast), color var(--t-fast);
}
a:hover { border-bottom-color: var(--color-primary-dark); }

strong { font-weight: 600; }
em { font-style: italic; }

ul, ol { margin: 0 0 var(--sp-4) var(--sp-5); }
li { margin-bottom: var(--sp-1); }

blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--color-primary);
  background: var(--color-surface);
  font-style: italic;
  color: var(--color-text-muted);
}

hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: var(--sp-6) 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Code (raro, ma serve per il formattato) */
code, pre {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.95em;
  background: var(--color-primary-soft);
  border-radius: var(--radius);
}
code { padding: 0.1em 0.4em; }
pre { padding: var(--sp-3) var(--sp-4); overflow-x: auto; }

/* === LAYOUT CONTAINER === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

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

.container--wide {
  max-width: 1400px;
}

/* === SECTION === */
.section {
  padding: var(--sp-10) 0;
}

.section--tight {
  padding: var(--sp-6) 0;
}

.section__header {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.section__title {
  font-size: var(--fs-2xl);
  position: relative;
  display: inline-block;
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--color-accent);
}

.section__subtitle {
  color: var(--color-text-muted);
  font-size: var(--fs-md);
  font-style: italic;
  font-family: var(--font-display);
}

/* === UTILITY === */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.lead {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-style: italic;
}

/* Visually hidden ma accessibile */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === PROSE (testo lungo pagine interne) === */
.prose {
  max-width: var(--content-width);
  margin: 0 auto;
  font-size: 1.05rem;
}

.prose p { margin-bottom: var(--sp-4); }

.prose img {
  border-radius: var(--radius);
  margin: var(--sp-5) auto;
  box-shadow: var(--shadow-sm);
}

.prose h2 { margin-top: var(--sp-8); }

/* Pagine con contenuti "densi" (canti, elenchi lunghi): più respiro tra paragrafi */
.prose--dense p {
  margin-bottom: var(--sp-5);
  line-height: 1.8;
}

/* Testo giustificato per paragrafi lunghi (narrativa, pagine di contenuto) */
.prose p {
  text-align: justify;
  hyphens: auto;
}

/* Liste in .prose: leggibili ma compatte */
.prose ul,
.prose ol {
  margin-left: var(--sp-5);
}
.prose li {
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-1);
}

/* Responsive base */
@media (max-width: 768px) {
  :root {
    --sp-10: 3rem;
    --sp-12: 4rem;
  }
  h1 { font-size: var(--fs-xl); }
  h2 { font-size: var(--fs-lg); }
}
