/* 글꼴은 페이지에 나오는 글자만 담은 부분 글꼴 (scripts/fonts.mjs로 다시 만든다). SIL OFL 1.1 — licenses/ */
@font-face { font-family: "Jua"; src: url("./fonts/jua-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gowun Dodum"; src: url("./fonts/gowun-dodum-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #fbf7ee;
  --card: #fffdf7;
  --ink: #16150f;
  --muted: #6b6457;
  --grid: rgba(22, 21, 15, 0.07);
  --pink: #ffc7d6;
  --yellow: #ffd84a;
  --line: 3px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --f-display: "Jua", "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --f-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.6;
  word-break: keep-all;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 16px 24px; display: grid; gap: 24px; }
.box { background: var(--card); border: var(--line); border-radius: 22px; box-shadow: var(--shadow); }

/* 머리 카드 */
.hero { display: flex; gap: 22px; align-items: center; padding: 26px 28px; }
.logo {
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  background: #2f7fd1; color: #fff; border: var(--line);
  display: grid; place-content: center; text-align: center;
  font-family: var(--f-display); font-size: 1.35rem; line-height: 1.1;
}
.logo span:last-child { color: var(--yellow); }
h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.15; }
.url { margin: 6px 0 8px; font-family: var(--f-display); letter-spacing: 0.12em; color: var(--muted); font-size: 0.95rem; }
.lead { margin: 0; color: var(--muted); font-size: 1.02rem; max-width: 40em; }

/* 학기 단추 */
.filters { display: flex; align-items: center; gap: 14px; padding: 16px 22px; flex-wrap: wrap; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.chip, .pill {
  font-family: var(--f-display); font-size: 1.05rem;
  border: var(--line); border-radius: 999px; padding: 6px 18px;
  background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink);
}
.chip.label { background: #fff1d6; }
.pill { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.pill:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.pill:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.pill.on { background: var(--pink); }
.pill:focus-visible, .go:focus-visible, .pic:focus-visible { outline: 3px dashed #2f7fd1; outline-offset: 3px; }
.count { margin: 0 0 0 auto; color: var(--muted); }
.count b { color: var(--ink); font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; }

/* 카드 */
.grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--card); border: var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card:not(.soon):hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--ink); }
.card[hidden] { display: none; }
.pic { display: block; aspect-ratio: 960 / 504; border-bottom: var(--line); background: #e7f5ff; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.card:hover .pic img { transform: scale(1.03); }
.pic.empty { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #fff1d6 0 14px, #fff8e8 14px 28px); }
.pic.empty span { font-family: var(--f-display); font-size: 2.6rem; color: #c9b48f; }

.body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 18px; flex: 1; }
.tag { align-self: flex-start; font-family: var(--f-display); font-size: 0.92rem; border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px; background: #f1ece2; }
.tag.t1 { background: #d0e7ff; } .tag.t2 { background: #c7f0ff; } .tag.t3 { background: #ffd6e3; }
.tag.t4 { background: #ffe3c2; } .tag.t5 { background: #fff0b8; } .tag.t6 { background: #dbf5c9; }
.card h2 { margin: 2px 0 0; font-family: var(--f-display); font-weight: 400; font-size: 1.45rem; line-height: 1.3; }
.desc { margin: 0; color: var(--muted); font-size: 0.97rem; flex: 1; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 14px; border-top: 2px dashed var(--ink); }
.addr { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.go {
  flex: none; font-family: var(--f-display); font-size: 1.02rem; color: var(--ink); text-decoration: none;
  background: var(--yellow); border: var(--line); border-radius: 14px; padding: 7px 12px; box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.go:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.go:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.go.off { background: #ece6da; color: var(--muted); box-shadow: none; }

.credit { text-align: center; color: var(--muted); font-size: 0.86rem; padding: 10px 16px 36px; }
.credit p { margin: 2px 0; }
.credit a { color: inherit; }

@media (max-width: 560px) {
  .wrap { padding-top: 18px; gap: 18px; }
  .hero { flex-direction: column; text-align: center; padding: 22px 18px; }
  .lead { font-size: 0.96rem; }
  .filters { justify-content: center; }
  .count { margin: 0; width: 100%; text-align: center; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .pic img, .pill, .go { transition: none; }
}
