/* ==========================================================================
   Global — Banda Musicale G. Puccini
   Shared styles for header, footer, nav, buttons on ALL pages.
   Colours use CSS custom properties set via Customizer (--red, --yellow).

   BREAKPOINTS
   ── Desktop + Tablet landscape : >= 64em  (1024px equiv)
   ── Tablet portrait            : 48em–63.99em (768–1023px)
   ── Mobile                     : < 48em   (< 768px)

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

/* ── Reset (scoped) ── */
*, *::before, *::after { box-sizing: border-box; }

body.bn-child-theme {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: #222;
  background: #fff;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

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 ── */
.bn-topbar {
  background: var(--red);
  color: #fff;
  font-size: .75rem;
  padding: .375rem 0;
  position: sticky;
  top: 0;
  z-index: 101;
}

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

.bn-topbar a {
  color: #fff;
  opacity: .9;
  transition: opacity .3s;
}

.bn-topbar a:hover { opacity: 1; }

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

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

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

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

.bn-logo > div { display: flex; flex-direction: column; }
.bn-logo-text-wrap { display: flex; flex-direction: column; }

.bn-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;
}

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

.bn-footer .bn-logo-text {
  color: #fff;
}

.bn-logo-sub {
  color: #fff;
}

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

.bn-menu a {
  position: relative;
  transition: color .3s;
  padding: .375rem 0;
}

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

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

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

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

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

/* ── Mobile Menu ── */
.bn-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;
}

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

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

.bn-mobile-menu a:hover { color: var(--red); }

/* ── Content Area ── */
.bn-site-content {
  max-width: 100vw;
  margin: 0 auto;
  padding: 3.75rem 1.25rem 5rem;
}

/* ── Buttons (shared) ── */
.bn-btn-primary {
  background: var(--red);
  color: #fff;
  padding: .875rem 2rem;
  border-radius: 3.125rem;
  font-weight: 700;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  transition: all .3s;
  border: none;
}

.bn-btn-primary:hover {
  filter: brightness(.85);
  transform: scale(1.04);
}

.bn-btn-secondary {
  background: var(--yellow);
  color: var(--red);
  padding: .875rem 2rem;
  border-radius: 3.125rem;
  font-weight: 700;
  font-size: 1rem;
  transition: all .3s;
  border: none;
}

.bn-btn-secondary:hover {
  filter: brightness(.92);
  transform: scale(1.04);
}

/* ── Footer ── */
.bn-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;
  }
}

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

.bn-footer a {
  color: #fff;
  opacity: .9;
  transition: opacity .3s;
}

.bn-footer a:hover { opacity: 1; }

.bn-footer h3 {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .125em;
  margin-bottom: 1.125rem;
  opacity: .75;
  font-weight: 600;
}

.bn-footer-copyright {
  border-top: .0625rem solid rgba(255, 255, 255, .25);
  margin-top: 4.375rem;
  padding-top: 1.875rem;
  font-size: .75rem;
  opacity: .75;
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE — Desktop + Tablet landscape (>= 64em)
   ========================================================================== */
@media (min-width: 64em) {
  .bn-menu { display: flex !important; }
  .bn-hamburger { display: none; }
  .bn-footer-grid { grid-template-columns: 3fr 2fr 2fr 2fr; }
}

/* ==========================================================================
   RESPONSIVE — Tablet portrait (48em – 63.99em)
   ========================================================================== */
@media (min-width: 48em) and (max-width: 63.99em) {
  .bn-nav { height: 4.5rem; }
  .bn-mobile-menu { top: 6.375rem; } /* topbar 1.875rem + header 4.5rem */
  .bn-footer-grid { grid-template-columns: 1fr 1fr; }
  .bn-footer { padding: 3.75rem 1.25rem 1.875rem; }
  .bn-footer-copyright { margin-top: 2.5rem; }
}

/* ==========================================================================
   RESPONSIVE — Mobile (< 48em)
   ========================================================================== */
@media (max-width: 47.99em) {
  .bn-nav { height: 4rem; }
  .bn-mobile-menu { top: 5.875rem; font-size: 1.15rem; padding: 1.5rem 1rem; } /* topbar 1.875rem + header 4rem */
  .bn-footer { padding: 3rem 1rem 1.5rem; }
  .bn-footer-copyright { margin-top: 2rem; }
  .bn-btn-primary,
  .bn-btn-secondary { padding: .75rem 1.5rem; font-size: .9rem; }
}

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

.admin-bar .bn-topbar { top: 2rem; }
.admin-bar .bn-header { top: 3.875rem; } /* admin-bar 2rem + topbar 1.875rem */
.admin-bar .bn-mobile-menu { top: 9.25rem; }

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