/*
Theme Name: Stacchi
Theme URI: https://www.stacchi.it/
Author: Netrix
Description: Tema custom bilingue per il Prof. Claudio Stacchi.
Version: 0.3.3
Text Domain: stacchi
*/

html { scroll-behavior: smooth; }

.stacchi-motion [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .65s ease, transform .65s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.stacchi-motion [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stacchi-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1200;
  width: 100%;
  height: 3px;
  background: #1b4a73;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}

header { transition: box-shadow .25s ease; }
body.is-scrolled header { box-shadow: 0 10px 30px rgba(16, 42, 64, .08); }

a,
button,
.carousel-btn {
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.is-pressed { transform: scale(.98) !important; }

.contact-map { padding: 0 !important; overflow: hidden; }
.contact-map iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (hover: hover) {
  main a:hover,
  main button:hover,
  main .carousel-btn:hover { transform: translateY(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .stacchi-motion [data-reveal] { opacity: 1; transform: none; }
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: #102a40;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #e4e8eb;
  border-radius: 4px;
  color: #1b4a73;
  background: #fff;
  font: 600 13px/1 Inter, sans-serif;
  cursor: pointer;
}

.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: '';
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle-icon { position: relative; }
.menu-toggle-icon::before { position: absolute; top: -7px; }
.menu-toggle-icon::after { position: absolute; top: 7px; }
.menu-toggle[aria-expanded='true'] .menu-toggle-icon { background: transparent; }
.menu-toggle[aria-expanded='true'] .menu-toggle-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded='true'] .menu-toggle-icon::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 880px) {
  body { overflow-x: hidden; }
  header { position: sticky; flex-wrap: wrap; gap: 12px; }
  .brand { min-width: 0; }
  .brand-logo { height: 48px; }
  .brand-text .name { font-size: 15px; }
  .brand-text .subtitle { display: none; }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  header nav,
  header nav[hidden] { display: none; }
  header nav.is-open {
    display: flex;
    flex: 0 0 calc(100% + 40px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0 -20px -16px;
    padding: 8px 20px 18px;
    border-top: 1px solid #e4e8eb;
    background: #fff;
  }
  header nav a { min-height: 44px; padding: 12px 0; }
  header .lang-toggle {
    margin: 8px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid #e4e8eb;
    border-left: 0;
  }
  .hero { min-height: 540px; height: auto; padding: 58px 20px; }
  .hero-inner { padding: 0; }
  .hero h1 { font-size: clamp(34px, 10vw, 42px); line-height: 1.12; overflow-wrap: normal; }
  .hero p { font-size: 16px; }
  .about-links { flex-wrap: wrap; }
  .cta-strip { padding: 34px 26px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

@media (max-width: 420px) {
  header { padding: 12px 16px; }
  header nav.is-open { flex-basis: calc(100% + 32px); margin-right: -16px; margin-left: -16px; padding-right: 16px; padding-left: 16px; }
  .brand { gap: 9px; }
  .brand-logo { height: 42px; }
  .brand-text .name { font-size: 14px; }
  .brand-text .role { font-size: 9px; }
  .menu-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
