/*
 * Landing page prodotti Alest (eDocendo, eMmobiliare).
 * File condiviso: deve restare identico in edocendo.it/ e emmobiliare.it/.
 * I colori di ciascun prodotto sono in .theme-edocendo / .theme-emmobiliare.
 */

/* ---------- Font (self-hosted, sottoinsieme latin, variable) ---------- */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../fonts/roboto-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Temi ---------- */
:root {
  --white: #fff;
  --grey-light: #ece9e9;
  --grey-dark: #54595f;
  --text-muted: #7a7a7a;
  --header-height: 60px;
  --container: 1140px;
  --font-main: "Montserrat", system-ui, sans-serif;
  --font-alt: "Nunito Sans", system-ui, sans-serif;
  --font-button: "Roboto", system-ui, sans-serif;
}

.theme-edocendo {
  --blue: #1da6df;
  --green: #4ac938;
  --hero-overlay: rgb(29 166 223 / 0.42);
  --idea-bg: linear-gradient(340deg, var(--green) 0%, var(--blue) 100%);
  --idea-shape: var(--green);
  --idea-title: var(--white);
  --features-title: var(--blue);
  --card-a: rgb(29 166 223 / 0.78);
  --card-b: rgb(74 201 56 / 0.75);
  --highlight-title: #2b7f20; /* verde del marchio scurito: contrasto 5:1 su bianco */
  --highlight-icon: var(--blue);
  --cta-overlay: linear-gradient(90deg, rgb(74 201 56 / 0.72) 0%, rgb(29 166 223 / 0.72) 100%);
  --social-icon: var(--green);
}

.theme-emmobiliare {
  --navy: #1a3a5c;
  --yellow: #fbb307;
  --hero-overlay: rgb(251 179 7 / 0.42);
  --idea-bg: var(--navy);
  --idea-shape: var(--navy);
  --idea-title: var(--yellow);
  --features-title: var(--yellow);
  --card-a: rgb(251 179 7 / 0.66);
  --card-b: rgb(26 58 92 / 0.8);
  --highlight-title: var(--navy);
  --highlight-icon: var(--yellow);
  --cta-overlay: linear-gradient(200deg, var(--navy) 39%, var(--yellow) 100%);
  --social-icon: var(--yellow);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--white);
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.section-title {
  font-size: 35px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.9px;
  text-align: center;
  color: var(--white);
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 3px solid var(--white);
  font-family: var(--font-button);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  background: transparent;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover,
.btn:focus-visible {
  background: var(--white);
  color: var(--grey-dark);
}

.btn:focus-visible,
.site-header a:focus-visible,
.social a:focus-visible {
  outline: 3px solid var(--grey-dark);
  outline-offset: 3px;
}

/* ---------- Divisori (onde/inclinazioni) ---------- */
.shape {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  pointer-events: none;
  z-index: 2;
}

.shape svg {
  width: calc(100% + 1.3px);
  max-width: none;
  height: 100%;
}

.shape path {
  fill: currentColor;
}

.shape--top {
  top: -1px;
}

.shape--bottom {
  bottom: -1px;
  transform: rotate(180deg);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--header-height);
  background: var(--white);
  box-shadow: -1px 2px 15px rgb(0 0 0 / 0.5);
  animation: fade-in-down 0.8s ease both;
}

.site-header img {
  height: 40px;
  width: auto;
}

/* ---------- Slideshow di sfondo ---------- */
.slideshow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.slideshow img.is-active,
.slideshow:not(.is-ready) img:first-child {
  opacity: 1; /* la prima immagine è visibile subito, anche senza JS */
}

.slideshow--kenburns img {
  transform: scale(1);
  transform-origin: center;
}

.slideshow--kenburns img.is-active {
  transform: scale(1.3);
  transition: opacity 0.5s ease, transform var(--slide-duration, 7s) linear;
}

/* L'immagine uscente resta ingrandita mentre svanisce, poi main.js la resetta. */
.slideshow--kenburns img.is-prev {
  transform: scale(1.3);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 648px;
  padding: 40px clamp(20px, 7vw, 110px);
  overflow: hidden;
  isolation: isolate;
  animation: fade-in-up 1.25s ease both;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--hero-overlay);
}

.hero__mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 0% 100%;
}

.hero__title {
  position: relative;
  z-index: 3;
  max-width: 720px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.16;
  color: var(--white);
  text-align: right;
}

.hero__title span {
  display: block;
  margin-top: 1.16em;
}

/* ---------- L'idea ---------- */
.idea {
  position: relative;
  padding: 107px 0 140px;
  background: var(--idea-bg);
  color: var(--white);
  text-align: center;
}

.idea .shape--top {
  height: 44px;
  color: var(--idea-shape);
}

.idea .shape--bottom {
  height: 137px;
  color: var(--white);
}

.idea .section-title {
  color: var(--idea-title);
}

.idea__text {
  max-width: 1000px;
  margin: 20px auto 0;
  font-size: 17px;
  line-height: 1.5;
}

.idea__text p + p {
  margin-top: 0.9em;
}

/* ---------- Funzionalità ---------- */
.features {
  padding: 30px 0 64px;
}

.features .section-title {
  color: var(--features-title);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 54px auto 0;
  padding: 0;
  list-style: none;
}

.feature-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  min-height: 250px;
  padding: 27px;
  overflow: hidden;
  color: var(--white);
  isolation: isolate;
}

.card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--card-a);
}

.card--b::before {
  background: var(--card-b);
}

.card h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.card h3,
.card p,
.card ul {
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.35); /* leggibilità del bianco sulle foto */
}

.card p {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.75;
}

.card ul {
  margin: 0.2em 0 0;
  padding: 0;
  list-style: none;
  line-height: 1.4;
}

.card ul li::before {
  content: "- ";
}

/* ---------- Punti di forza ---------- */
.highlights {
  padding: 20px 0 77px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.highlight {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 10px;
  text-align: center;
}

.highlight__icon {
  width: 50px;
  color: var(--highlight-icon);
}

.highlight__icon--lg {
  width: 64px;
}

.highlight__icon svg {
  width: 100%;
  height: auto;
  fill: currentColor;
}

.highlight h3 {
  font-family: var(--font-alt);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--highlight-title);
}

.highlight p {
  max-width: 340px;
  font-family: var(--font-alt);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  color: #616161; /* contrasto AA su bianco */
}

.gdpr {
  margin: 77px auto 0;
  width: 283px;
  height: auto;
}

/* ---------- Contatti (CTA) ---------- */
.cta {
  position: relative;
  padding: 160px 0;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  isolation: isolate;
}

.cta .slideshow {
  z-index: -2;
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cta-overlay);
}

.cta .shape--top {
  height: 73px;
  color: var(--white);
}

.cta__text {
  margin: 20px 0;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.6;
}

/* ---------- Brochure ---------- */
.brochure {
  padding: 120px 0 156px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(0deg, #4ac938 45%, #1da6df 100%);
}

.brochure .section-title {
  font-size: 36px;
  text-transform: uppercase;
}

.brochure__text {
  margin: 20px 0;
  font-size: 25px;
  line-height: 1.16;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  padding: 30px 20px 64px;
  text-align: center;
  background: var(--grey-light);
  overflow: hidden;
  isolation: isolate;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/footer-watermark.png") no-repeat -800px -215px;
  opacity: 0.05;
}

.site-footer .shape--bottom {
  height: 44px;
  color: var(--grey-dark);
}

.site-footer address {
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
  color: var(--grey-dark);
}

.site-footer address strong {
  font-weight: 800;
}

.site-footer address a {
  display: inline-block;
  padding: 5px 0; /* area di tocco di almeno 24px */
  text-decoration: none;
}

.social {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--white);
  color: var(--social-icon);
  transition: background-color 0.2s;
}

.social a:hover {
  background: var(--grey-dark);
}

.social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.footer-bar {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  color: var(--white);
  background: var(--grey-dark);
}

/* ---------- Animazioni all'ingresso nel viewport ---------- */
@keyframes fade-in-down {
  from { opacity: 0; transform: translate3d(0, -100%, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translate3d(0, 100%, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translate3d(-100%, 0, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in-right {
  from { opacity: 0; transform: translate3d(100%, 0, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Gli elementi restano visibili se JS è disattivato: li nasconde solo main.js. */
.js [data-reveal] {
  opacity: 0;
}

.js [data-reveal].is-visible {
  animation: 1.25s ease both;
}

.js [data-reveal="left"].is-visible { animation-name: fade-in-left; }
.js [data-reveal="right"].is-visible { animation-name: fade-in-right; }
.js [data-reveal="fade"].is-visible { animation-name: fade-in; }

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header,
  .hero,
  .js [data-reveal].is-visible {
    animation: none;
  }

  .js [data-reveal] {
    opacity: 1;
  }

  .slideshow--kenburns img.is-active {
    transform: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .section-title {
    font-size: 27px;
    line-height: 1.4;
  }

  .hero {
    justify-content: center;
    min-height: 330px;
  }

  .hero__title {
    font-size: 22px;
    text-align: center;
  }

  .hero__title span {
    margin-top: 0.4em;
  }

  .idea {
    padding: 70px 0 120px;
  }

  .idea .shape--bottom {
    height: 60px;
  }

  .feature-grid,
  .feature-grid--3,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    margin-top: 30px;
  }

  .card {
    min-height: 0;
    padding: 37px 27px;
  }

  .cta {
    padding: 100px 0 80px;
  }

  .cta__text {
    font-size: 20px;
  }

  .brochure .section-title {
    font-size: 27px;
  }
}
