/* ============================================================
   bastiano.it — foglio di stile principale
   ============================================================ */

:root {
  --carta:    #f8f7f4;
  --testo:    #1c1c1c;
  --testo-2:  #555;
  --testo-3:  #888;
  --accento:  #2d5a8e;
  --bordo:    #d8d4cc;
  --nav-h:    56px;
}

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

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--carta);
  color: var(--testo);
  line-height: 1.7;
}

/* ---- NAVIGAZIONE ----------------------------------------- */

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--carta);
  border-bottom: 1px solid var(--bordo);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-logo {
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: 0.02em;
  color: var(--testo);
  text-decoration: none;
}

.nav-logo span {
  color: var(--accento);
}

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--testo-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover,
.nav-links a.attiva {
  color: var(--accento);
  border-bottom-color: var(--accento);
}

/* hamburger mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--testo);
}

/* ---- LAYOUT PRINCIPALE ----------------------------------- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* pagine interne più strette per leggibilità testi */
main.testo {
  max-width: 640px;
}

/* ---- INTESTAZIONE PAGINA --------------------------------- */

.titolo-pagina {
  font-family: Georgia, serif;
  font-size: 1.0rem;
  font-weight: normal;
  color: var(--testo-3);
  font-style: italic;
  letter-spacing: 0.01em;
  margin-bottom: 2.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--bordo);
}

/* ---- HOMEPAGE -------------------------------------------- */

.home-intro {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--bordo);
  margin-bottom: 2.5rem;
}

.home-intro h1 {
  font-family: Georgia, serif;
  font-size: 1.9rem;
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.tagline {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--testo-2);
  font-style: italic;
}

/* blocchi sezione in home */
.sezione-home {
  margin-bottom: 2.8rem;
  padding-bottom: 2.8rem;
  border-bottom: 1px solid var(--bordo);
}

.sezione-home:last-child {
  border-bottom: none;
}

.sezione-home h2 {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--testo-3);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* anteprima articolo */
.anteprima {
  margin-bottom: 1.6rem;
}

.anteprima + .anteprima {
  padding-top: 1.4rem;
  border-top: 1px solid var(--bordo);
}

.anteprima-meta {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--testo-3);
  margin-bottom: 0.3rem;
}

.anteprima h3 {
  font-size: 1.05rem;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.anteprima h3 a {
  color: var(--testo);
  text-decoration: none;
  border-bottom: 1px solid var(--bordo);
}

.anteprima h3 a:hover {
  border-bottom-color: var(--accento);
  color: var(--accento);
}

.anteprima p {
  font-size: 0.92rem;
  color: var(--testo-2);
  line-height: 1.6;
}

.vedi-tutti {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--accento);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.8rem;
}

.vedi-tutti:hover { text-decoration: underline; }

/* ---- CHI SONO -------------------------------------------- */

.chi-sono-foto {
  float: right;
  margin: 0 0 1.5rem 2rem;
  width: 180px;
}

.chi-sono-foto img {
  width: 100%;
  border-radius: 3px;
  display: block;
}

.chi-sono-testo p {
  margin-bottom: 1.2rem;
}

.chi-sono-testo p:last-child {
  margin-bottom: 0;
}

/* ---- LISTA ARTICOLI (scritti / civica / news) ------------ */

.lista-articoli {
  list-style: none;
}

.lista-articoli li {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--bordo);
}

.lista-articoli li:first-child {
  padding-top: 0;
}

.lista-articoli .meta {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--testo-3);
  margin-bottom: 0.3rem;
}

.lista-articoli a {
  font-size: 1.05rem;
  color: var(--testo);
  text-decoration: none;
  border-bottom: 1px solid var(--bordo);
  line-height: 1.4;
}

.lista-articoli a:hover {
  color: var(--accento);
  border-bottom-color: var(--accento);
}

.lista-articoli .estratto {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--testo-2);
  line-height: 1.6;
}

/* ---- TESTO ARTICOLO -------------------------------------- */

.articolo h1 {
  font-size: 1.7rem;
  font-weight: normal;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.articolo .meta {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--testo-3);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bordo);
}

.articolo p {
  margin-bottom: 1.3rem;
}

.articolo p:last-child {
  margin-bottom: 0;
}

.torna-su {
  display: inline-block;
  margin-top: 2.5rem;
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.82rem;
  color: var(--accento);
  text-decoration: none;
}

.torna-su:hover { text-decoration: underline; }

/* ---- GALLERIA FOTO --------------------------------------- */

.galleria-intro {
  margin-bottom: 2rem;
  font-size: 0.92rem;
  color: var(--testo-2);
}

.serie-foto {
  margin-bottom: 3rem;
}

.serie-foto h2 {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--testo-3);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bordo);
}

.griglia-foto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px;
}

.griglia-foto a {
  display: block;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e8e5e0;
}

.griglia-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.griglia-foto a:hover img {
  transform: scale(1.03);
}

/* lightbox overlay */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}

#lightbox.aperto { display: flex; }

#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

#lightbox-chiudi {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}

#lightbox-didascalia {
  color: #ccc;
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.85rem;
}

/* ---- NEWS ------------------------------------------------ */

.news-item {
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--bordo);
}

.news-item:first-child { padding-top: 0; }

.news-data {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--testo-3);
  margin-bottom: 0.3rem;
}

.news-item h3 {
  font-size: 1rem;
  font-weight: normal;
  margin-bottom: 0.4rem;
}

.news-item h3 a {
  color: var(--testo);
  text-decoration: none;
  border-bottom: 1px solid var(--bordo);
}

.news-item h3 a:hover {
  color: var(--accento);
  border-bottom-color: var(--accento);
}

.news-item p {
  font-size: 0.88rem;
  color: var(--testo-2);
  line-height: 1.6;
}

.news-fonte {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--testo-3);
  margin-top: 0.4rem;
}

/* ---- FOOTER ---------------------------------------------- */

footer {
  border-top: 1px solid var(--bordo);
  padding: 2rem 2rem;
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.footer-nome {
  font-family: Georgia, serif;
  font-size: 0.9rem;
  color: var(--testo-2);
}

.footer-contatti {
  font-family: system-ui, Arial, sans-serif;
  font-size: 0.78rem;
  color: var(--testo-3);
  text-align: right;
}

.footer-contatti a {
  color: var(--accento);
  text-decoration: none;
}

.footer-contatti a:hover { text-decoration: underline; }

/* ---- RESPONSIVE ------------------------------------------ */

@media (max-width: 640px) {
  nav { padding: 0 1rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--carta);
    border-bottom: 1px solid var(--bordo);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.aperto { display: flex; }

  .hamburger { display: flex; }

  main { padding: 2rem 1rem 4rem; }

  .home-intro h1 { font-size: 1.5rem; }

  .chi-sono-foto {
    float: none;
    margin: 0 0 1.5rem 0;
    width: 140px;
  }

  .griglia-foto {
    grid-template-columns: repeat(2, 1fr);
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-contatti { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .griglia-foto img { transition: none; }
}

/* ===== ACCESSIBILITÀ: skip link ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1a3a5c;
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}
