/* ─── Header — fixed; transparent at the top, frosted sand once scrolled
   (.is-scrolled, assets/js/script.js). Mobile menu = floating cream panel. */

.hdr {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  padding: 16px 0;
  transition: padding 0.3s, background-color 0.3s, box-shadow 0.3s;

  &.is-scrolled {
    padding: 8px 0;
    background: color-mix(in srgb, var(--bg-color) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--line);
  }
}

.admin-bar .hdr {
  top: 46px;
}

@media (min-width: 783px) {
  .admin-bar .hdr {
    top: 32px;
  }
}

.hdr__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
}

/* Logo: round clay mark + lowercase serif wordmark, or an uploaded image */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
}

.logo__mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  display: grid;
  place-items: center;
}

.logo__text {
  text-transform: lowercase;

  & i {
    color: var(--clay);
    font-style: normal;
  }
}

.logo__img {
  display: block;
  max-width: var(--logo-max, 200px);

  & img {
    max-height: 48px;
    width: auto;
  }
}

@media (min-width: 640px) {
  .logo {
    font-size: 1.7rem;
  }
}

/* Menu — mobile: floating panel opened by the burger */
.hdr__nav .nav-list {
  position: fixed;
  top: 80px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: var(--r);
  background: var(--cream);
  box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--text-color) 50%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s var(--ease), visibility 0.3s;

  &.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  & a {
    display: block;
    padding: 14px 16px;
    font-family: var(--font-title);
    font-size: 1.6rem;
    text-decoration: none;
    color: var(--cocoa);
  }
}

.admin-bar .hdr__nav .nav-list {
  top: 126px;
}

.hdr__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hdr__cta {
  display: none;
  padding: 12px 22px;
}

@media (min-width: 640px) {
  .hdr__cta {
    display: inline-flex;
  }
}

.burger {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cocoa);

  & span {
    position: absolute;
    left: 14px;
    right: 14px;
    height: 1.8px;
    background: var(--cream);
    transition: transform 0.3s, opacity 0.3s;
  }

  & span:nth-child(1) { top: 17px; }
  & span:nth-child(2) { top: 22px; }
  & span:nth-child(3) { top: 27px; }

  &[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  &[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  &[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
}

/* Desktop: inline menu with clay underline on hover */
@media (min-width: 992px) {
  .hdr__nav .nav-list {
    position: static;
    flex-direction: row;
    gap: 30px;
    padding: 0;
    background: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    border-radius: 0;

    & a {
      position: relative;
      padding: 0;
      font-family: var(--font-text);
      font-size: inherit;
      font-weight: 600;
      color: var(--cocoa-2);
    }

    & a::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -4px;
      height: 1.5px;
      background: var(--clay);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.3s var(--ease);
    }

    & a:hover::after,
    & .current-menu-item > a::after {
      transform: none;
    }
  }

  .burger {
    display: none;
  }
}
