@import url('/fonts/pretendard-dynamic-subset.css');

/* KOXLO 음악 독립 앱 기본 레이아웃 및 디자인 토큰 (포털 portal-v5.css 와 동일) */
:root {
  --fs-micro: 11px;
  --fs-caption: 12px;
  --fs-small: 13px;
  --fs-body: 14px;
  --fs-lead: 15px;
  --fs-title-sm: 16px;
  --fs-title: 18px;
  --fs-logo: 21px;
  --fs-h3: 22px;
  --fs-h2: 26px;
  --fs-h1-sm: 34px;
  --fs-h1: 46px;
  --tracking-title: -0.02em;
  --paper: #fff;
  --sunken: #f2f6f8;
  --ink: #0b1215;
  --ink-2: #4b575e;
  --ink-3: #8a959b;
  --line: #e4eaed;
  --line-2: #c9d3d8;
  --accent: #16d0f0;
  --accent-d: #0084a8;
  --tint: #e7fafe;
  --r: 4px;
  --wrap: 1400px;
  --gutter: max(24px, calc((100vw - var(--wrap)) / 2 + 24px));
  --gnb-height: 68px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  font-size: var(--fs-lead);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

html:lang(ja) :is(body, .music-player),
html:lang(zh) :is(body, .music-player) {
  word-break: normal;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a {
  color: inherit;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent-d);
  outline-offset: 2px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 포털 밖 상단 메뉴 (포털 안 #frame-music 에서는 숨긴다) */
.header-gnb {
  flex: none;
  height: var(--gnb-height);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

html.is-embedded .header-gnb {
  display: none;
}

.gnb-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: var(--wrap);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.brand-name {
  font-size: var(--fs-logo);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.gnb-nav {
  display: flex;
  gap: 28px;
  height: 100%;
}

.gnb-tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.gnb-tab-btn.active {
  color: var(--ink);
}

.gnb-tab-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--accent);
}

.gnb-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  font-size: var(--fs-body);
  font-weight: 600;
}

.gnb-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  height: 38px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}

.search-input-field {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--ink);
  font-size: var(--fs-body);
  font-weight: 400;
}

.search-input-field::placeholder {
  color: var(--ink-3);
}

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}

.search-clear-btn.visible {
  display: inline-flex;
}

.gnb-lang {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
}

.gnb-lang select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  outline: 0;
  background: none;
  cursor: pointer;
  font-weight: 600;
}

.btn.sm.gnb-login-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.music-root {
  flex: 1;
  min-height: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--paper);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) var(--paper);
}

.music-root.stage-open {
  overflow: hidden;
}

.music-root.stage-open > .music-page,
.music-root.stage-open > .footer-unified {
  display: none;
}

/* 단일 줄 KOXLO 통일 푸터 */
.footer-unified {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-size: var(--fs-caption);
}

.footer-unified-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 24px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand-name {
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-legal-links a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-legal-links a:hover {
  color: var(--ink);
}

@media (max-width: 900px) {
  .gnb-inner {
    gap: 16px;
    padding: 0 16px;
  }
  .gnb-search-wrap {
    display: none;
  }
  .gnb-nav {
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .gnb-nav {
    display: none;
  }
  .footer-unified-inner {
    padding: 16px;
  }
}
