/* Site Header (공통) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #000;
  backdrop-filter: blur(6px);
  transition:
    background var(--transition),
    box-shadow var(--transition);
}

.site-header.is-scrolled {
  background: #000;
  backdrop-filter: blur(12px);
}
.site-sticky {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  overflow: visible;
  background: #000;
}

.site-sticky .site-header {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
}

.site-main {
  position: relative;
  z-index: 1;
  padding-top: 0;
  max-width: 100%;
  overflow-x: clip;
}

/* ===== Site Flow (공지·등록·아카이브) ===== */
.site-flow {
  position: relative;
  z-index: 2;
  overflow: visible;
  background: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-flow-enabled="false"] .site-flow {
  display: none;
}

[data-flow-enabled="false"] .site-sticky {
  background: #000;
}

.site-flow .container {
  min-width: 0;
  padding: 10px 0px;
}
.site-flow__inner {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px 0;
  width: 100%;
  min-width: 0;
  opacity: 0;
  animation: site-flow-inner-in 0.2s ease 0.1s forwards;
}

@keyframes site-flow-inner-in {
  to {
    opacity: 1;
  }
}
.site-flow__group {
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.site-flow .site-flow__group--archive {
  display: none;
}
.site-flow[data-pic-mode="archive"] .site-flow__group--active {
  display: none;
}
.site-flow[data-pic-mode="archive"] .site-flow__group--archive {
  display: flex;
}
.site-flow__card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  width: auto;
  min-width: 0;
  overflow: hidden;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.site-flow__card--wide {
  flex: 1;
  width: auto;
}
.site-flow__label {
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.site-flow__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-flow__badge {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-flow__badge.is-open {
  color: #4ade80;
}
.site-flow__badge.is-closed {
  color: rgba(255, 255, 255, 0.45);
}
.site-flow__btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  background: #fff;
  border-radius: 999px;
  transition: opacity 0.2s ease;
}
.site-flow__btn:hover {
  opacity: 0.85;
}
.site-flow__btn--archive {
  color: #fff;
  background: #2f6bff;
}

/* ===== GNB 하위메뉴  ===== */
@keyframes navGradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes navUnderlinePulse {
  0%, 100% {
    box-shadow:
      0 0 8px color-mix(in srgb, var(--nav-accent-a) 55%, transparent),
      0 0 18px color-mix(in srgb, var(--nav-accent-b) 35%, transparent);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 0 14px color-mix(in srgb, var(--nav-accent-a) 80%, transparent),
      0 0 28px color-mix(in srgb, var(--nav-accent-b) 45%, transparent);
    filter: brightness(1.15);
  }
}

.site-header,
.site-header__inner,
.site-header__nav,
.site-header__nav-list {
  overflow: visible;
}

.site-header__nav-item {
  position: relative;
  --nav-accent-a: #ff6b8a;
  --nav-accent-b: #ffc857;
  --nav-accent-c: #ff8e53;
}

/* 메뉴별 강조색  */
.site-header__nav-item--home .site-header__nav-link::before {
  display: none;
}
.site-header__nav-item--about {
  --nav-accent-a: #ffe08a;
  --nav-accent-b: #ffc857;
  --nav-accent-c: #ff9f1c;
}
.site-header__nav-item--forum {
  --nav-accent-a: #5eead4;
  --nav-accent-b: #2dd4bf;
  --nav-accent-c: #38bdf8;
}
.site-header__nav-item--archive {
  --nav-accent-a: #c4b5fd;
  --nav-accent-b: #a78bfa;
  --nav-accent-c: #6366f1;
}
.site-header__nav-item--research {
  --nav-accent-a: #fde047;
  --nav-accent-b: #a3e635;
  --nav-accent-c: #22c55e;
}
.site-header__nav-item--info {
  --nav-accent-a: #7dd3fc;
  --nav-accent-b: #38bdf8;
  --nav-accent-c: #818cf8;
}
.site-header__nav-item--notice {
  --nav-accent-a: #ff8a8a;
  --nav-accent-b: #ff6b8a;
  --nav-accent-c: #f43d30;
}

.site-header__nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 0 12px;
  /* 글자색 고정 — common.css 호버/활성색 오버라이드 */
  color: rgba(255, 255, 255, 0.95) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95);
  background: none;
  animation: none;
}

button.site-header__nav-link {
  margin: 0;
  border: 0;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.site-header__nav-row {
  position: relative;
  display: flex;
  align-items: center;
}

.site-header__sub-toggle {
  display: none;
}

/* 하단 언더라인 컬러/애니메이션 */
.site-header__nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--nav-accent-a),
    var(--nav-accent-b),
    var(--nav-accent-c),
    var(--nav-accent-b),
    var(--nav-accent-a)
  );
  background-size: 300% 100%;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header__nav-link.is-active::before {
  transform: scaleX(1);
  bottom: 0;
  height: 3px;
  animation:
    navGradientFlow 2.8s ease-in-out infinite,
    navUnderlinePulse 2.2s ease-in-out infinite;
}

.site-header__nav-item:hover .site-header__nav-link::before,
.site-header__nav-item:focus-within .site-header__nav-link::before {
  transform: scaleX(1);
  animation: navGradientFlow 2.8s ease-in-out infinite;
}

.site-header__nav-link[data-coming-soon]::before {
  display: none;
}

.site-header__nav-item.has-sub:hover,
.site-header__nav-item.has-sub:focus-within,
.site-header__nav-item.has-sub.is-open {
  z-index: 20;
}

.site-header__sub {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 1100;
  width: max-content;
  min-width: calc(100% + 52px);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  background: rgba(10, 10, 10, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 12px) scale(0.96);
  transition:
    opacity 0.24s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.24s ease;
}

/* 호버 브릿지: 메뉴↔서브 사이 빈 간격에서도 유지 */
.site-header__sub::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.site-header__nav-item.has-sub:hover > .site-header__sub,
.site-header__nav-item.has-sub:focus-within > .site-header__sub,
.site-header__nav-item.has-sub.is-open > .site-header__sub {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

@media (min-width: 1101px) {
  .site-header__nav-item.has-sub > .site-header__sub {
    left: -26px;
    transform: translateY(12px) scale(0.96);
    transform-origin: top left;
  }

  .site-header__nav-item.has-sub:hover > .site-header__sub,
  .site-header__nav-item.has-sub:focus-within > .site-header__sub,
  .site-header__nav-item.has-sub.is-open > .site-header__sub {
    transform: translateY(0) scale(1);
  }
}

.site-header__sub a,
.site-header__sub button.is-coming-soon {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 26px;
  border: 0;
  font-size: 15px !important;
  font-weight: 500 !important;
  font-family: inherit;
  text-align: left;
  color: rgba(255, 255, 255, 0.72) !important;
  text-shadow: none !important;
  white-space: nowrap;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease;
}

.site-header__sub a::before,
.site-header__sub button.is-coming-soon::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--nav-accent-a),
    var(--nav-accent-b),
    var(--nav-accent-c),
    var(--nav-accent-a)
  );
  background-size: 100% 300%;
  transform: translateY(-50%);
  transition: height 0.22s ease;
}

.site-header__sub a:hover,
.site-header__sub a:focus-visible,
.site-header__sub a.is-active,
.site-header__sub button.is-coming-soon:hover,
.site-header__sub button.is-coming-soon:focus-visible,
.site-header__sub button.is-coming-soon.is-active {
  color: rgba(255, 255, 255, 0.72) !important;
  background: transparent;
  padding-left: 26px;
  transform: none;
}

.site-header__sub a:hover::before,
.site-header__sub a:focus-visible::before,
.site-header__sub a.is-active::before,
.site-header__sub button.is-coming-soon:hover::before,
.site-header__sub button.is-coming-soon:focus-visible::before,
.site-header__sub button.is-coming-soon.is-active::before {
  height: 14px;
  animation: navGradientFlow 2.4s ease-in-out infinite;
}

/* 포럼 - Linked Exhibition 서브메뉴: 다른 서브메뉴 대비 눈에 띄는 강조 스타일 */
.site-header__nav-item--forum .site-header__sub li:last-child > a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--nav-accent-a) !important;
  font-weight: 800 !important;
  text-shadow: 0 0 14px color-mix(in srgb, var(--nav-accent-a) 60%, transparent);
}

.site-header__nav-item--forum .site-header__sub li:last-child > a:hover,
.site-header__nav-item--forum .site-header__sub li:last-child > a:focus-visible,
.site-header__nav-item--forum .site-header__sub li:last-child > a.is-active {
  color: var(--nav-accent-a) !important;
}

.site-header__nav-item--forum .site-header__sub li:last-child > a::after {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--nav-accent-a);
  animation: navUnderlinePulse 2.2s ease-in-out infinite;
}

.site-nav-backdrop {
  display: none;
}

/* 모바일 GNB */
@media (max-width: 1100px) {
  .site-header__menu-btn {
    display: flex;
  }

  /* sticky의 backdrop-filter가 fixed 기준을 가로채서 absolute로 배치 */
  .site-sticky {
    overflow: visible;
  }

  .site-header,
  .site-header__inner {
    overflow: visible;
  }

  .site-header__nav {
    display: block !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    bottom: auto;
    z-index: 1200;
    width: 100%;
    height: calc(100dvh - var(--site-sticky-offset, var(--site-header-height, 72px)));
    max-height: calc(100dvh - var(--site-sticky-offset, var(--site-header-height, 72px)));
    padding: 12px 20px 32px;
    background: rgba(8, 8, 10, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, -8px, 0);
    transition:
      opacity 0.48s ease,
      transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.48s ease;
  }

  body.is-nav-open .site-header__nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
  }

  body.is-nav-open {
    overflow: hidden;
  }

  body.is-nav-open .site-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    overflow: visible;
  }

  .site-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.48s ease, visibility 0.48s ease;
  }

  body.is-nav-open .site-nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header__nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .site-header__nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-header__nav-row {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .site-header__nav-link {
    flex: 1;
    padding: 16px 4px 14px !important;
    font-size: 17px !important;
    font-weight: 600 !important;
  }

  .site-header__nav-item > .site-header__nav-link {
    display: flex;
    width: 100%;
    padding: 16px 4px 14px !important;
    font-size: 17px !important;
  }

  .site-header__sub-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-right: -6px;
    color: rgba(255, 255, 255, 0.85);
  }

  .site-header__sub-toggle span {
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.4s ease;
  }

  .site-header__nav-item.has-sub.is-open > .site-header__nav-row .site-header__sub-toggle span {
    transform: rotate(225deg);
  }

  .site-header__sub {
    position: static;
    left: auto;
    top: auto;
    min-width: 0;
    width: 100%;
    padding: 0 0 10px 12px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s ease;
  }

  .site-header__sub::before,
  .site-header__sub::after {
    display: none;
  }

  /* 모바일 네비게이션 닫힘 상태 시 서브메뉴 클릭 및 터치 레이어 완전 차단 */
  body:not(.is-nav-open) .site-header__sub,
  body:not(.is-nav-open) .site-header__sub * {
    pointer-events: none !important;
    visibility: hidden !important;
  }

  /* 데스크톱 hover/focus-within 의 translate(-50%) 가 모바일에서 밀리지 않게 */
  .site-header__nav-item.has-sub:hover > .site-header__sub,
  .site-header__nav-item.has-sub:focus-within > .site-header__sub {
    left: auto;
    transform: none !important;
  }

  body.is-nav-open .site-header__nav-item.has-sub.is-open > .site-header__sub {
    max-height: 320px;
    opacity: 1;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.is-nav-open .site-header__nav-item.has-sub.is-open > .site-header__sub * {
    pointer-events: auto !important;
  }

  .site-header__nav-item.has-sub:not(.is-open) > .site-header__sub {
    max-height: 0;
    pointer-events: none !important;
  }

  .site-header__sub a,
  .site-header__sub button.is-coming-soon {
    padding: 12px 12px 12px 16px !important;
    font-size: 15px !important;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
  }

  .site-header__sub a::before,
  .site-header__sub button.is-coming-soon::before {
    left: 8px;
  }

  .site-header__sub a:hover,
  .site-header__sub a:focus-visible,
  .site-header__sub a.is-active,
  .site-header__sub button.is-coming-soon:hover,
  .site-header__sub button.is-coming-soon:focus-visible,
  .site-header__sub button.is-coming-soon.is-active {
    padding-left: 22px !important;
    transform: none;
  }

  .site-header__menu-btn.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header__menu-btn.is-open span:nth-child(2) {
    opacity: 0;
  }

  .site-header__menu-btn.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header__menu-btn span {
    transition: transform 0.4s ease, opacity 0.35s ease;
  }
}
