/*!
 * olismo-portale.css — Stile condiviso delle pagine
 * © 2016-2026 Avv. Carlo Alberto Calcagno · olismo-integrato.it
 * Palette coerente con olismo-core.js e con il manuale
 * "Leggere la persona, accompagnare il conflitto"
 */

/* ═══ VARIABILI PALETTE ═══ */
:root {
  /* Oro e avorio — identità principale del manuale */
  --gold: #c9a227;
  --gold-dark: #8a6a14;
  --gold-soft: #e8d08a;
  --ivory: #fcfaf4;
  --ivory-2: #f5efe0;
  --ivory-3: #ede3c8;

  /* Inchiostro — per i testi */
  --ink: #2a2520;
  --ink-2: #4a4540;
  --ink-3: #6a6560;
  --ink-light: #8a8580;

  /* Palette chakra — dal core JS */
  --ck-1: #a83232; /* rosso radice */
  --ck-2: #c45a22; /* arancio sacrale */
  --ck-3: #c49a1a; /* giallo plesso */
  --ck-4: #2e7d4f; /* verde cuore */
  --ck-5: #1565c0; /* blu gola */
  --ck-6: #4527a0; /* indaco */
  --ck-7: #7b2fa0; /* viola corona */

  /* Semaforo allerta */
  --alert-red: #c62828;
  --alert-red-bg: #fdecea;
  --alert-amber: #e6a817;
  --alert-amber-bg: #fdf7e4;
  --safe-green: #2e7d4f;
  --safe-green-bg: #e7f3ec;

  /* Tipografia */
  --font-title: "EB Garamond", Garamond, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               Arial, sans-serif;
}

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══ LAYOUT BASE ═══ */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══ HEADER DI PAGINA ═══ */
.site-header {
  background: linear-gradient(180deg, var(--ivory-2) 0%, var(--ivory) 100%);
  border-bottom: 2px solid var(--gold);
  padding: 28px 0 22px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(138, 106, 20, 0.06);
}
.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.site-logo {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold-dark);
  text-decoration: none;
  letter-spacing: 0.4px;
}
.site-logo span {
  color: var(--ink-2);
  font-weight: 400;
  font-size: 14px;
  display: block;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav a:hover {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}
.site-nav a.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold);
}

/* ═══ HERO DI PAGINA ═══ */
.page-hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--ivory-3);
  margin-bottom: 48px;
}
.page-hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 14px;
}
.page-hero__title {
  font-family: var(--font-title);
  font-size: 48px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}
.page-hero__subtitle {
  font-family: var(--font-title);
  font-size: 22px;
  font-style: italic;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.45;
}
@media (max-width: 700px) {
  .page-hero__title { font-size: 34px; }
  .page-hero__subtitle { font-size: 18px; }
  .page-hero { padding: 40px 0 28px; }
}

/* ═══ TIPOGRAFIA PAGINA ═══ */
h2 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 500;
  color: var(--gold-dark);
  margin: 56px 0 20px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}
h2::before {
  content: "§";
  color: var(--gold);
  margin-right: 12px;
  font-size: 26px;
  font-weight: 400;
  position: relative;
  top: -3px;
}
h3 {
  font-family: var(--font-title);
  font-size: 23px;
  font-weight: 500;
  font-style: italic;
  color: var(--gold-dark);
  margin: 36px 0 12px;
}
h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 8px;
  letter-spacing: 0.3px;
}

p {
  margin: 0 0 16px;
}
p.lead {
  font-family: var(--font-title);
  font-size: 21px;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.55;
  margin-bottom: 28px;
}

a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ck-1); }

ul, ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
li { margin-bottom: 8px; }

strong { color: var(--ink); font-weight: 700; }
em { color: var(--ink-2); }

blockquote {
  border-left: 3px solid var(--gold);
  margin: 24px 0;
  padding: 8px 20px;
  color: var(--ink-2);
  font-style: italic;
  font-family: var(--font-title);
  font-size: 19px;
  background: var(--ivory-2);
}

/* ═══ BOX COMPONENTI (coerenti con il manuale) ═══ */
.box-gold {
  background: linear-gradient(180deg, #fdf6dc 0%, #f8ecb8 100%);
  border-left: 4px solid var(--gold);
  padding: 22px 26px;
  margin: 28px 0;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(138, 106, 20, 0.08);
}
.box-gold__title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-dark);
  margin: 0 0 10px;
  font-style: italic;
}
.box-gold p { margin-bottom: 10px; }
.box-gold p:last-child { margin-bottom: 0; }

.box-blue {
  background: #eff3f8;
  border-left: 4px solid var(--ck-5);
  padding: 22px 26px;
  margin: 28px 0;
  border-radius: 2px;
}
.box-blue__title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--ck-5);
  margin: 0 0 10px;
  font-style: italic;
}

.box-alert {
  background: var(--alert-red-bg);
  border: 2px solid var(--alert-red);
  padding: 22px 26px;
  margin: 28px 0;
  border-radius: 4px;
}
.box-alert__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--alert-red);
  margin: 0 0 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.box-alert__title::before {
  content: "⚠";
  font-size: 22px;
}
.box-alert p { color: #6a1e1e; }
.box-alert strong { color: var(--alert-red); }

.box-care {
  background: var(--safe-green-bg);
  border-left: 4px solid var(--safe-green);
  padding: 22px 26px;
  margin: 28px 0;
  border-radius: 2px;
}
.box-care__title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--safe-green);
  margin: 0 0 10px;
  font-style: italic;
}

/* ═══ CARDS ═══ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin: 32px 0;
}
.card {
  background: #fff;
  border: 1px solid var(--ivory-3);
  border-radius: 6px;
  padding: 22px 24px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(138, 106, 20, 0.1);
  border-color: var(--gold-soft);
}
.card__number {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.card__title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}
.card__title em {
  display: block;
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 4px;
}
.card__body {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.55;
}
.card a.card__link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--gold-dark);
}
.card a.card__link::after { content: " →"; }

/* Card variante enneatipi, colorata */
.card-ennea {
  position: relative;
  overflow: hidden;
}
.card-ennea::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--accent, var(--gold));
}
.card-ennea .card__title { padding-left: 6px; }

/* ═══ TABELLE ═══ */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
}
.table th {
  background: var(--ivory-2);
  color: var(--gold-dark);
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--gold);
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ivory-3);
  vertical-align: top;
}
.table tr:nth-child(even) td { background: #fbf9f2; }
.table tr:last-child td { border-bottom: none; }

/* ═══ CTA ═══ */
.cta-button {
  display: inline-block;
  padding: 14px 32px;
  background: var(--gold-dark);
  color: var(--ivory);
  text-decoration: none;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background .2s;
  font-size: 16px;
}
.cta-button:hover {
  background: var(--ink);
  color: var(--ivory);
}
.cta-button--outline {
  background: transparent;
  color: var(--gold-dark);
  border: 2px solid var(--gold-dark);
  padding: 12px 30px;
}
.cta-button--outline:hover {
  background: var(--gold-dark);
  color: var(--ivory);
}

/* ═══ SEPARATORE ORNAMENTALE ═══ */
.ornament {
  text-align: center;
  margin: 48px 0;
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 20px;
}
.ornament::before { content: "✦ ✦ ✦"; }

/* ═══ FOOTER ═══ */
.site-footer {
  background: var(--ink);
  color: var(--ivory-3);
  padding: 48px 0 28px;
  margin-top: 80px;
  font-size: 14px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.site-footer h5 {
  color: var(--gold-soft);
  font-family: var(--font-title);
  font-size: 17px;
  margin: 0 0 12px;
  font-weight: 600;
}
.site-footer a {
  color: var(--ivory-3);
  text-decoration: none;
  display: block;
  padding: 3px 0;
  font-size: 14px;
}
.site-footer a:hover { color: var(--gold-soft); }
.site-footer__legal {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.6;
}
.site-footer__legal p { margin: 0 0 8px; }

/* ═══ ACCESSIBILITÀ & PRINT ═══ */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.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;
}
@media print {
  .site-header, .site-footer, .site-nav { display: none; }
  body { background: white; color: black; }
  .box-gold, .box-blue, .box-alert, .box-care { break-inside: avoid; }
}

/* ═══ RIFERIMENTO A VIOLENZA (banner emergenza) ═══ */
.emergency-banner {
  background: var(--alert-red);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
}
.emergency-banner a {
  color: white;
  text-decoration: underline;
  font-weight: 700;
}
.emergency-banner strong { color: white; }
