/* Prezzi (giro 3): capitoli di pages.css + calcolatori, tabelle e registri dei listini.
   Solo prezzi.html e le cinque pagine sotto /prezzi caricano questo file. */

/* testata: l'anno del listino accanto al nome */
.ph h1 > span { margin-left: .22em; }
.ph--photo h1 { max-width: 16ch; }
/* testata con foto verticale (pacchetti): titolo a sinistra, foto a destra su 5 colonne */
.px-ph { padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.px-ph .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1.2rem, 2.4vw, 2rem); align-items: end; }
.px-ph .ph__head { grid-column: 1 / span 7; padding-bottom: clamp(.5rem, 2vw, 1.5rem); }
.px-ph .ph__media { grid-column: 8 / span 5; margin: 0; }
.px-ph .ph__media img { height: auto; aspect-ratio: 4 / 5; }
@media (max-width: 860px) {
  .px-ph .wrap { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .px-ph .ph__head, .px-ph .ph__media { grid-column: 1 / -1; }
  .px-ph .ph__media img { aspect-ratio: 4 / 3; }
}

/* ---------------------------------------------------------------------------
   CALCOLATORE: capitolo sulla pietra, testata standard + listino a tutta larghezza
   --------------------------------------------------------------------------- */
.cap--calc .cap__wide { min-width: 0; margin-top: clamp(.6rem, 2vw, 1.6rem); }
.price-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 1.2rem 2.4rem; margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.price-tools .field { min-width: 0; }
.price-tools .field > span { font-size: var(--t-small); }
.price-tools select { min-width: 300px; max-width: 100%; min-height: 56px; font-size: var(--t-lead); background-color: var(--bianco); }
.price-stepper { display: flex; align-items: center; border-block: 1px solid var(--line-strong); min-height: 56px; }
.price-stepper button { width: 52px; min-height: 54px; font-size: var(--t-lead); }
.price-stepper button:hover:not(:disabled) { background: var(--calce); }
.price-stepper button:disabled { opacity: .35; cursor: default; }
.price-stepper output { min-width: 112px; text-align: center; font-family: var(--f-display); font-stretch: 86%; font-weight: 640; font-size: clamp(1.3rem, 1.8vw, 1.6rem); font-variant-numeric: tabular-nums; }

/* listino a matrice (villaggio, camping) */
.price-table-scroll { max-width: 100%; overflow-x: auto; }
.price-matrix, .package-table { width: 100%; border-collapse: collapse; }
.price-matrix td, .package-table td { font-variant-numeric: tabular-nums; }
.price-matrix caption, .package-table caption { text-align: left; color: var(--ink-2); font-size: var(--t-small); padding-bottom: 1rem; }
.price-matrix th, .price-matrix td, .package-table th, .package-table td { text-align: right; padding: 1.25rem .6rem; border-bottom: 1px solid var(--line); }
.price-matrix thead th, .package-table thead th { font-size: var(--t-micro); color: var(--ink-2); font-weight: 500; vertical-align: bottom; padding-block: .8rem; border-bottom-color: var(--ink); }
.price-matrix th:first-child, .package-table th:first-child { text-align: left; padding-left: 0; }
.price-matrix tbody th { min-width: 190px; max-width: 230px; font-weight: 400; }
.price-matrix tbody th a, .package-table tbody th a { font-family: var(--f-display); font-stretch: 86%; font-weight: 640; font-size: clamp(1.15rem, 1.45vw, 1.4rem); line-height: 1.15; }
.price-matrix td { white-space: nowrap; font-size: var(--t-body); color: var(--ink-2); }
.price-matrix small { display: block; font-size: var(--t-micro); font-weight: 400; color: var(--ink-2); line-height: 1.4; margin-top: .1rem; }
/* la colonna del periodo scelto si accende, il totale va in grande */
.price-matrix .is-selected { background: var(--calce); color: var(--ink); }
.price-matrix thead .is-selected { color: var(--ink); font-weight: 600; }
.price-matrix tbody td.is-selected { font-weight: 600; }
.price-matrix .price-estimate { padding-right: 0; padding-left: 1.2rem; }
.price-matrix tbody .price-estimate { font-family: var(--f-display); font-stretch: 80%; font-weight: 700; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: 1; color: var(--ink); }
.price-matrix thead .price-estimate { color: var(--ink); font-weight: 600; font-size: var(--t-small); }
.price-matrix th a, .package-table th a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.price-matrix th a:hover, .package-table th a:hover { color: var(--accent-ink); }
.price-table-scroll + .sr-only + .note, .cap--calc .note { margin-top: 1.2rem; }

/* pacchetti volo + soggiorno */
.price-flight { margin-bottom: 1.2rem; font-family: var(--f-display); font-stretch: 86%; font-weight: 640; font-size: clamp(1.25rem, 1.8vw, 1.6rem); }
.package-table tbody td { font-family: var(--f-display); font-stretch: 80%; font-weight: 700; font-size: clamp(1.5rem, 2.2vw, 2.1rem); line-height: 1; color: var(--ink); }
.package-table tbody td:last-child { font-size: clamp(1.6rem, 2.4vw, 2.3rem); }
.package-table td:last-child, .package-table th:last-child { padding-right: 0; }
.price-quote { font-family: var(--f-text); font-weight: 500; font-size: var(--t-small); display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .2em; color: var(--accent-ink); }
.price-flight-details { margin-top: clamp(1.6rem, 3vw, 2.4rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1.2rem, 2.4vw, 2rem); align-items: baseline; }
.price-flight-details:empty { display: none; }
.price-flight-details .kit { grid-column: 1 / span 8; margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-flight-details .kit > div { grid-template-columns: minmax(0, .45fr) minmax(0, 1.55fr); }
.price-flight-details .kit dt { font-weight: 600; }
.price-flight-details .kit dd { color: var(--ink); }
.price-flight-details > p { grid-column: 9 / span 4; color: var(--ink-2); }

/* ---------------------------------------------------------------------------
   REGISTRI: il prezzo principale in grande sopra la sua riga
   --------------------------------------------------------------------------- */
.reg dd > .reg__big { display: block; margin-bottom: .45rem; }
.reg dd > p + p { margin-top: .6rem; }

/* offerte (last minute, fuori stagione): nome, prezzo, cosa comprende */
.px-offerta dd { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); column-gap: clamp(1.2rem, 2.4vw, 2rem); align-items: baseline; }
.px-offerta__prezzo { display: grid; gap: .3rem; }
.px-offerta ul { display: grid; gap: .45rem; color: var(--ink); }
.price-amount { font-family: var(--f-display); font-stretch: 80%; font-weight: 700; font-size: clamp(2.4rem, 4.4vw, 4.2rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.price-amount span:first-child:not(:last-child) { margin-right: .12em; }
.price-amount span:last-child:not(:first-child) { font-family: var(--f-text); font-stretch: 100%; font-weight: 400; font-size: var(--t-body); color: var(--ink-2); margin-left: .4rem; white-space: nowrap; }

/* fuori stagione: i periodi in chiaro */
.px-periodi { display: grid; gap: .2rem; margin-top: .6rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.px-periodi p:not(:last-child) b { font-family: var(--f-display); font-stretch: 86%; font-weight: 640; font-size: clamp(1.35rem, 2vw, 1.8rem); }

/* indice dei prezzi: i due listini e le offerte */
.px-listini { margin-top: clamp(1rem, 3vw, 2.4rem); border-top: 1px solid var(--line); padding-top: clamp(1.8rem, 3vw, 2.6rem); }
.px-listini h3 { font-family: var(--f-display); font-stretch: 80%; font-weight: 640; font-size: clamp(2.2rem, 4vw, 3.6rem); line-height: 1.04; letter-spacing: -.01em; }
.px-listini h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .14em; text-decoration-color: transparent; transition: text-decoration-color .2s var(--ease), color .2s var(--ease); }
.px-listini h3 a:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.px-listini p { max-width: 46ch; }
.px-listini__foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.6rem; font-size: var(--t-small); color: var(--ink-2); }
.px-offerte > a .reg__v { grid-column: 5 / span 5; }
.px-offerte > a .reg__x { grid-column: 10 / span 3; display: grid; justify-items: end; gap: .25rem; text-align: right; white-space: normal; font-weight: 400; }
.px-offerte .reg__x b { font-family: var(--f-display); font-stretch: 80%; font-weight: 700; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1; color: var(--ink); }
.px-offerte .reg__x > span:not(.go) { font-size: var(--t-small); color: var(--ink-2); }
.px-offerte .reg__x .go { margin-top: .5rem; }

.close :focus-visible { outline-color: var(--on-blu); }

@media (max-width: 1100px) {
  /* listini: tutti i periodi anche sul telefono. La tabella scorre di lato; il nome dell'alloggio resta
     fermo a sinistra e il totale per le notti scelte a destra (il periodo scelto si porta in vista da solo) */
  .cap--calc .price-matrix { width: max-content; min-width: 100%; }
  .cap--calc .price-matrix th, .cap--calc .price-matrix td { padding: 1rem .55rem; }
  .cap--calc .price-matrix tbody th, .cap--calc .price-matrix thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--pietra); width: auto; min-width: 8.6rem; max-width: 10.5rem; padding-left: 0; padding-right: .8rem; white-space: normal; }
  .cap--calc .price-matrix tbody th a { font-size: 1.05rem; }
  .cap--calc .price-matrix thead th[data-period] > span { display: inline-block; min-width: 4.2rem; white-space: normal; }
  .cap--calc .price-matrix .price-estimate { position: sticky; right: 0; z-index: 1; background: var(--pietra); box-shadow: inset 1px 0 0 var(--line); width: auto; padding-left: .7rem; padding-right: 0; }
  .cap--calc .price-matrix tbody .price-estimate { font-size: 1.45rem; }
  .cap--calc .price-matrix tbody td.is-selected, .cap--calc .price-matrix thead th.is-selected { background: var(--calce); }
}
@media (max-width: 600px) {
  .cap--calc .price-matrix tbody th, .cap--calc .price-matrix thead th:first-child { min-width: 0; width: 7.6rem; max-width: 7.6rem; padding-right: .6rem; box-shadow: inset -1px 0 0 var(--line); }
  .cap--calc .price-matrix tbody th a { font-size: 1rem; }
  .cap--calc .price-matrix thead th[data-period] > span { min-width: 3.3rem; }
  .cap--calc .price-matrix th, .cap--calc .price-matrix td { padding-inline: .5rem; }
}
@media (max-width: 860px) {
  .price-flight-details { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .price-flight-details .kit, .price-flight-details > p { grid-column: 1 / -1; }
  .price-flight-details .kit { grid-template-columns: minmax(0, 1fr); }
  .px-offerta dd { grid-template-columns: minmax(0, 1fr); row-gap: 1rem; }
  .px-offerte > a .reg__x { justify-items: start; text-align: left; }
}
@media (max-width: 600px) {
  .price-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  .price-tools select { min-width: 0; width: 100%; }
  .price-tools .field { width: 100%; }
  .price-stepper { justify-content: space-between; }
  .price-matrix th, .price-matrix td { padding: 1rem .35rem; }
  .price-matrix tbody th { min-width: 0; width: 46%; }
  .price-matrix .price-estimate { width: 30%; padding-left: .6rem; }
  .package-table thead { display: none; }
  .package-table, .package-table tbody, .package-table tr, .package-table th, .package-table td { display: block; text-align: left; }
  .package-table caption { display: block; }
  .package-table tr { padding-block: .8rem 1.1rem; border-top: 1px solid var(--line); }
  .package-table th, .package-table td { border: 0; padding: .25rem 0; }
  .package-table td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
  .package-table td::before { content: attr(data-label); font-family: var(--f-text); font-stretch: 100%; font-weight: 400; font-size: var(--t-small); color: var(--ink-2); }
}

/* tutte le tariffe dei pacchetti (tools/tariffe-pacchetti.mjs): un aeroporto per riga, si apre la sua tabella */
.px-tutte .cap__wide { min-width: 0; margin-top: clamp(.6rem, 2vw, 1.6rem); border-bottom: 1px solid var(--line); }
.px-tutte__aero { border-top: 1px solid var(--line); }
.px-tutte__aero summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.6rem; padding: 1.4rem 2.6rem 1.4rem 0; position: relative; cursor: pointer; list-style: none; }
.px-tutte__aero summary::-webkit-details-marker { display: none; }
.px-tutte__aero summary > span:first-child { font-family: var(--f-display); font-stretch: 86%; font-weight: 640; font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.15; }
.px-tutte__aero summary > span:last-child { color: var(--ink-2); font-size: var(--t-small); }
.px-tutte__aero summary::after { content: '+'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.6rem; line-height: 1; color: var(--ink-2); }
.px-tutte__aero[open] summary::after { content: '−'; }
.px-tutte__aero summary:hover > span:first-child { color: var(--accent-ink); }
.px-tutte__aero .price-table-scroll { padding-bottom: clamp(1.4rem, 3vw, 2.4rem); }
.px-tutte__t thead th:not(:first-child) { min-width: 4.6rem; }
.px-tutte__t td { color: var(--ink); }
@media (max-width: 860px) {
  /* sul telefono il nome dell'alloggio resta fermo mentre si scorrono le settimane */
  .px-tutte__t tbody th, .px-tutte__t thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--calce); min-width: 9.5rem; width: auto; max-width: 11rem; padding-right: .8rem; }
  .px-tutte__t tbody th a { font-size: 1.05rem; }
}
