:root {
  --hero-min: 640px;
  --h1-hero: clamp(1.8rem, 2.7vw, 2.6rem);
  --hex-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 112'%3E%3Cpolygon points='50,6 92,29 92,83 50,106 8,83 8,29' fill='black' stroke='black' stroke-width='12' stroke-linejoin='round'/%3E%3C/svg%3E");
  --cyan: #25b1db;
  --navy: #171151;
  --honey: #f5b400;
  --on-cyan: #171151;
  --on-cyan-soft: #1f2a6b;

  --paper: #ffffff;
  --paper-2: #eef6fb;
  --ink: #171151;
  --ink-soft: #46437a;
  --rule: #d5e3ee;
  --field-navy: #171151;
  --on-navy: #eef6fb;
  --on-navy-soft: #b9c3e6;
  --logo-mark: #25b1dc;

  --font-display: 'Days One', 'Archivo', sans-serif;
  --font-body: 'Archivo', system-ui, sans-serif;

  --nav-space: 96px;
  --radius: 16px;
  --radius-sm: 12px;
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(56px, 10vw, 140px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--cyan) var(--paper-2);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--honey);
  color: var(--navy);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 3px;
}

img,
svg {
  max-width: 100%;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.field-cyan {
  background: var(--cyan);
  color: var(--on-cyan);
  --logo-mark: var(--navy);
}

.field-navy {
  background: var(--field-navy);
  color: var(--on-navy);
}

.field-paper-2 {
  background: var(--paper-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  min-height: 52px;
  padding: 0 1.6em;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: var(--on-navy);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.25s var(--ease-out),
    transform 0.15s var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--honey {
  background: var(--honey);
  color: var(--navy);
}

.btn--honey:hover {
  background: #ffc933;
}

.btn--ghost {
  background: transparent;
  color: inherit;
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  max-width: 52ch;
}

.hex {
  -webkit-mask: var(--hex-mask) center / 100% 100% no-repeat;
  mask: var(--hex-mask) center / 100% 100% no-repeat;
}

/* Telefono: la scala in rem scende di un ottavo (titoli, numeri, spaziature); il testo resta leggibile a 16px. */
@media (max-width: 640px) {
  html {
    font-size: 87.5%;
  }

  body {
    font-size: 16px;
  }

  .lead {
    font-size: 17px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Motion: reveal (attivo solo con JS e senza reduce-motion) */
.motion [data-reveal] {
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.8s var(--ease-out),
    clip-path 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.motion [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(28px);
}

.motion [data-reveal='wipe']:not(.is-in) {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
}

.motion [data-reveal='wipe'].is-in {
  clip-path: inset(0 0 0 0);
}

.motion [data-reveal='pop']:not(.is-in) {
  transform: scale(0.86);
}

.motion [data-reveal='left']:not(.is-in) {
  transform: translateX(-40px);
}

/* Bottoni: riempimento a scorrimento */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--honey);
  transform: translateX(-101%);
  transition: transform 0.45s var(--ease-out);
}

.btn--honey::before {
  background: var(--cyan);
}

.btn:hover::before {
  transform: translateX(0);
}

.btn:hover,
.btn:not(.btn--honey):hover {
  color: var(--navy);
}

.btn svg {
  transition: transform 0.3s var(--ease-out);
}

.btn:hover svg:last-child {
  transform: translateX(4px);
}

.btn:active {
  transform: scale(0.97);
}

/* Link con freccia */
.arrow-link svg {
  transition: transform 0.3s var(--ease-out);
}

.arrow-link:hover svg {
  transform: translateX(5px);
}

/* Transizione fra pagine */
.page-enter-active,
.page-leave-active {
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.35s var(--ease-out);
}

.page-enter-from {
  opacity: 0;
  transform: translateY(16px);
}

.page-leave-to {
  opacity: 0;
}

@media print {
  .motion [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}


/* ---- Brand logo ---- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}

.brand__mark {
  display: block;
  height: 100%;
  width: auto;
  flex: none;
  transition: transform 0.6s var(--ease-out);
}

.brand__word {
  display: block;
  height: 46%;
  width: auto;
  transition: transform 0.5s var(--ease-out);
}

a:hover > .brand .brand__mark {
  transform: none;
}

a:hover > .brand .brand__word {
  transform: translateX(3px);
}

/* ---- Header ---- */
.nav {
  --logo-mark: var(--cyan);
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 30;
  width: calc(100% - 32px);
  max-width: 1180px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--navy);
  color: var(--on-navy);
  border: 1.5px solid transparent;
  box-shadow: 0 14px 34px -18px rgb(7 5 32 / 0.55);
  transition:
    box-shadow 0.4s var(--ease-out),
    border-color 0.35s var(--ease-out),
    transform 0.4s var(--ease-out);
}

.nav--compact {
  transform: translateX(-50%) translateY(-6px) scale(0.985);
  box-shadow: 0 20px 44px -18px rgb(7 5 32 / 0.7);
}

.nav--on-dark {
  border-color: rgb(255 255 255 / 0.85);
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  padding: 0 10px 0 20px;
}

.nav__logo {
  display: block;
  height: 36px;
  color: var(--on-navy);
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 600 0.97rem var(--font-body);
  text-decoration: none;
  color: var(--on-navy-soft);
  cursor: pointer;
  transition:
    color 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--cyan);
  transform: scale(0);
  transition: transform 0.3s var(--ease-out);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--on-navy);
}

.nav__link:hover {
  background: rgb(238 246 251 / 0.07);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scale(1);
}

/* Sottomenu soluzioni */
.sub {
  position: relative;
}

.sub__chev {
  transition: transform 0.3s var(--ease-out);
}

.sub--open .sub__chev {
  transform: rotate(180deg);
}

.sub__panel {
  position: absolute;
  top: calc(100% + 14px);
  left: -12px;
  width: 380px;
  padding: 10px;
  border-radius: 22px;
  background: var(--navy);
  box-shadow:
    inset 0 0 0 1px rgb(238 246 251 / 0.14),
    0 24px 50px -20px rgb(7 5 32 / 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s var(--ease-out),
    transform 0.3s var(--ease-out),
    visibility 0.3s;
}

.sub__panel::before {
  content: '';
  position: absolute;
  inset: -16px 0 auto;
  height: 16px;
}

.sub--open .sub__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.sub__item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out);
}

.sub__item svg {
  flex: none;
  color: var(--cyan);
  transition: transform 0.4s var(--ease-out);
}

.sub__item strong {
  display: block;
  color: var(--on-navy);
}

.sub__item small {
  display: block;
  margin-top: 2px;
  color: var(--on-navy-soft);
  font-size: 0.85rem;
  line-height: 1.4;
}

.sub__item:hover {
  background: rgb(238 246 251 / 0.08);
}

.sub__item:hover svg {
  transform: translateX(2px);
}

.sub__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 12px 14px;
  border-top: 1px solid rgb(238 246 251 / 0.12);
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.sub__all svg {
  transition: transform 0.3s var(--ease-out);
}

.sub__all:hover svg {
  transform: translateX(5px);
}

.nav__cta {
  margin-left: 10px;
  min-height: 46px;
  padding: 0 1.3em;
  font-size: 0.95rem;
}

.nav__toggle {
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgb(238 246 251 / 0.08);
  color: var(--on-navy);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out);
}

.nav__toggle:hover {
  background: rgb(238 246 251 / 0.16);
}

@media (max-width: 980px) {
  .nav {
    border-radius: 28px;
  }

  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: grid;
  }
}

/* ---- Drawer mobile (fuori dalla barra: la barra ha transform e intrappolerebbe position: fixed) ---- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.45s;
}

.drawer--open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(7 5 32 / 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.drawer--open .drawer__backdrop {
  opacity: 1;
}

.drawer__panel {
  --logo-mark: var(--cyan);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 24px 0 0 24px;
  background: var(--navy);
  color: var(--on-navy);
  box-shadow: -30px 0 60px -30px rgb(7 5 32 / 0.6);
  transform: translateX(100%);
  transition: transform 0.45s var(--ease-out);
}

.drawer--open .drawer__panel {
  transform: none;
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.drawer__logo {
  display: block;
  height: 34px;
  color: var(--on-navy);
}

.drawer__close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgb(238 246 251 / 0.1);
  color: var(--on-navy);
  cursor: pointer;
  transition: background-color 0.25s var(--ease-out);
}

.drawer__close:hover {
  background: rgb(238 246 251 / 0.18);
}

.drawer__label {
  margin: 24px 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-navy-soft);
}

.drawer__sol {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px 10px 10px 6px;
  border-radius: 14px;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out);
}

.drawer__sol:hover {
  background: rgb(238 246 251 / 0.07);
}

.drawer__ico {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 100 / 112;
  background: var(--cyan);
  color: var(--navy);
}

.drawer__sol strong {
  display: block;
  color: var(--on-navy);
}

.drawer__sol small {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--on-navy-soft);
}

.drawer__links {
  margin-top: 18px;
  border-top: 1px solid rgb(238 246 251 / 0.12);
}

.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  border-bottom: 1px solid rgb(238 246 251 / 0.12);
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--on-navy);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.drawer__link svg {
  color: var(--on-navy-soft);
  transition: transform 0.3s var(--ease-out), color 0.2s var(--ease-out);
}

.drawer__link:hover,
.drawer__link.is-active {
  color: var(--cyan);
}

.drawer__link:hover svg {
  color: var(--cyan);
  transform: translateX(4px);
}

.drawer__cta {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px;
}

.drawer__cta .btn {
  justify-content: center;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
}

.drawer__call {
  text-align: center;
  font-size: 0.95rem;
  color: var(--on-navy-soft);
  text-decoration: none;
}

.drawer__call strong {
  color: var(--on-navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .drawer--open .drawer__nav > *,
  .drawer--open .drawer__links > * {
    animation: drawer-in 0.5s var(--ease-out) both;
    animation-delay: calc(0.08s + var(--i, 0) * 0.04s);
  }
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@media (min-width: 981px) {
  .drawer {
    display: none;
  }
}

/* ---- Layout ---- */
.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--honey);
  color: var(--navy);
  font-weight: 600;
}

#top-sentinel {
  position: absolute;
  top: 0;
  height: 80px;
  width: 1px;
}

.skip:focus {
  top: 12px;
}

/* ---- Adattamento WordPress ---- */
.icon {
  display: block;
  flex: none;
}

.sub__toggle .icon {
  transition: transform 0.3s var(--ease-out);
}

.sub--open .sub__toggle .icon {
  transform: rotate(180deg);
}

.nav__toggle .icon {
  display: block;
}

.admin-bar .nav {
  top: 48px;
}

@media (max-width: 782px) {
  .admin-bar .nav {
    top: 62px;
  }
}

.layout {
  overflow-x: clip;
}

.skip:focus {
  top: 12px;
}

/* ---- Elementor: azzera gli spazi di default dentro il tema ---- */
body.microbees {
  --container-default-padding-top: 0px;
  --container-default-padding-right: 0px;
  --container-default-padding-bottom: 0px;
  --container-default-padding-left: 0px;
  --kit-widget-spacing: 0px;
}

body.microbees main .elementor-element {
  --widgets-spacing: 0px 0px;
  --widgets-spacing-row: 0px;
  --widgets-spacing-column: 0px;
}

:where(body.microbees main .elementor-widget:not(:last-child)) {
  margin-block-end: 0;
}

body.microbees main .e-con,
body.microbees main .e-con-inner {
  --gap: 0px;
  --row-gap: 0px;
  --column-gap: 0px;
}

body.microbees main :is(h1, h2, h3) {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

body.microbees main :is(h4, h5, h6) {
  font-family: var(--font-body);
}

/* Contenuto di pagina senza Elementor e articoli */
.mb-entry {
  padding-block: var(--nav-space) var(--section);
}

.mb-entry__head {
  margin-bottom: 40px;
}

.mb-entry__title {
  font-size: clamp(2rem, 4.5vw, 3.4rem);
}

.mb-entry__meta {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.mb-entry__cover {
  margin: 0 0 40px;
  border-radius: var(--radius);
  overflow: hidden;
}

.mb-entry__cover img {
  display: block;
  width: 100%;
  height: auto;
}

.mb-entry__body {
  max-width: 72ch;
}

.mb-entry__body > * + * {
  margin-top: 1.1em;
}

.mb-entry__body :is(h2, h3) {
  margin-top: 1.8em;
}

.mb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.mb-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--paper-2);
  text-decoration: none;
  transition: transform 0.3s var(--ease-out);
}

.mb-card:hover {
  transform: translateY(-4px);
}

.mb-card h2 {
  font-size: 1.35rem;
}

.mb-card img {
  border-radius: var(--radius-sm);
  width: 100%;
  height: auto;
}

/* Widget Elementor dentro il tema: ereditano font e colori del brand, non quelli del kit */
body.microbees main :where(.elementor-widget-heading) .elementor-heading-title {
  color: inherit;
  font-family: var(--font-display);
  font-weight: 400;
}

/* :where tiene bassa la specificità: vince sulle regole del kit Elementor, perde con le classi del tema */
body.microbees main :where(.elementor-widget-text-editor) {
  color: inherit;
  font-family: var(--font-body);
  font-weight: inherit;
}
