/* T2.1 — Home. Uses the tokens and components of /assets/css/site.css.
   Sections: hero · doors · section head · rails · arrivals · range · photo bands (permuta, preventivo) ·
   workshop · sede tweaks */

.page-home { --home-pad: clamp(36px, 7vw, 96px); }

/* ---------- hero: photo overlay on mobile, ink column + photo on desktop */
.hh { position: relative; isolation: isolate; overflow: hidden; }
.hh__media { position: absolute; inset: 0; z-index: -2; }
.hh__media picture, .hh__media img { width: 100%; height: 100%; object-fit: cover; }
.hh__media img { object-position: 50% 30%; }
.hh::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, rgba(18, 20, 22, .94) 0%, rgba(18, 20, 22, .86) 42%, rgba(18, 20, 22, .2) 66%, rgba(18, 20, 22, 0) 80%);
}
.hh__inner {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: min(calc(100svh - var(--header-h)), 760px);
  padding-block: 26vh 20px;
}
.hh__text { display: grid; gap: 14px; }
.hh__eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.hh__eyebrow::before { content: ""; width: 20px; height: 2px; background: currentColor; flex: none; }
.hh h1 { font-size: clamp(2rem, 8.4vw, 3.5rem); max-width: 14ch; }
.hh__sub { font-size: 1rem; line-height: 1.45; max-width: 38ch; color: #DCDDDB; }
.hh__actions { display: grid; gap: 10px; margin-top: 4px; }
.hh__eyebrow-more { display: none; }
@media (min-width: 420px) { .hh__eyebrow-more { display: inline; } }
.hh__actions .btn { width: 100%; }
.hh .btn--primary .icon { width: 18px; height: 18px; }
/* hero lead form: desktop only (on mobile the sticky bar and the #preventivo band do the job) */
.hh__form { display: none; }
.trust--hero { color: var(--paper); gap: 4px 16px; font-size: .8125rem; padding-top: 4px; }
.trust--hero li::before { width: 5px; height: 5px; }

@media (min-width: 560px) {
  .hh__actions { display: flex; flex-wrap: wrap; }
  .hh__actions .btn { width: auto; }
}
@media (min-width: 1024px) {
  .hh { background: var(--ink); }
  .hh__media { left: 42%; }
  .hh__media img { object-position: 46% 50%; }
  .hh::after {
    left: 42%; width: 22%;
    background: linear-gradient(to right, var(--ink) 0%, rgba(18, 20, 22, .55) 45%, rgba(18, 20, 22, 0) 100%);
  }
  .hh__inner {
    justify-content: center;
    min-height: clamp(560px, calc(100svh - var(--header-h) - 40px), 700px);
    padding-block: 56px;
  }
  .hh__sub { font-size: var(--fs-lead); }
  .hh__text { max-width: 38%; min-width: 480px; gap: 18px; }
  .hh__inner:has(.hh__form) { flex-direction: row; align-items: center; justify-content: space-between; gap: 40px; }
  .hh__form { display: block; width: 380px; flex: none; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
  .hh__form { padding: 22px 24px; }
  .hh__form .lead-form__title { font-size: 1.375rem; }
  /* compact: phone + privacy only; message, email, marketing and alternatives stay in the #preventivo form */
  .hh__form .lead-form__more, .hh__form .lead-form__field--consenso_marketing,
  .hh__form .lead-form__alt, .hh__form .lead-form__intro { display: none; }
  .hh__form .lead-pill__text { padding-block: 6px; font-size: var(--fs-small); }
  /* four intents as an even 2 x 2 grid instead of 3 + 1 */
  .hh__form .lead-form__pills-list { display: grid; grid-template-columns: 1fr 1fr; }
  .hh__form .lead-pill__text { width: 100%; justify-content: center; min-height: 40px; }
  .hh h1 { font-size: clamp(2.5rem, 4.1vw, 3.5rem); }
  .trust--hero { flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--ink-2); font-size: var(--fs-small); }
}

/* ---------- three doors */
.hdoors { padding-block: var(--home-pad); }
.hdoors__head { display: grid; gap: 6px; margin-bottom: 20px; }
.hdoors__head p { max-width: 60ch; }
.hdoors__list { display: grid; gap: 8px; }
.hdoor {
  position: relative; display: grid; grid-template-columns: 76px 1fr 28px; align-items: center; gap: 14px;
  padding: 8px 14px 8px 8px; background: var(--surface); border-radius: var(--radius-lg);
  transition: transform var(--t), box-shadow var(--t);
}
.hdoor__media { aspect-ratio: 1; border-radius: 10px; }
.hdoor__body { display: grid; gap: 2px; }
.hdoor h3 { font-size: 1.125rem; }
.hdoor p { font-size: var(--fs-small); color: var(--muted); line-height: 1.35; }
.hdoor p strong { color: var(--ink); font-size: 1rem; }
.hdoor__link { text-decoration: none; }
.hdoor__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.hdoor:has(.hdoor__link:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }
.hdoor__link:focus-visible { outline: none; }
.hdoor__go { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper); transition: transform var(--t); }
.hdoor__go .icon { width: 16px; height: 16px; }
.hdoor:hover { box-shadow: 0 10px 30px rgba(18, 20, 22, .08); }
.hdoor:hover .hdoor__go { transform: translateX(3px); }
.hdoor img { transition: transform 400ms cubic-bezier(.2, .7, .2, 1); }
.hdoor:hover img { transform: scale(1.04); }

@media (min-width: 768px) {
  .hdoors__head { grid-template-columns: auto 1fr; align-items: end; gap: 12px 40px; margin-bottom: 28px; }
  .hdoors__head p { justify-self: end; text-align: right; max-width: 46ch; }
  .hdoors__list { grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
  .hdoor { grid-template-columns: 1fr; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
  .hdoor__media { aspect-ratio: 3 / 2; border-radius: 0; }
  .hdoor__body { padding: 18px 64px 20px 20px; gap: 4px; }
  .hdoor h3 { font-size: 1.375rem; }
  .hdoor__go { position: absolute; right: 18px; bottom: 22px; width: 36px; height: 36px; }
  .hdoor__go .icon { width: 18px; height: 18px; }
}

/* ---------- section head (title + intro left, link right) */
.hsec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 32px; margin-bottom: 20px; }
.hsec-head > div { display: grid; gap: 6px; max-width: 62ch; }
.hsec-head .link-arrow { white-space: nowrap; }
@media (min-width: 768px) { .hsec-head { margin-bottom: 32px; } }

/* ---------- rails (horizontal card lists, scroll-snap) */
.hrail__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: 74%; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px; scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.hrail__track::-webkit-scrollbar { display: none; }
.hrail__track > li { display: flex; scroll-snap-align: start; min-width: 0; }
.hrail__track > li > * { width: 100%; }
.hrail__track:focus-visible { outline-offset: -3px; }
.hrail__nav { display: none; }
.hrail__btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 2px solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink);
  font-size: 1.125rem; font-weight: 600; line-height: 1;
  transition: background-color var(--t), color var(--t), opacity var(--t);
}
.hrail__btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.hrail__btn:disabled { opacity: .3; cursor: default; }
@media (min-width: 768px) {
  .hrail__track { grid-auto-columns: calc((100% - 14px) / 2.15); gap: 20px; }
  .hrail__nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
  .hrail.is-static .hrail__nav { display: none; }
}

/* ---------- latest arrivals */
.harrivi { padding-block: var(--home-pad); }
@media (min-width: 1024px) {
  .hrail__track--cars {
    grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
    overflow: visible; margin-inline: 0; padding: 0;
  }
  .harrivi .hrail__nav { display: none; }
}

/* ---------- new range (CSS-only brand switch) */
.hgamma { padding-block: var(--home-pad); }
.hgamma__tabs { position: relative; }
.hgamma__switch {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--surface); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
}
.hgamma__label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border-radius: 999px; cursor: pointer; color: var(--ink);
  transition: background-color var(--t), color var(--t);
}
.hgamma__logo { height: 18px; width: auto; }
.hgamma__count { font-size: var(--fs-label); font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hgamma__label:hover { background: var(--paper-2); }
#hgamma-renault:checked ~ .hgamma__switch .hgamma__label--renault,
#hgamma-dacia:checked ~ .hgamma__switch .hgamma__label--dacia { background: var(--ink); color: var(--paper); }
#hgamma-renault:checked ~ .hgamma__switch .hgamma__label--renault .hgamma__count,
#hgamma-dacia:checked ~ .hgamma__switch .hgamma__label--dacia .hgamma__count { color: var(--muted-on-ink); }
#hgamma-renault:focus-visible ~ .hgamma__switch .hgamma__label--renault,
#hgamma-dacia:focus-visible ~ .hgamma__switch .hgamma__label--dacia { box-shadow: var(--focus); }
.hgamma__panel--dacia, #hgamma-dacia:checked ~ .hgamma__panel--renault { display: none; }
#hgamma-dacia:checked ~ .hgamma__panel--dacia { display: block; }
.hgamma__panel > .link-arrow { margin-top: 4px; }
.hrail__track--models { grid-auto-columns: 66%; }
.hgamma .mcard .tags { display: none; }
@media (max-width: 767px) { .hgamma .mcard__cta { display: none; } .hgamma .mcard__body { padding: 14px 16px; } }
.hgamma .mcard { box-shadow: 0 0 0 1px var(--line); }
@media (min-width: 768px) {
  .hrail__track--models { grid-auto-columns: calc((100% - 40px) / 3); }
  .hgamma .hrail__nav { position: absolute; top: 6px; right: 0; margin: 0; }
}
@media (min-width: 1180px) {
  .hrail__track--models { grid-auto-columns: calc((100% - 60px) / 4); }
}

/* ---------- photo bands with a form (permuta, preventivo) */
.hphoto { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: var(--paper); }
.hphoto__media { position: absolute; inset: 0; z-index: -2; }
.hphoto__media picture, .hphoto__media img { width: 100%; height: 100%; object-fit: cover; }
.hphoto::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(18, 20, 22, .7) 0%, rgba(18, 20, 22, .88) 46%, rgba(18, 20, 22, .96) 100%);
}
.hphoto :focus-visible { outline-color: var(--accent); }
.hphoto .lead-box :focus-visible { outline-color: var(--ink); }
.hphoto__grid { display: grid; gap: 24px; padding-block: var(--home-pad); }
.hphoto__text { display: grid; gap: 14px; align-content: start; }
.hphoto__text > p:not(.hh__eyebrow) { color: #DCDDDB; max-width: 46ch; }
.hphoto__form { box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.hphoto .lead-form__title { font-size: 1.375rem; }
.hticks { display: grid; gap: 8px; margin-top: 4px; font-size: .9375rem; }
.hticks li { display: flex; align-items: flex-start; gap: 10px; }
.hticks .icon { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
/* Plate and km side by side also on phones: both are short. */
.hpermuta .lead-form__row { grid-template-columns: 1fr 1fr; gap: 12px; }

.hfin { border-top: 1px solid rgba(247, 246, 242, .18); border-bottom: 1px solid rgba(247, 246, 242, .18); margin-top: 6px; }
.hfin > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
  font-weight: 600; cursor: pointer; list-style: none;
}
.hfin > summary::-webkit-details-marker { display: none; }
.hfin > summary::after { content: "+"; font-size: 1.375rem; font-weight: 400; line-height: 1; }
.hfin[open] > summary::after { content: "–"; }
.hfin__body { display: grid; gap: 10px; padding-bottom: 16px; font-size: .9375rem; color: #DCDDDB; }
.hfin__body strong { color: var(--paper); }

@media (min-width: 1024px) {
  .hphoto::after { background: linear-gradient(to right, rgba(18, 20, 22, .92) 0%, rgba(18, 20, 22, .78) 48%, rgba(18, 20, 22, .55) 100%); }
  .hphoto__grid { grid-template-columns: 1fr minmax(380px, 460px); gap: 64px; align-items: center; }
  .hphoto__text { max-width: 560px; }
  .hpermuta .hphoto__media img { object-position: 30% 50%; }
}

/* ---------- workshop */
.hofficina { padding-block: var(--home-pad); }
.hofficina__grid { display: grid; gap: 32px; align-items: center; }
.hofficina__media { display: none; }
.hofficina__body { display: grid; gap: 16px; }
.hofficina__body > p { max-width: 60ch; }
.hofficina__eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.hofficina__eyebrow::before { content: ""; width: 20px; height: 2px; background: var(--accent); flex: none; }
.hservizi { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; margin-block: 4px 8px; font-size: .9375rem; line-height: 1.3; }
.hservizi li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); font-weight: 500; }
.hservizi li::before { content: ""; width: 7px; height: 7px; flex: none; background: var(--ink); }
@media (min-width: 768px) {
  .hofficina__grid { grid-template-columns: minmax(260px, 5fr) 7fr; gap: clamp(32px, 6vw, 88px); }
  .hofficina__media { display: block; }
  .hservizi { font-size: 1rem; }
}

/* ---------- sede: the footer repeats the weekly hours, so phones keep only the live status */
@media (max-width: 767px) {
  .page-home .sede__grid { gap: 20px; }
  .page-home .sede { padding-top: var(--home-pad); }
  .page-home .sede__media { display: none; }
  .page-home .sede__hours { display: none; }
}

@media (max-width: 767px) { .hticks { display: none; } }

/* ---------- 50 years: seal in the hero, motto band (client request 2026-12-03) */
/* phones: the hero photo already shows the real 50-years sign, the seal stays in the motto band */
.hh__seal { display: none; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .45)); }
@media (min-width: 1024px) { .hh__seal { display: block; width: 92px; height: 92px; margin-bottom: 4px; } }
.hmotto { background: var(--ink); color: var(--paper); padding-block: clamp(36px, 6vw, 72px); }
.hmotto__inner { display: flex; align-items: center; gap: clamp(18px, 4vw, 40px); }
.hmotto__seal { width: clamp(84px, 14vw, 150px); height: auto; flex: none; }
.hmotto__text { font-size: clamp(1.5rem, 4.2vw, 3rem); font-weight: 700; line-height: 1.12; letter-spacing: -.01em; text-wrap: balance; max-width: 22ch; margin: 0; }
.hmotto__text strong { color: #CFA25A; font-weight: 800; } /* bronze-gold, as on the client business card */
