/* K.S.I. Kaldofreddo Service — stili globali sito (home + interne) */

:root {
  --ksi-primary: #003366;
  --ksi-secondary: #00a8e8;
  --ksi-accent: #ff4d00;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --section-pad-y: clamp(5.5rem, 10vw, 9rem);
}

/* Nessuno scroll animato sulle ancore; offset per header fisso */
html {
  scroll-behavior: auto !important;
  scroll-padding-top: 6.5rem;
  overflow-x: clip;
}

/* index.html: evita flash dell'hero al caricamento con ancoraggio (#recensioni, ecc.) */
html[data-ksi-hash-load] body {
  opacity: 0;
}

body {
  font-family: "Montserrat", sans-serif;
  min-width: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
.hero-title,
.chi-siamo-hero-title,
.secondary-hero-inner h1 {
  font-family: "Montserrat", sans-serif;
}

/* Badge hero index: una sola riga anche su mobile */
.index-hero-badge {
  white-space: nowrap;
}

/* CTA finali index / chi siamo: gradiente a tutta larghezza */
.ksi-cta-full {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #003366 0%, #004a8c 50%, #00264d 100%);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(0, 168, 232, 0.06), transparent 58%),
    linear-gradient(180deg, transparent 0%, rgba(0, 26, 51, 0.14) 100%);
  z-index: 0;
}

.hero-bg > * {
  position: relative;
  z-index: 1;
}

/* CTA / bottoni accent (classi Tailwind bg-orange sul markup) */
a.bg-orange,
button.bg-orange,
input[type="button"].bg-orange,
input[type="submit"].bg-orange {
  background: linear-gradient(180deg, #ff6a33 0%, var(--ksi-accent) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 18px rgba(255, 77, 0, 0.35);
}

[class*="bg-orange/"] {
  box-shadow: 0 0 0 1px rgba(255, 200, 170, 0.25), 0 0 16px rgba(255, 77, 0, 0.22);
}

a.bg-orange:hover,
button.bg-orange:hover,
input[type="button"].bg-orange:hover,
input[type="submit"].bg-orange:hover {
  background: linear-gradient(180deg, #ff8f5c 0%, #ff6a33 100%) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32), 0 0 24px rgba(255, 77, 0, 0.45);
}

.hero-title .text-orange {
  background: linear-gradient(135deg, var(--ksi-secondary) 0%, #66d4f5 50%, var(--ksi-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Titolo principale hero: ombra per leggibilità */
.hero-bg .hero-title {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 14px rgba(0, 0, 0, 0.32), 0 4px 28px rgba(0, 0, 0, 0.18);
}

.hero-bg .hero-title .text-orange {
  text-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.52)) drop-shadow(0 3px 10px rgba(0, 0, 0, 0.36));
}

.hero-bg .max-w-4xl > p,
.hero-bg .index-hero-lead {
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.3);
}

.hero-bg .index-hero-highlights {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.32);
}

/* Index — testo hero sulla foto */
.hero-bg .index-hero-title {
  font-weight: 700;
  font-size: clamp(1.6875rem, 5.2vw + 0.35rem, 2.375rem);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.hero-bg .index-hero-lead {
  font-weight: 500;
  font-size: clamp(0.9375rem, 2.4vw + 0.5rem, 1.0625rem);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

@media (min-width: 1024px) {
  .hero-bg .index-hero-title {
    font-size: clamp(2.75rem, 3.45vw + 1rem, 4.25rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
  }

  .hero-bg .index-hero-lead {
    font-size: clamp(1.0625rem, 0.55vw + 0.85rem, 1.25rem);
    line-height: 1.72;
    max-width: 38rem;
  }
}

.hero-bg {
  background-image: linear-gradient(115deg, rgba(0, 51, 102, 0.16), rgba(11, 25, 41, 0.1)),
    url("../immagini/hero-ksi.jpg");
  background-size: cover;
  background-position: center;
}

@media (min-width: 1024px) {
  .hero-bg {
    background-image: linear-gradient(115deg, rgba(0, 51, 102, 0.12), rgba(11, 25, 41, 0.08)),
      url("../immagini/hero-ksi.jpg");
  }
}

/* Home hero (solo .hero-bg su index): armonia blocchi su desktop */
@media (min-width: 1024px) {
  section.hero-bg > div:first-of-type {
    padding-top: 2.875rem;
    padding-bottom: max(5.5rem, 9svh);
  }

  .hero-bg .max-w-4xl > div:first-of-type {
    margin-bottom: 1.375rem;
  }

  .hero-bg .hero-title {
    letter-spacing: -0.03em;
    line-height: 1.06;
  }

  .hero-bg .max-w-4xl > p,
  .hero-bg .max-w-4xl > .index-hero-lead {
    margin-top: 1.5rem;
    max-width: 36rem;
  }

  .hero-bg .max-w-4xl > div.flex {
    margin-top: 1.875rem;
    gap: 1.125rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .hero-bg {
    background-image: linear-gradient(115deg, rgba(0, 51, 102, 0.2), rgba(11, 25, 41, 0.14)),
      url("../immagini/hero-mobile.jpg");
    background-position: center;
    background-size: cover;
  }

  #site-header {
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #site-header.glass-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body:not(.bg-concrete):not(.bg-white) #site-header:not(.nav-scrolled) {
    background: transparent !important;
  }

  body.bg-concrete #site-header:not(.nav-scrolled),
  body.bg-white #site-header:not(.nav-scrolled) {
    background: rgba(255, 255, 255, 0.96) !important;
  }

  body:not(.bg-concrete) #site-header.nav-scrolled {
    box-shadow: none !important;
    border-bottom: none !important;
  }

  body.bg-concrete #site-header,
  body.bg-white #site-header {
    border-bottom: none !important;
    box-shadow: none !important;
  }

  body.bg-concrete #site-header.nav-scrolled,
  body.bg-white #site-header.nav-scrolled {
    box-shadow: none !important;
    border-bottom: none !important;
  }

  #site-header > div:first-child {
    padding-top: 15px;
    padding-bottom: 15px;
    align-items: center;
  }

  #site-header .navbar-brand-svg {
    height: 68px;
    width: auto;
  }

  #site-header #mobile-menu-button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    color: inherit;
  }

  #site-header:not(.nav-scrolled) #mobile-menu-button {
    color: #fff !important;
  }

  #site-header #mobile-menu-button svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  #site-header #mobile-menu-button svg * {
    stroke-width: 1.35px;
  }

  #site-header.nav-scrolled #mobile-menu-button {
    border: none !important;
    color: #1a2b4c !important;
  }

  /* Index — hero area sopra la foto (solo mobile) */
  section.hero-bg > div:first-of-type {
    padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
    padding-top: max(2.5rem, 5.5svh);
    padding-bottom: 2rem;
  }

  .hero-bg .max-w-4xl {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
  }

  .hero-bg .index-hero-badge {
    align-self: center;
    margin: 0 auto 1.25rem;
    max-width: 100%;
    padding: 0.3125rem 0.625rem;
    gap: 0.375rem;
    font-size: clamp(0.75rem, 2.8vw, 0.8125rem);
    line-height: 1.2;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .hero-bg .index-hero-badge > span.relative.flex {
    height: 0.5rem;
    width: 0.5rem;
    flex-shrink: 0;
  }

  .hero-bg .index-hero-badge > span.relative.flex .h-3,
  .hero-bg .index-hero-badge > span.relative.flex .w-3 {
    height: 0.5rem;
    width: 0.5rem;
  }

  .hero-bg .index-hero-title {
    margin-bottom: 2rem;
    font-size: clamp(2rem, 6.5vw, 2.125rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
  }

  .hero-bg .index-hero-lead {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
  }

  .hero-bg .index-hero-ctas {
    margin-top: 2.5rem;
    gap: 0.9375rem;
  }

  .hero-bg .index-hero-ctas a {
    min-height: 2.625rem;
    padding: 0.5625rem 1.125rem;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
  }

  .hero-bg .index-hero-ctas a i {
    height: 0.875rem;
    width: 0.875rem;
  }

  .hero-bg .index-hero-highlights {
    margin-top: 2.5rem;
    gap: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.4;
  }
}

.glass-header {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#site-header {
  z-index: 100;
  isolation: isolate;
}

#site-header > div:first-child {
  position: relative;
  z-index: 1;
}

#site-header #mobile-menu-button {
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  min-height: 44px;
  min-width: 44px;
}

#site-header #mobile-menu-button svg {
  pointer-events: none;
}

/* Navbar leggibile su sezioni chiare: dopo scroll */
#site-header {
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

#site-header.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: rgba(26, 43, 76, 0.12) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

#site-header.nav-scrolled #mobile-menu-button {
  color: #1a2b4c !important;
  border-color: rgba(26, 43, 76, 0.28) !important;
}

#site-header.nav-scrolled #mobile-menu-button:hover {
  border-color: rgba(0, 168, 232, 0.55) !important;
  color: var(--ksi-secondary) !important;
}

#site-header.nav-scrolled > div:first-child nav a:not(.bg-orange) {
  color: #1a2b4c !important;
}

#site-header.nav-scrolled > div:first-child nav a:not(.bg-orange):hover {
  color: var(--ksi-secondary) !important;
}

#site-header.nav-scrolled > div:first-child nav a.text-ice {
  color: var(--ksi-secondary) !important;
}

#site-header.nav-scrolled > div:first-child nav a.text-ice:hover {
  color: #003366 !important;
}

/* Logo header: SVG inline — K.S.I. / KALDOFREDDO con currentColor; fiocco e fiamma a gradiente */
#site-header .navbar-brand {
  transition: color 0.35s ease;
}

#site-header:not(.nav-scrolled) .navbar-brand {
  color: #fff;
}

body:not(.bg-concrete) #site-header.nav-scrolled .navbar-brand {
  color: #082b67;
}

body.bg-concrete #site-header .navbar-brand,
body.bg-white #site-header .navbar-brand {
  color: #082b67;
}

body.bg-white #site-header.nav-scrolled,
body.bg-white #site-header:not(.nav-scrolled) {
  background-color: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: rgba(26, 43, 76, 0.12) !important;
}

body.bg-white #site-header > div:first-child nav a:not(.bg-orange) {
  color: #1a2b4c !important;
}

body.bg-white #site-header > div:first-child nav a.text-ice {
  color: var(--ksi-secondary) !important;
}

body.bg-white #site-header #mobile-menu-button {
  color: #1a2b4c !important;
  border-color: rgba(26, 43, 76, 0.28) !important;
}

/* Menu mobile: voci comode, CTA a tutta larghezza */
#mobile-menu.ksi-mobile-panel {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
  border-bottom-left-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
}

#mobile-menu.ksi-mobile-panel .ksi-mobile-nav > a:not(.ksi-mobile-nav-cta) {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
}

#mobile-menu.ksi-mobile-panel .ksi-mobile-nav > a:not(.ksi-mobile-nav-cta):hover,
#mobile-menu.ksi-mobile-panel .ksi-mobile-nav > a:not(.ksi-mobile-nav-cta):focus-visible {
  background-color: rgba(255, 255, 255, 0.07);
  outline: none;
}

#mobile-menu.ksi-mobile-panel .ksi-mobile-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-top: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html.ksi-cert-lightbox-open #site-header {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Loghi partner: sempre a colori, leggermente più grandi, cliccabili */
button.partner-logo-tile {
  display: flex;
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  -webkit-tap-highlight-color: transparent;
}

button.partner-logo-tile:focus-visible {
  outline: 2px solid var(--ksi-secondary);
  outline-offset: 3px;
}

.partner-logo-tile .partner-logo-img {
  filter: none;
  opacity: 1;
  width: auto;
  height: auto;
  max-height: 4.25rem;
  max-width: min(92%, 11.25rem);
  object-fit: contain;
  pointer-events: none;
}

@media (min-width: 768px) {
  .partner-logo-tile .partner-logo-img {
    max-height: 5rem;
    max-width: min(92%, 12.75rem);
  }
}

/* Lightbox logo partner */
.partner-logo-lightbox {
  align-items: center;
  justify-content: center;
  background: rgba(5, 26, 46, 0.94);
  padding: 1.5rem;
}

.partner-logo-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  transition: background-color 0.25s ease;
}

.partner-logo-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

#partner-logo-lightbox-image {
  max-height: min(85vh, 520px);
  max-width: min(92vw, 640px);
  width: auto;
  height: auto;
  object-fit: contain;
}

html.ksi-partner-lightbox-open #site-header {
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.map-industrial {
  filter: grayscale(100%) invert(90%) contrast(95%) brightness(95%);
}

.text-gradient {
  background: linear-gradient(90deg, #ffffff 0%, var(--ksi-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.secondary-hero-bg {
  background-image: linear-gradient(rgba(0, 26, 51, 0.38), rgba(0, 38, 77, 0.28)), url("../immagini/hero-secondary.jpg");
  background-size: cover;
  background-position: center;
}

@media (min-width: 1024px) {
  .secondary-hero-bg {
    background-image: linear-gradient(rgba(0, 26, 51, 0.32), rgba(0, 38, 77, 0.22)), url("../immagini/hero-secondary.jpg");
  }
}

@media (max-width: 768px) {
  .secondary-hero-bg {
    background-image: linear-gradient(rgba(0, 26, 51, 0.44), rgba(0, 38, 77, 0.32)), url("../immagini/hero-secondary2.jpg");
  }
}

/* Hero interne uniformi (Chi Siamo, Servizi, Contatti, Galleria): 65vh, testo calibrato */
.secondary-hero-bg.secondary-hero-bg--compact {
  min-height: 65vh;
  min-height: 65svh;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding-top: max(4.75rem, calc(env(safe-area-inset-top, 0px) + 3.25rem));
  padding-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .secondary-hero-bg.secondary-hero-bg--compact {
    padding-top: max(5.5rem, calc(env(safe-area-inset-top, 0px) + 3.75rem));
    padding-bottom: 2.25rem;
  }
}

.secondary-hero-bg--compact .secondary-hero-inner {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.secondary-hero-bg--compact .secondary-hero-inner h1 {
  font-size: clamp(1.875rem, 2.8vw + 1rem, 3.5rem);
  line-height: 1.12;
  font-weight: 700;
}

/* Desktop: solo titolo hero pagine interne (foto e sottotitolo invariati) */
@media (min-width: 1024px) {
  .secondary-hero-bg--compact .secondary-hero-inner h1 {
    font-size: clamp(1.9375rem, 2.95vw + 1.05rem, 3.875rem);
  }
}

.secondary-hero-bg--compact .secondary-hero-inner > p {
  margin-top: 1rem;
  font-size: 1.2rem;
  line-height: 1.65;
}

@media (min-width: 768px) {
  .secondary-hero-bg--compact .secondary-hero-inner > p {
    margin-top: 1.125rem;
  }
}

.service-image {
  border: 1px solid rgba(0, 168, 232, 0.45);
}

.luxury-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.luxury-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 22px 46px rgba(17, 24, 39, 0.15);
}

/* Barra cookie K.S.I. */
#cookie-banner {
  background: linear-gradient(180deg, rgba(0, 51, 102, 0.97) 0%, rgba(0, 38, 77, 0.98) 100%) !important;
  border-color: rgba(0, 168, 232, 0.35) !important;
}

#cookie-banner #accept-cookies {
  background: linear-gradient(180deg, #1ad0ff 0%, var(--ksi-secondary) 100%) !important;
  color: #041a2e !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

#cookie-banner #accept-cookies:hover {
  filter: brightness(1.08);
}

@media (max-width: 768px) {
  .lw-lightbox,
  .lightwidget-lightbox,
  .lightbox,
  [class*="lightbox"] {
    padding: 0 !important;
  }

  .lw-lightbox img,
  .lightwidget-lightbox img,
  .lightbox img,
  [class*="lightbox"] img {
    width: 95vw !important;
    max-width: 95vw !important;
    height: auto !important;
    margin: 0 auto !important;
  }
}

/* --- Pagina Chi Siamo (K.S.I.) --- */
.secondary-hero-bg .chi-siamo-hero-title {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Privacy / Cookie: titolo documento leggermente più grande su desktop (sopra le utility Tailwind) */
@media (min-width: 1024px) {
  main.max-w-5xl.pb-24 article.rounded-2xl > h1:first-of-type {
    font-size: 3.25rem !important;
    line-height: 1.08 !important;
  }
}

.secondary-hero-bg .chi-siamo-hero-lead {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.28);
}

.chi-siamo-photo-frame {
  box-shadow: 0 24px 50px -12px rgba(0, 51, 102, 0.22);
}

.chi-siamo-photo {
  display: block;
}

.map-ksi-embed {
  filter: grayscale(12%) contrast(1.02) saturate(0.95);
}

