/* ============================================================
   HUB TEMATICI + SEZIONI HOMEPAGE
   Usato da index.html, stili-architettonici.html, architetti-famosi.html.
   File separato (non in style.css/article.css) per non dover cambiare la
   ?v= di quei due fogli su tutte le pagine del sito.
   ============================================================ */

/* ---- Homepage: H1 su due livelli (parola chiave + sottotitolo) ---- */
.photo-hero h1 em.h1-sub {
  display: block; font-size: 0.5em; line-height: 1.15; letter-spacing: -0.02em;
  margin-top: 0.35em;
}

/* ---- Homepage: intro testuale sotto l'hero ---- */
.home-intro {
  max-width: 1200px; margin: 0 auto; padding: 2.75rem 2rem 0.5rem;
}
.home-intro p {
  max-width: 780px; font-size: 1.06rem; line-height: 1.8; color: var(--text-mid);
  margin: 0;
}
.home-intro a { color: var(--storia); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.home-intro a:hover { color: var(--gold); }

/* ---- Intestazione di sezione con H2 visibile ---- */
.home-section-head.with-h2 { align-items: flex-end; gap: 1rem; }
.home-section-head.with-h2 .hs-label { display: block; margin-bottom: 0.45rem; }
.home-h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; margin: 0; color: var(--text);
}
.home-section-head.with-h2 a { white-space: nowrap; }
.home-lead {
  max-width: 760px; font-size: 0.92rem; line-height: 1.75; color: var(--text-mid);
  margin: -0.4rem 0 1.4rem;
}
.home-block { padding-bottom: 1rem; }

/* La griglia epoche riusa .hub-categories/.hub-card di article.css: qui
   solo i margini, più stretti che in storia.html */
.home-block .hub-categories { margin: 0 0 1rem; gap: 0; background: var(--bg); }
/* Griglie a bordi sottili: linee disegnate da ogni cella (non dal gap), così
   le celle vuote dell'ultima riga restano bianche invece che grigie */
.home-block .hub-card,
.link-grid a { box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); }
.hub-card-count small { font-size: 0.42em; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---- Liste di link a pillola (stili, architetti, città, temi) ---- */
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 1rem; }
a.tag-pill-v2 { text-decoration: none; }
a.tag-pill-v2:hover { border-color: var(--text-mid); color: var(--text); }
.tag-pill-v2 .chip-meta { font-size: 0.68rem; color: var(--text-light); font-weight: 400; }

/* ---- Griglia compatta (materiali, città) ---- */
.link-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem;
}
.link-grid a {
  background: var(--bg); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 4px;
  transition: var(--ease); color: var(--text);
}
.link-grid a:hover { background: var(--bg-subtle); }
.link-grid .lg-name { font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.link-grid .lg-count {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
}
.link-grid.m .lg-count { color: var(--materiali); }
.link-grid.v .lg-count { color: var(--viaggi); }
.link-grid.s .lg-count { color: var(--storia); }
.link-grid .lg-desc { font-size: 0.8rem; color: var(--text-mid); line-height: 1.55; }

/* ============================================================
   PAGINE HUB (stili-architettonici.html, architetti-famosi.html)
   ============================================================ */
.hub-page { padding-bottom: 4rem; }
.hub-page .hub-text { max-width: 760px; font-size: 1rem; line-height: 1.8; color: var(--text-mid); }
.hub-page .hub-text p { margin-bottom: 1rem; }
.hub-page .hub-text a,
.hub-entry p a { color: var(--storia); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.hub-toc {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 2rem 0 1rem;
  padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.hub-toc a {
  font-size: 0.74rem; font-weight: 600; color: var(--text-mid);
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 3px; background: #fff;
}
.hub-toc a:hover { border-color: var(--storia); color: var(--storia); }

.hub-entry {
  padding: 2.25rem 0; border-bottom: 1px solid var(--border);
  display: grid; grid-template-columns: 200px 1fr; gap: 2rem;
  scroll-margin-top: 80px;
}
.hub-entry-era {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--storia); padding-top: 0.45rem;
}
.hub-entry h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 800; letter-spacing: -0.03em;
  margin: 0 0 0.7rem;
}
.hub-entry p { font-size: 0.95rem; line-height: 1.75; color: var(--text-mid); max-width: 720px; margin-bottom: 0.8rem; }
.hub-entry .hub-traits { font-size: 0.86rem; color: var(--text); }
.hub-entry .hub-traits strong { font-weight: 700; }
.hub-reads { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 4px; }
.hub-reads li { font-size: 0.86rem; line-height: 1.5; }
.hub-reads li::before { content: '→ '; color: var(--storia); }
.hub-reads li.m::before { color: var(--materiali); }
.hub-reads a { color: var(--text); font-weight: 600; }
.hub-reads a:hover { color: var(--storia); }
.hub-reads .hr-note { color: var(--text-light); font-weight: 400; }

/* Elenco architetti: griglia di schede per gruppo */
.arch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-top: 1.2rem;
}
.arch-grid a { box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border); background: var(--bg); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: 3px; color: var(--text); transition: var(--ease); }
.arch-grid a:hover { background: var(--bg-subtle); }
.arch-grid .ag-name { font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; }
.arch-grid .ag-dates { font-size: 0.7rem; color: var(--text-light); font-weight: 600; letter-spacing: 0.04em; }
.arch-grid .ag-hook { font-size: 0.8rem; color: var(--text-mid); line-height: 1.5; }

.hub-related { margin-top: 3rem; }
.hub-related h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }

@media (max-width: 760px) {
  /* Sezione mappa: la griglia a 2 colonne è inline in index.html e su
     telefono sforava di ~45px, allargando tutto il viewport */
  .home-map-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .home-map-grid > div:last-child { text-align: left !important; }
  .home-intro { padding: 2rem 1rem 0.25rem; }
  .home-intro p { font-size: 1rem; }
  .home-section-head.with-h2 { flex-direction: column; align-items: flex-start; }
  .hub-entry { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.75rem 0; }
  .hub-entry-era { padding-top: 0; }
}
