/* ============================================================
   style.css — Capitoli del manuale (Edizione Mermaid)
   Usato da Indice_Capitoli.html e Capitolo_XX.html
   ============================================================ */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #f4fafd;
  color: #1e293b;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container,
main,
nav#toc {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1.2rem;
}

/* ─── Header ─── */
header#header-anchor {
  background: #005c8d;
  color: #fff;
  padding: 16px 22px;
}

header#header-anchor h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.back-home {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: #cfe8f5;
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.back-home:hover { color: #fff; text-decoration: underline; }

/* ─── TOC ─── */
nav#toc h2 {
  color: #005c8d;
  font-size: 1.15rem;
  margin: 1.2rem 0 0.6rem;
}

nav#toc ul { list-style: none; padding: 0; margin: 0; }
nav#toc li { margin: 0; padding: 0; }

nav#toc a {
  display: block;
  padding: 6px 10px;
  color: #005c8d;
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.3;
  transition: background-color 0.2s ease;
}
nav#toc a:hover { background: rgba(0, 92, 141, 0.1); }

/* ─── Contenuti ─── */
main h2 {
  color: #005c8d;
  font-size: 1.3rem;
  margin-top: 2.2rem;
  border-bottom: 2px solid #d3e5ef;
  padding-bottom: 0.3rem;
}

main h3 {
  color: #14496e;
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

main ul, main ol { padding-left: 1.4rem; }
main li { margin: 0.25rem 0; }

hr {
  border: none;
  border-top: 1px solid #d9e8f0;
  margin: 1.6rem 0;
}

strong { color: #0b3a53; }

/* ─── Tabelle ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
th, td {
  border: 1px solid #cfe0ea;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
th { background: #e3f1f8; color: #0b3a53; }
tr:nth-child(even) td { background: #f6fbfd; }

/* ─── Immagini/figure ─── */
img, figure { max-width: 100%; height: auto; }
figcaption { font-size: 0.85rem; color: #64748b; }

/* ─── Evidenziazione sezione (navigation.js) ─── */
.flash-highlight {
  animation: flashBg 1.2s ease;
}
@keyframes flashBg {
  0%   { background: rgba(0, 122, 255, 0.18); }
  100% { background: transparent; }
}

/* ─── Pulsanti flottanti ─── */
#float-buttons {
  position: fixed;
  right: 16px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
#float-buttons a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #005c8d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  text-decoration: none;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}
#float-buttons a:hover { background: #007ab8; transform: scale(1.07); }

/* ─── Footer ─── */
footer#footer-anchor {
  background: #e8f3f9;
  color: #475569;
  margin-top: 3rem;
  padding: 1.4rem 1.2rem 1.8rem;
  font-size: 0.85rem;
  text-align: center;
}
footer#footer-anchor h6 {
  font-weight: 400;
  font-size: 0.72rem;
  color: #64748b;
  max-width: 720px;
  margin: 0.6rem auto 0;
}

/* ─── Mobile ─── */
@media (max-width: 640px) {
  header#header-anchor h1 { font-size: 1.1rem; }
  main h2 { font-size: 1.15rem; }
  #float-buttons a { width: 38px; height: 38px; }
}
