/* ==========================================================================
   Rita Colecchia – foglio di stile
   Nessuna dipendenza esterna: font di sistema, solo CSS.
   ========================================================================== */

:root {
  --bg: #faf9f6;
  --bg-alt: #f2f0eb;
  --surface: #ffffff;
  --ink: #1c2321;
  --muted: #535c58;
  --line: #e4e0d8;
  --primary: #234e46;
  --primary-dark: #183a34;
  --primary-soft: #e8efec;
  --focus: #b8860b;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 35, 33, .04), 0 6px 20px rgba(28, 35, 33, .05);
  --container: 72rem;
  --gutter: 1.25rem;
  --section-space: clamp(4rem, 9vw, 7rem);

  color-scheme: light;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0 0 .75rem;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--primary); text-underline-offset: .2em; }
a:hover { color: var(--primary-dark); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

address { font-style: normal; }

ul[role="list"] { list-style: none; margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

.eyebrow {
  margin-bottom: .75rem;
  color: var(--primary);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, .94);
  border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(250, 249, 246, .82); backdrop-filter: blur(8px); }
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  min-height: 4.25rem;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.logo:hover { color: var(--primary); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  margin: 0;
  padding: 0 0 .75rem;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: .35rem 0;
  color: var(--muted);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--primary); }

/* Menu mobile: il pulsante compare solo con JavaScript attivo */
.nav-toggle { display: none; }

.js .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -.5rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav { width: 100%; }
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }
.js .site-nav ul { flex-direction: column; gap: 0; padding: .25rem 0 1rem; }
.js .site-nav li + li { border-top: 1px solid var(--line); }
.js .site-nav a { display: block; padding: .8rem 0; font-size: 1rem; }

@media (min-width: 48rem) {
  .header-inner { flex-wrap: nowrap; }
  .js .nav-toggle { display: none; }
  .site-nav,
  .js .site-nav { display: block; width: auto; }
  .site-nav ul,
  .js .site-nav ul { flex-direction: row; gap: 2rem; padding: 0; }
  .js .site-nav li + li { border-top: 0; }
  .js .site-nav a { padding: .35rem 0; font-size: .9375rem; }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(3.5rem, 10vw, 7.5rem) clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 { max-width: 20ch; margin-bottom: 1.25rem; }

.lead {
  max-width: 38rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.id-card {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.id-card-title {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
}

.id-card dl,
.facts { margin: 0; }

.id-card dl > div,
.facts > div {
  display: grid;
  gap: .15rem;
  padding-block: .7rem;
}
.id-card dl > div + div,
.facts > div + div { border-top: 1px dashed var(--line); }

.id-card dt,
.facts dt {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.id-card dd,
.facts dd { margin: 0; font-weight: 500; }

@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; gap: 5rem; }
}

/* ---------- Sezioni ---------- */

.section { padding-block: var(--section-space); }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}

.section-head { max-width: 40rem; margin-bottom: 3rem; }
.section-head p:last-child { color: var(--muted); margin-bottom: 0; }

/* Card attività */
.cards {
  display: grid;
  gap: 1.25rem;
}

.card {
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card p { margin: 0; color: var(--muted); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.5rem;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  color: var(--primary);
}

@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
}

/* Chi siamo */
.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

.about-text p:not(.eyebrow) { max-width: 36rem; color: var(--muted); }

.facts {
  padding: .75rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (min-width: 60rem) {
  .about-grid { grid-template-columns: 1.2fr 1fr; gap: 5rem; }
}

/* ---------- Contatti ---------- */

.contact-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.contact-card,
.contact-form {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-name {
  display: block;
  margin-bottom: .25rem;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.contact-list {
  margin-top: 1.5rem !important;
  border-top: 1px solid var(--line);
}

.contact-list li {
  display: grid;
  gap: .1rem;
  padding-block: .8rem;
  border-bottom: 1px solid var(--line);
}

.contact-list a { overflow-wrap: anywhere; }

.contact-label {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  margin-bottom: .4rem;
  font-size: .9375rem;
  font-weight: 600;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: .75rem .9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  transition: border-color .15s ease, background-color .15s ease;
}

.field textarea { min-height: 8rem; resize: vertical; }

.field input:hover,
.field textarea:hover { border-color: #cfc9bd; }

.field input:focus,
.field textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  outline: 2px solid var(--primary-soft);
  outline-offset: 0;
}

.form-note { color: var(--muted); font-size: .875rem; }

.form-status { margin: 1rem 0 0; font-size: .9375rem; }
.form-status:empty { display: none; }
.form-status.is-visible {
  padding: .75rem 1rem;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  color: var(--primary-dark);
}

@media (min-width: 48rem) {
  .contact-card,
  .contact-form { padding: 2.25rem; }
}

@media (min-width: 60rem) {
  .contact-grid { grid-template-columns: 1fr 1.25fr; gap: 2rem; }
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 3rem 2rem;
  background: var(--ink);
  color: #c9cfcc;
  font-size: .9375rem;
}

.site-footer a { color: #fff; }
.site-footer a:hover { color: #d7e4df; }

.footer-inner {
  display: grid;
  gap: 1.5rem;
}

.footer-name {
  margin-bottom: .35rem;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.footer-inner p { margin: 0; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.copyright {
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  color: #a3aba7;
  font-size: .875rem;
}

@media (min-width: 48rem) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: start; }
  .copyright { grid-column: 1 / -1; }
}

/* ---------- Pagine legali ---------- */

.legal {
  padding-block: clamp(3rem, 8vw, 5rem) var(--section-space);
}

.legal-content { max-width: 46rem; }

.legal-content h1 { font-size: clamp(2rem, 5vw, 2.75rem); }

.legal-content h2 {
  margin-top: 2.75rem;
  font-size: 1.375rem;
}

.legal-content p,
.legal-content li { color: #343c39; }

.legal-content ul { padding-left: 1.25rem; }
.legal-content li { margin-bottom: .4rem; }

.legal-updated { color: var(--muted); font-size: .9375rem; }

.legal-box {
  margin-block: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.legal-box p:last-child { margin-bottom: 0; }

.back-link { display: inline-block; margin-bottom: 2rem; font-weight: 600; font-size: .9375rem; }

/* ---------- Preferenze utente ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .nav-toggle, .contact-form, .skip-link { display: none !important; }
  body { background: #fff; }
  .site-footer { background: none; color: #000; }
}
