/* Template: articolo, archivio, 404, pagina minimale (thank you page). */

/* ---------- Hero di articolo e archivio ---------- */
.pi-page-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 500px;
  padding: calc(var(--pi-header-height) + 40px) 6% 0;
  text-align: center;
  color: var(--pi-white);
  background: linear-gradient(130deg, var(--pi-blue) 0%, rgba(255, 255, 255, 0.35) 90%), var(--pi-blue);
}
.pi-page-hero h1 { margin: 0; color: var(--pi-white); font-size: clamp(30px, 2.2vw + 22px, 42px); }
.pi-page-hero__meta { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
.pi-page-hero__subtitle { margin: 0; font-size: clamp(18px, 1vw + 14px, 24px); font-weight: 300; }
.pi-page-hero__image {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin-bottom: -60px;
  line-height: 0;
}
.pi-page-hero__image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--pi-radius); box-shadow: var(--pi-shadow-card); }
.pi-page-hero--archive { min-height: 400px; padding-bottom: 80px; }
.pi-wave { position: absolute; left: 0; right: 0; bottom: -1px; height: 80px; line-height: 0; }
.pi-wave svg { width: 100%; height: 100%; }
.pi-wave path { fill: #fff; }
.pi-page-hero--archive .pi-wave path { fill: #fff; }

/* ---------- Articolo ---------- */
.pi-single { background: #fff; }
.pi-single__body { max-width: 900px; margin: 0 auto; padding: 100px var(--pi-gutter) 60px; }
.pi-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--pi-blue-20);
}
.pi-share__label { margin: 0; font-size: 18px; font-weight: 600; text-transform: uppercase; color: var(--pi-blue); }
.pi-share__links { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; }
.pi-share__links a { display: inline-flex; font-size: 18px; color: var(--pi-blue-dark); }
.pi-share__links a:hover { color: var(--pi-blue); }
.pi-single__excerpt { margin: 0 0 30px; color: var(--pi-ink); }

.pi-toc {
  margin: 0 0 40px;
  border: 1px solid var(--pi-blue-20);
  border-radius: 5px;
}
.pi-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--pi-blue-dark);
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid var(--pi-blue-20);
}
.pi-toc summary::-webkit-details-marker { display: none; }
.pi-toc summary .pi-icon { transition: transform 0.2s; }
.pi-toc:not([open]) summary { border-bottom: 0; }
.pi-toc[open] summary .pi-icon { transform: rotate(180deg); }
.pi-toc ol { margin: 0; padding: 16px 20px 16px 40px; font-size: 15px; }
.pi-toc ol ol { padding: 4px 0 0 20px; }
.pi-toc li + li { margin-top: 4px; }
.pi-toc a { color: var(--pi-ink); text-decoration: none; }
.pi-toc a:hover { color: var(--pi-blue); }

.pi-single__form { margin: 50px 0; }
.pi-post-nav { display: flex; justify-content: space-between; gap: 20px; margin: 40px 0; }
.pi-post-nav a { display: flex; flex-direction: column; gap: 4px; max-width: 45%; color: var(--pi-blue-dark); text-decoration: none; }
.pi-post-nav a:hover { color: var(--pi-blue); }
.pi-post-nav__label { display: inline-flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 600; color: var(--pi-blue); }
.pi-post-nav__next { margin-left: auto; text-align: right; align-items: flex-end; }
.pi-post-nav__title { font-size: 14px; text-transform: capitalize; }

/* ---------- Griglia articoli (archivio e correlati) ---------- */
.pi-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.pi-posts--section { max-width: var(--pi-container); margin: 0 auto; padding: 60px var(--pi-gutter) 100px; }
.pi-related { max-width: var(--pi-container); margin: 0 auto; padding: 0 var(--pi-gutter) 80px; }
.pi-related .pi-posts { grid-template-columns: repeat(auto-fill, minmax(280px, 360px)); }
.pi-post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}
.pi-post-card__image { position: relative; display: block; line-height: 0; }
.pi-post-card__image img { width: 100%; aspect-ratio: 16 / 9.5; object-fit: cover; }
.pi-post-card__badge {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--pi-blue-dark);
  border-radius: 3px;
}
.pi-post-card__body { flex: 1; padding: 30px 30px 20px; text-align: center; }
.pi-post-card__title { margin: 0 0 12px; font-size: 21px; font-weight: 400; text-transform: uppercase; line-height: 1.3; }
.pi-post-card__title a { color: var(--pi-blue); text-decoration: none; }
.pi-post-card__title a:hover { color: var(--pi-blue-dark); }
.pi-post-card__excerpt { margin: 0; font-size: 14px; line-height: 1.5; }
.pi-post-card__meta {
  margin: 0;
  padding: 12px 30px;
  font-size: 12px;
  text-align: center;
  color: var(--pi-ink);
  border-top: 1px solid #eaeaea;
}
.pi-archive { background: #fff; }
.pi-archive__empty { text-align: center; }
.pi-pagination { display: flex; justify-content: center; gap: 8px; padding-bottom: 80px; }
.pi-pagination .page-numbers { padding: 8px 14px; border-radius: var(--pi-radius-pill); text-decoration: none; }
.pi-pagination .current { background: var(--pi-blue); color: #fff; }

/* ---------- 404 ---------- */
.pi-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 70vh;
  padding: calc(var(--pi-header-height) + 40px) var(--pi-gutter) 80px;
  text-align: center;
  background: var(--pi-gradient-hero);
  color: var(--pi-white);
}
.pi-404 h1 { margin: 0; color: var(--pi-white); }
.pi-404 p { margin: 0; max-width: 55ch; }

/* ---------- Pagina minimale (thank you page) ---------- */
.pi-minimal { padding: 40px var(--pi-gutter) 80px; }
.pi-minimal > * { max-width: 1000px; margin-inline: auto; }
.pi-minimal > h1 { max-width: 1400px; }
.pi-minimal h1, .pi-minimal h2 { font-size: clamp(30px, 3vw + 18px, 56px); color: var(--pi-blue); text-align: center; }
.pi-minimal .wp-block-list, .pi-minimal ul { padding-left: 1.3em; }
.pi-minimal .wp-block-buttons { justify-content: center; gap: 25px; margin-top: 40px; }

@media (max-width: 767px) {
  .pi-page-hero { min-height: 400px; }
  .pi-page-hero--archive { min-height: 0; padding-top: calc(var(--pi-header-height) + 50px); padding-bottom: 110px; }
  .pi-page-hero__image { margin-bottom: -30px; }
  .pi-single__body { padding-top: 60px; }
  .pi-post-nav a { max-width: 100%; }
}

/* Pagine protette da password (modulo di WordPress, inc/setup.php): al centro della pagina, sotto l'header fisso. */
.pi-page > .post-password-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: calc(var(--pi-header-height) + 40px) var(--pi-gutter) 80px;
  text-align: center;
  background: var(--pi-gradient-hero);
  color: var(--pi-white);
}
.post-password-form p { max-width: 520px; margin: 0; font-size: 18px; line-height: 1.45; }
.post-password-form p:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  max-width: 460px;
  padding: 32px;
  background: var(--pi-glass);
  border: 1px solid var(--pi-glass-border);
  border-radius: var(--pi-radius-panel);
  box-shadow: var(--pi-shadow-panel);
  backdrop-filter: blur(18px);
}
.post-password-form label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; text-align: left; font-size: 15px; font-weight: 600; }
.post-password-form input[type="password"] {
  min-height: 50px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 400;
  color: var(--pi-ink);
  background: #fff;
  border: 1px solid var(--pi-glass-border);
  border-radius: var(--pi-radius);
}
.post-password-form input[type="submit"] {
  min-height: 50px;
  padding: 12px 28px;
  font: inherit;
  font-weight: 700;
  color: var(--pi-blue);
  background: var(--pi-white);
  border: 0;
  border-radius: var(--pi-radius-pill);
  cursor: pointer;
}
.post-password-form input[type="submit"]:hover { background: var(--pi-mint-light); color: var(--pi-ink); }
