/* =========================================================
   Articoli del blog sul design 2026 (tema-single.php, inc/post2026.php).
   Si appoggia al CSS compilato delle pagine interne (assets/page/):
   qui solo testata dell'articolo, colonna di lettura, indice e richiamo.
   ========================================================= */

/* ---------- Testata: titolo lungo, meno alta della testata delle pagine ---------- */
.pg-hero--post { min-height: max(84svh, 600px); }
.pg-hero--post .pg-hero__grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.pg-hero--post .pg-hero__title {
  font-size: clamp(2.3rem, 4.3vw, 4.6rem); line-height: 1; letter-spacing: -0.045em;
  max-width: 17em; text-wrap: balance;
}
.pg-hero--post .crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.pg-hero--post .crumbs [aria-current] {
  max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pg-hero--post .eyebrow a { color: inherit; }
.pg-hero--post .eyebrow a:hover { color: var(--paper); }
.pg-hero__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: rgba(243,239,232,.62); }
.pg-hero--nocover { min-height: auto; padding-bottom: clamp(64px, 9vw, 120px); }
.pg-hero--nocover .pg-hero__head { gap: clamp(64px, 10vw, 140px); }

/* ---------- Colonna di lettura ---------- */
.pg-article { position: relative; padding-block: clamp(80px, 10vw, 140px) clamp(90px, 11vw, 160px); }
.pg-article__progress {
  position: fixed; inset: 0 0 auto; z-index: 1000; height: 3px; pointer-events: none;
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.pg-article__progress.is-on { opacity: 1; }
.pg-article__progress span {
  display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--read, 0));
  background: var(--grad-hybrid);
}
.pg-article__grid {
  display: grid; grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 120px); align-items: start;
}
.pg-article__aside { position: sticky; top: calc(var(--nav-h) + 32px); display: grid; gap: 32px; }
.pg-article__aside .section-head { margin-bottom: 0; }
.pg-article__main { min-width: 0; max-width: 46rem; }

/* indice (richiudibile su tablet e smartphone) */
.pg-toc summary { list-style: none; cursor: default; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pg-toc summary::-webkit-details-marker { display: none; }
.pg-toc summary .section-head { margin-bottom: 0; }
.pg-toc__toggle { display: none; position: relative; width: 14px; height: 14px; flex: none; }
.pg-toc__toggle::before, .pg-toc__toggle::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: currentColor; transition: transform .4s var(--ease-out); }
.pg-toc__toggle::after { transform: rotate(90deg); }
.pg-toc[open] .pg-toc__toggle::after { transform: rotate(0); }
.pg-toc ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pg-toc li { border-bottom: 1px solid var(--line); }
.pg-toc a {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0;
  color: var(--muted); font-size: .92rem; line-height: 1.35; transition: color .3s, padding-left .4s var(--ease-out);
}
.pg-toc__n { font-size: 11px; color: var(--faint); padding-top: 2px; transition: color .3s; }
.pg-toc a:hover, .pg-toc a.is-active { color: var(--fg); }
.pg-toc a.is-active { padding-left: 6px; }
.pg-toc a.is-active .pg-toc__n { color: var(--human); }

.pg-article__nudge { display: grid; gap: 14px; justify-items: start; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.pg-article__nudge .link-arrow { color: var(--fg); font-size: 12px; }

/* risposta breve in apertura (GEO) */
.pg-article__answer {
  font-size: clamp(1.2rem, 1.6vw, 1.5rem); line-height: 1.45; letter-spacing: -0.02em; color: var(--fg);
  padding-left: 22px; border-left: 3px solid var(--human); margin: 0 0 clamp(40px, 5vw, 56px);
}

/* testo dell'editor */
.pg-article__body { font-size: clamp(1.05rem, 1.15vw, 1.16rem); line-height: 1.72; color: rgba(10,6,18,.78); }
.pg-article__body > * + * { margin-top: 1.1em; }
.pg-article__body :is(h2, h3, h4, h5, h6) { color: var(--fg); font-weight: 560; text-wrap: balance; }
.pg-article__body h2 {
  font-size: clamp(1.75rem, 2.6vw, 2.5rem); line-height: 1.08; letter-spacing: -0.04em;
  margin-top: clamp(56px, 6vw, 80px); margin-bottom: .1em;
}
.pg-article__body h3 { font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.2; letter-spacing: -0.03em; margin-top: 2em; }
.pg-article__body :is(h4, h5, h6) { font-size: 1.12rem; line-height: 1.3; letter-spacing: -0.02em; margin-top: 1.8em; }
.pg-article__body > :first-child { margin-top: 0; }
.pg-anchor { display: block; position: relative; top: calc(-1 * (var(--nav-h) + 32px)); height: 0; visibility: hidden; }
.pg-anchor + h2 { margin-top: 0; }
.pg-article__body > .pg-anchor { margin-top: clamp(56px, 6vw, 80px); }
.pg-article__body > .pg-anchor:first-child { margin-top: 0; }
.pg-article__body strong, .pg-article__body b { color: var(--fg); font-weight: 600; }
.pg-article__body a { color: var(--brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; transition: color .3s; }
.pg-article__body a:hover { color: var(--human); }
.pg-article__body :is(ul, ol) { padding: 0; list-style: none; display: grid; gap: .55em; }
.pg-article__body ul > li { position: relative; padding-left: 26px; }
.pg-article__body ul > li::before {
  content: ""; position: absolute; left: 2px; top: .68em; width: 8px; height: 8px; border-radius: 50%; background: var(--human);
}
.pg-article__body ol { counter-reset: pg-ol; }
.pg-article__body ol > li { position: relative; padding-left: 38px; counter-increment: pg-ol; }
.pg-article__body ol > li::before {
  content: counter(pg-ol, decimal-leading-zero); position: absolute; left: 0; top: .32em;
  font-family: var(--f-mono); font-size: 12px; color: var(--brand);
}
.pg-article__body li :is(ul, ol) { margin-top: .55em; }
.pg-article__body blockquote {
  margin-inline: 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--brand);
  font-family: var(--f-serif); font-style: italic; font-size: 1.5em; line-height: 1.3; color: var(--fg);
}
.pg-article__body :is(img, video, iframe) { max-width: 100%; height: auto; border-radius: var(--radius); }
.pg-article__body iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.pg-article__body figure { margin-inline: 0; max-width: 100%; }
.pg-article__body :is(figcaption, .wp-caption-text) { margin-top: 10px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .02em; color: var(--faint); }
.pg-article__body .wp-caption { max-width: 100% !important; }
.pg-article__body table { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.45; display: block; overflow-x: auto; }
.pg-article__body :is(th, td) { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.pg-article__body th { color: var(--fg); font-weight: 600; background: var(--surface-2); }
.pg-article__body pre { overflow-x: auto; padding: 18px 20px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: .85em; }
.pg-article__body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.4em; }

/* argomenti */
.pg-article__tags { margin-top: clamp(56px, 6vw, 80px); padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.pg-article__tags .mono { color: var(--faint); }
.pg-article__tags ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pg-tag {
  display: inline-flex; padding: 8px 14px; border: 1px solid var(--line); border-radius: 100px;
  font-size: 13px; color: var(--muted); transition: border-color .3s, color .3s, background-color .3s;
}
.pg-tag:hover { border-color: var(--fg); color: var(--fg); }

/* ---------- Richiamo a metà articolo ---------- */
.pg-article__body .pg-midcta {
  position: relative; isolation: isolate; overflow: hidden;
  margin-block: clamp(56px, 6vw, 80px); padding: clamp(32px, 4vw, 52px);
  border-radius: var(--radius-lg); background: var(--ink); color: var(--paper);
  display: grid; gap: 16px; justify-items: start;
}
.pg-midcta__orb {
  position: absolute; z-index: -1; width: 520px; height: 520px; right: -180px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle at 35% 40%, rgba(252,106,58,.45), transparent 52%),
              radial-gradient(circle at 65% 60%, rgba(98,37,157,.55), transparent 56%);
  filter: blur(50px); animation: orb 16s ease-in-out infinite alternate;
}
.pg-midcta .eyebrow { color: rgba(243,239,232,.7); }
.pg-midcta__title {
  margin: 0; font-size: clamp(1.9rem, 3.2vw, 2.9rem); line-height: 1; letter-spacing: -0.045em; font-weight: 560; color: var(--paper);
}
.pg-midcta__title .serif { font-size: 1.06em; letter-spacing: -0.02em; }
.pg-midcta__text { margin: 0 0 8px; max-width: 32em; color: rgba(243,239,232,.74); font-size: 1rem; line-height: 1.55; }
.pg-article__body .pg-midcta a { text-decoration: none; }
.pg-midcta .btn--primary, body[data-theme="light"] .pg-midcta .btn--primary { background: var(--paper); color: var(--ink); }

/* ---------- Contatti: titolo più lungo di quello globale ---------- */
/* Due righe equilibrate (una frase per riga) invece di quattro. */
.post-2026 .cta__title { font-size: clamp(2.5rem, 4.1vw, 4.7rem); line-height: .98; }
.post-2026 .cta__title .serif { font-size: 1.12em; }

/* ---------- Tablet e smartphone ---------- */
@media (max-width: 1000px) {
  .pg-hero--post .pg-hero__grid { grid-template-columns: 1fr; }
  .pg-article__grid { grid-template-columns: 1fr; gap: 40px; }
  .pg-article__aside { position: static; }
  .pg-toc summary { cursor: pointer; margin-bottom: 0; padding-block: 4px 16px; }
  .pg-toc__toggle { display: block; }
  .pg-article__main { max-width: none; }
  .pg-article__nudge { display: none; }
  .pg-article__grid.is-single .pg-article__aside { display: none; }
}
@media (max-width: 700px) {
  .pg-hero--post { min-height: min(100svh, 680px); padding-block: calc(var(--nav-h) + 6px) 28px; }
  .pg-hero--post .pg-hero__title { font-size: clamp(1.95rem, 8.4vw, 2.5rem); }
  .pg-hero--post .crumbs [aria-current] { max-width: 22ch; }
  .pg-article { padding-block: 72px; }
  .pg-toc a { padding: 10px 0; }
  .pg-article__body blockquote { font-size: 1.3em; }
  .pg-article__body .pg-midcta { margin-inline: calc(-1 * var(--pad) / 2); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-midcta__orb { animation: none; }
}
