/* ================================
   HEADER
   ================================ */
.header {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  height: 700px;
  overflow-x: hidden; /* Evita scroll orizzontale */
}

.template-header-text {
  text-align: center;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  align-self: center;
  color: var(--white);
  position: relative;
  margin: 0 1rem;
}

.template-header-text h1 {
  margin-bottom: 0.15em;
}

.template-header-text span,
.template-text-2 span {
  display: block;
}

.template-header-text h2 {
  color: var(--arthurMurrayYellow);
  font-size: var(--h4);
  font-weight: 500;
  text-transform: uppercase;
  max-width: 250px;
  margin: 0 auto;
  line-height: 1.3em;
}

.header picture {
  grid-column: 1;
  grid-row: 1;
  filter: brightness(.4); /* Oscura l’immagine per migliorare leggibilità testo */
  position: relative;
}

.header picture img {
  margin: 0;
}

/* ================================
   BODY TEMPLATE
   ================================ */
.template-body picture img {
  max-width: 500px;
  margin: 0 auto;
}

.template-body {
  border-top: 1px solid var(--lightblue);
  display: grid;
  grid-template-columns: 1rem 1fr 1rem;
  grid-template-rows: auto;
  background-image: linear-gradient(
      174deg,
      rgba(235,235,235,.8) 0%,
      rgba(235,235,235,.8) 47%,
      var(--arthurMurrayBlue) 47.08%,
      var(--arthurMurrayBlue) 87%,
      var(--lightgray) 87.08%
    ),
    url(../images/FootprintsBackground.svg);
  background-size: cover;
  position: relative;
  text-align: center;
  padding: 3em 0 0;
  grid-row-gap: 1em;
  row-gap: 1em;
}

.template-text-1 {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  color: var(--darkgray);
  justify-self: center;
  max-width: 500px;
}

.template-text-2 {
  color: var(--offwhite);
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  z-index: 3;
  margin: 3em auto 1em;
  text-align: center;
}

.template-text-1 h3 {
  margin-bottom: 0.5em;
}

/* ================================
   VIDEO PLAYER
   ================================ */
.video-player {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  color: var(--white);
  z-index: 3;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 95% 0 0; /* Rapporto per mantenere proporzioni */
  position: relative;
}

.video-player iframe {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 8px;
  max-width: 500px;
  text-align: center;
  display: block;
}

/* ================================
   ANGOLAZIONE DECORATIVA
   ================================ */
.template-angle {
  grid-column: 1 / 4;
  grid-row: 3 / 4;
  position: relative;
  display: grid;
  grid-template-columns: 1rem 1fr 1rem;
  grid-template-rows: auto;
  margin-top: 3em;
}

.template-body picture {
  grid-column: 1 / 4;
  grid-row: 2 / 3;
  color: var(--white);
  margin-bottom: -2em;
  z-index: 0;
  overflow: hidden;
}

.template-text-2 h3 {
  margin: 0 auto 0.5em;
}

.template-body h3 {
  font-weight: 500;
}

.call-to-action p {
  text-align: center;
}

.template-body a {
  color: var(--mediumblue);
  transition: all .4s ease-out;
  text-decoration: none;
}

.template-body a:hover {
  color: var(--arthurMurrayYellow);
  transition: all .4s ease-out;
}

/* ================================
   MEDIA QUERIES
   ================================ */
@media screen and (min-width: 475px) {
  .template-header-text h2 {
    max-width: none;
  }
}

@media screen and (min-width: 615px) {
  .header {
    height: 690px;
  }
  .template-header-text span {
    display: inline-block;
  }
}

@media screen and (min-width: 500px) {
  .video-player {
    padding: 56.25% 0 3em; /* Rapporto 16:9 */
  }
}

@media screen and (min-width: 655px) {
  .template-body {
    background-image: linear-gradient(
        174deg,
        rgba(235,235,235,.8) 0%,
        rgba(235,235,235,.8) 39%,
        var(--arthurMurrayBlue) 39.08%,
        var(--arthurMurrayBlue) 87%,
        var(--lightgray) 87.08%
      ),
      url(../images/FootprintsBackground.svg);
  }
  .template-text-1 {
    max-width: 650px;
  }
  .video-player iframe {
    max-width: 400px;
    margin: 0 auto;
  }
  .template-angle {
    margin-top: 3em;
  }
  .template-text-2 span {
    display: inline;
  }
  .template-text-2 {
    max-width: 650px;
    margin: 1em auto 3em;
  }
}

@media screen and (min-width: 747px) {
  .video-player {
    padding: 35.25% 0 3em; /* Rapporto più panoramico */
  }
}

@media screen and (min-width: 1000px) {
  .template-body {
    grid-template-columns: 1rem 1fr 1fr 1rem;
    background-image: linear-gradient(
        174deg,
        rgba(235,235,235,.8) 0%,
        rgba(235,235,235,.8) 50%,
        var(--arthurMurrayBlue) 50.08%,
        var(--arthurMurrayBlue) 100%
      ),
      url(../images/FootprintsBackground.svg);
    background-size: cover;
    text-align: left;
    -moz-column-gap: 1em;
    column-gap: 1em;
    padding-top: 2em;
  }

  .template-text-1,
  .video-player {
    margin: 2em 0 0;
    max-width: 450px;
  }

  .video-player iframe {
    max-width: 300px;
  }

  .video-player {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    margin: -1em auto 0;
  }

  .template-angle {
    grid-column: 1 / 5;
    grid-row: 2 / 3;
    margin: 0 0 1em;
    gap: 1em;
    grid-template-columns: 1em .9fr 1fr 1em;
  }

  .template-body picture {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
    align-self: center;
    justify-self: right;
    margin-top: auto;
    margin-bottom: -3rem;
    min-width: 500px;
  }

  .template-text-2 {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    text-align: left;
    max-width: 500px;
    margin: 5em auto 0 4em;
  }

  .template-text-2 span {
    display: block;
  }
}

/* ================================
   FEATURE DETECTION
   ================================ */
@supports not (-webkit-touch-callout: none) {
  @media screen and (min-width: 1000px) {
    .header {
      background-attachment: fixed; /* Effetto parallax */
    }
  }
}
