/* Blog statico — Istituti Sanitari
 * Foglio di stile delle pagine del blog, che non caricano il bundle React.
 * Riprende colori e impaginazione del sito (tema chiaro). Generato a mano:
 * le pagine lo includono con ?v=<hash> (vedi _strumenti/genera_blog.py). */

:root {
  --fg: #0a0a0a;
  --muted: #6b6b6b;
  --border: #e5e7eb;
  --bg-soft: #f7f7f7;
  --brand: #01402e;
  --green: #22c55e;
  --green-dark: #2d6a4f;
  --yellow: #f6c234;
  --radius: .75rem;
  --wrap: 72rem;
  --text: 46rem;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--fg);
  font: 400 1.0625rem/1.7 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green-dark); }
a:hover { color: var(--green); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--fg); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; }

/* ------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.5rem;
}
.logo img { display: block; height: 3rem; width: auto; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border); border-radius: .5rem;
  padding: .45rem .7rem; font: inherit; font-size: .95rem; cursor: pointer;
}

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 1.5rem;
}
.site-nav a {
  color: var(--fg); text-decoration: none; font-weight: 500; font-size: 1rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #d9a400; }

.btn {
  display: inline-block;
  background: linear-gradient(90deg, #6fb04f, #b0f26d);
  color: var(--brand) !important; font-weight: 700; font-size: .95rem;
  text-decoration: none; padding: .6rem 1.2rem; border-radius: 999px;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: .5rem 1rem 1rem;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .site-nav a { display: block; padding: .5rem 0; }
  .site-header .btn-head { display: none; }
}

/* ------------------------------------------------------- breadcrumb */

.breadcrumb { font-size: .875rem; color: var(--muted); margin: 1rem 0 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.breadcrumb li + li::before { content: "›"; margin-right: .4rem; color: #b5b5b5; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb [aria-current] { color: #c89400; }

/* ---------------------------------------------------------- articolo */

.post { max-width: var(--text); margin: 0 auto; padding: 1.5rem 0 3rem; }

.post-head { text-align: center; margin-bottom: 2rem; }
.badge {
  display: inline-block; background: #fef7dd; color: #b48600;
  font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .25rem .75rem; border-radius: 999px;
}
.post-head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.15; font-weight: 800;
  margin: 1rem 0 .75rem; letter-spacing: -.01em;
}
.post-meta { color: var(--muted); font-size: .9rem; }
.post-meta span + span::before { content: "·"; margin: 0 .5rem; }

.post-cover {
  margin: 0 0 2rem; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-soft); aspect-ratio: 16 / 9;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.post-body h2 { font-size: 1.75rem; line-height: 1.25; margin: 2.75rem 0 1rem; font-weight: 700; }
.post-body h3 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 .75rem; font-weight: 700; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li { margin: .35rem 0; }
.post-body blockquote {
  margin: 1.5rem 0; padding: .75rem 1.25rem; border-left: 4px solid var(--green);
  background: var(--bg-soft); border-radius: 0 .5rem .5rem 0;
}
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.post-body table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.post-body thead th { background: var(--bg-soft); }

/* box che rimanda alla pagina del corso */
.callout {
  margin: 0 0 2rem; padding: 1rem 1.25rem;
  border: 1px solid #cdeedd; background: #f1fbf5; border-radius: var(--radius);
}
.callout p { margin: 0; }
.callout a { font-weight: 700; }

.cta {
  margin: 3rem 0 0; padding: 1.75rem; text-align: center;
  background: var(--brand); color: #fff; border-radius: var(--radius);
}
.cta h2 { margin: 0 0 .5rem; font-size: 1.5rem; }
.cta p { margin: 0 0 1.25rem; color: #d7e7df; }

/* ---------------------------------------------------- articoli correlati */

.related { border-top: 1px solid var(--border); padding: 2.5rem 0 3rem; }
.related h2 { font-size: 1.5rem; margin: 0 0 1.25rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .5rem; background: #fff;
}
.card h2, .card h3 { font-size: 1.1rem; line-height: 1.35; margin: 0; }
.card h2 a, .card h3 a { color: var(--fg); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--green-dark); text-decoration: underline; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.card .post-meta { font-size: .8rem; }

/* ------------------------------------------------------ indice blog */

.blog-head { text-align: center; padding: 2rem 0 2.5rem; }
.blog-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem; font-weight: 800; }
.blog-head p { color: var(--muted); margin: 0 auto; max-width: 40rem; }
.blog-list { padding-bottom: 3.5rem; }

/* ------------------------------------------------------------ footer */

.site-footer { background: var(--brand); color: #d7e7df; font-size: .92rem; margin-top: 1rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-cols {
  display: grid; gap: 2rem; padding: 3rem 0 2rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}
.footer-cols h2 { color: #fff; font-size: 1rem; margin: 0 0 .75rem; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: .35rem 0; }
.footer-info { border-top: 1px solid rgba(255, 255, 255, .15); padding: 1.5rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.footer-info p { margin: 0; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .15); padding: 1.25rem 0 2rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: space-between; }

/* ------------------------------------------------- cookie e WhatsApp */

.cookie {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  max-width: 48rem; margin: 0 auto; background: #fff; color: var(--fg);
  border: 1px solid var(--border); border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1 1 18rem; font-size: .88rem; color: var(--muted); }
.cookie strong { display: block; color: var(--fg); font-size: .95rem; }
.cookie-actions { display: flex; gap: .6rem; }
.cookie button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  border-radius: .6rem; padding: .55rem 1rem; border: 1px solid var(--border); background: #fff;
}
.cookie button.ok { background: var(--green); border-color: var(--green); color: #fff; }

.wa {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #25d366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.wa svg { width: 1.9rem; height: 1.9rem; fill: #fff; }
.cookie:not([hidden]) ~ .wa { bottom: 7.5rem; }

@media print {
  .site-header, .site-footer, .cookie, .wa, .related, .cta { display: none; }
}
