/* 작은대학교 — 현대적인 에디토리얼 지식 블로그.
   로컬 전용(외부 폰트·이미지·프레임워크 없음). 시스템 산세리프 단일 스택으로
   한국어 가독성을 우선한다(한글 세리프는 시스템 미설치 시 폴백이 깨진다).
   색은 잉크 + 인디고 하나. 구분은 테두리가 아니라 여백으로. */

:root {
  --paper: #fcfbf9;          /* 따뜻한 아이보리 화이트 */
  --paper-2: #f3f1ec;        /* 아주 옅은 보조 면 */
  --ink: #1a1a1d;            /* 짙은 먹색 */
  /* WCAG AA — 가장 어두운 배경인 --accent-soft(L=0.8645) 기준으로 4.5:1 을 넘긴다.
     Objective Review 001 High-1: 이전 #6e6e77 은 --paper-2 에서 4.47:1,
     --accent-soft 에서 4.39:1 로 미달이었다. */
  --ink-soft: #696971;       /* 보조 회색 — paper 5.26:1 / paper-2 4.82:1 / accent-soft 4.74:1 */
  --line: #e7e5df;           /* 최소한의 경계선 */
  --accent: #2e3d80;         /* 포인트 — 인디고 하나 */
  --accent-2: #3b4e9e;
  --accent-soft: #edeff7;
  --on-accent: #ffffff;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --maxw: 1080px;
  --readw: 40rem;            /* 본문 최대 폭 — 읽기 편한 한 줄 길이 */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131417; --paper-2: #191a1e; --ink: #e9e9ec; --ink-soft: #9a9aa4;
    --line: #26272c; --accent: #a3b0e8; --accent-2: #bcc6f2; --accent-soft: #1e2130;
    --on-accent: #131417;
  }
}
:root[data-theme="dark"] {
  --paper: #131417; --paper-2: #191a1e; --ink: #e9e9ec; --ink-soft: #9a9aa4;
  --line: #26272c; --accent: #a3b0e8; --accent-2: #bcc6f2; --accent-soft: #1e2130;
  --on-accent: #131417;
}
:root[data-theme="light"] {
  --paper: #fcfbf9; --paper-2: #f3f1ec; --ink: #1a1a1d; --ink-soft: #696971;
  --line: #e7e5df; --accent: #2e3d80; --accent-2: #3b4e9e; --accent-soft: #edeff7;
  --on-accent: #ffffff;
}

/* ── 기초 ────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.05rem; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { letter-spacing: -0.02em; word-break: keep-all; }
/* 브라우저 기본 링크·버튼 스타일이 노출되지 않게 한다 */
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 30; background: var(--accent); color: var(--on-accent);
  padding: .55rem 1rem; border-radius: 8px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.eyebrow {
  margin: 0 0 .8rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}

/* ── 헤더 ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand .mark { color: var(--accent); flex: none; }
.brand .wm { font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; }
.nav { display: flex; align-items: center; gap: 1.15rem; }
.nav a {
  color: var(--ink-soft); font-size: .9rem; font-weight: 600;
  transition: color .18s var(--ease);
}
.nav a:hover { color: var(--accent); }
.nav-about { color: var(--ink); }

/* ── 오늘의 수업 (홈의 주인공) ───────────────────────────────────── */
.today .wrap { padding-top: 3.4rem; padding-bottom: 1rem; }
.today-card {
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 2.6rem; align-items: center;
  border-radius: var(--radius); transition: transform .22s var(--ease);
}
.today-card:hover { transform: translateY(-2px); }
.today-copy { min-width: 0; }   /* 그리드 자식 넘침 방지(긴 제목) */
.today-card h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.85rem); line-height: 1.28; margin: 0 0 .9rem; font-weight: 800;
}
.today-card:hover h1 { color: var(--accent); }
.today-sum {
  margin: 0 0 1.1rem; color: var(--ink-soft); font-size: 1.06rem; line-height: 1.75;
  max-width: 34rem;
}
.today-thumb {
  aspect-ratio: 4 / 3; border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 78% 18%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    linear-gradient(152deg, var(--accent-soft), var(--paper-2));
}

/* 메타 한 줄 — 날짜 · 학과 · 읽기 시간 */
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: 0 0 1.1rem; font-size: .82rem; color: var(--ink-soft);
}
.meta > * + *::before {
  content: "·"; margin-right: .5rem; color: var(--line);
}
.meta-dept { color: var(--accent); font-weight: 700; }
.meta-read { white-space: nowrap; }   /* '약 12분'이 줄바꿈으로 쪼개지지 않게 */

.go {
  display: inline-block; font-size: .92rem; font-weight: 700; color: var(--accent);
  transition: transform .18s var(--ease);
}
.today-card:hover .go, .card:hover .go { transform: translateX(3px); }

/* ── 섹션 공통 ───────────────────────────────────────────────────── */
.sec { scroll-margin-top: 72px; }
.sec .wrap { padding-top: 3.6rem; padding-bottom: 1rem; }
.sec-title {
  margin: 0 0 1.6rem; font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ── 최신 수업 카드 ──────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.2rem; }
.card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 1.5rem; border-radius: var(--radius); background: var(--paper-2);
  transition: transform .22s var(--ease), background-color .22s var(--ease);
}
.card:hover { transform: translateY(-3px); background: var(--accent-soft); }
.card h3 { margin: 0 0 .55rem; font-size: 1.25rem; line-height: 1.4; font-weight: 800; }
.card:hover h3 { color: var(--accent); }
.card-sum {
  margin: 0 0 1.1rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .go { margin-top: auto; }

/* ── 학과 ────────────────────────────────────────────────────────── */
.dept-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .9rem; }
.dept {
  padding: 1.3rem 1.2rem; border-radius: var(--radius); background: var(--paper-2);
  scroll-margin-top: 80px;
}
.dept h3 { margin: 0 0 .35rem; font-size: 1.02rem; font-weight: 800; }
.dept-desc { margin: 0 0 1rem; font-size: .86rem; line-height: 1.6; color: var(--ink-soft); }
.dept-stat { font-size: .8rem; font-weight: 700; color: var(--accent); }
.dept-stat.is-soon { color: var(--ink-soft); font-weight: 600; }
/* 운영 중인 학과는 테두리가 아니라 면과 색으로 자연스럽게 강조 */
.dept.is-open { background: var(--accent-soft); }

/* ── 소개 ────────────────────────────────────────────────────────── */
.about .wrap { padding-top: 4.4rem; padding-bottom: 1rem; }
.about h2 {
  margin: 0 0 .8rem; font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.4;
  max-width: var(--readw);
}
.about p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; max-width: var(--readw); }

/* ── 뉴스레터 ────────────────────────────────────────────────────── */
.letter .wrap {
  padding-top: 4.4rem; padding-bottom: 4.4rem; margin-top: 3.4rem;
  border-top: 1px solid var(--line);
}
.letter h2 { margin: 0 0 .5rem; font-size: 1.3rem; font-weight: 800; }
.letter-note { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.sub-form { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.sub-form input {
  flex: 1 1 16rem; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: 10px; background: var(--paper);
}
.sub-form button {
  padding: .7rem 1.3rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ── 푸터 ────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 2.4rem; padding-bottom: 3rem; }
.site-footer .brand { margin-bottom: .7rem; }
.foot-desc { margin: 0 0 .3rem; color: var(--ink-soft); font-size: .92rem; max-width: var(--readw); }
.foot-sub { margin: 0; color: var(--ink-soft); font-size: .82rem; }

/* ── 게시물(수업) 본문 ───────────────────────────────────────────── */
.reading .wrap { padding-top: 2.6rem; }
.post { max-width: var(--readw); margin: 0 auto; padding-bottom: 4rem; }
.post h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.3rem); line-height: 1.34; margin: .2rem 0 1.4rem;
  font-weight: 800;
}
.post h2 {
  margin: 2.4rem 0 .8rem; font-size: .76rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.post h3 { margin: 1.8rem 0 .5rem; font-size: 1.3rem; line-height: 1.45; font-weight: 800; }
.post p { margin: .8rem 0; line-height: 1.85; }
.post ul, .post ol { margin: .8rem 0; padding-left: 1.3rem; }
.post li { margin: .35rem 0; line-height: 1.8; }
.post strong { font-weight: 700; }
.post a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post blockquote {
  margin: 1.2rem 0; padding: .9rem 1.2rem; border-radius: 10px;
  background: var(--accent-soft); color: var(--ink);
}
.post blockquote p { margin: 0; }
.post code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em;
  background: var(--paper-2); padding: .1rem .35rem; border-radius: 5px;
}
.post hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }
.backlink {
  display: inline-block; margin-top: 2.6rem; font-size: .9rem; font-weight: 700;
  color: var(--accent);
}

/* ── 반응형 ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .today-card { grid-template-columns: 1fr; gap: 1.4rem; }
  /* 그래픽이 콘텐츠보다 커지지 않게 — 모바일에선 상단의 얇은 띠로 */
  .today-thumb { order: -1; aspect-ratio: auto; height: 130px; }
  .today .wrap { padding-top: 2.2rem; }
}
@media (max-width: 620px) {
  body { font-size: 1rem; }
  .nav { gap: .85rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: .84rem; white-space: nowrap; }
  .topbar .wrap { gap: .75rem; }
  /* 학과는 좁은 화면에서 가로 스크롤 */
  .dept-row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -1.5rem; padding: 0 1.5rem .5rem; -webkit-overflow-scrolling: touch;
  }
  .dept-row::-webkit-scrollbar { display: none; }
  .dept { flex: 0 0 13rem; scroll-snap-align: start; }
  .sec .wrap, .about .wrap { padding-top: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
