/* Sito ELIOS: le poche regole di pagina che il sistema non ha (dentro i visual, le altezze dei pannelli,
   le pagine di approfondimento a lunghezza libera). Tutto il resto viene da assets/system.css. */

/* il simbolo del logo LACASADELSOLE accanto al nome ELIOS */
.nav__logo { gap: var(--s-2); align-items: center; }
.nav__mark { width: 32px; height: auto; flex: none; }
@media (max-width: 639px) { .nav__mark { width: 26px; } }
.menu-card .panel--prodotto { --p-h: 168px; background: var(--surface); }

/* prodotti ritagliati: sul fondo chiaro, interi, mai tagliati */
.tile__media--prodotto { background: var(--surface); }
.tile__media--prodotto > img { object-fit: contain; padding: var(--s-5); }
.panel--prodotto { background: var(--surface); }
.panel--prodotto > .frame__img { object-fit: contain; padding: var(--s-5); }
#scelta .panel--prodotto { --p-h: 300px; }
@media (max-width: 639px) { #scelta .panel--prodotto { --p-h: 220px; } }
#scelta .card > p { margin-top: var(--s-3); }
#scelta .step-num { margin-bottom: var(--s-4); }

/* i due diagrammi su fondo chiaro, larghi quanto la pagina */
.frame--diagramma { --ratio: 34%; padding: var(--s-5); }
.frame--diagramma > .dg { width: 100%; height: 100%; position: absolute; inset: 0; }
@media (max-width: 1023px) { .frame--diagramma { --ratio: 56%; } }
@media (max-width: 639px) { .frame--diagramma { --ratio: 120%; } }

/* il 3D: la foto larga dell'esploratore */
.frame--tred { display: block; --ratio: 0; aspect-ratio: 2.25 / 1; max-height: 460px; width: 100%; }
@media (max-width: 1023px) { .frame--tred { aspect-ratio: 4 / 3; } }
.frame--tred > .frame__img { object-position: 50% 40%; }
#esplora-3d .section-head--row { margin-bottom: var(--s-7); }

/* la mappa d'Italia: intera nel suo riquadro */
.frame--mappa { background: var(--surface); padding: var(--s-5); }
.frame--mappa > img { position: absolute; inset: var(--s-5); width: calc(100% - 2 * var(--s-5)); height: calc(100% - 2 * var(--s-5)); object-fit: contain; max-width: none; }

/* righe con nome e frase su due righe (modi di funzionamento, perché sceglierci) */
.rows.modi > li, .rows.perche > li { grid-template-columns: 1fr; }
.rows.modi .rows__name, .rows.perche .rows__name { font-size: var(--t-lead); }
.split-col > h3 + .rows { margin-top: var(--s-2); }


/* chiusura */
.close__word-host { margin-top: auto; }
.close__word-host .close__word { max-width: none; }
.footer__brand { display: inline-flex; min-height: 44px; align-items: center; }
.footer__brand img { width: 195px; height: auto; filter: brightness(0) invert(1); opacity: .92; }
.footer__contatti li > span { color: var(--muted); }

/* pagine di approfondimento (gamma, modelli, privacy): lunghe quanto il loro contenuto */
main > section.section--libera { height: auto; min-height: 0; padding-bottom: var(--s-9); }
main > section.section--libera:first-child { padding-top: calc(var(--nav) + var(--s-9)); }
.hero--gamma { height: auto; min-height: 0; }
.hero--gamma .hero__in { padding-bottom: 0; }
.salti { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); }
.salti .pill { min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--s-5); border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink); text-decoration: none; }
.salti .pill:hover { border-color: var(--ink); }
.tile--modello .rows { margin-top: var(--s-2); }
.tile--modello .rows > li { padding-block: var(--s-2); }
.tile--modello .tile__facts { font-variant-numeric: tabular-nums; }
.frame--prodotto { --ratio: 100%; background: var(--surface); border: 0; }
.frame--prodotto > img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.section--modello h1 { font: var(--display-weight) var(--t-h2)/1.08 var(--font-display); letter-spacing: var(--display-tracking); }
.elenco { display: grid; gap: var(--s-3); padding-left: 1.1em; }
.elenco li { line-height: 1.6; }
.documenti { list-style: none; padding: 0; }
.altri { margin-top: var(--s-9); }
.altri__lista { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); }
.testo-legale h1 { font: var(--display-weight) var(--t-h2)/1.1 var(--font-display); }

/* tabella di confronto: righe con la riga sottile, su telefono un blocco per modello */
.confronto { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.confronto th, .confronto td { text-align: left; padding: var(--s-4) var(--s-3) var(--s-4) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.confronto thead th { font: 500 var(--t-label)/1.3 var(--font-text); color: var(--muted); }
.confronto tbody th { font-weight: 500; }
.confronto a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.confronto a:hover { text-decoration-color: var(--action); }
@media (max-width: 1023px) {
  .confronto thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .confronto, .confronto tbody, .confronto tr, .confronto th, .confronto td { display: block; }
  .confronto tr { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-5); }
  .confronto tbody th { grid-column: 1 / -1; border: 0; padding: 0; font-size: var(--t-lead); }
  .confronto td { border: 0; padding: 0; }
  .confronto td::before { content: attr(data-l); display: block; color: var(--muted); font-size: var(--t-label); }
}

/* altezze per tablet e telefono (layout-v4: ogni sezione resta di una o due schermate) */
@media (min-width: 640px) and (max-width: 1279px) {
  #scelta .grid > .card.span-4 { grid-column: auto / span 4; }
  #scelta .panel--prodotto { --p-h: 200px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
}
@media (max-width: 639px) {
  #azienda, #scelta, #domande { --hm: 2; }
  #scelta .panel--prodotto { --p-h: 300px; }
  .fasi > div { grid-column: auto / span 6; }
  .fasi p { display: none; }
}
@media (min-width: 640px) and (max-width: 1023px) { #scelta .panel--prodotto { --p-h: 340px; } }
@media (min-width: 1024px) {
  #scelta .card > p { min-height: calc(3 * 1.6em); }
}
.section--testata h1, .section--modello h1 { font: var(--display-weight) var(--t-h1)/1.04 var(--font-display); letter-spacing: var(--display-tracking-xl); }
.section--modello h1 { font-size: var(--t-h2); }
@media (max-width: 639px) {
  #azienda .rows--spec > li, #impianti .rows--spec > li, #ordine .rows--spec > li { grid-template-columns: 1fr; gap: 2px; }
  #azienda .rows--spec .rows__value, #impianti .rows--spec .rows__value, #ordine .rows--spec .rows__value { grid-column: 1; grid-row: 2; text-align: left; max-width: none; white-space: normal; }
  #impianti { --hm: 2; }
  #impianti .frame--mappa { min-height: 560px; }
}

/* titoli di terzo livello: una sola misura in tutta la pagina */
main h3, .faq .faq__item > h3 { font: 500 var(--t-card)/1.3 var(--font-text); letter-spacing: -0.01em; }
.split-col > h3 { margin-bottom: var(--s-2); }

/* produzione: quattro foto in fila, poi le quattro fasi */
.wall--4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; border-radius: var(--r-lg); overflow: clip; }
.wall--4 > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; transition: transform 600ms var(--ease); }
.fasi { margin-top: var(--s-6); row-gap: var(--s-5); }
.fasi p, .passi p { margin-top: var(--s-2); }
@media (min-width: 640px) and (max-width: 1023px) { .wall--4 > img { aspect-ratio: 9 / 16; } .fasi > div { grid-column: auto / span 6; } }
@media (max-width: 639px) { .wall--4 { grid-template-columns: repeat(2, 1fr); } .wall--4 > img { aspect-ratio: 3 / 4; } }

/* gamma in home: elenco delle famiglie, la foto a destra cambia sotto il puntatore */
.frame--peek { background: var(--surface); }
.frame--peek > .frame__img { object-fit: contain; padding: var(--s-8); }
.rows.famiglie > li { cursor: default; }
.rows.famiglie .rows__name a { color: inherit; text-decoration: none; }
.rows.famiglie .rows__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rows.famiglie > li { padding-block: var(--s-3); }
.rows.famiglie > li > p { color: var(--ink); font-size: var(--t-small); }
@media (max-width: 639px) { .frame--peek > .frame__img { padding: var(--s-5); } }

/* i sei passi dell'ordine */
.passi { list-style: none; padding: 0; margin: 0; row-gap: var(--s-7); }
.passi > li { border-top: 1px solid var(--line); padding-top: var(--s-5); }
.passi .step-num { margin-bottom: var(--s-4); }
@media (min-width: 640px) and (max-width: 1023px) { .passi > li.span-4 { grid-column: auto / span 6; } }
@media (max-width: 639px) { .passi > li { grid-column: auto / span 6; padding-top: var(--s-4); } .passi { row-gap: var(--s-5); } .passi p { display: none; } .passi h3 { font-size: 17px; } }

/* domande: la foto del laboratorio sotto il titolo */
.frame--domande { --ratio: 70%; margin-top: var(--s-6); }
@media (max-width: 1023px) { .frame--domande { --ratio: 56%; } }

/* fascia arancione: arancio più scuro, così il testo bianco si legge a 7:1 */
#perche.ground-brand { --bg: #8a4209; --surface: #7a3a08; background: #8a4209; }

/* mappa e foto collegate: rispondono al puntatore */
.frame--mappa > img { transition: transform 600ms var(--ease); }
@media (hover: hover) and (pointer: fine) { a.frame--mappa:hover > img, a.frame--photo:hover > .frame__img { transform: scale(1.02); } }

@media (max-width: 1279px) {
  #azienda .rows--spec > li { grid-template-columns: 1fr; gap: 2px; }
  #azienda .rows--spec .rows__value { grid-column: 1; grid-row: 2; text-align: left; white-space: normal; }
}
.hero__stage > .solo-telefono { display: none; }
@media (max-width: 639px) { .hero__stage > .solo-telefono { display: block; } .hero__stage > .solo-desktop { display: none; } }

/* ordine: la foto larga del configuratore sotto il testo */
.configuratore { display: flex; flex-direction: column; gap: var(--s-6); height: 100%; }
.frame--configuratore { display: block; flex: 1 1 auto; min-height: 220px; }
.frame--configuratore > .frame__img { object-position: 50% 0%; }


/* schermi molto stretti (320): il tasto della barra va nel menu, le foto delle sezioni lunghe si tolgono */
@media (max-width: 379px) {
  header.nav .nav__bar > .nav__actions { display: none; }
  #funzionamento .frame--photo, #ordine .frame--configuratore { display: none; }
}
@media (max-width: 1279px) { .rows.famiglie > li > p { display: none; } }
@media (max-width: 639px) { #gamma { --hm: 2; } #scelta .panel--prodotto { --p-h: 260px; } }

@media (min-width: 1024px) { .grid.grid--top.fill { grid-template-rows: minmax(0, 1fr); } }
@media (max-width: 639px) {
  .passi > li { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: var(--s-3); }
  .passi .step-num { margin: 0; }
  #esplora-3d .frame--tred { aspect-ratio: 3 / 4; }
}

/* schema di funzionamento: armadio ELIOS con inverter, batterie e teleruttori; flussi animati per stato */
.frame--schema { display: block; padding: var(--s-5) var(--s-6); --ratio: 0; }
.schema { display: grid; gap: var(--s-4); }
.schema__barra { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.schema__stati { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.schema__stato, .schema__pausa { min-height: 44px; padding: 0 var(--s-5); border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font: 500 15px/1 var(--font-text); cursor: pointer; transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease); }
.schema__stato:hover, .schema__pausa:hover { border-color: var(--ink); }
.schema__stato[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.schema__pausa { padding: 0 var(--s-4); font-size: 14px; }
.schema__disegno { width: 100%; }
.schema__svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (min-width: 640px) { .schema__svg--largo { max-height: 400px; margin-inline: auto; } }
.schema__svg--alto { display: none; }
@media (max-width: 639px) { .schema__svg--largo { display: none; } .schema__svg--alto { display: block; } .frame--schema { padding: var(--s-4); } }
.schema__frase { margin: 0; min-height: 3.2em; max-width: 70ch; }
.schema .armadio { fill: color-mix(in oklab, var(--p-accent) 7%, transparent); stroke: var(--p-accent); stroke-width: 2; stroke-dasharray: 8 6; }
.schema .armadio__t { font: 500 15px var(--font-text); fill: var(--p-accent); }
.schema .n rect { fill: #fff; stroke: var(--line-strong); stroke-width: 1.5; transition: stroke 300ms var(--ease); }
.schema .n .t { font-family: var(--font-display); fill: var(--ink); }
.schema .n .s { font-family: var(--font-text); font-size: 14px; fill: var(--muted); }
.schema .k circle { fill: #fff; stroke: var(--line-strong); stroke-width: 2; transition: fill 300ms var(--ease); }
.schema .e { fill: none; stroke: color-mix(in oklab, var(--ink) 22%, transparent); stroke-width: 3; stroke-linejoin: round; }
.schema .f { fill: none; stroke: var(--p-accent); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 10 16; opacity: 0; transition: opacity 300ms var(--ease); }
.schema .f-bat { stroke-dasharray: 6 12; }
@media (prefers-reduced-motion: no-preference) { .schema:not(.is-fermo) .f { animation: schema-flusso 1.1s linear infinite; } }
@keyframes schema-flusso { to { stroke-dashoffset: -26; } }
/* sole e batterie: pannelli e batterie, ingresso 1, uscita AUX */
.schema[data-stato="sole"] :is(.f-pv, .f-bat, .f-k1, .f-casa, .f-aux) { opacity: 1; }
.schema[data-stato="sole"] :is(.n-pannelli, .n-inverter, .n-batterie, .n-teleruttori, .n-casa, .n-aux) rect { stroke: var(--p-accent); }
.schema[data-stato="sole"] .k1 circle { fill: var(--p-accent); stroke: var(--p-accent); }
/* batterie scariche: rete sull'ingresso 2, i pannelli ricaricano */
.schema[data-stato="rete"] :is(.f-pv, .f-bat, .f-rete, .f-k2, .f-casa) { opacity: 1; }
.schema[data-stato="rete"] .f-bat { animation-direction: reverse; }
.schema[data-stato="rete"] :is(.n-pannelli, .n-rete, .n-commutatore, .n-inverter, .n-batterie, .n-teleruttori, .n-casa) rect { stroke: var(--p-accent); }
.schema[data-stato="rete"] .k2 circle { fill: var(--p-accent); stroke: var(--p-accent); }
/* senza rete: il commutatore passa al generatore */
.schema[data-stato="generatore"] :is(.f-gen, .f-acin, .f-bat, .f-k2, .f-casa) { opacity: 1; }
.schema[data-stato="generatore"] .f-bat { animation-direction: reverse; }
.schema[data-stato="generatore"] :is(.n-generatore, .n-commutatore, .n-inverter, .n-batterie, .n-teleruttori, .n-casa) rect { stroke: var(--p-accent); }
.schema[data-stato="generatore"] .k2 circle { fill: var(--p-accent); stroke: var(--p-accent); }
.schema[data-stato="rete"] .f-rete, .schema[data-stato="rete"] .f-k2 { stroke: var(--p-accent); }
@media (min-width: 1024px) and (max-width: 1279px) { .schema__svg--largo { max-height: 250px; } .schema__frase { min-height: 0; } }
@media (max-width: 639px) {
  #funzionamento > .wrap { display: flex; flex-direction: column; gap: var(--s-6); }
  #funzionamento .split-col { display: none; }
  #funzionamento .grid.fill { display: block; }
  #funzionamento .frame--photo.frame--fill { height: auto; aspect-ratio: 1; min-height: 0; }
}
/* senza rete: ELIOS va da solo con pannelli e batterie, rete assente e generatore spento */
.schema[data-stato="isola"] :is(.f-pv, .f-bat, .f-k1, .f-casa) { opacity: 1; }
.schema[data-stato="isola"] :is(.n-pannelli, .n-inverter, .n-batterie, .n-teleruttori, .n-casa) rect { stroke: var(--p-accent); }
.schema[data-stato="isola"] .k1 circle { fill: var(--p-accent); stroke: var(--p-accent); }
.schema :is(.n-rete, .e-rete) { transition: opacity 300ms var(--ease); }
.schema:is([data-stato="isola"], [data-stato="generatore"]) :is(.n-rete, .e-rete) { opacity: .35; }
.schema:is([data-stato="isola"], [data-stato="generatore"]) .n-rete rect { stroke-dasharray: 5 5; }
.schema[data-stato="isola"] :is(.n-generatore, .e-gen) { opacity: .35; }
.schema__stati { row-gap: var(--s-2); }
/* titolo della home (scelto da Edoardo): «off-grid» e «All-In-One» mai spezzati, a capo solo prima di «in un cabinet».
   Da 1024 px il titolo prende tutta la riga e testo e tasti vanno sotto. */
.unito { white-space: nowrap; }
@media (min-width: 1024px) {
  html .hero--product:has(.hero__stage > :is([data-product], img, picture)) .hero__head h1 { grid-column: 1 / -1; grid-row: 1; font-size: min(var(--ly-h1), 4.3vw); }
  html .hero--product:has(.hero__stage > :is([data-product], img, picture)) .hero__head .hero__lead { grid-column: 1 / span 7; grid-row: 2; align-self: start; }
  html .hero--product:has(.hero__stage > :is([data-product], img, picture)) .hero__head > .btn-row { grid-column: 9 / -1; grid-row: 2; align-self: start; justify-content: flex-end; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  html .hero--product .hero__head h1 { font-size: 4.4vw; }
}
@media (max-width: 639px) {
  #ordine > .wrap > .group { flex: none; }
  #ordine .configuratore { flex: 1 1 auto; min-height: 0; }
}
.rows.famiglie > li { padding-block: var(--s-2); }
