/* ============================================================================
 * mobile-concept-ps.css — 사립학교 목록 /private-schools/ 모바일(≤767px) 전용 배치 (opt-in 프로젝트 mobile · 사이클 4)
 * 확정 목업 「나안」 규격(앞 사이클과 같은 값, 이 페이지 고유 남색·금색·글꼴 유지). 폭 ≤ 767px 한정, 768px 이상 무영향.
 * 마크업·스크립트·링크는 그대로 두고 배치·모양만 바꾼다 (기능 100% 보존).
 * ========================================================================== */

@media (max-width: 767px) {

    /* ---------- 짧은 상단 ---------- */
    body .ps-hero { padding: 0; min-height: 0; }
    body .ps-hero .ps-hero-fade { display: none; }
    /* bugfix B52 R1-161: 휴대폰 첫 화면을 배너 · 필터가 다 차지해 첫 학교 제목이 문서 위 766px(390x664 창 밖)였다 — 배너 위아래 여백 · 필터 사이 간격을 줄이고,
       필터 이름표를 칸 왼쪽에 붙이고(2열 유지), 「필터 초기화」를 학비 이름표 줄 오른쪽에 올려 세로를 줄인다. 입력칸 높이 40px · 마크업 · 동작은 그대로. */
    body .ps-hero .ps-hero-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 10px 16px 10px; text-align: left; max-width: none; margin: 0; }
    body .ps-hero .ps-hero-eyebrow { grid-column: 1 / -1; margin: 0 0 2px; font-size: 12px; /* [bugfix B53 R1-313] 11 → 12 */ letter-spacing: .14em; text-align: left; }
    body .ps-hero .ps-hero-title { grid-column: 1 / -1; margin: 0 0 2px; font-size: 22px; line-height: 1.2; text-align: left; }
    body .ps-hero .ps-hero-subtitle { grid-column: 1 / -1; margin: 0 0 4px; font-size: 12px; text-align: left; }
    body .ps-hero .ps-hero-desc { grid-column: 1 / -1; margin: 0 0 6px; font-size: 12px; line-height: 1.5; text-align: left; max-width: none; }
    body .ps-hero .ps-hero-desc br { display: none; }
    body .ps-hero .ps-province-switch { grid-column: 1; margin: 0; padding: 3px; }
    body .ps-hero .ps-province-option { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 34px; padding: 5px 14px; font-size: 12.5px; }
    body .ps-hero .ps-hero-stat { grid-column: 2; justify-self: end; margin: 0; padding: 0; font-size: 12px; background: none; border: 0; box-shadow: none; }
    body .ps-hero .ps-hero-stat-icon { font-size: 14px; }
    body .ps-hero .ps-hero-stat strong { font-size: 15px; }

    /* ---------- 프리셋 칩 줄 ---------- */
    body .ps-preset-bar { padding: 6px 0 0; border-bottom: 0; }
    body .ps-preset-bar .ps-preset-inner { padding: 0 14px; gap: 6px; }
    body .ps-preset-bar .ps-preset-chip { min-height: 34px; padding: 6px 13px; font-size: 12.5px; font-weight: 700; }

    /* ---------- 필터 상자 (지역 · 검색+정렬 · 2열 선택 · 학비 범위 · 초기화) ---------- */
    body .ps-district-filter { position: static; padding: 6px 0 0; border: 0; background: transparent; box-shadow: none; }
    body .ps-district-filter .ps-district-filter-inner { display: flex; align-items: center; gap: 8px; padding: 0 14px; max-width: none; }
    body .ps-district-filter .ps-district-label { flex: 0 0 auto; font-size: 12px; gap: 4px; }
    body .ps-district-filter .ps-district-select { flex: 1; min-width: 0; max-width: none; min-height: 40px; font-size: 13px; }
    body .ps-toolbar { padding: 6px 0 0; background: transparent; border: 0; }
    body .ps-toolbar .ps-toolbar-inner { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0 14px; max-width: none; }
    body .ps-toolbar .ps-search { flex: 1 1 0; min-width: 0; max-width: none; }
    body .ps-toolbar .ps-search-input { width: 100%; min-height: 40px; font-size: 13px; }
    body .ps-toolbar .ps-sort { flex: 0 0 auto; width: auto; gap: 0; }
    body .ps-toolbar .ps-sort-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    body .ps-toolbar .ps-sort-select { flex: none; width: 118px; min-height: 40px; font-size: 12.5px; }
    body .ps-filters { padding: 6px 0 0; border: 0; background: transparent; }
    body .ps-filters .ps-filters-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 0 14px; max-width: none; }
    body .ps-filters .ps-filter-group { flex-direction: row; align-items: center; gap: 6px; margin: 0; min-width: 0; }
    /* [bugfix B53 R1-282 · R1-313] 필터 이름 · 「필터 초기화」 글자: 옅은 회색 #94a3b8(대비 2.56) → B48 보조 글자 #5d6c73, 이름 11 → 12px */
    body .ps-filters .ps-filter-label { flex: 0 0 auto; margin: 0; font-size: 12px; color: #5d6c73; }
    body .ps-filters .ps-filter-select { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 40px; font-size: 13px; }
    /* 학비 묶음은 상자를 풀어(display: contents) 이름표와 「필터 초기화」가 한 줄(3줄째), 범위 막대가 그 아래 줄(4줄째)을 쓴다. */
    body .ps-filters .ps-filter-tuition { display: contents; }
    body .ps-filters .ps-filter-tuition .ps-filter-label { grid-column: 1; grid-row: 3; align-self: center; }
    body .ps-filters .ps-filter-tuition .ps-tuition-range { grid-column: 1 / -1; grid-row: 4; }
    /* [bugfix B53 R1-285] 학비 범위: 따로 떨어진 막대 둘(각 90px) → 두 입력을 범위 칸 폭 한 막대 위에 겹치고, 고른 구간만 청록 #0d7680 으로 채운다.
       채움 위치는 app.js 가 값으로 정하는 --ps-lo · --ps-hi(0 ~ 1). 손잡이(24px)만 누를 수 있고 막대 줄 높이는 44px. 입력 · 값 · 단계 · 동작 그대로 */
    body .ps-filters .ps-tuition-range { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(44px, auto); align-items: center; column-gap: 12px; }
    body .ps-filters .ps-tuition-range::before {
        content: ""; grid-row: 1; grid-column: 1; height: 6px; border-radius: 999px;
        background: linear-gradient(to right,
            #e2e8f0 calc(12px + (100% - 24px) * var(--ps-lo, 0)), #0d7680 calc(12px + (100% - 24px) * var(--ps-lo, 0)),
            #0d7680 calc(12px + (100% - 24px) * var(--ps-hi, 1)), #e2e8f0 calc(12px + (100% - 24px) * var(--ps-hi, 1)));
    }
    body .ps-filters .ps-tuition-range input[type="range"] {
        grid-row: 1; grid-column: 1; box-sizing: border-box; width: 100%; height: 24px; margin: 0; padding: 0;
        -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none;
    }
    body .ps-filters .ps-tuition-range input[type="range"]::-webkit-slider-runnable-track { height: 24px; background: transparent; border: 0; }
    body .ps-filters .ps-tuition-range input[type="range"]::-moz-range-track { height: 24px; background: transparent; border: 0; }
    body .ps-filters .ps-tuition-range input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none; appearance: none; pointer-events: auto; box-sizing: border-box; width: 24px; height: 24px; margin-top: 0;
        border: 2px solid #fff; border-radius: 50%; background: #0d7680; box-shadow: 0 0 0 1px #0d7680; cursor: pointer;
    }
    body .ps-filters .ps-tuition-range input[type="range"]::-moz-range-thumb {
        pointer-events: auto; box-sizing: border-box; width: 24px; height: 24px;
        border: 2px solid #fff; border-radius: 50%; background: #0d7680; box-shadow: 0 0 0 1px #0d7680; cursor: pointer;
    }
    body .ps-filters .ps-tuition-range input[type="range"]:focus { outline: none; }
    body .ps-filters .ps-tuition-range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px #0d7680, 0 0 0 4px rgba(13, 118, 128, .3); }
    body .ps-filters .ps-tuition-range input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px #0d7680, 0 0 0 4px rgba(13, 118, 128, .3); }
    body .ps-filters .ps-filter-reset { grid-column: 2; grid-row: 3; justify-self: end; align-self: center; min-height: 40px; padding: 6px 14px; font-size: 12.5px; color: #5d6c73; }
    body .ps-result-bar { padding: 4px 0 0; }
    body .ps-result-bar .ps-result-bar-inner { padding: 0 16px; max-width: none; }
    body .ps-result-bar .ps-result-info { font-size: 12.5px; }

    /* ---------- 학교 리스트 행 ---------- */
    body .ps-content { padding: 0; }
    body .ps-section .ps-section-header { padding: 6px 16px 4px; }
    body .ps-section .ps-section-title { font-size: 17px; }
    body .ps-section + .ps-section .ps-section-header { padding-top: 12px; }
    body .ps-section + .ps-section .ps-section-header::before { display: none; }
    body .ps-school-grid { display: block; margin: 0 14px; padding: 0; background: #fff; border: 1px solid #e6e8ee; border-radius: 14px; overflow: hidden; }
    body .ps-school-card { position: relative; display: block; margin: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid #e6e8ee; border-radius: 0; box-shadow: none; transform: none; background: #fff; }
    body .ps-school-card:last-child { border-bottom: 0; }
    body .ps-school-card::before { display: none; }
    body .ps-school-card .ps-card-header, body .ps-school-card .ps-card-info { display: block; margin: 0; padding: 0; }
    body .ps-school-card .ps-card-name { margin: 0; padding-right: 86px; font-size: 14px; line-height: 1.35; letter-spacing: -.02em; }
    /* [bugfix B53 R1-282 · R1-313] 카드 도시 · 「학비 문의」 · 소개문 · 태그 글자 12px 이상, 소개문은 한 줄 말줄임 → 두 줄까지 보이고 말줄임 */
    body .ps-school-card .ps-card-city { margin: 1px 0 0; font-size: 12px; letter-spacing: .04em; }
    body .ps-school-card .ps-card-tuition { position: absolute; right: 12px; top: 10px; margin: 0; font-size: 13px; font-weight: 800; }
    body .ps-school-card .ps-card-tuition-na { font-size: 12px; font-weight: 600; }
    body .ps-school-card .ps-card-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; margin: 3px 0 0; font-size: 12px; line-height: 1.5; white-space: normal; overflow: hidden; }
    body .ps-school-card .ps-card-tags { margin: 5px 0 0; gap: 5px; flex-wrap: wrap; }
    body .ps-school-card .ps-card-tags span { font-size: 12px; }
    body .ps-school-card .ps-card-footer { display: none; }

    /* ---------- 더 보기 · 빈 결과 ---------- */
    body .ps-loadmore-wrap { padding: 8px 14px 6px; }
    body .ps-loadmore-wrap .ps-loadmore-btn { width: 100%; min-height: 44px; padding: 10px 16px; font-size: 13px; justify-content: center; }
    body .ps-empty { padding: 28px 16px; }
    body .ps-loading { padding: 28px 16px; }
}

/* bugfix B91 R1-161 — 휴대폰(≤767px)에서 상세 필터(학년 · 종교 · 보딩 · 도시 · 학비 · 초기화)를 접힌 채 열고 지역 줄 오른쪽 「필터」 단추로 펼친다.
   새 색 · 새 글꼴 0: 단추 모양은 같은 줄 정렬 칸(흰 바탕 · #e2e8f0 테두리 · 40px), 고른 수는 학교 수 배지(.ps-section-count) 색, 펼친 상태 테두리는 정렬 칸 초점 색. PC 는 단추를 숨겨 그대로. */
.ps-filter-toggle { display: none; }
@media (max-width: 767px) {
    body .ps-district-filter .ps-filter-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; min-height: 40px; padding: 0 11px; border: 1px solid #e2e8f0; border-radius: var(--radius-sm, 8px); background: #fff; font-family: var(--font-body); font-size: 12.5px; font-weight: 700; color: var(--ink-deep); cursor: pointer; }
    body .ps-district-filter .ps-filter-toggle[aria-expanded="true"] { border-color: var(--azure-bright); box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.1); }
    body .ps-district-filter .ps-filter-toggle:focus-visible { outline: 2px solid var(--azure-bright); outline-offset: 2px; }
    body .ps-district-filter .ps-filter-toggle-count { min-width: 18px; padding: 0 6px; border-radius: 100px; background: rgba(0, 102, 204, 0.08); color: var(--azure-pure); font-size: 11.5px; line-height: 18px; text-align: center; }
    body .ps-district-filter .ps-filter-toggle-count[hidden] { display: none; }
    body .ps-district-filter .ps-filter-toggle-arrow { transition: transform .15s ease; }
    body .ps-district-filter .ps-filter-toggle[aria-expanded="true"] .ps-filter-toggle-arrow { transform: rotate(180deg); }
    body .ps-filters:not(.is-open) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ps-filter-toggle-arrow { transition: none; } }
