/* =====================================================================
   FOGLIO DI STILE – Sito Maria Rita Signorino
   Organizzato a blocchi. Cerca "BLOCCO" per spostarti da una sezione all'altra.
   Indice:
     1. COLORI (modifica qui la palette)
     2. BASE
     3. ACCESSIBILITÀ (skip-link, focus)
     4. INTESTAZIONE E MENU
     5. HERO E RICERCA
     6. GRIGLIE E CARD
     7. ELEMENTI (tag, pulsanti, avvisi)
     8. PROFILO E FOTO
     9. ARTICOLI E DOMANDE
    10. PUBBLICAZIONI
    11. PIÈ DI PAGINA
    12. TABLET E SMARTPHONE
   ===================================================================== */


/* ===== BLOCCO 1 · COLORI ============================================
   Tema chiaro (predefinito) e tema scuro (se il dispositivo lo richiede).
   Cambia solo i codici esadecimali (#xxxxxx). */
:root {
  color-scheme: light dark;
  --bg:       #f7f5f0;   /* sfondo pagina */
  --surface:  #fffdf9;   /* sfondo card */
  --surface2: #eef3ef;   /* sfondo secondario (tag, avvisi) */
  --ink:      #17231e;   /* testo principale */
  --muted:    #64716b;   /* testo secondario */
  --line:     #dce4df;   /* bordi */
  --accent:   #236b58;   /* colore principale (verde) */
  --accent2:  #dbeee7;   /* verde chiaro */
  --on-accent:#ffffff;   /* testo sopra i pulsanti verdi */
  --warm:     #f3e7d7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #111614;
    --surface:  #1a201d;
    --surface2: #202823;
    --ink:      #edf3ef;
    --muted:    #aab8b1;
    --line:     #303a35;
    --accent:   #70c9a8;
    --accent2:  #1d4035;
    --on-accent:#0b1a14;   /* testo scuro su verde chiaro: contrasto leggibile */
    --warm:     #3b3024;
  }
}


/* ===== BLOCCO 2 · BASE ============================================== */
*  { box-sizing: border-box; }
html { scroll-padding-top: 96px; }          /* i link #ancora non finiscono sotto l'intestazione */
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
a   { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
section { padding: 58px 0; }
[hidden] { display: none !important; }      /* necessario per la ricerca nelle domande */
.wrap  { max-width: 1120px; margin: auto; padding: 0 24px; }
.muted { color: var(--muted); }
.mt    { margin-top: 18px; }
.mt-lg { margin-top: 25px; }


/* ===== BLOCCO 3 · ACCESSIBILITÀ ===================================== */
.sr-only {                                   /* testo solo per screen reader */
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {                                 /* "Vai al contenuto" per chi usa la tastiera */
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 10px 16px; border-radius: 10px; font-weight: 750;
}
.skip-link:focus { top: 12px; }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}


/* ===== BLOCCO 4 · INTESTAZIONE E MENU =============================== */
header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
}
.nav {
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { font-weight: 850; letter-spacing: -.03em; }
.brand small {
  display: block; color: var(--muted);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent); color: var(--on-accent); margin-right: 9px;
}
.links { display: flex; gap: 18px; font-size: 15px; color: var(--muted); }
.links a { padding: 6px 2px; border-bottom: 2px solid transparent; }
.links a:hover { color: var(--ink); }
.links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }


/* ===== BLOCCO 5 · HERO E RICERCA ==================================== */
.hero {
  padding: 70px 0 55px;
  background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 34%);
}
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .13em; color: var(--accent); font-weight: 850; }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1; letter-spacing: -.055em; margin: 12px 0 20px; }
.hero p  { font-size: 19px; color: var(--muted); max-width: 700px; }
.search  { display: flex; gap: 8px; max-width: 700px; }
.search input {
  flex: 1; min-width: 0; padding: 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink);
}
.search button { font: inherit; border: 0; cursor: pointer; }


/* ===== BLOCCO 6 · GRIGLIE E CARD ==================================== */
.grid  { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid.grid-2 { grid-template-columns: repeat(2, 1fr); }   /* variante a 2 colonne (pubblicazioni) */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card {
  display: block;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 23px;
}
a.card:hover { border-color: var(--accent); }
.card h2, .card h3 { margin-top: 0; letter-spacing: -.025em; }
.sectionhead { margin-bottom: 25px; }
.sectionhead h2 { font-size: 35px; letter-spacing: -.04em; margin: 5px 0; }


/* ===== BLOCCO 7 · ELEMENTI (tag, pulsanti, avvisi) ================== */
.tag {
  display: inline-block; background: var(--surface2); color: var(--muted);
  font-size: 11px; font-weight: 800; padding: 5px 9px;
  border-radius: 999px; text-transform: uppercase;
}
.btn {
  display: inline-block; padding: 11px 16px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); font-weight: 750;
}
.btn:hover { filter: brightness(1.08); }
.btn.alt { background: var(--surface2); color: var(--ink); }
.notice {
  padding: 18px 20px; border-left: 4px solid var(--accent);
  background: var(--surface2); border-radius: 12px;
}


/* ===== BLOCCO 8 · PROFILO E FOTO ==================================== */
.profile { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.portrait-img {                              /* foto della dottoressa */
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 28px; border: 1px solid var(--line); background: var(--surface2);
}
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; max-width: 640px; }
.gallery figure { margin: 0; }
.gallery img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: 20px; border: 1px solid var(--line); background: var(--surface2);
}
.gallery figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
.timeline { display: grid; gap: 12px; }
.timeline div { padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }


/* ===== BLOCCO 9 · ARTICOLI E DOMANDE ================================ */
.article { max-width: 820px; }
.article h1 { font-size: 48px; line-height: 1.04; letter-spacing: -.05em; }
.article h2 { font-size: 28px; margin-top: 40px; }
.article ul { padding-left: 22px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { text-decoration: underline; text-underline-offset: 3px; }
.meta { font-size: 14px; color: var(--muted); }
.gruppo { margin-top: 44px; scroll-margin-top: 96px; }
.gruppo h2 { font-size: 26px; letter-spacing: -.03em; margin: 0 0 16px; }
.qa { border-top: 1px solid var(--line); padding: 17px 0; }
.qa strong { display: block; margin-bottom: 5px; }
.filtro-box { margin: 22px 0 6px; }


/* ===== BLOCCO 10 · PUBBLICAZIONI ==================================== */
.pub { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: start; }
.pub p, .pub h2 { overflow-wrap: anywhere; }
.pub h2 { font-size: 21px; line-height: 1.2; }
.pub img {
  width: 140px; height: 180px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface2);
}


/* ===== BLOCCO 11 · PIÈ DI PAGINA ==================================== */
footer { border-top: 1px solid var(--line); padding: 38px 0; color: var(--muted); font-size: 14px; }
footer a { text-decoration: underline; text-underline-offset: 3px; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }


/* ===== BLOCCO 12 · TABLET E SMARTPHONE =============================== */
@media (max-width: 1000px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  /* Il menu NON viene più nascosto: va su una seconda riga, scorrevole in orizzontale */
  .nav   { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 10px; padding-bottom: 6px; }
  .links { width: 100%; overflow-x: auto; gap: 18px; padding-bottom: 6px; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .grid, .grid.grid-2, .grid4, .profile, .cols { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
  .pub img { width: 110px; height: 142px; }
  .profile .portrait-img { max-width: 300px; }
  .article h1 { font-size: 39px; }
  .sectionhead h2 { font-size: 30px; }
  section { padding: 44px 0; }
  .hero { padding: 48px 0 40px; }
  .search { flex-wrap: wrap; }
  .search .btn { width: 100%; text-align: center; }
}
