/* ============================================================
   Daily Korean News — Layout System
   Clean white, modern, fully responsive
   ============================================================ */
:root {
  --bg-main: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary-color: #2563eb;
  --accent-orange: #f97316;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font-family: inherit;
  letter-spacing: inherit;
}

/* ============================================================
   HEADER & NAVBAR
   ============================================================ */
.header-container {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.top-brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: none;
  margin: 0 auto;
  padding: 10px 24px;
  gap: 16px;
  flex-wrap: nowrap;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 좌측 상단 로고: 둥근 아이콘(이미지) + 브랜드명(실제 텍스트)
   글자를 이미지에 굽지 않고 HTML 텍스트로 두면 OS 기본 산세리프로 렌더링되어
   어느 기기에서도 선명하고, 자간·굵기·색을 CSS 로 정확히 통제할 수 있습니다. */
.brand-favicon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.brand-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
  text-decoration: none;
  letter-spacing: -0.4px;
  line-height: 1.15;
  white-space: nowrap;
}

/* Sub Navigation Menu */
.nav-menu-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  position: relative;
  flex-shrink: 0;
}

.nav-menu-item {
  position: relative;
}

.nav-menu-link {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  display: block;
}

.nav-menu-link:hover,
.nav-menu-link.active {
  color: var(--primary-color);
  background: #eff6ff;
}

/* Category Dropdown */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  padding: 6px 0;
  display: none;
  z-index: 1100;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 18px;
  color: #334155;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #f1f5f9;
  color: var(--primary-color);
}

/* Language Switcher (국기 + 드롭다운) */
.lang-switcher {
  position: relative;
  flex-shrink: 0;
}

.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lang-current:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-sm);
}

.lang-caret {
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid #94a3b8;
  border-bottom: 1.5px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 0.15s ease, margin-top 0.15s ease;
}

.lang-current[aria-expanded="true"] .lang-caret {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 2.5px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

/* 국기 SVG 에는 반드시 ?v= 버전을 붙입니다.
   dist/_headers 가 /images/* 를 public, max-age=604800 (7일) 로 캐시하기 때문에
   버전이 없으면 국기를 고쳐도 브라우저·Cloudflare 엣지가 옛 파일을 계속 보여줍니다. */
.flag-kr { background-image: url("../images/flag-kr.svg?v=20261011"); }
.flag-us { background-image: url("../images/flag-us.svg?v=20261011"); }
.flag-hu { background-image: url("../images/flag-hu.svg?v=20261011"); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  list-style: none;
  display: none;
  z-index: 1200;
}

.lang-menu.open {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  background: none;
  border: none;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.lang-option:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.lang-option.active {
  color: #0f172a;
}

.lang-option.active::after {
  content: "✓";
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
}

/* 레벨 배지 4단계 색상은 '번호 칩'에만 쓴다 (배지 내부를 색으로 채우지 않음)
   Beginner 1~3 파랑 / Intermediate 4~6 초록 / Advanced 7~8 주황 / Proficient 9~10 빨강 */
.level-badge.lvl-basic .level-badge-num { background: #2563eb; }
.level-badge.lvl-inter .level-badge-num { background: #16a34a; }
.level-badge.lvl-adv   .level-badge-num { background: #ea580c; }
.level-badge.lvl-prof  .level-badge-num { background: #dc2626; }

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main-wrapper {
  max-width: none;
  margin: 0 0 80px;
  padding: 0;
}

/* 가운데 정렬되는 콘텐츠 컨테이너 (히어로만 풀블리드로 넓게 편다) */
.content-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.page-view {
  display: block;
}

.page-view.hidden {
  display: none !important;
}

/* ============================================================
   FEATURED GRID (Top view)
   ============================================================ */
/* 히어로: 화면 가로폭을 꽉 채우는 풀블리드 영역 (Engoo 스타일, 각진 사각형) */
.hero-bleed {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto 8px;
}

.featured-grid-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6px;
}

.featured-left-card {
  position: relative;
  height: 480px;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  background: #1e293b;
}

.featured-right-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  height: 480px;
}

.featured-card-small {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  background: #1e293b;
}

.card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.featured-left-card:hover .card-bg-img,
.featured-card-small:hover .card-bg-img {
  transform: scale(1.04);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.82) 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
}

.badge-new {
  align-self: flex-start;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  line-height: 1.35;
}

/* 흰 배경 위(일반 기사 카드)에서는 어두운 외곽선으로 바꿔 보이게 한다 */
.article-card-standard .badge-new {
  color: #334155;
  border-color: #cbd5e1;
}

.card-bottom-info {
  margin-top: auto;
}

.card-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.featured-card-small .card-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.level-badge {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.level-badge-num {
  background: #64748b;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}

/* 모달 닫기 등에 쓰는 작은 버튼 (기존 lang-btn 재사용) */
.lang-btn {
  background: transparent;
  border: none;
  color: #64748b;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.lang-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.category-tag {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 3px;
  white-space: nowrap;
}

.date-tag {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* 흰 배경 카드 위에서는 투명 배지가 안 보이므로 회색 외곽선 버전으로 */
.article-card-standard .level-badge,
.article-card-standard .category-tag,
.article-card-standard .date-tag {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--border-color);
  color: #64748b;
}

.article-card-standard .level-badge-num {
  color: #ffffff;
}

/* 카드의 날짜 줄 (제목 아래, 레벨 위) */
.card-date {
  font-size: 11.5px;
  font-weight: 500;
  color: #d1d5db;
  letter-spacing: 0.01em;
  margin-bottom: 8px;
}

.article-card-standard .card-date {
  color: #94a3b8;
  margin-bottom: 6px;
}

.article-paragraph {
  margin-bottom: 1.25rem;
  line-height: 1.85;
}

.article-paragraph:last-child {
  margin-bottom: 0;
}

/* ============================================================
   CATEGORY SECTIONS
   ============================================================ */
.category-section {
  margin-bottom: 40px;
}

.section-title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* 홈/카테고리 페이지: 3열 × 3행 = 9개 (Engoo 스타일, 각진 사각형) */
.articles-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.article-card-standard {
  background: #ffffff;
  border-radius: 0;
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}

.article-card-standard:hover {
  border-color: var(--border-dark);
  box-shadow: var(--shadow-md);
}

.article-card-thumb {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #1e293b;
}

.article-card-body {
  padding: 14px;
}

.article-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
  line-height: 1.45;
}

/* ============================================================
   HOME BODY: 카테고리 목록
   ============================================================ */
.home-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.home-categories {
  min-width: 0;
}

/* See more 링크 */
.see-more-row {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0 28px;
}

.category-section .see-more-row {
  margin: 16px 0 0;
}

/* 히어로(5개 카드) 바로 아래 우측에 붙는 See more — 카드 오른쪽 끝에 맞춘다 */
.see-more-row.hero-see-more {
  margin: 8px 0 0;
  padding: 0 8px;
}

.see-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
}

.see-more-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

.see-more-arrow {
  font-weight: 800;
}

/* ============================================================
   COLLECTION (카테고리별 모아보기) PAGE
   ============================================================ */
.collection-head {
  padding: 26px 0 14px;
}

.collection-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.collection-sub {
  font-size: 13.5px;
  color: #64748b;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* ============================================================
   MATERIALS VIEW
   ============================================================ */
.materials-hero {
  text-align: center;
  padding: 40px 20px 24px;
}

.materials-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
  margin-bottom: 8px;
}

.materials-hero p {
  font-size: 15px;
  color: #64748b;
  margin-bottom: 0;
}

/* Level Slider */
.level-slider-container {
  max-width: 560px;
  margin: 0 auto 28px;
}

.level-bar-graphic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 10px;
  margin-bottom: 10px;
}

.level-bar-line {
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 6px;
  background: linear-gradient(90deg, #2563eb 0%, #16a34a 33%, #ea580c 66%, #dc2626 100%);
  border-radius: 9999px;
  z-index: 1;
  transform: translateY(-50%);
}

.level-node {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #2563eb;
  z-index: 2;
  cursor: pointer;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.level-node:hover {
  transform: scale(1.3);
}

.level-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}

.level-lbl-beginner    { color: #2563eb; }
.level-lbl-intermediate { color: #16a34a; }
.level-lbl-advanced    { color: #ea580c; }
.level-lbl-proficient  { color: #dc2626; }

/* Search Filter */
.materials-filter-bar {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 36px;
}

.search-input-box {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
}

.search-input-box:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.category-select-box {
  padding: 11px 14px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  cursor: pointer;
  min-width: 140px;
}

/* Materials Category Cards */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 20px;
}

.material-cat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0;
  padding: 22px 20px;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.material-cat-card:hover {
  border-color: #94a3b8;
  box-shadow: var(--shadow-sm);
}

.material-cat-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0;
  padding-right: 22px;
  position: relative;
  line-height: 1.45;
}

.material-cat-card h3::after {
  content: "→";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-weight: 600;
}

/* ============================================================
   ARTICLE DETAIL PAGE
   ============================================================ */
.article-detail-wrapper {
  max-width: 780px;
  margin: 32px auto 80px;
  padding: 0 20px;
}

.article-detail-hero {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 28px;
  position: relative;
  height: 380px;
  box-shadow: var(--shadow-md);
}

.article-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
  color: #ffffff;
}

.article-detail-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.article-detail-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
}

.article-detail-body {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  font-size: 16px;
  color: #1e293b;
  line-height: 1.8;
  margin-bottom: 20px;
}

.vocab-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
}

.vocab-box h4 {
  font-size: 13px;
  color: var(--primary-color);
  margin-bottom: 6px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vocab-instruction {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 14px;
  font-style: italic;
}

.vocab-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vocab-box li,
.vocab-item {
  font-size: 14px;
  color: #334155;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* Engoo-style vocab item */
.vocab-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocab-word {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.vocab-pos {
  font-size: 11px;
  font-weight: 600;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

.vocab-pron-kor {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

.vocab-foreign {
  font-size: 13px;
  color: #94a3b8;
}

.vocab-meaning {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: #94a3b8; /* 회색: 쉬운 뜻 */
  line-height: 1.5;
}

.vocab-example-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.vocab-example {
  font-size: 14px;
  color: #0f172a; /* 검은색: 예문 */
  line-height: 1.6;
  font-weight: 500;
}

/* Speaker buttons */
.speak-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  padding: 0;
  line-height: 1;
}

.speak-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

.speak-btn:active {
  transform: scale(0.95);
}

.speak-btn-sm {
  width: 22px;
  height: 22px;
  font-size: 10px;
  background: #cbd5e1;
  margin-top: 2px;
}

/* Question items */
.q-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.q-num {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--primary-color);
  min-width: 22px;
}

.article-source {
  margin-top: 18px;
  font-size: 13px;
  color: #64748b;
}

.article-source a {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: none;
}

.article-source a:hover {
  text-decoration: underline;
}

/* 히어로 이미지 출처 표기 (Pexels·Pixabay·Unsplash API 약관 준수) */
.article-image-credit {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}

.article-image-credit a {
  color: #64748b;
  font-weight: 600;
  text-decoration: none;
}

.article-image-credit a:hover {
  text-decoration: underline;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 0;
  margin-bottom: 20px;
  cursor: pointer;
  background: none;
  border: none;
}

.back-btn:hover {
  text-decoration: underline;
}

/* ============================================================
   MODAL (kept as fallback)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 90%;
  max-width: 680px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.modal-body {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.75;
}

/* ============================================================
   FOOTER
   ============================================================ */
.bot-honeypot {
  display: none !important;
}

footer {
  text-align: center;
  padding: 28px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

/* ── Footer: 신뢰성 페이지 링크 (About / Contact / Privacy / Terms) ──
   모든 페이지 하단에 항상 노출되어야 합니다. */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.footer-links a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}
.footer-note {
  font-size: 12px;
  line-height: 1.65;
  max-width: 720px;
  margin: 0 auto 10px;
}

/* ── 정적 정보 페이지 (About / Contact / Privacy / Terms) ── */
.legal-page {
  max-width: 840px;
  margin: 0 auto;
  padding: 44px 22px 64px;
  line-height: 1.75;
  color: var(--text-main);
}
.legal-page h1 {
  font-size: 30px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.legal-page h2 {
  font-size: 19px;
  margin: 32px 0 10px;
}
.legal-page h3 {
  font-size: 16px;
  margin: 22px 0 8px;
}
.legal-page p,
.legal-page li {
  font-size: 15px;
}
.legal-page ul {
  padding-left: 22px;
}
.legal-page .legal-updated {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 24px;
}
.legal-page a {
  color: var(--primary-color);
}
.legal-page .contact-email {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  margin: 4px 0 2px;
}

/* ============================================================
   RESPONSIVE — Tablet (≤900px)
   ============================================================ */
@media (max-width: 900px) {
  .featured-grid-container {
    grid-template-columns: 1fr;
  }

  .featured-right-grid {
    height: auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .featured-card-small {
    height: 200px;
  }

  .featured-left-card {
    height: 340px;
  }

  .home-body {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .articles-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤600px)
   ============================================================ */
@media (max-width: 600px) {
  .top-brand-bar {
    padding: 8px 14px;
    gap: 8px;
  }

  .brand-title {
    font-size: 15px;
  }

  .brand-favicon {
    width: 28px;
    height: 28px;
  }

  .nav-menu-bar {
    gap: 0px;
  }

  .nav-menu-link {
    font-size: 12px;
    padding: 6px 7px;
  }

  .lang-btn {
    padding: 3px 7px;
    font-size: 10px;
  }

  .main-wrapper {
    padding: 0;
    margin: 0 0 60px;
  }

  .content-container {
    padding: 16px 12px 0;
  }

  .collection-title {
    font-size: 21px;
  }

  .featured-grid-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .featured-left-card {
    height: 280px;
  }

  .featured-right-grid {
    grid-template-columns: 1fr 1fr;
    height: auto;
    gap: 10px;
  }

  .featured-card-small {
    height: 160px;
  }

  .card-title {
    font-size: 15px;
  }

  .featured-card-small .card-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .articles-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .article-detail-hero {
    height: 240px;
  }

  .article-detail-title {
    font-size: 18px;
  }

  .article-detail-body {
    padding: 18px 16px;
    font-size: 15px;
  }

  .materials-filter-bar {
    flex-direction: column;
  }

  .level-labels-row {
    font-size: 10px;
  }

  .materials-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .material-cat-card {
    padding: 18px 12px;
  }

  .material-icon {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .material-cat-card h3 {
    font-size: 13px;
  }
}

/* ============================================================
   RESPONSIVE — Very small (≤380px)
   ============================================================ */
@media (max-width: 380px) {
  .articles-row {
    grid-template-columns: 1fr;
  }

  .materials-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   ARTICLE DETAIL — EDITORIAL REFINEMENT
   파란색 최소화 · 세리프 본문 · 헤어라인 구분선
   ============================================================ */
.article-detail-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.article-detail-body {
  font-size: 17px;
  line-height: 1.9;
  color: #1f2733;
  padding: 34px 40px;
}

.article-paragraph + .article-paragraph {
  margin-top: 18px;
}

/* 섹션 제목: 이모지 대신 헤어라인 + 레터스페이싱 */
.vocab-box {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-top: 38px;
}

.vocab-box h4 {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 14px;
  border-top: 2px solid #111827;
  margin-bottom: 4px;
}

.vocab-instruction {
  font-size: 12.5px;
  color: #9ca3af;
  font-style: normal;
  margin-bottom: 8px;
}

.vocab-box ul {
  gap: 0;
}

.vocab-box li,
.vocab-item {
  background: transparent;
  border: none;
  border-top: 1px solid #eceef1;
  border-radius: 0;
  padding: 15px 2px;
}

.vocab-word {
  font-size: 16.5px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.01em;
}

.vocab-pos {
  font-size: 10.5px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 3px;
  padding: 1px 6px;
}

.vocab-pron-kor {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}

.vocab-foreign {
  font-size: 12.5px;
  color: #9ca3af;
}

.vocab-meaning {
  font-size: 13.5px;
  color: #6b7280;
}

.vocab-example {
  font-size: 14.5px;
  color: #111827;
  font-weight: 400;
}

/* 스피커 버튼: 파란 원 대신 담백한 아이콘 버튼 */
.speak-btn {
  width: 26px;
  height: 26px;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  font-size: 0;
}

.speak-btn svg {
  width: 13px;
  height: 13px;
  display: block;
}

.speak-btn:hover {
  background: #e5e7eb;
  color: #111827;
  transform: none;
}

.speak-btn-sm {
  width: 22px;
  height: 22px;
  background: #f9fafb;
}

.speak-btn-sm svg {
  width: 11px;
  height: 11px;
}

/* 질문 목록 */
.q-item {
  gap: 10px;
  padding: 5px 0;
  font-size: 14.5px;
  color: #1f2733;
}

.q-num {
  color: #9ca3af;
  font-weight: 700;
  min-width: 18px;
  font-variant-numeric: tabular-nums;
}

/* 출처 / 뒤로가기: 파란색 제거 */
.article-source a {
  color: #111827;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.back-btn {
  color: #4b5563;
  font-size: 13.5px;
}

.back-btn:hover {
  color: #111827;
}

@media (max-width: 640px) {
  .article-detail-body {
    padding: 24px 20px;
    font-size: 16px;
  }
}


/* ============================================================
   RESPONSIVE — FLUID (창 크기에 따라 자연스럽게 변하도록)
   ============================================================ */

/* 유동 타이포그래피: 화면 폭에 따라 글자 크기가 부드럽게 변한다 */
.section-title-bar {
  font-size: clamp(15px, 1.4vw + 10px, 18px);
}

.materials-hero h1 {
  font-size: clamp(20px, 3vw, 28px);
}

.materials-hero p {
  font-size: clamp(13px, 0.6vw + 11px, 15px);
}

.card-title {
  font-size: clamp(14px, 1.1vw + 10px, 18px);
}

.featured-card-small .card-title {
  font-size: clamp(11px, 0.8vw + 8px, 13px);
}

.article-detail-title {
  font-size: clamp(18px, 2vw + 8px, 26px);
}

/* 헤더: 좁아지면 네비게이션을 다음 줄로 내린다 */
@media (max-width: 780px) {
  .top-brand-bar {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 8px 14px;
  }

  .brand-link {
    flex: 1 1 auto;
    min-width: 0;
  }

  .top-brand-bar nav {
    order: 3;
    flex-basis: 100%;
  }

  .nav-menu-bar {
    gap: 2px;
  }

  .nav-menu-link {
    padding: 6px 9px;
    font-size: 13px;
  }
}

/* 태블릿 */
@media (max-width: 900px) {
  .featured-left-card {
    height: clamp(240px, 45vw, 340px);
  }

  .featured-card-small {
    height: clamp(150px, 24vw, 200px);
  }
}

/* 모바일 */
@media (max-width: 600px) {
  .main-wrapper {
    padding: 0;
    margin: 0 0 60px;
  }

  .content-container {
    padding: 16px 14px 0;
  }

  .featured-grid-container {
    gap: 6px;
  }

  .featured-left-card {
    height: 220px;
  }

  .featured-right-grid {
    gap: 6px;
  }

  .featured-card-small {
    height: 140px;
  }

  .articles-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .article-card-thumb {
    height: 120px;
  }

  .category-section {
    margin-bottom: 28px;
  }

  .section-title-bar {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .materials-hero {
    padding: 24px 14px 18px;
  }

  .materials-filter-bar {
    flex-direction: column;
    max-width: none;
  }

  .category-select-box {
    min-width: 0;
    width: 100%;
  }

  .materials-grid {
    gap: 12px;
  }

  .level-slider-container {
    max-width: none;
    padding: 0 6px;
  }

  .level-labels-row {
    font-size: 10px;
  }

  .article-detail-wrapper {
    padding: 0 14px;
    margin: 20px auto 60px;
  }

  .article-detail-hero {
    height: 220px;
    border-radius: 12px;
    margin-bottom: 20px;
  }

  .article-detail-body {
    padding: 20px 18px;
    font-size: 15.5px;
  }

  .lang-menu {
    min-width: 136px;
  }
}

/* 아주 좁은 화면 */
@media (max-width: 400px) {
  .featured-right-grid {
    grid-template-columns: 1fr;
  }

  .featured-card-small {
    height: 150px;
  }

  .articles-row {
    grid-template-columns: 1fr;
  }

  .nav-menu-link {
    font-size: 12px;
    padding: 5px 6px;
  }
}


/* ============================================================
   HEADER SEARCH (국기(언어 선택) 왼쪽에 붙는 검색창)
   ============================================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
  margin-left: auto;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 240px;
  min-width: 120px;
}

.header-search-input {
  width: 100%;
  padding: 8px 40px 8px 14px;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search-input::placeholder {
  color: #94a3b8;
}

.header-search-input:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 기본 브라우저 X 버튼 제거 (아이콘 버튼과 겹침 방지) */
.header-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.header-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.header-search-btn:hover {
  color: var(--primary-color);
  background: #e2e8f0;
}

.header-search-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ============================================================
   SEARCH RESULT PAGE (search.html)
   ============================================================ */
.search-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px 80px;
}

.search-page-head {
  margin-bottom: 18px;
}

.search-page-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 8px;
}

.search-results-head {
  font-size: 15px;
  font-weight: 600;
  color: #334155;
}

.search-count {
  font-size: 14px;
  color: #64748b;
  margin-top: 4px;
}

/* 검색 페이지 상단의 큰 검색 바 */
.search-bar-row {
  display: flex;
  gap: 10px;
  max-width: 620px;
  margin: 0 0 26px;
}

.search-bar-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 15px;
  background: #ffffff;
  outline: none;
}

.search-bar-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.search-bar-btn {
  flex-shrink: 0;
  width: 48px;
  border: 1px solid var(--border-dark);
  background: #f8fafc;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.search-bar-btn:hover {
  background: #eff6ff;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.search-bar-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* 결과 그리드: articles-row(3열) 재사용 */
.search-results-grid {
  min-height: 120px;
}


/* 페이지네이션: « ‹ 1–45 of 65 › » */
.search-pagination {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin: 34px auto 0;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.search-pagination:empty {
  display: none;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 10px 12px;
  border: none;
  border-right: 1px solid var(--border-color);
  background: #ffffff;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pg-btn:last-child {
  border-right: none;
}

a.pg-btn:hover {
  background: #eff6ff;
  color: var(--primary-color);
}

.pg-btn.pg-disabled {
  color: #cbd5e1;
  cursor: default;
}

.pg-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-right: 1px solid var(--border-color);
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   HEADER SEARCH / SEARCH PAGE — RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .header-search {
    flex-basis: 190px;
  }
}

@media (max-width: 600px) {
  /* 좁은 화면: 검색창+국기를 다음 줄 전체 폭으로 내린다 */
  .header-actions {
    order: 3;
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
    gap: 8px;
  }

  .top-brand-bar nav {
    order: 2;
  }

  .header-search {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-search-input {
    font-size: 13px;
    padding: 7px 36px 7px 12px;
  }

  .search-page {
    padding: 20px 14px 60px;
  }

  .search-page-title {
    font-size: 21px;
  }

  .search-bar-row {
    max-width: none;
  }

  .pg-btn {
    min-width: 36px;
    padding: 9px 9px;
  }

  .pg-info {
    padding: 9px 12px;
    font-size: 12.5px;
  }
}

