/* ===== Masthead over the image (mobile-first) ===== */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.45s var(--ease);
}
.masthead.is-hidden { transform: translateY(-100%); }
body.nav-open .masthead { transform: none; }
.masthead-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: clamp(1.1rem, 0.8rem + 1.4vw, 1.9rem) var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-m);
  transition: padding 0.4s var(--ease);
}
.masthead.is-scrolled { background: var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28); }
.masthead.is-scrolled .masthead-inner,
.masthead.is-solid .masthead-inner { padding-block: clamp(0.7rem, 0.5rem + 0.6vw, 1rem); }
.masthead.is-solid { background: var(--ink); }

/* Brand (centred, the masthead) */
.masthead-brand { grid-column: 2; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease); }
.masthead-logo { height: clamp(42px, 4vw + 1rem, 56px); width: auto; transition: height 0.4s var(--ease); }
.masthead.is-scrolled .masthead-logo,
.masthead.is-solid .masthead-logo { height: clamp(38px, 3vw + 0.8rem, 46px); }
.masthead-tagline { display: none; }

/* Hide the logo while the menu is open (fixes overlap) */
body.nav-open .masthead-brand { opacity: 0; visibility: hidden; }

/* Navigation lettering */
.nav-left, .nav-right { display: none; }
.nav-left ul, .nav-right ul { display: flex; align-items: center; gap: clamp(1.1rem, 0.6rem + 1.2vw, 2.2rem); list-style: none; }
.nav-left a, .nav-right a, .services-toggle {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.85;
  transition: opacity 0.3s var(--ease), color 0.3s var(--ease);
}
.nav-left a:hover, .nav-right a:hover, .services-toggle:hover { opacity: 1; }
.nav-left > ul > li > a, .nav-right > ul > li > a, .services-toggle { position: relative; }
.nav-left > ul > li > a::after, .nav-right > ul > li > a::after, .services-toggle::after {
  content: ""; position: absolute; left: 0; bottom: -5px; width: 100%; height: 1px;
  background: var(--cream); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.nav-left > ul > li > a:hover::after, .nav-right > ul > li > a:hover::after, .services-toggle:hover::after { transform: scaleX(1); }

/* Hamburger / close (mobile) */
.menu-btn { grid-column: 1; justify-self: start; display: flex; flex-direction: column; justify-content: center; gap: 6px; width: 28px; height: 28px; }
.menu-btn span { display: block; height: 1.5px; width: 26px; background: var(--cream); transition: transform 0.35s var(--ease), opacity 0.25s var(--ease); }
body.nav-open .menu-btn span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
body.nav-open .menu-btn span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

/* ===== Mobile nav overlay (espresso, refined) ===== */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--ink);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}
body.nav-open .mobile-nav { opacity: 1; visibility: visible; }

.mobile-nav-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-h) + 1.4rem) var(--gutter) calc(var(--gutter) + 1rem);
}

.m-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 242, 234, 0.45);
  margin-bottom: 0.9rem;
}
.m-sub {
  list-style: none;
  margin: 0 0 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.m-main {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.m-lead { margin-bottom: 1.7rem; }
.m-sub a, .m-main a {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--cream);
  transition: color 0.25s var(--ease);
}
.m-sub a:hover, .m-main a:hover { color: var(--gold); }

.m-foot { margin-top: auto; padding-top: 1.8rem; display: flex; flex-direction: column; gap: 0.7rem; }
.mobile-cta, .mobile-call { width: 100%; }
.mobile-cta .wa-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Overlay reveal */
.mobile-nav-inner > * { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
body.nav-open .mobile-nav-inner > * { opacity: 1; transform: none; }
body.nav-open .mobile-nav-inner > *:nth-child(1) { transition-delay: 0.12s; }
body.nav-open .mobile-nav-inner > *:nth-child(2) { transition-delay: 0.2s; }
body.nav-open .mobile-nav-inner > *:nth-child(3) { transition-delay: 0.28s; }
body.nav-open .mobile-nav-inner > *:nth-child(4) { transition-delay: 0.36s; }

/* ===== Desktop ===== */
@media (min-width: 1024px) {
  .menu-btn { display: none; }
  .mobile-nav { display: none; }
  .nav-left { display: block; justify-self: start; }
  .nav-right { display: block; justify-self: end; }
  .masthead-tagline {
    display: block;
    font-family: var(--font-body);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(247, 242, 234, 0.7);
  }
  .masthead-logo { height: clamp(52px, 3.4vw + 1rem, 68px); }
  .masthead.is-scrolled .masthead-logo,
  .masthead.is-solid .masthead-logo { height: clamp(44px, 2.6vw + 0.8rem, 54px); }

  /* Services dropdown */
  .has-dropdown { position: relative; }
  .services-toggle { display: inline-flex; align-items: center; gap: 0.45em; background: none; cursor: pointer; padding: 0; }
  .nav-caret { transition: transform 0.3s var(--ease); }
  .has-dropdown:hover .nav-caret,
  .services-toggle[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

  .dropdown {
    position: absolute;
    top: calc(100% + 18px);
    left: 0;
    min-width: 230px;
    padding: 0.5rem;
    background: var(--ink);
    border: 1px solid rgba(247, 242, 234, 0.12);
    border-top: 2px solid var(--wine);
    box-shadow: 0 26px 54px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
  }
  .dropdown::before { content: ""; position: absolute; top: -18px; left: 0; right: 0; height: 18px; }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown,
  .has-dropdown.is-open .dropdown { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
  .dropdown a {
    font-size: 0.84rem; letter-spacing: 0.02em; text-transform: none;
    color: var(--cream); opacity: 0.85; padding: 0.7em 0.85em; white-space: nowrap;
    transition: background 0.25s var(--ease), opacity 0.25s var(--ease);
  }
  .dropdown a:hover { background: rgba(247, 242, 234, 0.08); opacity: 1; }
}