:root {
  --ink: #1B2447;
  --ink-soft: #3A4566;
  --mist: #EEF1F5;
  --paper: #FAFBFC;
  --amber: #E8A33D;
  --amber-deep: #9A5F0B;
  --line: #D5DAE3;
  --radius: 10px;
  --serif: "Young Serif", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--amber-deep); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.skip {
  position: absolute; left: -999px; top: 0.5rem; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 6px;
}
.skip:focus { left: 0.5rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 0.75rem; }
h1 { font-size: clamp(2.1rem, 5vw, 3.5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
.small { font-size: 0.9rem; color: var(--ink-soft); }
.section-deep .small { color: #C5CCDD; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 251, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.8rem; }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand-name { font-family: var(--serif); font-size: 1.3rem; }
.brand-role { font-size: 0.85rem; color: var(--ink-soft); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 0.97rem; }
.nav a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; }
.menu-btn {
  display: none; font: inherit; font-weight: 500; color: var(--ink);
  background: none; border: 1.5px solid var(--ink); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--ink); color: #fff; border: 2px solid var(--ink);
  padding: 0.8rem 1.4rem; border-radius: 999px; transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn-small { padding: 0.45rem 1.1rem; font-size: 0.95rem; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 6rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36em; margin-bottom: 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }

.loop { margin: 0; }
.loop svg { width: 100%; height: auto; }
.loop .ring { stroke: var(--ink); stroke-dasharray: 5 9; stroke-linecap: round; }
.loop .ring-dot { fill: var(--ink); }
.loop .t { font-family: var(--sans); font-size: 15px; fill: var(--ink); }
.loop .t-big { font-family: var(--serif); font-size: 22px; }
.loop .t-small { font-size: 14px; fill: var(--ink-soft); }
.loop .t-accent { fill: var(--amber-deep); font-weight: 600; }
.loop .exit, .loop .exit-head { stroke: var(--amber); }
.loop .exit { stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.4s 0.5s ease-out forwards; }
.loop .exit-head { opacity: 0; animation: show 0.3s 1.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }
.loop figcaption { font-size: 0.92rem; color: var(--ink-soft); margin-top: 0.75rem; max-width: 30em; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-tint { background: var(--mist); }
.section-deep { background: var(--ink); color: #fff; }
.section-deep a { color: #fff; }
.section-intro { max-width: 38em; color: var(--ink-soft); margin-bottom: 2rem; }

.split { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.split > h2 { position: sticky; top: 6rem; }

.stack article { padding: 0 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.stack article:last-child { border-bottom: 0; margin-bottom: 0; }
.stack p { margin: 0; max-width: 38em; }

/* Ambiti */
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.areas li { background: var(--paper); padding: 1.5rem; }
.areas p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* Percorso: sequenza reale, quindi numerata */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { position: relative; padding: 0 0 1.75rem 3.5rem; counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--amber); color: var(--ink); font-family: var(--serif);
  display: grid; place-items: center;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 1.2rem; top: 2.6rem; bottom: 0.2rem; width: 2px; background: var(--line); }
.steps p { margin: 0; max-width: 36em; }

/* Chi sono */
.about { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.photo { aspect-ratio: 4 / 5; border-radius: var(--radius); background: #2A3562; display: grid; place-items: center; border: 1px dashed #6B76A0; }
.about-text p { max-width: 38em; }

/* Segnaposto da compilare */
.ph { background: rgba(232, 163, 61, 0.25); border-radius: 4px; padding: 0.05em 0.35em; }
.section-deep .ph { background: rgba(232, 163, 61, 0.28); color: #FFE4B5; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--amber-deep); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0.75rem 0 0; max-width: 38em; color: var(--ink-soft); }

/* Contatti */
.contacts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.contacts dt { font-weight: 600; }
.contacts dd { margin: 0; }
.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.form label { display: block; font-weight: 500; font-size: 0.95rem; margin: 0 0 0.3rem; }
.form input, .form textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 8px; padding: 0.7rem 0.85rem; margin-bottom: 1rem;
}
.form input:focus, .form textarea:focus { border-color: var(--ink); outline: 3px solid rgba(232, 163, 61, 0.5); }
.form [aria-invalid="true"] { border-color: #B3261E; }
.form-status { margin: 1rem 0 0; min-height: 1.5em; font-weight: 500; }

/* Footer */
.site-footer { background: var(--ink); color: #E6EAF3; padding-block: 2.5rem; }
.site-footer a { color: #fff; }
.site-footer .small { color: #B9C1D6; }
.site-footer .ph { background: rgba(232, 163, 61, 0.28); color: #FFE4B5; }
.foot p { margin-bottom: 0.5rem; }

/* Pagina privacy */
.doc { padding-block: 3rem 5rem; max-width: 46rem; }
.doc h2 { font-size: 1.4rem; margin-top: 2rem; }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid, .split, .about { grid-template-columns: 1fr; }
  .split > h2 { position: static; }
  .areas { grid-template-columns: 1fr 1fr; }
  .photo { max-width: 320px; }
  .menu-btn { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 1rem;
    padding: 1.25rem; background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
}
@media (max-width: 560px) {
  .areas { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; gap: 0; }
  .contacts dd { margin-bottom: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loop .exit { animation: none; stroke-dashoffset: 0; }
  .loop .exit-head { animation: none; opacity: 1; }
}

/* Blog */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.post-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card > div { padding: 1.25rem 1.4rem 1.5rem; }
.post-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.post-card h3 a { text-decoration: none; }
.post-card h3 a:hover { text-decoration: underline; }
.post-card p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.post-meta { font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.blog-group { margin-bottom: 3rem; }
.article { padding-block: 3rem 5rem; max-width: 46rem; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1rem; }
.article .cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 1rem 0 1.5rem; }
.prose { font-size: 1.1rem; line-height: 1.75; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 0.95rem; }
.post-nav a { max-width: 48%; }
.cta-box { background: var(--mist); border-radius: var(--radius); padding: 1.75rem; }
.cta-box h2 { font-size: 1.4rem; }
@media (max-width: 560px) { .post-nav { flex-direction: column; } .post-nav a { max-width: none; } }

/* Logo */
.brand { flex-direction: row; align-items: center; gap: 0.75rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-logo { width: 40px; height: 40px; flex: none; }

/* Foto e logo del Centro */
img.photo { width: 100%; height: auto; object-fit: cover; object-position: 50% 30%; border: 0; background: none; }
.partner { display: inline-block; background: #fff; border-radius: 8px; padding: 0.6rem 1rem; margin: 0.5rem 0 1rem; }
.partner img { display: block; height: auto; }
img.photo { aspect-ratio: 1 / 1; object-position: 50% 50%; }
