/*
  Header e footer nativi CRAL
  Stile moderno, pulito e responsive.
*/

:root {
  --cral-blue: #0053a1;
  --cral-light: #e9f8ff;
  --cral-text: #24465c;
  --cral-border: #b9def3;
  --cral-shadow: 0 14px 34px rgba(0, 83, 161, .14);
}

html,
body {
  overflow-x: hidden;
}

.cral-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(245, 252, 255, .98), rgba(255, 255, 255, .96));
  border-bottom: 1px solid rgba(185, 222, 243, .75);
  box-shadow: 0 8px 24px rgba(0, 83, 161, .08);
  backdrop-filter: blur(10px);
}

.cral-header-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.cral-brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(0, 83, 161, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 22px rgba(0, 83, 161, .10);
}

.cral-brand__link,
.cral-brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  outline-offset: 4px;
}

.cral-brand img,
.cral-brand .custom-logo {
  width: auto;
  max-width: 154px;
  max-height: 58px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.cral-brand__name {
  color: var(--cral-blue);
  font-size: 22px;
  font-weight: 800;
}

.cral-navigation {
  flex: 1 1 auto;
}

.cral-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cral-menu li {
  margin: 0;
}

.cral-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--cral-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.cral-menu a:hover,
.cral-menu a:focus {
  background: var(--cral-blue);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 83, 161, .16);
}

.cral-header-social {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.cral-header-social__link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(0, 83, 161, .15);
  box-shadow: 0 8px 18px rgba(0, 83, 161, .10);
  color: var(--cral-blue);
  text-decoration: none;
  transition: background-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}

.cral-header-social__link svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

.cral-header-social__link:hover,
.cral-header-social__link:focus {
  background: var(--cral-blue);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 83, 161, .20);
}

.cral-menu-toggle {
  display: none !important;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--cral-border);
  border-radius: 999px;
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.cral-menu-toggle__bar {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--cral-blue);
  transition: transform .22s ease, opacity .22s ease;
}

.cral-site-header.is-open .cral-menu-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.cral-site-header.is-open .cral-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.cral-site-header.is-open .cral-menu-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .cral-header-shell {
    min-height: 74px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
  }

  .cral-brand img,
  .cral-brand .custom-logo {
    max-width: 138px;
    max-height: 52px;
  }

  .cral-menu-toggle {
    display: inline-flex !important;
  }

  .cral-navigation {
    order: 5;
    flex: 0 0 100%;
    display: none;
  }

  .cral-header-social {
    margin-left: auto;
  }

  .cral-site-header.is-open .cral-navigation {
    display: block;
  }

  .cral-menu {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 4px;
  }

  .cral-menu a {
    width: 100%;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(185, 222, 243, .9);
  }

}

@media (max-width: 480px) {
  .cral-header-shell {
    width: min(100% - 20px, 1180px);
  }

  .cral-brand img,
  .cral-brand .custom-logo {
    max-width: 118px;
  }

  .cral-header-social__link {
    width: 34px;
    height: 34px;
  }
}

.site-main {
  min-height: 50vh;
}

.cral-content-article {
  margin: 0;
}

.cral-site-footer {
  background: linear-gradient(180deg, #e9f8ff 0%, #d9f1fb 100%);
  border-top: 1px solid rgba(185, 222, 243, .85);
  color: var(--cral-text);
}

.cral-footer-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 28px;
  display: grid;
  grid-template-columns: minmax(210px, 1.15fr) repeat(4, minmax(145px, 1fr));
  gap: 28px;
  align-items: start;
}

.cral-site-footer h2 {
  margin: 0 0 14px;
  color: var(--cral-blue);
  font-size: 17px;
  font-weight: 800;
}

.cral-site-footer p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.65;
}

.cral-footer-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: var(--cral-blue);
  font-weight: 800;
  text-decoration: none;
}

.cral-footer-logo img,
.cral-footer-logo .custom-logo,
.cral-footer-logo .custom-logo-link img {
  width: auto;
  max-width: 160px;
  max-height: 72px;
  object-fit: contain;
}

.cral-footer-menu {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.cral-footer-menu li {
  margin: 0;
}

.cral-footer-menu a,
.cral-site-footer a {
  color: var(--cral-blue);
  font-weight: 700;
  text-decoration: none;
  transition: color .22s ease, transform .22s ease, background-color .22s ease;
}

.cral-footer-menu a {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 240px;
  padding: 8px 11px;
  border-radius: 999px;
  line-height: 1.25;
  white-space: normal;
}

.cral-footer-menu a:hover,
.cral-footer-menu a:focus {
  background: #fff;
  color: #003f7d;
  transform: translateX(4px);
}

.cral-social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cral-social-link {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0, 83, 161, .16);
  box-shadow: 0 8px 18px rgba(0, 83, 161, .11);
  color: var(--cral-blue);
  line-height: 1;
}

.cral-social-link svg {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

.cral-social-link[href="#"] {
  opacity: .75;
}

.cral-map-embed {
  margin-top: 10px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0, 83, 161, .14);
  box-shadow: 0 10px 22px rgba(0, 83, 161, .12);
  overflow: hidden;
}

.cral-map-embed iframe {
  display: block;
  width: 100%;
  min-height: 170px;
  border: 0;
}


.cral-social-link:hover,
.cral-social-link:focus {
  background: var(--cral-blue);
  color: #fff;
  transform: translateY(-2px);
}

.cral-footer-bottom {
  border-top: 1px solid rgba(0, 83, 161, .12);
  padding: 16px;
  text-align: center;
}

.cral-footer-bottom p {
  margin: 0;
  color: #44657a;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .cral-footer-shell {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .cral-footer-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .cral-footer-shell {
    grid-template-columns: 1fr;
    padding: 34px 0 24px;
    text-align: center;
  }

  .cral-footer-menu a,
  .cral-social-list {
    justify-content: center;
  }

  .cral-footer-menu a {
    max-width: 100%;
  }
}

/*
  Pagina "Diventa socio".
  Queste classi gestiscono il modulo creato con lo shortcode [cral_socio_form].
*/
.cral-socio-form-card {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px;
  border: 1px solid rgba(185, 222, 243, .95);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--cral-shadow);
}

.cral-socio-message {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 14px;
  font-weight: 700;
}

.cral-socio-message--success {
  background: #e7fff1;
  color: #08763c;
  border: 1px solid #abe8c2;
}

.cral-socio-message--error {
  background: #fff0f0;
  color: #a42121;
  border: 1px solid #f1b1b1;
}

.cral-socio-form {
  display: grid;
  gap: 18px;
}

.cral-socio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cral-socio-form label {
  display: grid;
  gap: 8px;
  color: var(--cral-text);
  font-weight: 800;
}

.cral-socio-form input,
.cral-socio-form textarea {
  width: 100%;
  border: 1px solid rgba(0, 83, 161, .18);
  border-radius: 14px;
  background: #f8fdff;
  color: var(--cral-text);
  font: inherit;
  font-weight: 500;
  padding: 13px 14px;
  outline: none;
  transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.cral-socio-form input:focus,
.cral-socio-form textarea:focus {
  background: #fff;
  border-color: var(--cral-blue);
  box-shadow: 0 0 0 4px rgba(0, 83, 161, .12);
}

.cral-socio-privacy {
  display: flex !important;
  grid-template-columns: none;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px !important;
  font-size: 14px;
  line-height: 1.45;
}

.cral-socio-privacy input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
}

.cral-socio-submit {
  justify-self: start;
  min-height: 48px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--cral-blue);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 83, 161, .22);
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.cral-socio-submit:hover,
.cral-socio-submit:focus {
  background: #003f7d;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(0, 83, 161, .28);
}

.cral-socio-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/*
  Sezione Home "Diventa socio".
  Il contenuto rimane modificabile dai blocchi WordPress.
*/
.cral-home-socio {
  position: relative;
  overflow: hidden;
  border-radius: 0;
}

.cral-home-socio::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 28px;
  pointer-events: none;
}

.cral-home-socio .wp-block-button__link {
  box-shadow: 0 14px 28px rgba(0, 83, 161, .22);
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease, color .22s ease;
}

.cral-home-socio .wp-block-button__link:hover,
.cral-home-socio .wp-block-button__link:focus {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(0, 83, 161, .28);
}

@media (max-width: 700px) {
  .cral-socio-form-card {
    padding: 22px;
  }

  .cral-socio-grid {
    grid-template-columns: 1fr;
  }
}
