/* Petrol Gamma: bianco e nero, font Rajdhani. La griglia e' quella di Bootstrap. */

@font-face { font-family: 'Rajdhani'; font-weight: 300; font-display: swap; src: url('../fonts/rajdhani-300.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 400; font-display: swap; src: url('../fonts/rajdhani-400.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 500; font-display: swap; src: url('../fonts/rajdhani-500.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url('../fonts/rajdhani-600.woff2') format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url('../fonts/rajdhani-700.woff2') format('woff2'); }

:root {
  --pg-nero: #000;
  --pg-scuro: #1f1f1f;
  --pg-card: #3a3a3a;
  --pg-fondo: #f5f5f5;
  --pg-campo: #eaeaea;
  --pg-bianco: #fff;
  --pg-header: 100px;
}

html { scroll-behavior: smooth; scroll-padding-top: var(--pg-header); }
body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pg-nero);
  background: var(--pg-fondo);
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { font-family: inherit; line-height: 1.2; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

.skip-link { position: fixed; top: -60px; left: 12px; z-index: 2000; padding: 10px 16px; background: var(--pg-bianco); color: var(--pg-nero); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Comparsa allo scroll, solo se JS e' attivo */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Header e menu ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--pg-header); padding: 10px 30px;
  background: transparent; transition: background .3s;
}
.site-header__logo img { display: block; width: 120px; height: auto; }
.site-header.is-scrolled { background: var(--pg-scuro); }
/* Pagine senza video in apertura (news, schede stazione, testi legali): header sempre scuro, altrimenti il logo bianco sparisce */
body:not(:has(.hero)) .site-header { background: var(--pg-scuro); }
body:not(:has(.hero)) .hamburger span { background: var(--pg-bianco); }
.hamburger { display: flex; flex-direction: column; gap: 7px; width: 48px; padding: 8px; background: none; border: 0; cursor: pointer; }
.hamburger span { display: block; height: 7px; background: var(--pg-nero); border-radius: 4px; transition: background .3s; }
.hamburger span:nth-child(2) { margin-left: -6px; margin-right: 6px; }
.site-header.is-scrolled .hamburger span { background: var(--pg-bianco); }

.site-menu {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; justify-content: flex-end;
  background: rgba(2, 1, 1, .93);
  opacity: 0; transition: opacity .3s;
}
.site-menu[hidden] { display: none; }
.site-menu.is-open { opacity: 1; }
.site-menu__gamma { flex: 0 1 auto; height: 100%; aspect-ratio: 576 / 767; background: url('../images/brand/GammaMenu.png') center right / contain no-repeat; }
.site-menu__panel {
  flex: 0 0 30%; min-width: 437px; height: 100%; padding: 20px 40px 30px; overflow-y: auto;
  background: var(--pg-bianco); text-align: right;
  transform: translateX(40px); transition: transform .35s ease;
}
.site-menu.is-open .site-menu__panel { transform: none; }
.site-menu__close { padding: 2px 8px; font-size: 42px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--pg-nero); margin-right: -22px; }
.site-menu__links { list-style: none; margin: 56px 0 0; padding: 0; }
.site-menu__links a { display: block; padding: 5px 0; font-size: 40px; font-weight: 600; line-height: 1.25; color: var(--pg-scuro); text-decoration: none; }
.site-menu__links a:hover, .site-menu__links a[aria-current] { color: #6b6b6b; }
.site-menu__rule { width: 15%; margin: 24px 0 18px auto; opacity: 1; border-color: #666; }
.site-menu__social-title { margin: 0 0 14px; }
.site-menu__social { display: flex; justify-content: flex-end; gap: 28px; list-style: none; padding: 0; margin: 0; font-size: 26px; }
.site-menu__social a { text-decoration: none; }

/* ---------- Hero video ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 480px; overflow: hidden; background: var(--pg-scuro); }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Valori identici al sito attuale: maschera e velo hanno opacita' 0.8, il velo in piu' ha il colore semitrasparente */
.hero__mask { position: absolute; inset: 0 auto 0 0; width: 65%; background: url('../images/brand/gammaLogoTrans.png') center right / contain no-repeat; opacity: .8; }
.hero__veil { position: absolute; inset: 0 0 0 65%; background: rgba(255, 255, 255, .83); opacity: .8; }
.hero--home .hero__mask { width: 75%; background-image: url('../images/brand/Raggruppa-100-1.png'); }
.hero--home .hero__veil { left: 75%; background: rgba(247, 247, 247, .9); }

/* ---------- Bottoni ---------- */
.btn-pg {
  display: inline-block; padding: 15px 30px;
  font-size: 18px; font-weight: 600; line-height: 1;
  color: var(--pg-nero); background: transparent;
  border: 2px solid var(--pg-nero); text-decoration: none; cursor: pointer;
  transition: background .25s, color .25s;
}
.btn-pg i { margin-left: 8px; font-size: .85em; }
.btn-pg:hover, .btn-pg:focus-visible { background: var(--pg-nero); color: var(--pg-bianco); }
.btn-pg--light { color: var(--pg-bianco); border-color: var(--pg-bianco); }
.btn-pg--light:hover, .btn-pg--light:focus-visible { background: var(--pg-bianco); color: var(--pg-nero); }
.btn-pg--solid { background: var(--pg-nero); color: var(--pg-bianco); border-color: var(--pg-nero); }
.btn-pg--solid:hover, .btn-pg--solid:focus-visible { background: var(--pg-bianco); color: var(--pg-nero); }

/* ---------- Sezioni ---------- */
.sec { padding: 100px 0; }
.sec-photo { position: relative; padding: 100px 0; color: var(--pg-bianco); background-position: center; background-size: cover; }
.sec-photo::before { content: ''; position: absolute; inset: 0; background: rgba(12, 12, 12, .73); }
.sec-photo > * { position: relative; }
.sec-dark { padding: 100px 0; color: var(--pg-bianco); background: var(--pg-scuro); }
.sec-title-xl { font-size: 60px; font-weight: 700; }
.sec-title-lg { font-size: 45px; font-weight: 600; }
.sec-title-md { font-size: 32px; font-weight: 600; }
.intro-title { font-size: 25px; font-weight: 400; line-height: 1.5; }
.intro-title strong { display: block; font-weight: 700; }
.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }

/* Servizi in home */
.servizio-box { height: 100%; padding: 22px 18px; text-align: center; border: 1px solid #000; }
.servizio-box img { width: auto; height: 90px; margin-bottom: 12px; }
.servizio-box h3, .servizio h3 { font-size: 23px; font-weight: 600; margin-bottom: 8px; }
.servizio-box p, .servizio p { margin: 0; font-size: 15px; }
.servizio { display: flex; gap: 18px; align-items: flex-start; }
.servizio img { flex: none; width: 66px; height: 66px; object-fit: contain; }

/* Contatori */
.contatore { text-align: center; }
.contatore i { display: block; margin-bottom: 18px; font-size: 42px; }
.contatore__n { display: block; font-size: 52px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.contatore__t { display: block; margin-top: 18px; font-size: 16px; font-weight: 600; line-height: 1.25; }

/* Blocchi metà testo, metà immagine o video */
.split { display: grid; grid-template-columns: 1fr 1fr; }
.split__text { display: flex; align-items: center; padding: 60px 8%; }
.split__text > div { max-width: 560px; margin: 0 auto; }
.split__media { position: relative; min-height: 452px; background-position: center; background-size: cover; overflow: hidden; }
.split__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.split--dark { background: var(--pg-nero); color: var(--pg-bianco); }
.split__title { display: flex; gap: 14px; align-items: center; font-size: 26px; font-weight: 600; margin-bottom: 12px; }
.split__title img { width: 36px; height: auto; }
.split--rete .split__media { min-height: 645px; }

/* Flip box Gamma Card */
.flip { height: 280px; perspective: 1000px; }
.flip__in { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .7s; }
.flip:hover .flip__in, .flip:focus-within .flip__in { transform: rotateY(180deg); }
.flip__face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; text-align: center; backface-visibility: hidden; border: 2px solid var(--pg-bianco); border-radius: 14px; }
.flip__face img { width: auto; height: 96px; margin-bottom: 18px; }
.flip__face h3 { margin: 0; font-size: 28px; font-weight: 600; }
.flip__back { color: var(--pg-nero); background: var(--pg-bianco); transform: rotateY(180deg); }
.flip__back h3 { margin-bottom: 8px; }
.flip__back p { margin: 0; }

.prodotto-img { display: block; width: 100%; max-width: 380px; height: 360px; margin-left: auto; margin-right: auto; object-fit: contain; }

/* Partner */
.carosello { position: relative; display: flex; align-items: center; gap: 10px; }
.carosello__track { display: flex; flex: 1; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carosello__track::-webkit-scrollbar { display: none; }
.partner { flex: 0 0 calc((100% - 96px) / 5); scroll-snap-align: start; display: flex; align-items: center; justify-content: center; height: 110px; padding: 10px; background: var(--pg-bianco); }
.partner img { max-height: 90px; width: auto; object-fit: contain; }
.carosello__btn { flex: none; width: 40px; height: 40px; font-size: 18px; background: none; border: 0; cursor: pointer; }

/* Ener Gamma */
.energamma { position: relative; padding: 100px 0; color: var(--pg-bianco); text-align: center; background: #05122e; overflow: hidden; }
.energamma video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.energamma::before { content: ''; position: absolute; inset: 0; z-index: 1; background: rgba(0, 0, 0, .35); }
.energamma .container { position: relative; z-index: 2; }
.energamma__logo { width: 240px; margin-bottom: 36px; }
.energamma p { font-size: 20px; font-weight: 500; margin-bottom: 30px; }

/* Card bianche (Competitivita', Vision, Assistenza) */
.card-pg { height: 100%; padding: 36px 28px; text-align: center; color: var(--pg-nero); background: var(--pg-bianco); border-radius: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.card-pg h3 { font-size: 32px; font-weight: 600; margin-bottom: 12px; }
.card-pg p { margin: 0; }
.pull-up { margin-top: -70px; position: relative; z-index: 2; }

/* Vantaggi Gamma Card */
.vantaggio { display: flex; gap: 16px; align-items: flex-start; }
.vantaggio img { flex: none; width: 38px; height: 38px; object-fit: contain; }
.vantaggio p { margin: 0; }
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.store-badges img { height: 56px; width: auto; }

/* Form */
.pg-form { max-width: 760px; margin: 0 auto; }
.pg-form input[type=text], .pg-form input[type=email], .pg-form input[type=tel], .pg-form textarea {
  display: block; width: 100%; padding: 13px 14px; font: inherit; color: var(--pg-nero);
  background: var(--pg-campo); border: 0; border-radius: 0;
}
.pg-form ::placeholder { color: #666; }
.pg-form__consent { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 20px; font-size: 15px; color: #444; }
.pg-form__consent input { margin-top: 5px; flex: none; }
.pg-form__error { padding: 12px 16px; margin-bottom: 16px; color: #fff; background: #a11212; }
/* reCAPTCHA v3: badge in basso a sinistra come nel sito attuale (a destra c'e' il pulsante di iubenda).
   Chiuso mostra solo il logo, al passaggio del mouse si apre con i link a privacy e termini di Google. */
.grecaptcha-badge { left: 4px !important; right: auto !important; width: 70px !important; overflow: hidden !important; transition: width .3s ease !important; z-index: 50; }
.grecaptcha-badge:hover { width: 256px !important; }
.pg-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Contatti */
.contatto { display: flex; gap: 16px; margin-bottom: 26px; }
.contatto > i { flex: none; width: 26px; margin-top: 4px; font-size: 24px; text-align: center; }
.contatto h2 { font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.contatto p { margin: 0; }
.social-boxes { display: flex; gap: 10px; list-style: none; padding: 0; margin: 20px 0 0; }
.social-boxes a { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; font-size: 19px; border: 2px solid currentColor; border-radius: 4px; text-decoration: none; }
.social-boxes a:hover { background: var(--pg-bianco); color: var(--pg-nero); border-color: var(--pg-bianco); }
.sec .social-boxes a:hover { background: var(--pg-nero); color: var(--pg-bianco); border-color: var(--pg-nero); }

/* Area gestori */
.login-box { max-width: 460px; margin: 0 auto; }
.login-box input { display: block; width: 100%; padding: 13px 14px; margin-bottom: 10px; font: inherit; background: var(--pg-campo); border: 0; }
.login-note { padding: 12px 16px; margin-bottom: 16px; background: var(--pg-campo); }

/* Rete distributiva */
#mappa { height: 810px; max-height: 90vh; background: #d9dfe2; }
.mappa-pin { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; color: #fff; font-size: 14px; background: #000; border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.mappa-pin i { transform: rotate(45deg); }
.mappa-cluster { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; font-weight: 700; color: #fff; background: #1f1f1f; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.mappa-popup { font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: 500; }
.mappa-popup img { display: block; width: 100%; height: 120px; margin-bottom: 8px; object-fit: cover; }
.mappa-popup b { display: block; font-size: 17px; line-height: 1.2; margin-bottom: 4px; }
.mappa-popup .mappa-link { display: inline-block; margin-top: 8px; margin-right: 12px; font-weight: 700; color: #000; }

.griglia-stazioni { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 30px 12px 70px; max-width: 1440px; margin: 0 auto; }
.stazione-card { display: flex; flex-direction: column; color: var(--pg-bianco); background: var(--pg-card); border-radius: 6px; overflow: hidden; }
.galleria { position: relative; background: #222; }
.galleria__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.galleria__track::-webkit-scrollbar { display: none; }
.galleria__track img { flex: 0 0 100%; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; scroll-snap-align: start; }
.galleria__vuota { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; font-size: 48px; color: #777; }
.galleria__btn { position: absolute; top: 50%; width: 36px; height: 36px; margin-top: -18px; color: #fff; background: rgba(0, 0, 0, .45); border: 0; cursor: pointer; }
.galleria__btn--p { left: 6px; }
.galleria__btn--s { right: 6px; }
.stazione-card__body { flex: 1; padding: 20px 22px 24px; }
.stazione-card h2 { font-size: 18px; font-weight: 600; text-transform: uppercase; margin-bottom: 12px; }
.stazione-card h2 a { text-decoration: none; }
.stazione-card h2 a:hover { text-decoration: underline; }
.etichette { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0 0 6px; font-size: 15px; }
.etichette i { margin-right: 5px; }

/* Scheda stazione */
.pagina-top { padding-top: calc(var(--pg-header) + 60px); }
.scheda-foto { width: 100%; }
.scheda-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; }
.scheda-nav a { text-decoration: none; font-weight: 600; }
.scheda-nav a:hover { text-decoration: underline; }
.scheda-numero { font-weight: 600; color: #666; }

/* News */
.griglia-news { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 400px)); justify-content: center; gap: 24px; }
.news-card { display: flex; flex-direction: column; background: var(--pg-bianco); border-radius: 6px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.news-card__img { display: block; aspect-ratio: 16 / 9; background: var(--pg-scuro); overflow: hidden; }
.news-card__img > img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-card__img > img { transform: scale(1.04); }
.news-card__vuota { display: flex; align-items: center; justify-content: center; height: 100%; }
.news-card__vuota img { width: 110px; opacity: .6; }
.news-card__body { flex: 1; display: flex; flex-direction: column; padding: 20px 22px 24px; }
.news-card__body h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.news-card__body h3 a { text-decoration: none; }
.news-card__body h3 a:hover { text-decoration: underline; }
.news-card__body p { font-size: 15px; }
.news-card__meta { font-size: 14px; color: #666; margin-bottom: 8px; }
.news-card__meta a { color: inherit; font-weight: 600; text-decoration: none; }
.news-card__link { margin-top: auto; font-weight: 600; text-decoration: none; }
.news-card__link i { margin-left: 6px; font-size: .85em; }
.news-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: 12px; font-weight: 600; color: #fff; background: #000; border-radius: 3px; }
.news-articolo { max-width: 860px; }
.news-articolo__img { display: block; width: 100%; margin: 24px 0 30px; border-radius: 6px; }
.news-articolo__testo img { max-width: 100%; height: auto; }
.news-galleria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.news-galleria img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; }

/* Testi legali */
.testo-legale h2 { margin-top: 32px; font-size: 26px; font-weight: 600; }
.bozza { padding: 12px 16px; background: var(--pg-campo); border-left: 4px solid #000; }

/* Footer */
.site-footer { color: var(--pg-bianco); background: var(--pg-scuro); }
.site-footer__main { padding: 70px 0 60px; }
.site-footer h2 { font-size: 22px; font-weight: 600; margin-bottom: 22px; }
.site-footer p { margin: 0; font-size: 15px; }
.site-footer b { font-weight: 700; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .social-boxes { justify-content: center; }
.site-footer .social-boxes a:hover { text-decoration: none; }
.site-footer__logo { width: 150px; }
.site-footer__pages { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 20px; list-style: none; margin: 0; padding: 0; font-size: 15px; }
.site-footer__bottom { padding: 16px 20px; font-size: 14px; text-align: center; border-top: 1px solid #5a5a5a; }

/* ---------- Tablet e smartphone ---------- */
@media (max-width: 1024px) {
  .griglia-stazioni { grid-template-columns: repeat(2, 1fr); }
  .sec-title-xl { font-size: 44px; }
  .contatore__n { font-size: 40px; }
  .partner { flex-basis: calc((100% - 48px) / 3); }
  .pull-up { margin-top: 30px; }
  /* Come il sito attuale: tra 768 e 1024px la maschera si allarga (pagine 75%, home 90%) */
  .hero__mask { width: 75%; }
  .hero__veil { left: 75%; }
  .hero--home .hero__mask { width: 90%; }
  .hero--home .hero__veil { left: 90%; }
}
@media (max-width: 767px) {
  body { font-size: 16px; }
  /* Le righe g-5 hanno margini laterali piu' larghi del padding del container: sborderebbero di 12px */
  .row.g-5 { --bs-gutter-x: 1.5rem; }
  /* L'header resta uguale al desktop (logo 120px), come nel sito attuale */
  /* Come il sito attuale: sotto i 768px il video occupa il 70% dell'altezza dello schermo */
  .hero { height: 70vh; height: 70svh; min-height: 0; }
  /* Sotto i 768px la maschera copre tutto il video, allineata a sinistra e tagliata a destra */
  .hero__mask, .hero--home .hero__mask { width: 100%; background-size: cover; background-position: left center; }
  .hero__veil, .hero--home .hero__veil { display: none; }
  .sec, .sec-photo, .sec-dark, .energamma { padding: 64px 0; }
  .sec-title-xl { font-size: 36px; }
  .sec-title-lg { font-size: 32px; }
  .sec-title-md { font-size: 26px; }
  .contatore__n { font-size: 34px; }
  .split { grid-template-columns: 1fr; }
  .split__text { padding: 48px 20px; }
  .split__media, .split--rete .split__media { min-height: 300px; }
  .griglia-stazioni { grid-template-columns: 1fr; padding: 20px 16px 50px; }
  .griglia-news, .news-galleria { grid-template-columns: 1fr; }
  .partner { flex-basis: calc((100% - 24px) / 2); }
  .site-menu__gamma { display: none; }
  .site-menu__panel { flex: 1 1 100%; min-width: 0; padding: 14px 20px 24px; }
  .site-menu__close { margin-right: 0; }
  .site-menu__links { margin-top: 24px; }
  .site-menu__links a { font-size: 32px; }
  .site-footer__main { padding: 50px 0 40px; }
  .site-footer__bottom { font-size: 13px; }
  #mappa { height: 70vh; }
  .scheda-nav { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .flip__in { transition: none; }
}
