/* #region colors */

:root {
  /* --header-color: #255ee9;

    --button-text-color: #f6f6f6;
    --main-lighter-color: #ffffff;
    --button-primary-color: #f6f6f6;
    --button-secondary-color: #23272a;
    --button-extra-color: #8ea1e1;
    --footer-text-color: #7289da; */

  --main-text-color: #0a0a0a;
  --secondary-text-color: #f6f6f6;
  /* --background-color: #23272a; */
  --background-secondary-color: #1b263b;

  --button-background-color: #415a77;
  --button-text-color: #f6f6f6;
  --hover-button-background-color: #e0e1dd;
  --hover-button-text-color: #1b263b;

  --icon-color: #778da9;
}

/* #endregion colors */

/* #region global styles */
* {
  box-sizing: border-box;
  border: 0px;
  padding: 0;
  margin: 0;
  text-decoration: none;
  font-family: "Roboto", sans-serif;
}

html,
body {
  height: 100%;
}

/* #endregion global styles */

/* #region utility classes */

.highlightv-z {
  position: relative;
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    to bottom,
    #009343 47%,
    var(--secondary-text-color) 0%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.highlightr-z {
  position: relative;
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    to bottom,
    #cf2734 47%,
    var(--secondary-text-color) 0%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.flag {
  aspect-ratio: 16 / 9;
  width: 130px;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
  border: 1px solid black;
  min-width: 130px;
  background: linear-gradient(
    to right,
    #009343 33%,
    #fff 33%,
    #fff 66%,
    #cf2734 0
  );
}

.d-flex {
  display: flex;
}

#background-wrapper {
  background-color: var(--background-secondary-color);
  color: var(--secondary-text-color);
}

.iframe-wrapper {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* #endregion utility classes */

/* #region linkstyling */

.link {
  background-color: var(--button-background-color);
  color: var(--button-text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 7px 12px;
  border-radius: 18px;

  &:hover {
    background-color: var(--hover-button-background-color);
    cursor: pointer;
    color: var(--hover-button-text-color);
  }
}

/* #endregion linkstyling */

/* #region img-text-section */

.img-text-section {
  padding: 1rem;
  justify-content: center;
  align-items: center;

  .img-text-container {
    flex-direction: column;

    .img-container {
      height: 20vh;
      padding: 0.5rem;
      justify-content: center;
      flex-basis: 0;
      flex-grow: 2;

      img {
        height: 100%;
        max-width: 100%;
        object-fit: cover;
        align-items: center;
        border-radius: 25px;
        box-shadow: rgba(0, 0, 0, 0.56) 0px 22px 70px 4px;
        transition: transform 0.4s;

        &:hover {
          transform: scale(1.1);
          cursor: pointer;
        }
      }
    }

    .text-container {
      flex-direction: column;
      flex-basis: 0;
      flex-grow: 3;
      justify-content: start;

      .section-title {
        padding-top: 1rem;
        justify-content: center;
        align-items: center;

        i {
          color: var(--icon-color);
          padding-right: 10px;
        }
      }
    }

    span {
      padding: 0.5rem;
      text-align: center;
    }
  }
}

/* #endregion img-text-section */

header {
  background-color: var(--background-secondary-color);
  height: auto;
  padding: 0.5rem 0;
  flex-direction: column;
  color: var(--secondary-text-color);
  gap: 0.5rem;

  #left-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 0.75rem;
    height: clamp(64px, 10vh, 92px);

    .flag {
      display: none;
    }

    #logo-container {
      height: 100%;
      display: flex;
      align-items: center;

      #logo {
        border-radius: 0.25rem;
        height: 100%;
        max-height: 100%;
        width: auto;
        display: block;
      }
    }
  }

  #site-title {
    text-align: center;
    padding: 0 0.75rem;
    line-height: 1.1;
    color: inherit;
  }

  nav {
    padding: 0.5rem 0.75rem 0.75rem;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
}

main {
  #hero {
    overflow: hidden;
    width: 100%;

    img {
      width: 100%;
      height: 100%;
      object-fit: scale-down;
      transform: scale(1.2);
    }
  }

  #about-us {
    padding: 10px;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;

    span {
      text-align: center;
    }
  }

  #servizi {
    padding-top: 1rem;
    text-align: center;
    font-size: xx-large;
    color: inherit;
  }

  #convenzioni-section {
    flex-direction: column;
    justify-content: center;
    background-color: #415a77;
    width: 100%;
    height: 40vh;
    padding: 3rem 0;
    color: #e0e1dd;

    h2 {
      text-align: center;
    }

    .convenzioni-carousel {
      padding: 1rem 0;
      width: 100%;
      overflow: hidden;
      user-select: none;
      touch-action: pan-y;
      cursor: grab;

      &.is-dragging {
        cursor: grabbing;
      }

      #convenzioni-track {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;

        gap: clamp(8px, 1.2vw, 18px);
        width: max-content;
        will-change: transform;

        .convenzione {
          flex: 0 0 auto;
          margin: 0% 0.6%;

          box-sizing: border-box;
          width: clamp(140px, 18vw, 220px);

          padding: 1rem;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;

          text-decoration: none;
          color: inherit;
          border-radius: 12px;
          background: rgba(255, 255, 255, 0.06);
          backdrop-filter: blur(2px);

          .convenzione-img-wrapper {
            width: 100%;
            display: flex;
            justify-content: center;

            img {
              max-width: 90%;
              height: 5vh;
              max-height: none;
              object-fit: contain;
              -webkit-user-drag: none;
              user-select: none;

              -webkit-box-shadow: 10px 10px 50px 5px rgba(0, 0, 0, 0.8);
              box-shadow: 10px 10px 50px 5px rgba(0, 0, 0, 0.473);
              transition: transform 0.4s;

              &:hover {
                transform: scale(1.08);
                cursor: pointer;
              }
            }
          }

          .convenzione-title {
            width: 100%;
            text-align: center;
            margin-top: 8px;

            h4 {
              font-size: 1rem;
              margin: 0;
            }
          }
        }
      }
    }
  }
}

footer {
  padding: 2rem 0;
  flex-direction: column;
  background-color: var(--background-secondary-color);
  justify-content: space-around;
  color: var(--secondary-text-color);

  .footer-section {
    .section-title {
      margin: 0.5rem 0;
      text-align: center;
    }

    .section-list {
      text-align: center;

      ul {
        list-style: none;
        padding-bottom: 0.5rem;

        li {
          a {
            color: inherit;
          }
        }
      }
    }
  }

  #info-wrapper {
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;

    #contacts {
      ul {
        gap: 0.25rem;
        flex-direction: column;
      }
    }

    #info-orari {
      ul {
        gap: 0.25rem;
        flex-direction: column;
        align-items: end;

        /* hack to keep saturday aligned to the others, simply kept the same text but hid the extra part */

        li:nth-child(6) {
          span {
            color: var(--background-secondary-color);
          }
        }

        li:nth-child(7) {
          align-self: center;
        }
      }
    }
  }
}

/* #region mediaqueries */

@media (min-width: 500px) {
  .link {
    font-size: larger;
    padding: 7px 12px;
  }

  .img-text-section {
    .img-text-container {
      flex-direction: row;

      span {
        align-self: center;
      }
    }

    &:nth-of-type(even) {
      .img-text-container {
        flex-direction: row-reverse;
      }
    }
  }
}

@media (min-width: 768px) {
  header {
    padding: 0.75rem 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    #left-container {
      padding: 0;
      justify-content: flex-start;

      #site-title {
        padding: 0;
      }
    }

    nav {
      padding: 0;
      justify-content: flex-end;
      gap: 1rem;
      flex-wrap: nowrap;
    }
  }

  main {
    #about-us {
      h2 {
        padding-top: 1rem;
        font-size: 2.5rem;
      }

      span {
        font-size: 1rem;
        padding: 0 3rem;
        padding-bottom: 2rem;
      }
    }

    #servizi {
      font-size: 3rem;
    }
  }

  .img-text-section {
    .img-text-container {
      .img-container {
        height: 30vh;
      }

      .text-container {
        .section-title {
          h3 {
            font-size: 2rem;
          }
        }

        span {
          font-size: 1.25rem;
        }
      }
    }
  }
}

@media (min-width: 1024px) {
  header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.9rem 1.2rem;
    column-gap: 1rem;

    #left-container {
      justify-self: start;

      .flag {
        display: block;
      }
    }

    #site-title {
      justify-self: center;
      text-align: center;
      margin: 0;
      white-space: nowrap;
    }

    nav {
      justify-self: end;
      justify-content: flex-end;
    }
  }

  main {
    #servizi {
      font-size: 4rem;
    }
  }

  .img-text-section {
    .img-text-container {
      .img-container {
        height: 30vh;
      }
    }
  }
}

@media (min-width: 1280px) {
  header {
    #site-title {
      font-size: 3rem;
    }

    nav {
      font-size: larger;
    }
  }

  main {
    #servizi {
      font-size: 5rem;
    }
  }

  #background-wrapper {
    display: flex;
    flex-direction: column;
  }

  .img-text-section {
    padding-bottom: 10rem;
    width: 60%;
    margin: auto;

    .img-text-container {
      .img-container {
        height: 30vh;
      }

      .text-container {
        padding: 1rem;
      }
    }
  }
}

@media (min-width: 1440px) {
  header {
    #site-title {
      font-size: 3rem;
    }

    nav {
      font-size: larger;
    }
  }

  main {
    #servizi {
      font-size: 5rem;
    }
  }

  .img-text-section {
    padding-bottom: 10rem;
    width: 60%;
    margin: auto;

    .img-text-container {
      .img-container {
        height: 30vh;
      }
    }
  }
}

/* #endregion mediaqueries */

/* #region keyframes */
@keyframes slide-from-left {
  from {
    transform: translateX(-200%);
  }

  to {
    transform: translateX(0%);
  }
}

@keyframes slide-from-right {
  from {
    transform: translateX(+200%);
  }

  to {
    transform: translateX(0%);
  }
}

.img-text-section {
  opacity: 0;
}

.img-text-section:nth-of-type(even).in-view {
  animation: slide-from-left ease 1s;
  opacity: 1;
}

.img-text-section:nth-of-type(odd).in-view {
  animation: slide-from-right ease 1s;
  opacity: 1;
}

/* #endregion keyframes */
