/* =========================================================================
   _high 디자인 시스템 — highsample.html 디자인 토큰 기반 반응형 홈페이지

   [타이포그래피 규칙]
   - 폰트 크기는 12 / 14 / 16px 3종만 사용 (16px 가 최대, 기본 14px).
   - 위계는 굵기(400/700·800)와 색/여백으로 표현 → 총 6종(3크기 × 2굵기).
     · 16px : 페이지/섹션/카드 제목, 가장 강한 강조
     · 14px : 본문·버튼·링크·입력·표 (기본)
     · 12px : 라벨·메타·날짜·뱃지·캡션
   ========================================================================= */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --text-primary: #333333;
    --text-secondary: #9299a2;
    --accent-blue: #d4efff;
    --accent-blue-strong: #8fd4ff;
    --accent-dark: #2b2b2b;
    --smp-green: #7ac143;
    --smp-blue: #1a7a8c;
    --divider: #f0f0f0;
    --line: #e9ecef;
    --danger: #ff4d4d;
    --ok: #198754;
    --radius: 14px;
    --radius-sm: 8px;
    --header-h: 76px;          /* 로고(63) + 위아래 6.5px 여백 → 하단 선과 최소 5px 이상 */
    --fs-lg: 16px;
    --fs-base: 14px;
    --fs-sm: 12px;
    --shadow: 0 4px 18px rgba(0, 0, 0, .06);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .18);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--fs-base);
    line-height: 1.6;
    word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; font-size: var(--fs-base); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ============================ Header / Nav ============================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--divider);
}
.header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-logo { display: block; width: auto; }
.brand-logo-pc { height: 63px; }
.brand-logo-mo { height: 37px; display: none; }
.brand-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--smp-green), var(--smp-blue));
    color: #fff;
    border-radius: 9px;
    display: grid; place-items: center;
    font-size: var(--fs-lg); font-weight: 800;
    letter-spacing: -.5px;
}
.brand-text { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.5px; display: flex; flex-direction: column; line-height: 1.15; }
.brand-text em { font-style: normal; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-link {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-primary);
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg-secondary); }
.nav-link.is-active { background: var(--accent-dark); color: #fff; font-weight: 700; }
.nav-auth { border: 1px solid var(--line); color: var(--text-secondary); margin-left: 6px; }
.nav-auth:hover { background: var(--bg-secondary); color: var(--text-primary); }

.nav-toggle {
    margin-left: auto;
    width: 42px; height: 42px;
    border: 1px solid var(--divider);
    background: #fff;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================ Main / Sections ============================ */
.site-main { min-height: 60vh; }

.page-head { padding: 40px 0 16px; }
.page-head .container,
.page-head .container-narrow { display: flex; flex-direction: column; gap: 6px; }
.page-eyebrow { font-size: var(--fs-sm); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-blue-strong); }
.page-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.3px; }
.page-title-sub { margin-left: 4px; font-size: var(--fs-base); font-weight: 400; color: var(--text-secondary); }
.page-desc { color: var(--text-secondary); font-size: var(--fs-base); }

.section { padding: 14px 0 40px; }
/* .section 의 좌우 padding 0 이 .container 의 0 20px 를 덮어써 본문이 가장자리에 붙던 문제 →
   container 와 동일한 좌우 여백(20px)으로 복구 (page-head 와 정렬) */
.container.section { padding-left: 20px; padding-right: 20px; }
.section-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 14px; }

/* ============================ Buttons ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--divider);
    background: #fff;
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: var(--fs-base);
    font-weight: 600;
    transition: all .18s;
    line-height: 1;
}
.btn:hover { background: var(--bg-secondary); }
.btn-dark { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.btn-dark:hover { background: #000; }
.btn-blue { background: var(--accent-blue); border-color: var(--accent-blue); color: var(--text-primary); }
.btn-ghost { background: none; }
.btn-sm { padding: 7px 14px; font-size: var(--fs-sm); }
.btn-lg { padding: 14px 26px; font-size: var(--fs-lg); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-block { width: 100%; }

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--fs-sm);
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-secondary);
}
.pill-y { background: #e7f6ee; color: var(--ok); }
.pill-n { background: #eef0f2; color: #6c757d; }
.pill-drop { background: #fdeaea; color: #dc3545; }
.pill-soon { background: #e7f0fb; color: #2563a8; }

/* ============================ Cards ============================ */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-body { padding: 22px; }

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: var(--fs-base);
}

/* ============================ Home ============================ */
/* 히어로 — 슬로건 쇼케이스. 다이나믹 배경(떠다니는 브랜드 블롭 + 학습 모눈 격자, 이미지 없음).
   ※ 본문 타이포 규칙(12/14/16px)의 예외 영역: 메인 임팩트를 위해 clamp 로 반응형 확대. */
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;                         /* 격자/블롭(음수 z-index) 을 .hero 안에 가둠 */
    background:
        radial-gradient(120% 85% at 86% -25%, rgba(122, 193, 67, .18) 0%, rgba(122, 193, 67, 0) 55%),   /* 우상단 그린(브랜드) */
        radial-gradient(120% 95% at -8% 120%, rgba(26, 122, 140, .15) 0%, rgba(26, 122, 140, 0) 55%),    /* 좌하단 블루(브랜드) */
        linear-gradient(160deg, #eef7ff 0%, #f5faff 48%, #ffffff 100%);
    border-bottom: 1px solid var(--divider);
}
/* 학습 노트(모눈종이) 격자 — 이미지 없이 CSS gradient. 좌상단에서 시작해 부드럽게 사라짐 */
.hero::before {
    content: "";
    position: absolute; inset: 0; z-index: -2;
    background-image:
        linear-gradient(to right, rgba(26, 122, 140, .05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26, 122, 140, .05) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(130% 110% at 18% -5%, #000 30%, transparent 82%);
            mask-image: radial-gradient(130% 110% at 18% -5%, #000 30%, transparent 82%);
    animation: heroGridPan 8s linear infinite;      /* 모눈이 대각선으로 흐름 */
    will-change: background-position;
    pointer-events: none;
}
@keyframes heroGridPan { to { background-position: 34px 34px; } }   /* 타일 1칸(34px) 이동 → 끊김 없이 반복 */
/* 다이나믹 배경: 흐르는 오로라 색 워시 — 이미지 아님. 큰 그라데이션을 background-position 으로 움직여 확실히 보이게 */
.hero::after {
    content: "";
    position: absolute; inset: -25%; z-index: -3;
    background:
        radial-gradient(38% 48% at 22% 30%, rgba(122, 193, 67, .34), transparent 72%),
        radial-gradient(42% 52% at 78% 22%, rgba(143, 212, 255, .36), transparent 72%),
        radial-gradient(46% 56% at 62% 88%, rgba(26, 122, 140, .30), transparent 72%);
    background-size: 200% 200%;
    filter: blur(26px);
    will-change: background-position;
    animation: heroAurora 5s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes heroAurora {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 20%; }
    100% { background-position:  35% 100%; }
}
/* 다이나믹 배경: 천천히 떠다니는 브랜드 컬러 블롭(blur 원형, 이미지 아님) */
.hero-deco { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(22px); will-change: transform; }
.hero-orb-1 { width: 280px; height: 280px; top: -80px; right: 5%;
    background: radial-gradient(circle at 32% 30%, rgba(122, 193, 67, .55), rgba(122, 193, 67, 0) 70%);
    animation: heroFloat 3s ease-in-out infinite alternate; }
.hero-orb-2 { width: 220px; height: 220px; bottom: -90px; left: 3%;
    background: radial-gradient(circle at 32% 30%, rgba(26, 122, 140, .42), rgba(26, 122, 140, 0) 70%);
    animation: heroFloat 4s ease-in-out infinite alternate; animation-delay: -5s; }
.hero-orb-3 { width: 160px; height: 160px; top: 24%; left: 46%;
    background: radial-gradient(circle at 32% 30%, rgba(143, 212, 255, .5), rgba(143, 212, 255, 0) 70%);
    animation: heroFloat 3s ease-in-out infinite alternate; animation-delay: -3s; }
/* alternate 로 왕복 → 끊김 없이, 진폭을 키워 확실히 보이게 */
@keyframes heroFloat {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(44px, -36px, 0) scale(1.14); }
}

.hero-inner { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto;
    padding: clamp(24px, 9vw, 66px) 20px clamp(16px, 8vw, 58px); }   /* 위·아래 격자 1칸(34px)씩 축소 */

/* 슬로건 */
.hero-slogan { position: relative; display: flex; flex-direction: column; gap: clamp(8px, 1.4vw, 14px); max-width: 760px; }
.hero-slogan::before { content: ""; width: 40px; height: 4px; margin-bottom: 18px; border-radius: 4px;
    background: linear-gradient(90deg, var(--smp-green), var(--smp-blue)); }   /* 디자인 액센트 바 */
.hero-lead { font-size: clamp(16px, 2.1vw, 22px); font-weight: 700; line-height: 1.5; letter-spacing: -.02em; color: #4a5560; }
.hero-emph { font-size: clamp(23px, 3.7vw, 40px); font-weight: 800; line-height: 1.32; letter-spacing: -.035em; color: var(--accent-dark); }
.hero-emph b { font-weight: 800; color: var(--smp-blue); white-space: nowrap;
    background: linear-gradient(180deg, transparent 62%, rgba(122, 193, 67, .28) 62%); padding: 0 .04em; border-radius: 3px; }   /* 브랜드명 형광펜 하이라이트 */

/* (접근성) 원래 prefers-reduced-motion 사용자에겐 모션을 정지했으나, 운영자 요청으로
   OS '동작 줄이기'(Windows 애니메이션 효과 OFF / iOS 동작 줄이기) 설정과 무관하게 항상 재생함.
   동작 줄이기 사용자까지 다시 정지시키려면 아래 한 줄을 되살리세요:
   @media (prefers-reduced-motion: reduce) { .hero-orb, .hero::before, .hero::after { animation: none; } } */

.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: stretch; }   /* 양쪽 컬럼 높이 맞춤(배너가 공지 높이를 채우도록) */
.home-cols-solo { grid-template-columns: 1fr; }   /* 배너·바로가기 모두 없을 때(지점 미선택) 공지사항 단독 풀폭 */
.home-col { min-width: 0; }
/* 배너 없을 때: 학년별 개설강좌 바로가기 2x2 (공지 높이를 채움) */
.grade-shortcuts { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 14px; height: 100%; }
.grade-card { --gc: #2563eb; --gcbg: #edf3ff; position: relative; display: flex; flex-direction: column; gap: 7px; padding: 15px 16px 14px; border-radius: 16px; text-decoration: none; border: 1px solid #e6eaf0; background: #fff; min-height: 104px; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.grade-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gc); }              /* 좌측 accent 스트라이프 */
.grade-card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 70px; height: 70px; border-radius: 50%; background: var(--gcbg); }   /* 코너 장식 */
.grade-card .gc-head { position: relative; display: flex; align-items: center; gap: 7px; }
.grade-card .gc-grade { font-size: 13px; font-weight: 800; color: #fff; background: var(--gc); border-radius: 7px; padding: 2px 8px; }
.grade-card .gc-label { font-size: 12px; font-weight: 700; color: #475569; }
.grade-card .gc-count { position: relative; font-size: 14px; font-weight: 800; color: var(--gc); }
.grade-card .gc-go { position: relative; margin-top: auto; font-size: 12px; font-weight: 700; color: var(--gc); display: flex; align-items: center; gap: 3px; }
.grade-card .gc-go i { font-style: normal; transition: transform .15s ease; }
/* 학년별 파스텔 accent (2x2 순서: 중3·고1·고2·고3) */
.grade-card:nth-child(1) { --gc: #2563eb; --gcbg: #edf3ff; }
.grade-card:nth-child(2) { --gc: #0d9488; --gcbg: #e7f6f3; }
.grade-card:nth-child(3) { --gc: #d97706; --gcbg: #fdf3e3; }
.grade-card:nth-child(4) { --gc: #7c3aed; --gcbg: #f3edfe; }
.grade-card:not(.is-off):hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15, 23, 42, .10); border-color: var(--gc); }
.grade-card:not(.is-off):hover .gc-go i { transform: translateX(3px); }
/* 개설강좌 없음 → 비활성(확실히 구분) */
.grade-card.is-off { --gc: #aab0bb; --gcbg: #f0f1f4; background: #f4f5f8; border-color: #e8eaef; cursor: default; }
.grade-card.is-off .gc-grade { background: #c2c8d2; }
.grade-card.is-off .gc-label { color: #9aa3af; }
.grade-card.is-off .gc-count { color: #aeb6c0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head .section-title { margin-bottom: 0; }
.more-link { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); white-space: nowrap; }
.more-link:hover { color: var(--text-primary); }

@media (max-width: 860px) {
    .home-cols { grid-template-columns: 1fr; gap: 28px; }
}

/* ============================ 개설강좌 (class) ============================ */
.subject-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.subject-tab {
    border: 1px solid var(--divider);
    background: #fff;
    color: var(--text-primary);
    border-radius: 999px;
    padding: 9px 16px;
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1;
    transition: all .18s;
}
.subject-tab.is-active { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); font-weight: 700; }
/* PC 필터 배치: 왼쪽=학년(위)·과목(아래) / 오른쪽 끝=선생님 */
.filter-area { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.filter-left { flex: 1 1 auto; min-width: 0; }
.filter-right { flex: 0 0 auto; }
.subject-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.subject-bar .subject-tabs { margin-bottom: 0; }
/* 선생님 select — 과목 탭과 동일한 크기감(높이·글꼴·라운드) */
.teacher-filter { font-size: var(--fs-base); font-weight: 600; padding: 9px 16px; border: 1px solid var(--divider); border-radius: 999px; background: #fff; min-width: 180px; max-width: 260px; line-height: 1; }
/* 학년 탭 (서버사이드 링크 — .subject-tab 와 별개 클래스로 app.js 간섭 방지) */
.grade-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.grade-bar .grade-lab { font-size: var(--fs-sm); color: var(--text-secondary); font-weight: 700; }
.grade-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.grade-tab { border: 1px solid var(--divider); background: #fff; color: var(--text-primary); border-radius: 999px; padding: 9px 16px; font-size: var(--fs-base); font-weight: 600; line-height: 1; text-decoration: none; transition: all .18s; }
.grade-tab:hover { border-color: var(--accent-blue-strong); }
.grade-tab.is-active { background: var(--accent-blue); color: var(--text-primary); border-color: var(--accent-blue-strong); font-weight: 700; }
/* 모바일 필터(select 묶음) — 데스크탑 숨김, 모바일에서만 노출(선생님 / 학년·과목) */
.mobile-filters { display: none; }

.schedule-wrap {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 30px;
}
@media (max-width: 1000px) {
    /* 가로 ≤1000px: 시간표 영역 숨김 + 학년·과목·선생님 필터를 탭→select 로 전환 */
    .schedule-wrap { display: none; }
    .filter-area { display: none; }
    .mobile-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
    .mobile-filters .mf-row { display: flex; gap: 8px; }
    .mobile-filters .mf-sel { font-size: var(--fs-base); font-weight: 600; padding: 10px 12px; border: 1px solid var(--divider); border-radius: 10px; background: #fff; min-width: 0; }
    .mobile-filters .mf-teacher { width: 100%; }
    .mobile-filters .mf-row .mf-sel { flex: 1 1 0; }
}
.schedule-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.schedule-table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.schedule-table th { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); padding: 6px 0 10px; }
.schedule-table .time-col { width: 80px; }
.schedule-table td {
    background: #fff;
    border-radius: var(--radius-sm);
    vertical-align: top;
    padding: 6px;
    height: 64px;
}
.schedule-table td.time-cell {
    background: transparent;
    text-align: center;
    padding: 4px 2px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    height: auto;
}
.time-cell .tc-s, .time-cell .tc-e { display: block; white-space: nowrap; }
.time-cell .tc-sep { display: block; color: #c0c6cf; line-height: 1; }
.sch-item {
    border-radius: 8px;
    padding: 8px 9px;
    margin-bottom: 5px;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,.04);
}
.sch-item:last-child { margin-bottom: 0; }
.sch-title { font-size: var(--fs-sm); font-weight: 700; color: var(--text-primary); }
.sch-sub-prefix { display: none; color: #6b7280; }
.is-all-subject .sch-sub-prefix { display: inline; }
.sch-teacher {
    display: inline-block;
    margin-top: 4px;
    background: none; border: 0; padding: 0;
    font-size: 12px; color: #6b7280;
    text-decoration: none;
}
.sch-empty { color: #cfd4da; font-size: var(--fs-sm); }
.sch-apply { display: none; }   /* 데스크탑: 셀 클릭으로 신청. 모바일에서만 버튼 노출 */
.sch-time { display: none; }     /* 데스크탑: 좌측 시간열 사용. 모바일에서만 박스 안에 시간 표시 */
.sch-subj { display: none; font-size: 12px; color: #4b5563; font-weight: 700; }
.is-all-subject .sch-subj { display: block; }
.sch-cname { font-size: 12px; font-weight: 500; color: var(--text-primary); margin-top: 1px; }
.sch-status { display: inline-block; font-size: 11px; font-weight: 700; margin-top: 3px; padding: 2px 8px; border-radius: 999px; }
.sch-st-y { background: #e8f5e9; color: #1b7f4d; } .sch-st-n { background: #eeeeee; color: #6c757d; } .sch-st-drop { background: #fdecea; color: #c0392b; }
.sm-subj { display: none; font-size: 12px; color: #4b5563; font-weight: 700; margin-top: 4px; }
.is-all-subject .sm-subj { display: block; }

/* 시간표 파스텔 */
.pastel-1{background:#fff3f3}.pastel-2{background:#fff7e6}.pastel-3{background:#fffbe6}
.pastel-4{background:#f3fae8}.pastel-5{background:#eaf8f1}.pastel-6{background:#eaf7fb}
.pastel-7{background:#edf4ff}.pastel-8{background:#f3f0ff}.pastel-9{background:#fff0f6}
.pastel-10{background:#f5f5f5}.pastel-11{background:#f0f7ff}.pastel-12{background:#f6f1ea}

/* 모바일 시간표 */
.schedule-mobile { display: none; }
.sm-day { margin-bottom: 18px; }
.sm-day-title {
    position: sticky; top: var(--header-h); z-index: 1;
    background: var(--bg-secondary);
    padding: 8px 0;
    font-size: var(--fs-lg); font-weight: 800;
    border-bottom: 2px solid var(--accent-dark);
}
.sm-card {
    margin-top: 10px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,.05);
}
.sm-time { font-size: var(--fs-sm); font-weight: 700; color: var(--text-secondary); }
.sm-title { margin-top: 4px; font-size: var(--fs-base); font-weight: 500; }
.sm-actions { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* 강사 그리드 */
.teacher-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.teacher-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    text-align: left;
    padding: 0;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.teacher-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-dark); }
.teacher-thumb { aspect-ratio: 2/3; background: var(--bg-secondary); }   /* 업로드 2:3 사진에 맞춰 여백 제거 */
.teacher-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.teacher-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #bbb; font-size: var(--fs-sm); }
.teacher-body { padding: 14px 16px; }
.teacher-name { font-size: var(--fs-lg); font-weight: 700; }
.teacher-subject { margin-top: 3px; font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }   /* 과목 많아도 2줄 고정 → 카드 높이 정렬 유지 */

/* 강좌 목록 (전체 시간표 아래, 한 줄에 하나 — 아이콘/메타 없이 신청하기만) */
.course-group { margin-top: 22px; }
.course-group:first-child { margin-top: 0; }
.course-group-title { font-size: var(--fs-base); font-weight: 800; color: var(--smp-blue); padding: 4px 4px 8px; border-bottom: 2px solid var(--accent-dark); scroll-margin-top: 80px; }
.course-row { display: flex; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--divider); }
.course-row-info { flex: 1; min-width: 0; }
.course-row-info h3 { font-size: var(--fs-base); font-weight: 700; }
.course-row-info p { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-secondary); }
.btn-apply { flex: 0 0 auto; border: 1px solid var(--accent-dark); background: #fff; color: var(--text-primary); padding: 9px 20px; border-radius: 999px; font-size: var(--fs-base); font-weight: 600; transition: all .15s; }
.btn-apply:hover { background: var(--accent-dark); color: #fff; }
.course-status { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--text-secondary); }

/* 사진 없는 강사 placeholder (이미지 없음 문구 대신 실루엣) */
.teacher-avatar { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef6ff, #f4f0ff); }
.teacher-avatar svg { width: 42%; height: 42%; fill: #c2d1de; }

/* 개설강좌 상단 관리자 바 */
.admin-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 14px; background: var(--bg-secondary); border-radius: 10px; font-size: var(--fs-sm); color: var(--text-secondary); }
.admin-bar b { color: var(--text-primary); }
.admin-bar .btn { margin-left: auto; }

/* ============================ Modal layer ============================ */
.hi-layer { position: fixed; inset: 0; z-index: 1000; }
.hi-layer[hidden] { display: none; }
.hi-layer-dim { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.hi-layer-box {
    position: relative;
    width: min(680px, calc(100% - 28px));
    max-height: calc(100vh - 64px);
    margin: 32px auto;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;   /* 라운드 유지: 스크롤바가 모서리 안 깨도록 — 스크롤은 .hi-layer-body 가 담당 */
    box-shadow: var(--shadow-lg);
}
.hi-layer-body { max-height: calc(100vh - 64px); overflow-y: auto; padding: 30px; }
.hi-layer-close {
    position: absolute; top: 14px; right: 16px;
    z-index: 5;   /* sticky 헤더 위에 표시 */
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: var(--bg-secondary);
    font-size: var(--fs-lg); line-height: 1;
}
.popup-title { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.3px; padding-right: 30px; }
.popup-subtitle { margin-top: 6px; color: var(--text-secondary); font-size: var(--fs-sm); }
.popup-section { margin-top: 18px; line-height: 1.8; font-size: var(--fs-base); }
.popup-section-title { margin-top: 22px; margin-bottom: 8px; font-size: var(--fs-base); font-weight: 700; }
.popup-info {
    margin-top: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    line-height: 1.9;
    font-size: var(--fs-base);
}
.popup-info b { display: inline-block; min-width: 64px; color: var(--text-secondary); font-weight: 600; }
.popup-actions { margin-top: 22px; display: flex; gap: 10px; }
.popup-html { font-size: var(--fs-base); }
.popup-html p { margin: 0 0 10px; }
.popup-html ul, .popup-html ol { padding-left: 20px; }
.popup-html img { margin: 8px 0; border-radius: 8px; }
.popup-html h1, .popup-html h2, .popup-html h3, .popup-html h4,
.notice-view-body h1, .notice-view-body h2, .notice-view-body h3, .notice-view-body h4 {
    font-size: var(--fs-lg); font-weight: 700; margin: 14px 0 8px; line-height: 1.5;
}

/* 선생님 팝업 — 큰 사진(2:3) 옆에 주요 이력 */
.popup-teacher-head { display: flex; gap: 22px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line); }   /* 사진+주요이력 (sticky 미사용 — 팝업 전체 스크롤) */
.popup-teacher-meta { flex: 1 1 auto; min-width: 0; }
.popup-teacher-photo-lg { position: relative; flex: 0 0 220px; width: 220px; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--bg-secondary); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(15, 23, 42, .14); }   /* 클릭(팝업) 시 이미지 테두리·프레임 */
.popup-teacher-photo-lg img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.popup-teacher-photo-lg .tps-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.popup-teacher-photo-lg .tps-slide.on { opacity: 1; }
.popup-teacher-career { margin-top: 14px; }
.popup-teacher-career .popup-section-title { margin-top: 0; }
.popup-course-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }   /* PC: 한 줄에 2개 */
.popup-course-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pcr-info { flex: 1; min-width: 0; }
.pcr-apply { flex: 0 0 auto; }
.pcr-title { display: block; font-size: var(--fs-base); font-weight: 700; }
.pcr-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: var(--fs-sm); color: var(--text-secondary); align-items: center; }
.crs-grade { display: inline-block; font-size: 11px; font-weight: 800; color: #2563eb; background: #eef4ff; border-radius: 5px; padding: 1px 6px; margin-right: 4px; vertical-align: middle; line-height: 1.7; }   /* 강좌명 앞 대상 학년 뱃지 */
.req-class-card { margin: 14px 0 16px; }   /* 수업신청 팝업의 수업 정보 카드 간격 */
@media (max-width: 560px) {
    /* 모바일: sticky 없이 사진을 가운데 큼직하게(별도 프로필 느낌) */
    .popup-teacher-head { flex-direction: column; align-items: center; gap: 14px; position: static; padding-bottom: 0; border-bottom: 0; text-align: center; }
    .popup-teacher-photo-lg { width: 190px; align-self: center; }
    .popup-teacher-meta { text-align: center; width: 100%; display: block; max-height: none; }
    .popup-teacher-meta .popup-title { padding-right: 0; }
    .popup-teacher-career { text-align: left; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--divider); overflow: visible; }
    .popup-course-list { grid-template-columns: 1fr; }   /* 모바일: 한 줄에 1개 */
}

.course-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 8px; }
.course-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.course-row-title { border: 0; background: none; padding: 0; font-size: var(--fs-base); font-weight: 700; text-align: left; }
.course-row-title:hover { text-decoration: underline; }
.course-row-meta { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); color: var(--text-secondary); }

/* ============================ Forms ============================ */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: var(--fs-sm); font-weight: 700; }
.form-control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: var(--fs-base);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: 0; border-color: var(--accent-blue-strong); box-shadow: 0 0 0 3px rgba(143,212,255,.25); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239299a2' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: var(--fs-base); }
.form-check input { width: 18px; height: 18px; }

/* ============================ FAQ ============================ */
.faq-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 0;
    padding: 18px 4px;
    text-align: left;
    font-size: var(--fs-base);
    font-weight: 700;
}
.faq-q .q-mark { color: var(--accent-blue-strong); font-weight: 800; }
.faq-q .chev { margin-left: auto; transition: transform .2s; color: var(--text-secondary); }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { display: none; padding: 4px 4px 20px 30px; color: #555; line-height: 1.8; font-size: var(--fs-base); }
.faq-item.open .faq-a { display: block; }

/* ============================ 지점안내 (branches) ============================ */
.branch-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.branch-grid { display: grid; gap: 18px; }
.branch-card { display: grid; grid-template-columns: 435px 1fr; gap: 0; overflow: hidden; align-items: stretch; }
.branch-photo { background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.branch-photo img { width: 100%; height: auto; display: block; transition: transform .3s ease; }
.branch-photo:hover img { transform: scale(1.04); }
.branch-info { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.branch-info h3 { font-size: var(--fs-lg); font-weight: 800; }
.branch-meta { margin-top: 14px; list-style: none; }
.branch-meta li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--divider); font-size: var(--fs-base); }
.branch-meta li:first-child { border-top: 0; }
.branch-meta .label { flex: 0 0 70px; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-sm); }

/* ============================ 찾아오시는길 (map) ============================ */
.map-card .card-body { display: grid; gap: 18px; }
.map-meta { list-style: none; }
.map-meta li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--divider); font-size: var(--fs-base); }
.map-meta li:last-child { border-bottom: 0; }
.map-meta .label { flex: 0 0 80px; color: var(--text-secondary); font-weight: 600; font-size: var(--fs-sm); }
.map-image { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

/* ============================ 설명회 (presentation) ============================ */
.pres-list { display: grid; gap: 14px; }
.pres-card { display: flex; align-items: center; gap: 16px; padding: 18px 22px; transition: border-color .2s, box-shadow .2s; }
.pres-card:hover { border-color: var(--accent-dark); box-shadow: var(--shadow); }
.pres-date {
    flex: 0 0 auto;
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 72px;
}
.pres-date .d { font-size: var(--fs-lg); font-weight: 800; line-height: 1; }
.pres-date .m { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 4px; }
.pres-status {
    flex: 0 0 auto;
    min-width: 64px;
    text-align: center;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: var(--fs-sm);
    font-weight: 700;
}
.pres-status.is-live { background: #e7f6ee; color: var(--ok); }
.pres-status.is-done { background: #eef0f2; color: #6c757d; }
.pres-body { flex: 1; min-width: 0; }
.pres-body h3 { font-size: var(--fs-base); font-weight: 700; }
.pres-body p { margin-top: 5px; font-size: var(--fs-sm); color: var(--text-secondary); }
.pres-arrow { color: var(--text-secondary); font-size: var(--fs-lg); }

.pres-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pager a, .pager span {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--line);
    font-size: var(--fs-base); font-weight: 600; color: var(--text-primary);
}
.pager a:hover { background: var(--bg-secondary); }
.pager .on { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.pager .gap { border: 0; min-width: 22px; padding: 0; color: var(--text-secondary); }
.pager-edge { color: var(--text-secondary); }

/* ============================ 공지사항 (notice) ============================ */
.notice-list { list-style: none; border-top: 2px solid var(--accent-dark); }
.notice-item { border-bottom: 1px solid var(--line); }
.notice-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;   /* 좌우 0 — 제목/날짜를 page-head(컨테이너 가장자리)와 동일 여백으로 */
    transition: background .15s;
}
.notice-badge:empty { display: none; }   /* 뱃지 없을 때 gap 유발 방지(이중 안전장치) */
.notice-item a:hover { background: var(--bg-secondary); }
.notice-item.is-pinned { background: #fbfdff; }
.notice-badge { flex: 0 0 auto; display: flex; gap: 6px; }
.notice-subject { flex: 1; min-width: 0; font-size: var(--fs-base); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-item.is-pinned .notice-subject { font-weight: 700; }
.notice-date { flex: 0 0 auto; font-size: var(--fs-sm); color: var(--text-secondary); }

.notice-view-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.notice-view-title { margin-top: 8px; font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.3px; }
.notice-view-meta { margin-top: 10px; display: flex; gap: 14px; font-size: var(--fs-sm); color: var(--text-secondary); }
.notice-view-body { line-height: 1.85; font-size: var(--fs-base); }
.notice-view-body img { height: auto; }

@media (max-width: 720px) {
    .notice-subject { white-space: normal; }
    .notice-item a { align-items: flex-start; flex-wrap: wrap; gap: 4px 10px; padding: 10px 0; }   /* 제목↔날짜 세로간격(14→4)·상하여백(16→10) 축소 */
    .notice-date { width: 100%; }
}

/* ============================ 데이터 표 (교습비 등) ============================ */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    border: 1px solid var(--line);
    padding: 11px 10px;
    text-align: center;
    vertical-align: middle;
    font-size: var(--fs-base);
    line-height: 1.6;
}
.data-table thead th { background: var(--bg-secondary); color: var(--text-secondary); font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.data-table td { color: #555; }
.data-table .tl { text-align: left; }
.data-table .note { background: var(--bg-secondary); color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.8; }
.section-title-mt { margin-top: 36px; }

/* ============================ 정책 페이지 (이용약관 등, _pages 내용 통일) ============================ */
.legal { line-height: 1.85; color: #555; }
.legal .container-lg { padding: 0; max-width: none; margin: 0; }
.legal .row { display: block; margin: 0; }
.legal .card { border: 0; box-shadow: none; background: none; border-radius: 0; margin: 0 !important; }
.legal .card-body { padding: 0; }
.legal h5,
.legal h6.card-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: var(--text-primary);
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    text-decoration: none !important;
}
.legal > .container-lg > .row > div:first-child h5,
.legal > .container-lg > .row > div:first-child h6.card-title { margin-top: 0; }
.legal h6.card-subtitle { display: none; }      /* &nbsp; 간격용 더미 */
.legal p { font-size: var(--fs-base); color: var(--text-primary); margin: 14px 0 4px; }
.legal ul { list-style: none; padding-left: 0; margin: 0 0 10px; }
.legal li { font-size: var(--fs-base); color: #555; padding: 3px 0; }

/* ============================ Footer (참고: /index.html) ============================ */
.site-footer { margin-top: 48px; background: #0A2A1B; color: #cdd8d1; }
.footer-inner { max-width: 1040px; margin: 0 auto; padding: 34px 20px 44px; }
.footer-policy { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-policy a { font-size: var(--fs-base); color: #e6ede9; }
.footer-policy a:hover { color: #fff; text-decoration: underline; }
.footer-policy a.strong { font-weight: 700; color: #fff; }
.footer-info { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-info li { font-size: var(--fs-sm); color: #9fb3a8; position: relative; }
.footer-info li + li::before { content: ''; position: absolute; left: -10px; top: 50%; width: 1px; height: 11px; background: rgba(255,255,255,.18); transform: translateY(-50%); }

/* ============================ 반응형 ============================ */
@media (min-width: 768px) {
    .teacher-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
    .teacher-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

@media (max-width: 860px) {
    /* 학년·과목·선생님 select 전환은 ≤1000px(시간표 숨김 시점)으로 이동 */
    .schedule-mobile { display: none; }   /* 카드뷰 폐지 */
    /* 시간표 셀: 클릭 신청 비활성(버튼만 동작) + 신청하기 버튼 노출 */
    .sch-item { pointer-events: none; cursor: default; }
    .sch-item .sch-teacher, .sch-item .sch-apply { pointer-events: auto; }
    .sch-apply { display: block; width: 100%; margin-top: 8px; padding: 7px 6px; border: 0; border-radius: 8px; background: var(--accent-dark); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer; }
    .sch-apply:hover { filter: brightness(.95); }
    /* 좌측 시간열 삭제 → 각 강좌 박스 안에 시간 표시 · 강좌 없는 요일 열 숨김 · 보이는 요일은 고정폭 */
    .schedule-table .time-col, .schedule-table td.time-cell { display: none; }
    .schedule-table .sch-empty-day { display: none; }
    .schedule-table { table-layout: auto; min-width: 0; }
    .schedule-table th, .schedule-table td { min-width: 158px; }
    .sch-time { display: block; font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
    /* 공백 없는 긴 강좌명도 박스 안에서 줄바꿈 */
    .sch-item .sch-subj, .sch-item .sch-cname, .sch-item .sch-time { word-break: break-all; }
    .pres-detail-grid { grid-template-columns: 1fr; }
    .branch-card { grid-template-columns: 1fr; }
    .branch-photo img { width: 100%; }
}

@media (max-width: 720px) {
    :root { --header-h: 60px; }
    .brand-logo-pc { display: none; }
    .brand-logo-mo { display: block; }
    .nav-toggle { display: flex; }
    .site-nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #fff;
        border-bottom: 1px solid var(--divider);
        padding: 8px 16px 16px;
        box-shadow: var(--shadow);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .18s, transform .18s;
    }
    .site-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .nav-link { padding: 13px 12px; border-radius: 10px; }

    .hero-inner { padding: 46px 20px 42px; }   /* 모바일은 이전(축소 전) 높이 유지 */
    .home-cols .notice-item:nth-child(n+4) { display: none; }   /* 모바일 홈은 공지 3개만(목록 페이지는 영향 없음) */
    .hero-orb-1 { width: 190px; height: 190px; top: -60px; right: -16px; }
    .hero-orb-2 { width: 150px; height: 150px; bottom: -70px; left: -24px; }
    .hero-orb-3 { display: none; }                  /* 모바일은 블롭 2개로 가볍게 */
    .form-grid { grid-template-columns: 1fr; }
    .pres-detail-grid { grid-template-columns: 1fr; }

    .hi-layer-box { width: 100%; max-height: 100vh; height: 100vh; margin: 0; border-radius: 0; }
    .hi-layer-body { max-height: 100vh; padding: 24px 20px; }
    .popup-actions .btn { width: 100%; }
}

@media (max-width: 420px) {
    .teacher-grid { grid-template-columns: 1fr; }
    .teacher-card { display: flex; }
    .teacher-thumb { flex: 0 0 100px; width: 100px; }
    .teacher-body { display: flex; flex-direction: column; justify-content: center; }
}
