/* ==========================================================================
   Homepage — Banda Musicale G. Puccini
   Pixel-perfect replica of the approved design.
   All colours use CSS custom properties set in <head> via Customizer.

   BREAKPOINTS
   ── Desktop + Tablet landscape : >= 64em
   ── Tablet portrait            : 48em – 63.99em
   ── Mobile                     : < 48em

   UNITS — rem / em / % / vw / vh / clamp — zero px
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: #222;
  background: #fff;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; height: auto; }
button { cursor: pointer; border: none; background: transparent; font-family: inherit; }

/* ── Topbar ── */
.topbar {
  background: var(--red);
  color: #fff;
  font-size: .75rem;
  padding: .375rem 0;
  position: sticky;
  top: 0;
  z-index: 101;
}

.topbar .container {
  max-width: 77.5rem;
  margin: auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  align-items: center;
}

/* ── Header ── */
header {
  background: #fff;
  position: sticky;
  top: 1.875rem;
  z-index: 102;
  box-shadow: 0 .125rem .625rem rgba(0, 0, 0, .1);
}

.nav {
  max-width: 100vw;
  margin: auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5.375rem;
}

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 1vw;
}

.logo-img {
  height: clamp(5.5rem, 8vw, 6.5rem);
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-family: Georgia, serif;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  font-weight: 700;
  line-height: .9;
  color: var(--red);
  letter-spacing: -.0625em;
}

.logo-sub {
  font-size: clamp(.6rem, 1vw, .7rem);
  letter-spacing: .1em;
  color: #555;
}

/* ── Menu ── */
.menu {
  display: none;
  gap: 2rem;
  font-weight: 600;
  font-size: .97rem;
  align-items: center;
  color: #333;
}

.menu a { position: relative; transition: color .3s; }

.menu a::after {
  content: "";
  position: absolute;
  width: 0;
  height: .125rem;
  background: var(--red);
  bottom: -.375rem;
  left: 0;
  transition: width .3s;
}

.menu a:hover { color: var(--red); }
.menu a:hover::after { width: 100%; }

/* ── Hamburger ── */
.hamburger {
  width: 2rem;
  height: 1.625rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
}

.hamburger span {
  display: block;
  height: .1875rem;
  background: var(--red);
  border-radius: .1875rem;
  transition: all .4s;
}

.js-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(.5rem, .5rem); }
.js-hamburger.open span:nth-child(2) { opacity: 0; }
.js-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(.5rem, -.5rem); }

/* ── Mobile Menu ── */
.mobile-menu {
  position: fixed;
  top: 7.25rem; /* topbar 1.875rem + header 5.375rem */
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
  overflow-y: auto;
  padding: 2.5rem 1.25rem;
  font-size: 1.3rem;
  font-weight: 500;
  display: none;
}

.mobile-menu.show { transform: translateY(0); display: block; }

.mobile-menu a {
  display: block;
  padding: .75rem 0;
  border-bottom: .0625rem solid #eee;
}

/* ── Hero ── */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .52);
  z-index: 2;
  transition: background .4s;
}

.hero-content {
  max-width: 77.5rem;
  margin: auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
  height: 100%;
  position: relative;
  z-index: 3;
}

.hero-text h1 {
  font-family: Georgia, serif;
  font-size: clamp(2.9rem, 8vw, 5.8rem);
  line-height: 1.02;
  font-weight: 700;
  margin-bottom: 1.125rem;
  color: #fff;
  text-shadow: .1875rem .1875rem .75rem rgba(0, 0, 0, .85);
}

.hero-text p {
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  font-weight: 300;
  margin-bottom: 2.375rem;
  color: #fff;
  text-shadow: .125rem .125rem .5rem rgba(0, 0, 0, .75);
}

.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--red);
  color: #fff;
  padding: 1.1875rem 2.375rem;
  border-radius: 3.125rem;
  font-weight: 700;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, .3);
  transform: scale(0);
  transition: transform .4s;
}

.btn-primary:active::after { transform: scale(3); }
.btn-primary:hover { background: #7a1f1f; transform: scale(1.04); }

.btn-secondary {
  background: var(--yellow);
  color: var(--red);
  padding: 1.1875rem 2.375rem;
  border-radius: 3.125rem;
  font-weight: 700;
  font-size: 1.125rem;
  transition: all .3s;
}

.btn-secondary:hover { background: #e0b02a; transform: scale(1.04); }

/* ── Scheda Tecnica ── */
.scheda {
  background: #fff;
  border-radius: 1.125rem;
  overflow: hidden;
  box-shadow: 0 1.5625rem 3.125rem var(--shadow);
  color: #222;
  max-width: 23.75rem;
}

.scheda-header {
  background: var(--red);
  color: #fff;
  padding: 1rem 1.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.scheda-body {
  padding: 2rem 1.75rem;
  font-size: .9375rem;
  line-height: 1.75;
}

.scheda-body ul { list-style: none; }
.scheda-body li { margin-bottom: .9375rem; }
.scheda-body strong { color: var(--red); }

/* ── Section ── */
.section {
  padding: 5.625rem 1.25rem;
  max-width: 77.5rem;
  margin: auto;
}

/* ── Main Grid ── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.875rem;
}

/* ── Cards ── */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 1.375rem;
  height: clamp(18rem, 30vw, 25.625rem);
  cursor: pointer;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1), box-shadow .5s;
  display: block;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s cubic-bezier(.34, 1.56, .64, 1);
}

.card:hover img { transform: scale(1.13); }

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 1.875rem 3.75rem var(--shadow);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  color: #fff;
  opacity: 0;
  transition: opacity .4s;
}

.card:hover .card-overlay { opacity: 1; }

.card-title {
  font-family: Georgia, serif;
  font-size: clamp(1.25rem, 2.5vw, 1.6875rem);
  line-height: 1.1;
  font-weight: 700;
}

.card-subtitle {
  font-size: .875rem;
  opacity: .9;
  margin-top: .25rem;
  display: none;
}

.card:hover .card-subtitle { display: block; }

/* ── Events Column ── */
.events-col h3 {
  font-size: 1.3125rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1.5rem;
  position: relative;
}

.events-col h3::after {
  content: "(clicca per info)";
  font-size: .6875rem;
  opacity: 0;
  position: absolute;
  bottom: -.25rem;
  right: 0;
  transition: opacity .3s;
}

.events-col:hover h3::after { opacity: 1; }

.event-card {
  background: #fff;
  border: .0625rem solid #eee;
  border-radius: 1.125rem;
  padding: 1.375rem;
  transition: all .4s cubic-bezier(.34, 1.56, .64, 1);
  margin-bottom: 1rem;
}

.event-card:hover {
  transform: translateY(-.5rem);
  box-shadow: 0 1.25rem 2.1875rem var(--shadow);
}

.event-date {
  font-size: clamp(2rem, 4vw, 2.875rem);
  font-weight: 700;
  line-height: 1;
  color: #222;
}

.event-month {
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .0625em;
  color: var(--red);
}

.btn-event {
  background: var(--red);
  color: #fff;
  padding: .9375rem;
  border-radius: .875rem;
  font-weight: 700;
  width: 100%;
  margin-top: 1.25rem;
  transition: all .3s;
}

.btn-event:hover { background: #7a1f1f; }

/* ── About ── */
.about {
  background: #f9f7f4;
  padding: 5.625rem 1.25rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.125rem;
  max-width: 77.5rem;
  margin: auto;
}

/* ── Footer ── */
.footer {
  background: var(--red);
  color: #fff;
  padding: 5.625rem 1.25rem 2.5rem;
}

/* Footer logo — responsive sizing */
.bn-footer-logo {
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  width: 6vw;
  height: auto;
  max-width: 5rem;
  min-width: 3rem;
}

/* Tablet portrait */
@media (min-width: 48em) and (max-width: 63.99em) {
  .bn-footer-logo {
    width: 8vw;
    max-width: 4.5rem;
    min-width: 2.8rem;
  }
}

/* Mobile */
@media (max-width: 47.99em) {
  .bn-footer-logo {
    width: 12vw;
    max-width: 4rem;
    min-width: 2.5rem;
  }
}

.footer-grid {
  max-width: 77.5rem;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.125rem;
}

.footer a { color: #fff; opacity: .9; transition: opacity .3s; }
.footer a:hover { opacity: 1; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
}

.modal.show { opacity: 1; }

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 27.5rem;
  border-radius: 1.5rem;
  overflow: hidden;
  margin: 1.25rem;
  transform: scale(.75);
  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
}

.modal.show .modal-content { transform: scale(1); }

.modal-header {
  background: var(--red);
  color: #fff;
  padding: 1.625rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.4375rem;
  font-weight: 700;
}

.modal-header button { font-size: 2.375rem; line-height: 1; color: #fff; }

/* ── Form ── */
.form-group { margin-bottom: 1.375rem; }

.form-group label {
  display: block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .0625em;
  margin-bottom: .5rem;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 1.125rem;
  border: .125rem solid #ddd;
  border-radius: 1rem;
  font-size: 1rem;
  transition: border .3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--red);
}

.submit-btn {
  background: var(--red);
  color: #fff;
  padding: 1.25rem;
  border-radius: 1rem;
  font-weight: 700;
  font-size: 1.0625rem;
  width: 100%;
  transition: all .3s;
}

.submit-btn:hover { background: #7a1f1f; }

/* ── Spinner ── */
@keyframes spin {
  from { transform: rotate(0); }
  to   { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE — Desktop + Tablet landscape (>= 64em)
   ========================================================================== */
@media (min-width: 64em) {
  .hero-content { grid-template-columns: 7fr 5fr; }
  .main-grid { grid-template-columns: 1fr 1fr 1fr; }
  .about-grid { grid-template-columns: 2fr 1fr; }
  .footer-grid { grid-template-columns: 3fr 2fr 2fr 2fr; }
  .menu { display: flex !important; }
  .hamburger { display: none; }
  .scheda { margin-top: 0; }
}

/* ==========================================================================
   RESPONSIVE — Tablet portrait (48em – 63.99em)
   ========================================================================== */
@media (min-width: 48em) and (max-width: 63.99em) {
  .hero { height: auto; min-height: 100vh; padding: 5rem 0 7.5rem; }
  .hero-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .main-grid { grid-template-columns: 1fr 1fr; }
  .card { height: clamp(16rem, 25vw, 21.25rem); }
  .scheda { max-width: 21.25rem; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 3.75rem 1.25rem; }
  .about { padding: 3.75rem 1.25rem; }
  .footer { padding: 3.75rem 1.25rem 1.875rem; }
  .nav { height: 4.5rem; }
  .mobile-menu { top: 6.375rem; }
}

/* ==========================================================================
   RESPONSIVE — Mobile (< 48em)
   ========================================================================== */
@media (max-width: 47.99em) {
  .hero { height: auto; min-height: 100vh; padding: 5rem 0 7.5rem; }
  .hero-content { gap: 1.875rem; }
  .scheda { margin: 2.5rem auto 0; max-width: 21.25rem; }
  .section { padding: 3.75rem 1.25rem; }
  .main-grid { gap: 2.1875rem; }
  .card { height: clamp(14rem, 50vw, 21.25rem); }
  .card-title { font-size: 1.5rem; }
  .about { padding: 3.75rem 1.25rem; }
  .footer { padding: 3.75rem 1.25rem 1.875rem; }
  .nav { height: 4rem; }
  .mobile-menu { top: 5.875rem; font-size: 1.15rem; padding: 1.5rem 1rem; }

  .btn-primary,
  .btn-secondary {
    padding: .875rem 1.75rem;
    font-size: 1rem;
  }

  .event-card { padding: 1rem; }
}

/* ── WP Admin Bar — sticky come topbar e header ── */
#wpadminbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 102;
}

.admin-bar .topbar { top: 2rem; }
.admin-bar header { top: 3.875rem; }
.admin-bar .mobile-menu { top: 9.25rem; }

@media (max-width: 48.875em) {
  #wpadminbar { position: sticky !important; }
  .admin-bar .topbar { top: 2.875rem; }
  .admin-bar header { top: 4.75rem; }
  .admin-bar .mobile-menu { top: 8.75rem; }
}
