/* =========================================================
   Schede di approfondimento: Modellazione e iper-realismo (Tav. 03)
   e Project management (Tav. 04).
   Usa i token di styles.css e il linguaggio di home-tavola.css
   (cornice, cartiglio, testate a filo); qui solo cio' che e' proprio
   della pagina: l'apertura, le serie di rendering, le schermate.
   ========================================================= */

/* ---------------- testi d'apertura delle sezioni ---------------- */
.pp-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.pp-intro .tv-testo { margin: 0; }

/* ---------------- rendering: una serie alla volta ---------------- */
.pp-schede {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.4rem;
}
.pp-schede button {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: 0 1.1rem 0 .8rem;
  border: 1px solid var(--tv-filo-chiaro);
  border-radius: var(--radius-pill);
  background: transparent;
  font: 500 .9rem var(--sans);
  color: var(--ink-body);
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.pp-schede button::before {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(22, 19, 15, .15);
}
.pp-schede button:hover { border-color: var(--ink); color: var(--ink); }
.pp-schede button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }

.pp-pannello { animation: ppEntra 600ms var(--ease-soft); }
.pp-pannello[hidden] { display: none; }
@keyframes ppEntra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.pp-vista { margin: 0; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 2px; background: var(--cream-deep); }
.pp-vista img { width: 100%; height: 100%; object-fit: cover; transition: transform 1200ms var(--ease-soft); }
.pp-vista a:hover img { transform: scale(1.02); }

.pp-dettaglio {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: clamp(1.4rem, 3vw, 2.6rem);
  margin-top: clamp(1.2rem, 2.4vw, 1.8rem);
  align-items: start;
}
.pp-scheda { margin: 0; border-top: 1px solid var(--ink); }
.pp-scheda > div { padding: .8rem 0; border-bottom: 1px solid var(--tv-filo-chiaro); }
.pp-scheda dt { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--tv-rame); }
.pp-scheda dd { margin: .3rem 0 0; font-size: .98rem; line-height: 1.5; color: var(--ink); }
.pp-scheda dd span { display: block; font-size: .86rem; color: var(--stone-dark); }
.pp-quattro { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.pp-quattro figure { margin: 0; aspect-ratio: 1; overflow: hidden; border-radius: 2px; background: var(--cream-deep); }
.pp-quattro img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-soft); }
.pp-quattro a:hover img { transform: scale(1.04); }
.pp-apri { display: block; height: 100%; cursor: zoom-in; }

/* ---------------- gestionale: su inchiostro, come un monitor sul tavolo ---------------- */
.pp-gestionale { background: var(--ink); color: var(--cream); }
.pp-gestionale .tv-testata { border-bottom-color: rgba(247, 242, 233, .5); }
.pp-gestionale .tv-testata h2, .pp-gestionale .tv-lede { color: var(--cream); }
.pp-gestionale .tv-rif { color: var(--stone-light); }
.pp-gestionale .tv-testo { color: var(--stone-light); }

.pp-schermo { margin: 0; }
.pp-schermo img { width: 100%; height: auto; display: block; border-radius: 0 0 4px 4px; }
.pp-schermo figcaption { margin-top: .7rem; font-size: .86rem; line-height: 1.5; color: var(--stone-light); }
.pp-galleria .pp-schermo img { border-radius: 4px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.pp-telefono { max-width: 250px; }
.pp-cornice {
  display: flex; gap: 6px; align-items: center;
  height: 26px; padding: 0 12px;
  background: #2A251F;
  border-radius: 6px 6px 0 0;
}
.pp-cornice span { width: 9px; height: 9px; border-radius: 50%; background: rgba(247, 242, 233, .22); }
.pp-schermo-grande { box-shadow: 0 30px 70px rgba(0, 0, 0, .45); border-radius: 6px; }
.pp-schermo-grande figcaption { padding: 0 .2rem; }

.pp-moduli, .pp-metodo { margin-top: clamp(3rem, 6vw, 4.5rem); }
.pp-moduli h3, .pp-metodo h2, .pp-metodo h3 {
  margin: 0 0 1.2rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--cream);
}
.pp-gestionale .tv-ambiti {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  border-top-color: rgba(247, 242, 233, .5);
}
.pp-gestionale .tv-ambiti > div { border-bottom-color: var(--hairline-dark); }
.pp-gestionale .tv-ambiti dt { color: var(--brass-soft); }
.pp-gestionale .tv-ambiti dd { color: var(--cream); }

.pp-galleria {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.6rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  align-items: start;
}

.pp-metodo ol {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(247, 242, 233, .5);
}
.pp-metodo li {
  padding: 1.1rem 1.4rem 0 0;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--stone-light);
}
.pp-metodo li + li { padding-left: 1.4rem; border-left: 1px solid var(--hairline-dark); }
.pp-metodo li b {
  display: block;
  margin-bottom: .4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--cream);
}
.pp-nota { margin-top: clamp(2.4rem, 5vw, 3.4rem); font-size: .86rem; color: var(--stone-light); }

/* ---------------- schermi medi e piccoli ---------------- */
@media (max-width: 980px) {
  .pp-intro, .pp-dettaglio { grid-template-columns: minmax(0, 1fr); }
  .pp-telefono { max-width: 200px; }
  .pp-metodo ol { grid-template-columns: minmax(0, 1fr); }
  .pp-metodo li, .pp-metodo li + li { padding: 1rem 0; border-left: 0; border-bottom: 1px solid var(--hairline-dark); }
}
@media (max-width: 640px) {
  .pp-vista { aspect-ratio: 3 / 2; }
  .pp-quattro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pp-gestionale .tv-ambiti { grid-template-columns: minmax(0, 1fr); }
  .pp-galleria { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .pp-pannello { animation: none; }
  .pp-vista img, .pp-quattro img { transition: none; }
}

/* ---------------- project management: la valutazione su carta, fra due sezioni scure ---------------- */
.pp-valutazione { background: var(--cream); }
.pp-valutazione .pp-moduli h3 { color: var(--ink); }
.pp-valutazione .pp-schermo figcaption { color: var(--stone-dark); }
.pp-valutazione .pp-schermo-grande { box-shadow: 0 24px 60px rgba(22, 19, 15, .18); }
.pp-valutazione .pp-galleria .pp-schermo img { box-shadow: 0 14px 34px rgba(22, 19, 15, .14); border: 1px solid var(--tv-filo-chiaro); }
.pp-valutazione .tv-ambiti {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
}
.pp-come { padding-top: clamp(3rem, 6vw, 4.5rem); }
.pp-come .pp-metodo { margin-top: 0; }
@media (max-width: 640px) {
  .pp-valutazione .tv-ambiti { grid-template-columns: minmax(0, 1fr); }
}

/* ================= Strumenti PM: stessa struttura in cinque capitoli =================
   Il problema, la soluzione, le funzioni (testo e viste di esempio), revisione e
   affinamento, il risultato. Ogni capitolo apre con occhiello e titolo, come le
   sezioni di Villa Benni e della Torre. */
.st-strumento { background: var(--cream); }
.st-alterna { background: var(--cream-deep); }
.st-lede { max-width: 40ch; margin: 0 0 clamp(1.6rem, 3vw, 2.4rem); }

.st-capitolo { margin-top: clamp(4rem, 9vw, 7rem); scroll-margin-top: 5rem; }
.st-due {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 5vw, 5rem); align-items: start;
}
.st-due .tv-testo { margin: 0; }
.st-grande {
  margin: 0; font-family: var(--serif); font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  line-height: 1.32; color: var(--ink); text-wrap: pretty;
}

/* le viste di esempio: la schermata come foglio appoggiato sulla carta */
.st-schermo { margin: 0; }
.st-schermo img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--tv-filo-chiaro); border-radius: 6px;
  box-shadow: 0 18px 40px -18px rgba(26, 23, 20, .35);
  background: #fff;
}
.st-schermo figcaption { margin-top: .6rem; font-size: .84rem; line-height: 1.5; color: var(--stone-dark); }
.st-schermo figcaption b { color: var(--ink); font-weight: 600; }
.st-schermo .pp-apri { height: auto; }
.st-schermo-grande { margin-top: clamp(2rem, 4vw, 3rem); }
.st-schermo-grande img { box-shadow: 0 30px 70px -24px rgba(26, 23, 20, .45); }

/* le funzioni: testo da un lato, viste dall'altro, alternati */
.st-funzioni { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(3.2rem, 7vw, 5.5rem); }
.st-funzione {
  display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.5fr);
  gap: clamp(1.6rem, 4vw, 4rem); align-items: start;
}
.st-funzione:nth-child(even) { grid-template-columns: minmax(0, 1.5fr) minmax(0, .78fr); }
.st-funzione:nth-child(even) .st-funzione-testo { order: 2; }
.st-funzione-testo { position: sticky; top: 6rem; }
.st-funzione-num { font-size: .78rem; font-weight: 600; letter-spacing: .12em; color: var(--tv-rame); font-variant-numeric: tabular-nums; }
.st-funzione h3, .st-funzione h4 {
  margin: .35rem 0 .7rem; font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.15; color: var(--ink);
}
.st-funzione p { margin: 0 0 1rem; font-size: .98rem; line-height: 1.65; color: var(--ink-body); }
.st-funzione ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--tv-filo-chiaro); }
.st-funzione ul li {
  padding: .55rem 0 .55rem 1.1rem; position: relative;
  font-size: .9rem; line-height: 1.5; color: var(--ink-body);
  border-bottom: 1px solid var(--tv-filo-chiaro);
}
.st-funzione ul li::before { content: ''; position: absolute; left: 0; top: 1.05rem; width: 5px; height: 5px; border-radius: 50%; background: var(--tv-rame); }
.st-funzione ul b { color: var(--ink); font-weight: 600; }
.st-funzione-viste { display: grid; gap: clamp(1.2rem, 2.5vw, 2rem); }

/* revisione: prima e dopo, poi le tappe */
.st-confronto { margin-top: clamp(2.4rem, 5vw, 3.6rem); }
.st-confronto h3, .st-confronto h4, .st-tappe-titolo {
  margin: 0 0 1rem; font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--tv-rame);
}
.st-confronto-viste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.4rem); }
.st-perche {
  margin: 1.4rem 0 0; max-width: 62ch;
  font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.45; color: var(--ink);
}
.st-tappe {
  list-style: none; margin: clamp(2.6rem, 5vw, 3.6rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.6rem 1.4rem;
}
.st-tappe li { position: relative; padding-top: 1.1rem; border-top: 1px solid var(--ink); }
.st-tappe li::before { content: ''; position: absolute; left: 0; top: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--tv-rame); }
.st-tappe time { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .06em; color: var(--tv-rame); font-variant-numeric: tabular-nums; }
.st-tappe span { display: block; margin-top: .35rem; font-size: .9rem; line-height: 1.45; color: var(--ink-body); }
.st-affinamenti {
  list-style: none; counter-reset: aff; margin: clamp(2.4rem, 5vw, 3.4rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(1.6rem, 4vw, 3.4rem);
}
.st-affinamenti li {
  counter-increment: aff; position: relative;
  padding: 1.1rem 0 1.2rem 2.4rem; border-top: 1px solid var(--tv-filo-chiaro);
  font-size: .95rem; line-height: 1.6; color: var(--ink-body);
}
.st-affinamenti li::before {
  content: counter(aff, decimal-leading-zero); position: absolute; left: 0; top: 1.2rem;
  font-size: .76rem; font-weight: 600; letter-spacing: .1em; color: var(--tv-rame);
}
.st-affinamenti b { display: block; margin-bottom: .2rem; color: var(--ink); font-weight: 600; }

/* il risultato: i numeri, poi la sintesi */
.st-numeri {
  margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--tv-filo-chiaro);
}
.st-numeri > div { padding: 1rem 1rem 1.1rem 0; }
.st-numeri > div + div { padding-left: 1.2rem; border-left: 1px solid var(--tv-filo-chiaro); }
.st-numeri dt { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tv-rame); }
.st-numeri dd { margin: .35rem 0 0; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.05; color: var(--ink); }
.st-risultato-corpo {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(1.6rem, 5vw, 4rem);
  align-items: start; margin-top: clamp(1.6rem, 3vw, 2.4rem);
}
.st-risultato-corpo .tv-testo { margin: 0; max-width: 62ch; font-size: 1.02rem; }
.st-telefono { width: clamp(180px, 18vw, 240px); }

.st-metodo .pp-metodo { margin-top: 0; }

@media (max-width: 980px) {
  .st-due, .st-funzione { grid-template-columns: minmax(0, 1fr); }
  .st-funzione:nth-child(even) { grid-template-columns: minmax(0, 1fr); }
  .st-funzione:nth-child(even) .st-funzione-testo { order: 0; }
  .st-funzione-testo { position: static; }
  .st-tappe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .st-confronto-viste, .st-affinamenti { grid-template-columns: minmax(0, 1fr); }
  .st-tappe { grid-template-columns: minmax(0, 1fr); }
  .st-numeri { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-numeri > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .st-numeri > div:nth-child(n+3) { border-top: 1px solid var(--tv-filo-chiaro); }
  .st-risultato-corpo { grid-template-columns: minmax(0, 1fr); }
  .st-telefono { width: 62%; justify-self: center; }
}

/* ================= Impostazione delle pagine progetto =================
   Come Villa Benni e la Torre: hero con logo, titolo e sintesi; poi la
   sezione d'apertura a pagina divisa; in fondo cartiglio e progetto successivo. */

/* loghi della hero: il re e' alto e stretto (si regola sull'altezza, come la
   Torre), il gantt e la bilancia sono quasi quadrati */
#logoDrawRe { width: clamp(64px, min(11vw, 15vh), 118px); }
#logoDrawGestionale, #logoDrawValutazione { width: clamp(180px, min(24vw, 30vh), 300px); }

/* apertura con una schermata: intera, su fondo scuro, non ritagliata */
.immobile-foto.immobile-schermo { background: var(--ink); }
.immobile-schermo img {
  object-fit: contain; object-position: center;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.2rem, 3vw, 3rem) clamp(4.5rem, 10vh, 6.5rem);
}
.immobile-schermo::after { height: 22%; }

/* testate dei capitoli: occhiello e titolo, su filo */
.st-capitolo .st-testa {
  max-width: none;
  margin-bottom: clamp(1.6rem, 3.4vw, 2.6rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--hairline);
}
.st-capitolo .st-testa h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.pp-metodo .eyebrow { margin-bottom: .6rem; }
@media (max-width: 900px) {
  /* su telefono la schermata detta l'altezza: niente fascia scura vuota */
  .immobile-foto.immobile-schermo { height: auto; aspect-ratio: 16 / 14; }
  .immobile-schermo img { padding: 1rem 1rem 5rem; object-position: center top; }
}
