/* ===================================================================
   bd_hybrid v4 리디자인 스타일 (Phase 3: 보딩스쿨 4섹션 구조)
   hs_hybrid v4/v5 기반 — accent = violet #7c3aed
   =================================================================== */

/* ===== v4 토큰 ===== */
.wrap {
    --ink: #1c1c1e; --ink-2: #3a3a3c; --ink-3: #8e8e93;
    --ink-4: #aeaeb2; --ink-5: #d1d1d6;
    --surface: #ffffff; --bg: #f7f7f8; --border: #e8e8eb;
    --accent: #7c3aed; --accent-dark: #5b21b6;
    --accent-soft: #f3f0ff; --accent-mid: #ddd6fe;
    --blue-soft: #eef4ff; --blue: #2563eb;
    --amber-soft: #fef7ec; --amber: #b45309;
    --violet-soft: #f3f0ff; --violet: #7c3aed;
    --rose-soft: #fef1f2; --rose: #be123c;
    --green-soft: #eefbf3; --green: #15803d;
    --serif: 'Roboto Mono', 'Courier New', monospace;
    --sans: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius: 10px;
    max-width: 480px; margin: 0 auto; padding: 0 16px;
    font-family: var(--sans); color: var(--ink);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #5b21b6 0%, #3730a3 100%);
    color: #fff; padding: 44px 20px 36px; text-align: center;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -60%; right: -30%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.hero h1 {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 26px; font-weight: 900; margin-bottom: 8px;
    line-height: 1.3; position: relative;
}
.hero h1 .flag { font-size: 22px; vertical-align: -1px; margin-right: 2px; }
.hero-desc {
    font-size: 13px; opacity: 0.8; max-width: 320px;
    margin: 0 auto 24px; line-height: 1.6; position: relative;
}
.hero-stats { display: flex; justify-content: center; gap: 0; position: relative; }
.hero-stat { text-align: center; padding: 0 22px; position: relative; }
.hero-stat + .hero-stat::before {
    content: ''; position: absolute; left: 0;
    top: 4px; bottom: 4px; width: 1px;
    background: rgba(255,255,255,0.2);
}
.hero-stat-num { font-size: 28px; font-weight: 800; font-family: var(--sans); line-height: 1; }
.hero-stat-lbl { font-size: 10px; opacity: 0.6; margin-top: 4px; letter-spacing: 0.5px; }

/* ===== SECTION ===== */
.section { margin-top: 28px; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 14px; padding: 0 2px;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.section-count { font-size: 12px; color: var(--ink-4); }

/* ===== FEATURED RAIL ===== */
.feat-rail {
    display: flex; gap: 11px; overflow-x: auto;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 0 16px 10px;
}
.feat-rail::-webkit-scrollbar { display: none; }
.feat-card {
    flex-shrink: 0; width: 158px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; scroll-snap-align: start;
    transition: border-color 0.2s, transform 0.2s;
    text-decoration: none; color: inherit;
}
.feat-card:active { border-color: var(--accent); transform: scale(0.98); }
.feat-top {
    height: 58px; display: flex; align-items: center;
    justify-content: center; position: relative;
}
.feat-top.elite { background: var(--violet-soft); }
.feat-top.general { background: var(--bg); }
.feat-top.intl { background: #ecfeff; }
.feat-init { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.feat-prov {
    position: absolute; top: 6px; left: 6px;
    font-size: 9px; font-weight: 600; padding: 1px 6px;
    border-radius: 4px; letter-spacing: 0.3px;
}
.feat-prov.bc { background: var(--blue-soft); color: var(--blue); }
.feat-prov.on { background: var(--amber-soft); color: var(--amber); }
.feat-prov.ot { background: var(--rose-soft); color: var(--rose); }
.feat-score-tag {
    position: absolute; top: 6px; right: 6px;
    font-size: 11px; font-weight: 700; color: var(--accent);
    background: var(--surface); padding: 1px 7px; border-radius: 6px;
    border: 1px solid var(--accent-mid);
}
.feat-body { padding: 10px 11px 12px; }
.feat-name {
    font-size: 13px; font-weight: 600; color: var(--ink);
    margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feat-price { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--accent); }
.feat-price-unit { font-family: var(--sans); font-size: 10px; color: var(--ink-4); font-weight: 400; }
.feat-detail { font-size: 10px; color: var(--ink-4); margin-top: 2px; }
/* [Phase 3] feat-rail 뱃지 — mockup M2 */
.feat-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.feat-badge { font-size: 10px; padding: 2px 6px; border-radius: 999px; font-weight: 600; line-height: 1.4; }
.feat-badge.elite  { background: var(--teal-soft); color: var(--teal); }
.feat-badge.gen    { background: #f5f5f5; color: #333; }
.feat-badge.intl   { background: var(--amber-soft); color: var(--amber); }
.feat-badge.gender { background: #fafafa; color: #666; border: 1px solid #e0e0e0; }

/* ===== FILTER ===== */
.filter-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.f-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.f-row + .f-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.f-label {
    font-size: 10px; font-weight: 600; color: var(--ink-4);
    letter-spacing: 0.8px; text-transform: uppercase; min-width: 28px;
}
.f-chip {
    font-size: 12px; font-weight: 500; padding: 5px 13px; border-radius: 20px;
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-3);
    cursor: pointer; transition: all 0.15s var(--ease);
    -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.f-chip:active { transform: scale(0.96); }
.f-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.f-chip.soft { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-mid); }
.f-sep { width: 1px; height: 16px; background: var(--border); }
.f-search {
    width: 100%; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border); position: relative;
}
.f-search input {
    width: 100%; font-size: 13px; font-family: var(--sans);
    padding: 9px 12px 9px 34px; border: 1px solid var(--border);
    border-radius: 8px; outline: none; background: var(--bg); color: var(--ink);
    transition: border-color 0.2s;
}
.f-search input::placeholder { color: var(--ink-5); }
.f-search input:focus { border-color: var(--accent); }
.f-search .material-symbols-outlined {
    position: absolute; left: 10px; top: 50%;
    margin-top: 5px; transform: translateY(-50%);
    font-size: 18px; color: var(--ink-5);
}

/* ===== CARDS ===== */
/* [2026-04-14 v2] A1 · 1열 복구 + max-width 700px (homestay 일관성) */
.cards { display: flex; flex-direction: column; gap: 8px; max-width: 700px; margin: 0 auto; }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px;
    transition: border-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none; color: inherit; display: block;
}
.card:active { border-color: var(--accent); transform: scale(0.995); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-av {
    width: 56px; height: 50px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; flex-shrink: 0;
}
.card-av.elite { background: var(--violet-soft); border: 1px solid #e0d8f0; }
.card-av.general { background: var(--bg); border: 1px solid var(--border); }
.card-av.intl { background: #ecfeff; border: 1px solid #cffafe; }
.card-av-text { font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--ink-2); }
.card-av-score { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 1px; }
.card-info { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.card-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 4px; }
.badge.bc { background: var(--blue-soft); color: var(--blue); }
.badge.on { background: var(--amber-soft); color: var(--amber); }
.badge.ot { background: var(--rose-soft); color: var(--rose); }
.badge.elite { background: var(--violet-soft); color: var(--violet); }
.badge.general { background: var(--bg); color: var(--ink-3); }
.badge.intl { background: #ecfeff; color: #0891b2; }
.badge.male { background: #eff6ff; color: #2563eb; }
.badge.female { background: var(--rose-soft); color: var(--rose); }
.card-sub { font-size: 11px; color: var(--ink-4); margin-top: 4px; }
.cost-strip {
    display: flex; align-items: center; background: var(--bg);
    border-radius: 8px; padding: 10px 12px; border: 1px solid var(--border);
}
.cost-cell { flex: 1; }
.cost-cell:first-child { text-align: left; }
.cost-cell.mid { text-align: center; }
.cost-cell.end { text-align: right; }
.cost-lbl {
    font-size: 9px; color: var(--ink-4); font-weight: 500;
    letter-spacing: 0.4px; text-transform: uppercase; margin-bottom: 1px;
}
.cost-val { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.cost-op { color: var(--ink-5); font-size: 13px; font-weight: 300; padding: 0 4px; flex-shrink: 0; }
.cost-total .cost-val { font-size: 17px; font-weight: 700; color: var(--accent); }
.show-more { text-align: center; margin-top: 20px; }
.show-more button {
    font-size: 13px; font-weight: 500; font-family: var(--sans);
    padding: 10px 28px; border-radius: 24px; border: 1px solid var(--border);
    background: var(--surface); color: var(--ink-3); cursor: pointer;
    transition: all 0.15s;
}
.show-more button:active { background: var(--bg); transform: scale(0.97); }
.divider { height: 1px; background: var(--border); margin: 32px 0; }

/* ===== COMPARE SECTION ===== */
.compare-card {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 8px; text-decoration: none; color: var(--ink);
}
.compare-rank {
    font-family: var(--serif); font-size: 18px; font-weight: 700;
    color: var(--accent); min-width: 24px;
}
.compare-info { flex: 1; }
.compare-name { font-size: 14px; font-weight: 600; }
.compare-cost { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.compare-dots { display: flex; gap: 3px; }
.compare-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.compare-dots .dot.on { background: var(--accent); }

/* ===== BLOG ===== */
/* [2026-04-14 v2] A1 · 1열 복구 + max-width 700px */
.blog-list {
    display: flex; flex-direction: column; gap: 1px;
    background: var(--border); border-radius: var(--radius);
    overflow: hidden; border: 1px solid var(--border);
    max-width: 700px; margin: 0 auto;
}
.blog-item {
    display: flex; gap: 8px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--ink);
}
.blog-badge {
    font-size: 11px; padding: 2px 6px; border-radius: 4px;
    background: var(--bg); color: var(--ink-3); white-space: nowrap;
}
.blog-title { font-size: 14px; }
.blog-empty { text-align: center; padding: 20px; color: var(--ink-3); }
.blog-admin { text-align: right; padding: 12px 0; }
.btn-write {
    display: inline-block; padding: 8px 16px;
    border: 1px solid var(--accent); color: var(--accent);
    border-radius: var(--radius); text-decoration: none; font-size: 13px;
}

/* ===== ERROR STATE ===== */
.bd-error { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.bd-error button {
    margin-top: 12px; padding: 8px 16px;
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; background: white;
}

/* ===== SEARCH ===== */
.bd-search-box { margin: 0 0 16px; }
.bd-search-inner {
    display: flex; align-items: center;
    background: #f7f8fa; border: 2px solid #e2e6ea;
    border-radius: 12px; padding: 0 16px; transition: border-color .2s;
}
.bd-search-inner:focus-within { border-color: var(--accent); }
.bd-search-icon { font-size: 18px; margin-right: 8px; opacity: .5; }
.bd-search-input {
    flex: 1; border: none; background: transparent; padding: 12px 0;
    font-size: 15px; outline: none; font-family: inherit;
}
.bd-search-input::placeholder { color: #adb5bd; }
.bd-search-clear {
    border: none; background: transparent; font-size: 18px;
    color: #adb5bd; cursor: pointer; padding: 4px 8px;
}
.bd-search-clear:hover { color: #495057; }
.bd-search-count { font-size: 13px; color: var(--ink-4); margin-top: 6px; padding-left: 4px; }
.bd-search-scroll-hint {
    color: var(--accent); text-decoration: none; font-weight: 500; cursor: pointer;
}
.bd-search-scroll-hint:hover { text-decoration: underline; }
.bd-bounce-arrow {
    display: inline-block; font-weight: 700; font-size: 15px;
    animation: bd-bounce 1.5s ease infinite;
}
@keyframes bd-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(5px); opacity: 0.5; }
}

/* ===== v5 필터 재정비 추가 스타일 ===== */

/* 주별 헤더 */
.province-header {
    font-size: 13px; font-weight: 700; padding: 10px 14px;
    margin: 20px 0 8px; border-radius: 8px;
}
.province-header:first-child { margin-top: 0; }
.province-bc { background: var(--blue-soft); color: var(--blue); }
.province-on { background: var(--amber-soft); color: var(--amber); }
.province-other { background: var(--rose-soft); color: var(--rose); }

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
    .wrap { max-width: 560px; }
    .hero h1 { font-size: 30px; }
    .feat-card { width: 170px; }
    .card { padding: 16px 18px; }
    /* [2026-04-14 v2] A1: .blog-list 2열 제거 (1열 유지) */
    /* PC 스크롤바 표시 */
    .feat-rail::-webkit-scrollbar { display: block; height: 4px; }
    .feat-rail::-webkit-scrollbar-track { background: var(--bg); border-radius: 2px; }
    .feat-rail::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 2px; }
    .feat-rail { scrollbar-width: thin; scrollbar-color: var(--ink-5) var(--bg); }
}

/* [Phase 6-A] .wrap PC 폭 확장 — mobile-first 설계 보완 (2026-04-13) */
@media (min-width: 1024px) {
  .wrap { max-width: 1120px; padding: 0 24px; }
}
@media (min-width: 1400px) {
  .wrap { max-width: 1200px; }
}

/* [2026-04-14 v2] A1: .cards 2열 미디어쿼리 제거 (1열 유지) */
@media (min-width: 1024px) {
  .filter-box, .bd-search-box { max-width: 880px; margin-left: auto; margin-right: auto; }
}

/* [Phase 7] feat-rail PC 네비 버튼 */
.feat-rail-wrap { position: relative; }
.feat-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--ink-5, #e0e0e0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #333);
  z-index: 5;
  line-height: 1;
  padding: 0;
  transition: transform 0.15s;
}
.feat-nav:hover { transform: translateY(-50%) scale(1.08); }
.feat-nav.prev { left: 4px; }
.feat-nav.next { right: 4px; }
.feat-nav[disabled] { opacity: 0.35; cursor: not-allowed; }
@media (min-width: 1024px) and (hover: hover) {
  .feat-rail-wrap:hover .feat-nav { display: flex; align-items: center; justify-content: center; }
}

/* [Phase 8-X/Y] 필터/검색 왼쪽 정렬 + 네비 상시 (2026-04-13) */
@media (min-width: 1024px) {
  .bd-search-box {
    max-width: 400px;
    margin-left: 0 !important;
    margin-right: 0;
    margin-bottom: 4px;
  }
  .filter-box {
    max-width: 680px;
    margin-left: 0 !important;
    margin-right: 0;
    margin-top: 0;
  }
  .feat-rail-wrap .feat-nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .feat-nav[disabled] { opacity: 0.2; }
}

/* [Phase 9-A] 하단 공유 섹션 PC 2열 (prep_footer_sections 공유) (2026-04-13) */
@media (min-width: 1024px) {
  /* FAQ: 부모 자체 grid (id-check C3 패턴) */
  .prep-faq {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    column-gap: 16px;
  }
  .prep-faq h2 { grid-column: 1 / -1; }
  .prep-faq .faq-item { align-self: start; }

  /* 대학 진학 사례 — .university-list 자체 grid (id-check C2 패턴) */
  .prep-university .university-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .prep-university .university-item { align-self: start; }
  /* [id-check C4 반영] login-hint는 리스트 하단 풀폭 */
  .prep-university .university-list .uni-login-hint { grid-column: 1 / -1; }

  /* blog-list 시각 정돈 */
  .blog-list {
    background: transparent;
    border: 0;
    gap: 12px;
  }
  .blog-item {
    border: 1px solid var(--ink-200, #e0e0e0);
    border-radius: 8px;
    padding: 12px 14px;
  }
}

/* [Phase 9-B] 필터 내 검색창 인라인 통합 (2026-04-13) */
.f-row-region { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.f-search-inline { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #fff; border: 1px solid var(--ink-200, #e0e0e0); border-radius: 6px; position: relative; }
.f-search-inline:focus-within { border-color: var(--teal, #0f8a81); }
.f-search-inline .hs-search-input,
.f-search-inline .bd-search-input,
.f-search-inline input[type="text"] { border: 0; outline: none; background: transparent; font-size: 13px; font-family: inherit; min-width: 0; flex: 1 1 auto; }
.f-search-inline .hs-search-icon,
.f-search-inline .bd-search-icon { font-size: 14px; }
.f-search-inline .hs-search-clear,
.f-search-inline .bd-search-clear { border: 0; background: transparent; cursor: pointer; padding: 2px 4px; color: var(--ink-500, #666); }
.f-search-inline .hs-search-count,
.f-search-inline .bd-search-count { position: absolute; top: 100%; left: 0; margin-top: 4px; font-size: 11px; color: var(--ink-500, #666); }

@media (min-width: 1024px) {
  .f-search-inline { flex: 0 0 240px; margin-left: auto; }
}

@media (max-width: 767px) {
  .f-row-region { display: flex; flex-wrap: wrap; gap: 6px; }
  .f-row-region .f-label { flex: 1 1 100%; order: 1; }
  .f-row-region .f-chip { flex: 0 0 calc(25% - 5px); text-align: center; order: 2; font-size: 11px; padding: 5px 6px; }
  .f-search-inline { flex: 1 1 100%; order: 0; margin-bottom: 6px; }
}

/* [Phase 10] 로그인 시 province 헤더 풀폭 — 2026-04-14 A1 이후 .cards는 flex이므로 grid-column 무해 */
@media (min-width: 768px) {
  .cards .province-header { grid-column: 1 / -1; }
}

/* ===== [2026-04-14 v2] D2 · feat-rail 순위 번호 (reason 생략 — 기존 feat-badges 보존) ===== */
/* 기존 .feat-card overflow:hidden 유지. rank 배지는 카드 내부 우상단 배치 (id-check W3: BC/ON 뱃지 좌상단과 겹침 회피) */
.feat-card { position: relative; }

.feat-rank {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--teal, #0d7680);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    box-shadow: 0 1px 4px rgba(13, 118, 128, 0.3);
    z-index: 2;
    font-family: var(--sans, -apple-system, sans-serif);
    pointer-events: none;
}
