/*
  [수업 2] CSS = 웹페이지의 "옷과 인테리어"
  선택자 { 속성: 값; } 모양. "이 태그는 이런 색, 이런 크기로 해줘"라는 뜻이에요.
*/

/* 색과 글꼴을 변수로 모아두면 나중에 한 곳만 고치면 돼요 */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #777777;
  --line: #e8e8e8;
  --accent: #111111;
  --max: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  line-height: 1.7;
}

a { color: inherit; }

/* 메뉴 */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-weight: 700; text-decoration: none; letter-spacing: -0.02em; }
.site-header nav a { margin-left: 20px; text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }

/* 공통 가로폭 */
.hero, .section, .site-footer { max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* 첫 화면 */
.hero { min-height: calc(100vh - 70px);   /* 화면 높이 - 위 메뉴 높이 */
  display: flex;
  flex-direction: column;
  justify-content: center;          /* 세로 가운데 */
  align-items: center;              /* 가로 가운데 */
  text-align: center; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.2em; color: var(--muted); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.4rem, 8vw, 5rem); line-height: 1.1; letter-spacing: -0.04em; margin-bottom: 24px; }
.lead { color: var(--muted); max-width: 520px; margin-bottom: 32px; margin: 0 auto 32px; }
.button {
  display: inline-block; padding: 12px 24px;
  border: 1px solid var(--accent); border-radius: 999px;
  text-decoration: none; font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}
.button:hover { background: var(--accent); color: #fff; }

/* 섹션 */
.section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--line); }
.section h2 { font-size: 1rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 32px; font-weight: 500; }
.section p { max-width: 640px; margin-bottom: 8px; }

/* 영상 카드 격자: 화면 크기에 맞춰 칸 수가 자동으로 바뀜 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }

.card {
  all: unset;               /* 버튼의 기본 모양 지우기 */
  cursor: pointer; display: block;
}
.card[hidden] { display: none; }   /* .card 의 all: unset 이 hidden 을 덮어쓰지 않게 */
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: #f2f2f2; border-radius: 4px; margin-bottom: 12px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .thumb img { transform: scale(1.04); }
.play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 2rem; background: rgba(0, 0, 0, 0.25);
  opacity: 0; transition: opacity 0.2s;
}
.card:hover .play, .card:focus-visible .play { opacity: 1; }
.thumb.placeholder .play { opacity: 1; color: var(--muted); background: none; }
.card h3 { font-size: 1.05rem; font-weight: 600; }
.card p { color: var(--muted); font-size: 0.9rem; }

.site-footer { padding-top: 32px; padding-bottom: 48px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); }

/* 영상 팝업 */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  display: grid; place-items: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-body { width: min(1000px, 100%); aspect-ratio: 16 / 9; background: #000; }
.modal-body iframe, .modal-body video { width: 100%; height: 100%; border: 0; }
.modal-close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: 0; font-size: 1.5rem; cursor: pointer;
}

@media (max-width: 600px) {
  .hero { padding-top: 72px; padding-bottom: 72px; }
}

/* About: 글 옆에 로고 이미지 */
.about { display: flex; align-items: center; gap: 64px; }
.about p { flex: 0 1 auto; }
.about-img { width: 220px; height: 220px; object-fit: contain; flex-shrink: 0; }

@media (max-width: 600px) {
  .about { flex-direction: column-reverse; align-items: flex-start; gap: 24px; }
  .about-img { width: 140px; height: 140px; }
}

/* 카테고리 필터 버튼 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters[hidden] { display: none; }
.filter {
  padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: none; font: inherit; font-size: 0.9rem; color: var(--muted);
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter:hover { color: var(--text); border-color: var(--text); }
.filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
