/* base.css */

@font-face {
  font-family: "Roboto";
  src: url("../font/roboto-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../font/roboto-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../font/roboto-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1f2933;
  background: #f4f4f1;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: #8f1d21;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

button {
  font: inherit;
}

.home-wrapper {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
  padding: 16px 0 40px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0 0 0 0);
}

@media (min-width: 768px) {
  .home-wrapper {
    width: min(100% - 48px, 1180px);
    padding: 24px 0 56px;
  }
}

/* =========================================================
   MENU
   ========================================================= */

.site-nav-header {
  position: sticky;
  top: var(--site-header-top);
  z-index: 1000;
  margin-bottom: 18px;
  background: #ffffff;
  border: 1px solid #ddd8d2;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.site-nav-header::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 0;
  left: 0;
  z-index: -1;
  height: calc(100% + 8px);
  border-radius: 22px;
  pointer-events: none;
}

.site-nav-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--site-header-height);
  padding: 14px 16px;
}

.site-nav-brand {
  flex: 0 0 auto;
}

.site-nav-brand img {
  width: 88px;
  height: auto;
}

.site-nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #d7d1ca;
  border-radius: 12px;
  background: #ffffff;
  color: #1f2933;
  cursor: pointer;
}

.site-nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 10px;
  background: #1f2933;
}

.site-nav-toggle__label {
  font-size: 12px;
  line-height: 1;
}

.site-nav {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  left: 16px;
  display: none;
  max-height: calc(100vh - 120px);
  padding: 10px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #ddd8d2;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  -webkit-overflow-scrolling: touch;
}

.site-nav.is-open {
  display: flex;
  flex-direction: column;
}

.site-nav > a,
.site-nav-item__link {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  color: #1f2933;
  font-weight: 700;
  line-height: 1.3;
}

.site-nav > a:hover,
.site-nav > a:focus,
.site-nav-item__link:hover,
.site-nav-item__link:focus {
  background: #f6f1ee;
  text-decoration: none;
}

.site-nav-item {
  display: block;
}

.site-nav-item__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav-item__row .site-nav-item__link {
  flex: 1 1 auto;
}

.site-nav-subtoggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid #d7d1ca;
  border-radius: 10px;
  background: #ffffff;
  color: #1f2933;
  cursor: pointer;
}

.site-nav-subtoggle:hover,
.site-nav-subtoggle:focus {
  background: #f6f1ee;
}

.site-nav-subtoggle span {
  display: block;
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.site-nav-subtoggle[aria-expanded="true"] span {
  transform: translateY(-1px) rotate(45deg);
}

.site-nav-submenu {
  display: none;
  margin-top: 6px;
  padding: 10px 12px;
  background: #f8f5f2;
  border: 1px solid #e5dfd9;
  border-radius: 12px;
}

.site-nav-item.is-submenu-open .site-nav-submenu {
  display: block;
}

.site-nav-submenu a {
  display: block;
  width: 100%;
  padding: 8px 10px;
  color: #1f2933 !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}

.site-nav-submenu a + a {
  margin-top: 2px;
}

.site-nav-submenu a:hover,
.site-nav-submenu a:focus {
  background: #ffffff;
  color: #8f1d21 !important;
  text-decoration: none;
}

.site-nav__cta {
  color: #8f1d21 !important;
}

/* Lingue, condivisione e privacy: mobile */
.site-nav-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
  padding: 12px 14px 6px;
  border-top: 1px solid #e5dfd9;
}

.site-nav-languages {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-nav-languages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.site-nav-languages img {
  width: 25px;
  height: 25px;
}

.site-nav-share {
  overflow: hidden;
}

/* Social: mobile, dopo le lingue */
.site-nav-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px 0;
  border-top: 1px solid #e5dfd9;
}

.site-nav-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8f5f2;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-nav-socials a:hover,
.site-nav-socials a:focus {
  background: #f1e9e4;
  text-decoration: none;
  transform: translateY(-2px);
}

.site-nav-socials img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Privacy: mobile, in fondo */
.site-nav-policy {
  margin-top: 10px;
  padding: 10px 14px 6px;
  border-top: 1px solid #e5dfd9;
}

.site-nav-policy a {
  color: #1f2933;
  font-size: 14px;
  font-weight: 500;
}

.site-nav-policy a:hover,
.site-nav-policy a:focus {
  color: #8f1d21;
  text-decoration: none;
}

@media (min-width: 768px) {
  .site-nav-header__inner {
    padding: 16px 20px;
  }

  .site-nav-brand img {
    width: 104px;
  }
}

/* =========================================================
   MENU DESKTOP
   ========================================================= */

@media (min-width: 992px) {
  .site-nav-toggle {
    display: none;
  }

  .site-nav-header__inner {
    justify-content: space-between;
  }

  .site-nav {
    position: static;
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    max-height: none;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .site-nav > a,
  .site-nav-item__link {
    width: auto;
    padding: 10px 12px;
  }

  .site-nav-item {
    position: relative;
    flex: 0 0 auto;
  }

  .site-nav-item__row {
    display: block;
  }

  .site-nav-subtoggle {
    display: none;
  }

  .site-nav-item--has-submenu::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: 10px;
  }

  .site-nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    min-width: 280px;
    margin-top: 0;
    padding: 10px;
    background: #ffffff;
    border: 1px solid #ddd8d2;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
    z-index: 1005;
  }

  .site-nav-submenu a {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .site-nav-item--has-submenu:hover .site-nav-submenu,
  .site-nav-item--has-submenu:focus-within .site-nav-submenu {
    display: block;
  }

  /* Lingue e Sharethis restano sulla riga del menu */
  .site-nav-tools {
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0 0 0 12px;
    border-top: 0;
    border-left: 1px solid #e5dfd9;
	border-right: 1px solid #e5dfd9;
  }

  .site-nav-share {
    max-width: 220px;
  }

  /* Social sulla stessa riga delle voci del menu */
  .site-nav-socials {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .site-nav-socials a {
    width: 32px;
    height: 32px;
  }

  .site-nav-socials img {
    width: 18px;
    height: 18px;
  }

  /* Privacy sotto i social ma sempre dentro il box menu */
  .site-nav-policy {
    flex-basis: 100%;
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 0;
    padding: 0;
    border: 0;
  }

  .site-nav-policy a {
    font-size: 13px;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  margin-top: 28px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #ddd8d2;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
}

.site-footer__inner {
  display: grid;
  gap: 24px;
  padding: 24px 18px;
}

.site-footer__col {
  min-width: 0;
}

.site-footer__brand {
  display: inline-block;
  margin-bottom: 14px;
}

.site-footer__brand img {
  width: 104px;
  height: auto;
}

.site-footer__text {
  max-width: 34ch;
  margin: 0;
  color: #4a5560;
}

.site-footer__title {
  margin: 0 0 12px;
  color: #8f1d21;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer__links,
.site-footer__contacts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links li + li,
.site-footer__contacts li + li {
  margin-top: 8px;
}

.site-footer__links a,
.site-footer__contacts a {
  color: #1f2933;
  font-weight: 500;
}

.site-footer__links a:hover,
.site-footer__links a:focus,
.site-footer__contacts a:hover,
.site-footer__contacts a:focus {
  color: #8f1d21;
  text-decoration: none;
}

.site-footer__contacts li {
  color: #4a5560;
}

.site-footer__contacts li:first-child {
  color: #1f2933;
  font-weight: 700;
}

.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  background: #f8f5f2;
  border-top: 1px solid #e4ddd7;
}

.site-footer__bottom p {
  margin: 0;
  color: #4a5560;
  font-size: 14px;
}

.site-footer__bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer__bottom-links a {
  color: #1f2933;
  font-size: 14px;
  font-weight: 500;
}

.site-footer__bottom-links a:hover,
.site-footer__bottom-links a:focus {
  color: #8f1d21;
  text-decoration: none;
}

@media (min-width: 768px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 28px;
    padding: 28px 24px;
  }

  .site-footer__bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 20px;
  }
}

@media (min-width: 992px) {
  .site-footer {
    margin-top: 34px;
  }

  .site-footer__inner {
    padding: 32px 28px;
  }

  .site-footer__brand img {
    width: 118px;
  }
}

/* =========================================================
   OFFSET HEADER STICKY E ANCORE
   ========================================================= */

:root {
  --site-header-top: 10px;
  --site-header-height: 78px;
  --site-anchor-offset: calc(
    var(--site-header-top) + var(--site-header-height) + 18px
  );
}

html {
  scroll-padding-top: var(--site-anchor-offset);
}

[id] {
  scroll-margin-top: var(--site-anchor-offset);
}

@media (min-width: 768px) {
  :root {
    --site-header-top: 14px;
    --site-header-height: 84px;
    --site-anchor-offset: calc(
      var(--site-header-top) + var(--site-header-height) + 20px
    );
  }
}

@media (min-width: 992px) {
  :root {
    --site-header-height: 88px;
    --site-anchor-offset: calc(
      var(--site-header-top) + var(--site-header-height) + 22px
    );
  }
}

/* =========================================================
   BACK TO TOP
   ========================================================= */

.back-to-top {
  position: fixed;
  right: 17.8%;
  bottom: 18px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: #8f1d21;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d8d1ca;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  text-decoration: none;
  transform: translateY(8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease,
    background-color 0.22s ease,
    color 0.22s ease;
}

.back-to-top:hover,
.back-to-top:focus {
  color: #ffffff;
  background: #8f1d21;
  text-decoration: none;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top span {
  font-size: 20px;
  line-height: 1;
}

@media (max-width: 767px) {
  .back-to-top {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
}

.site-footer__socials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.site-footer__socials img {
  width: 20px;
  height: 20px;
  display: block;
}