/* ============================================================
   LM Header — Fixed-position brand header
   ============================================================ */

.lm-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-brand-primary, #000000);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .lm-header {
    background-color: rgba(255, 255, 255, 0.5);
  }
}

.lm-header__inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2rem;
  padding: 0 2rem;
  position: relative;
}

/* ---------- Logo ---------- */

.lm-header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  overflow: hidden;
  min-width: 0;
}

.lm-header__logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.lm-header__logo-text {
  font-family: var(--font-heading, 'Livvic'), sans-serif;
  font-size: 2.8rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: inherit;
  line-height: 1;
}

/* ---------- Desktop nav ---------- */

.lm-header__nav--desktop {
  display: none;
  gap: 3rem;
  margin-left: auto;
}

@media screen and (min-width: 990px) {
  .lm-header__nav--desktop {
    display: flex;
  }
}

.lm-header__nav-link {
  font-family: var(--font-heading, 'Montserrat', sans-serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.lm-header__nav-link:hover {
  opacity: 0.7;
}

.lm-header__nav-link:focus-visible {
  outline: 0.2rem solid var(--color-brand-primary, #000000);
  outline-offset: 0.3rem;
}

@media screen and (max-width: 1499px) {
  .lm-header__nav-link {
    font-size: 1.1rem;
    letter-spacing: 0.07em;
  }

  .lm-header__apply-btn {
    font-size: 0.9rem;
    padding: 0.45rem 1.2rem;
  }

  .lm-header__nav--desktop {
    gap: 1.75rem;
  }

  .lm-header__logo-text {
    font-size: 2rem;
    letter-spacing: 0.2em;
  }
}

@media screen and (max-width: 1199px) {
  .lm-header__logo-text {
    font-size: 1.7rem;
    letter-spacing: 0.15em;
  }

  .lm-header__nav--desktop {
    gap: 1.25rem;
  }

  .lm-header__nav-link {
    font-size: 1rem;
  }

  .lm-header__inner {
    gap: 1rem;
    padding: 0 1.25rem;
  }
}

/* ---------- Desktop actions ---------- */

.lm-header__actions--desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

@media screen and (min-width: 990px) {
  .lm-header__actions--desktop {
    display: flex;
  }
}

.lm-header__apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading, 'Montserrat', sans-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background-color: var(--color-brand-primary, #000);
  border-radius: var(--radius-pill, 300px);
  padding: 0.6rem 1.8rem;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.lm-header__apply-btn:hover {
  opacity: 0.85;
}

.lm-header__apply-btn:focus-visible {
  outline: 0.2rem solid var(--color-brand-primary, #000000);
  outline-offset: 0.3rem;
}

/* ---------- Homepage transparent state ---------- */

.lm-header--transparent {
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-brand-primary, #000000);
}

/* Dark logo with white bg works on both light and dark backgrounds — no inversion needed */

.lm-header--transparent .lm-header__apply-btn {
  background-color: var(--color-brand-primary, #000);
  color: #fff;
}

/* ---------- Scrolled state (homepage only; non-home is always solid) ---------- */

.lm-header--transparent.lm-header--scrolled {
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-brand-primary, #000000);
}

.lm-header--transparent.lm-header--scrolled .lm-header__apply-btn {
  background-color: var(--color-brand-primary, #000);
  color: #fff;
}

/* Non-homepage shadow */
.lm-header:not(.lm-header--transparent) {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---------- Spacer ---------- */

.lm-header__spacer {
  height: 80px;
}

/* Non-homepage: clear the fixed header AND add breathing room below the nav
   (homepage keeps the hero under the transparent header — no offset spacer).
   base.css `div:empty { display: none }` (specificity 0,1,1) collapses this
   intentionally-empty spacer; scope under .section-lm-header (0,2,0) to win
   and force display back so the spacer actually reserves its height. */
.section-lm-header .lm-header__spacer--offset {
  display: block;
  height: 112px;
}

/* ---------- Hamburger (mobile) ---------- */

.lm-header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

@media screen and (min-width: 990px) {
  .lm-header__hamburger {
    display: none;
  }
}

.lm-header__hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: currentColor;
  border-radius: 1px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---------- Small mobile (<420px) ---------- */

@media screen and (max-width: 519px) {
  .lm-header__inner {
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .lm-header__logo-text {
    font-size: 1.4rem;
    letter-spacing: 0.12em;
  }

  .lm-header__logo {
    margin-right: -20px;
    padding-right: 0;
  }
}

@media screen and (max-width: 379px) {
  .lm-header__logo-text {
    font-size: 1.15rem;
    letter-spacing: 0.1em;
  }
}

/* ============================================================
   Mobile Menu Overlay
   ============================================================ */

.lm-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  visibility: hidden;
}

.lm-mobile-menu--open {
  pointer-events: auto;
  visibility: visible;
}

.lm-mobile-menu__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lm-mobile-menu--open .lm-mobile-menu__overlay {
  opacity: 1;
}

.lm-mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background-color: #fff;
  color: var(--color-brand-primary, #000);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lm-mobile-menu--open .lm-mobile-menu__panel {
  transform: translateX(0);
}

.lm-mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.lm-mobile-menu__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.lm-mobile-menu__nav {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0;
}

.lm-mobile-menu__link {
  display: block;
  font-family: var(--font-heading, 'Montserrat', sans-serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: opacity 0.2s ease;
}

.lm-mobile-menu__link:hover {
  opacity: 0.7;
}

.lm-mobile-menu__link:focus-visible {
  outline: 0.2rem solid var(--color-brand-primary, #000000);
  outline-offset: 0.3rem;
}

.lm-mobile-menu__apply {
  margin-top: 1.5rem;
  text-align: center;
  border-bottom: none;
}
