/* ── 폰트 ── */
@font-face {
  font-family: 'Eulyoo1945';
  src: url('/fonts/Eulyoo1945-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GothicA1';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/GothicA1-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GothicA1';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/GothicA1-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GothicA1';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/GothicA1-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GothicA1';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/GothicA1-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: 'GothicA1';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2205@1.0/GothicA1-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

/* ── 변수 ── */
:root {
  --bg: #f0f0f0;
  --rule: #6e6e6e;
  --text: #111111;
  --ui-font: "GothicA1", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* ── 기본 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-gutter: stable; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.fonts-loading body { visibility: hidden; }
html.fonts-ready body { visibility: visible; }

/* ── 메뉴 오버레이 ── */
.menu-overlay {
  touch-action: pan-y;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #eed347;
  z-index: 100;
  visibility: hidden;
  pointer-events: none;
}
.menu-overlay.is-open { visibility: visible; pointer-events: auto; }
.menu-overlay-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--text);
  align-items: center;
  height: 52px;
}
.menu-overlay-top .menu-overlay-spacer {
  grid-column: 1;
  font-size: 18px;
  line-height: 1.15;
  padding-left: 4mm;
}
.menu-overlay-top .menu-overlay-nav {
  grid-column: 2 / 5;
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
  display: flex;
  align-items: center;
  padding-left: 4mm;
}
.menu-overlay-top .menu-overlay-close {
  margin-left: auto;
  padding-right: 4mm;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.menu-overlay-top .menu-overlay-close button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  display: flex;
  align-items: center;
}
.menu-overlay-top .menu-overlay-close button:hover { opacity: 0.5; }
.menu-overlay-body {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex: 1;
}
.menu-overlay-links {
  grid-column: 3;
  padding: 4mm 0 4mm 4mm;
  display: flex;
  flex-direction: column;
}
.menu-overlay-links a {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
  text-decoration: none;
}
.menu-overlay-links a:hover { opacity: 0.5; }
.menu-overlay-spacer { display: block; height: 1.75em; }
.menu-overlay-links span {
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
}

/* ── 헤더 ── */
.header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--rule);
  align-items: center;
  height: 52px;
}
.logo, .nav { font-size: 18px; line-height: 1.15; padding-left: 4mm; }
.logo { grid-column: 1; white-space: nowrap; }
.nav {
  grid-column: 2 / 5;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  align-items: center;
}
.nav::-webkit-scrollbar { display: none; }
.nav a, .logo a { color: inherit; text-decoration: none; }
.spacer { display: inline-block; width: 2em; }
.nav-icons { display: flex; align-items: center; gap: 16px; margin-left: auto; padding-right: 4mm; flex-shrink: 0; }
.nav-icons button { background: none; border: none; cursor: pointer; padding: 0; color: var(--text); display: flex; align-items: center; }
.nav-icons button:hover { opacity: 0.5; }

/* ── 검색 바 ── */
.header-search-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  align-items: center;
  padding: 0 4mm;
  background: var(--bg);
  z-index: 10;
}
.header-search-overlay.is-open { display: flex; }
.header-search-overlay input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid var(--text);
  outline: none;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 0 4px 2px 4px;
  max-width: 320px;
}
.header-search-overlay input::placeholder { color: var(--rule); }
.header-search-close {
  background: none;
  border: none;
  font-family: var(--ui-font);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  padding: 0 0 0 16px;
  letter-spacing: -0.01em;
}
.header-search-close:hover { opacity: 0.5; }

/* ── 인용문 ── */
.quote { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--rule); align-items: center; }
.quote-inner { grid-column: 2 / 4; text-align: center; font-size: 18px; line-height: 1.5; padding: 18px 12px; }
.quote-line { display: block; }
.quote-source { display: block; margin-top: 2px; }

/* ── 푸터 ── */
.footer { padding: 8mm 0 12mm 0; font-size: 18px; text-align: center; color: var(--text); }

/* ── 모바일 공통 ── */
@media (max-width: 820px) {
  .header { display: flex; align-items: center; }
  .logo { flex-shrink: 0; }
  .nav { flex: 1; padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }
  .nav a, .nav .spacer { display: none; }
  .nav-icons { float: none; margin-left: auto; padding-top: 0; }
  .quote { grid-template-columns: 1fr; }
  .quote-inner { grid-column: 1; text-align: left; padding: 14px 4mm; }
  .header-search-overlay input { max-width: 160px; font-size: 16px; }
  .menu-overlay-links { grid-column: 1; padding-left: 4mm; }
  .menu-overlay-body { min-height: 0; grid-template-columns: repeat(2, 1fr); }
}
