/* Shared site navigation, aligned with the reference site's category header. */
.main-content {
  isolation: isolate;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 70px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(86, 57, 42, .08);
  background: #fff;
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.topbar .menu-button {
  position: relative;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #33475c;
}

.topbar .menu-button,
.topbar .top-contact {
  transition: background .18s ease, color .18s ease;
}

.topbar .menu-button:hover,
body.top-menu-open .topbar .menu-button {
  background: rgba(51, 71, 92, .09);
  color: #22303f;
}

.topbar .menu-button svg {
  width: 24px;
  height: 24px;
  opacity: 1;
  stroke-width: 1.9;
}

body.top-menu-open .topbar .menu-button::before,
body.top-menu-open .topbar .menu-button::after {
  content: none;
}

.topbar .top-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar .top-logo img {
  width: 130px;
}

.topbar .top-actions {
  display: flex;
  justify-self: end;
}

.topbar .top-contact {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #33475c;
}

.topbar .top-contact:hover {
  background: rgba(51, 71, 92, .09);
  color: #22303f;
}

.topbar .top-contact svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.topbar .top-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 14px 24px 13px;
  border: 0;
  border-top: 1px solid rgba(240, 231, 226, .7);
  border-radius: 0 0 16px 16px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(86, 57, 42, .11);
  backdrop-filter: none;
}

.topbar .top-menu-panel[hidden] {
  display: none;
}

.topbar .top-menu-panel a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 78px;
  padding: 4px 2px;
  border-radius: 11px;
  background: transparent;
  color: #2c2928;
  text-align: center;
  box-shadow: none;
  transition: background .18s ease;
}

.topbar .top-menu-panel a:hover,
.topbar .top-menu-panel a.active {
  background: var(--menu-tint);
  color: #2c2928;
  transform: none;
}

.topbar .top-menu-panel a > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--menu-tint);
  color: var(--menu-accent);
  transition: transform .18s ease, box-shadow .18s ease;
}

.topbar .top-menu-panel a:hover > span,
.topbar .top-menu-panel a.active > span {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px color-mix(in srgb, var(--menu-accent) 16%, transparent);
}

.topbar .top-menu-panel a b {
  overflow: hidden;
  max-width: 100%;
  color: #2c2928;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.topbar .top-menu-panel a.active b {
  color: var(--menu-accent);
}

.topbar .top-menu-panel svg {
  width: 25px;
  height: 25px;
  stroke-width: 1.9;
}

body.top-menu-open .main-content::after {
  content: '';
  position: absolute;
  z-index: 1100;
  inset: 70px 0 0;
  background: rgba(20, 16, 15, .45);
}

/* 首页顶栏：页面在顶部时无背景，开始滚动或打开菜单后显示背景 */
.main-content:has(.seoul-home) .topbar {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.topbar-scrolled .main-content:has(.seoul-home) .topbar,
body.top-menu-open .main-content:has(.seoul-home) .topbar {
  background: #fffdfb;
  border-bottom-color: rgba(86, 57, 42, .08);
  box-shadow: 0 3px 14px rgba(70, 52, 42, .06);
  backdrop-filter: blur(16px);
}

/* The homepage now uses this shared header as well. */
.main-content:has(.target-seoul-home) > .topbar {
  display: grid;
}

@media (max-width: 720px) {
  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .topbar .top-logo img {
    width: 112px;
  }

  .topbar .top-menu-panel {
    gap: 2px;
    padding: 12px 6px 11px;
  }

  .topbar .top-menu-panel a {
    min-height: 72px;
    gap: 6px;
    padding-inline: 1px;
  }

  .topbar .top-menu-panel a > span {
    width: 40px;
    height: 40px;
  }

  .topbar .top-menu-panel a b {
    font-size: clamp(10px, 2.75vw, 13px);
  }

  .topbar .top-menu-panel svg {
    width: 23px;
    height: 23px;
  }

  body.top-menu-open .main-content::after {
    top: 62px;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-inline: 12px;
  }

  .topbar .menu-button {
    width: 38px;
    height: 38px;
  }

  .topbar .top-logo img {
    width: 102px;
  }

  .topbar .top-contact {
    width: 38px;
    height: 38px;
  }

  .topbar .top-menu-panel a > span {
    width: 37px;
    height: 37px;
  }
}
