/* ========================================================================
   shared.css — 공통 리셋 · 변수 · 기본 타이포
   두 테마(warm / vivid)를 [data-theme] 변수로 전환
   ======================================================================== */

/* --- Modern Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
button { background: none; border: 0; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Theme: Warm (default) --- */
:root,
[data-theme="warm"] {
  --bg:        #faf0e1;
  --surface:   #fff6e8;
  --text:      #3d2615;
  --text-soft: #4a2b15;
  --accent:    #c65d2a;
  --secondary: #e6a86b;
  --muted:     #a88474;
  --border:    #e8d5b9;

  --font-display: 'Cormorant Garamond', 'Noto Serif KR', serif;
  --font-body:    'Noto Sans KR', system-ui, sans-serif;
  --font-label:   'Noto Sans KR', system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 8px rgba(61, 38, 21, 0.08);
  --shadow-md: 0 8px 24px rgba(61, 38, 21, 0.12);
  --shadow-lg: 0 16px 48px rgba(61, 38, 21, 0.16);
}

/* --- Theme: Vivid --- */
[data-theme="vivid"] {
  --bg:        #f9f7f2;
  --surface:   #ffffff;
  --text:      #0f0f0f;
  --text-soft: #4a4a4a;
  --accent:    #ff5d2a;
  --secondary: #00b2b2;
  --tertiary:  #8b2fb0;
  --quaternary:#ffd447;
  --muted:     #888;
  --border:    #e5e5e5;

  --font-display: 'Anton', 'Black Han Sans', system-ui, sans-serif;
  --font-body:    'Pretendard', system-ui, sans-serif;
  --font-label:   'Pretendard', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.18);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.15; }

.container { width: min(92%, 1200px); margin-inline: auto; }

.label {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}

/* --- Unified Button System (embossed, same size everywhere) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  min-width: 160px;
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  line-height: 1;
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
  /* Embossed depth — consistent across all buttons */
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.35),
    inset -1px -1px 2px rgba(0,0,0,0.18),
    0 4px 12px rgba(0,0,0,0.14),
    0 1px 3px rgba(0,0,0,0.08);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn:active {
  transform: translateY(0);
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,0.25),
    0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost   { background: var(--surface); color: var(--accent); }
.btn-ink     { background: #0f0f0f; color: #fff; }
@media (max-width: 480px) {
  .btn { min-width: 0; width: 100%; }
  .course-actions .btn, .hero-ctas .btn { flex: 1 1 auto; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Screen reader only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Focus (a11y) --- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --- Gallery common (used by gallery.js) --- */
.gallery-item { cursor: zoom-in; transition: transform .25s; position: relative; overflow: hidden; border-radius: var(--radius-sm); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item figcaption { position: absolute; inset: auto 0 0 0; padding: 12px; color: white; background: linear-gradient(transparent, rgba(0,0,0,0.6)); font-size: 13px; opacity: 0; transition: opacity .2s; }
.gallery-item:hover figcaption { opacity: 1; }
.gallery-item:hover { transform: translateY(-2px); }

.gallery-masonry { columns: 2; column-gap: 12px; }
.gallery-masonry > * { break-inside: avoid; margin-bottom: 12px; }
@media (min-width: 768px) { .gallery-masonry { columns: 3; } }
@media (min-width: 1200px) { .gallery-masonry { columns: 4; } }

.gallery-h-scroll { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 0; scrollbar-width: thin; }
.gallery-h-scroll > * { flex: 0 0 min(70vw, 420px); scroll-snap-align: start; aspect-ratio: 4/5; }

/* --- Lightbox --- */
.lightbox { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border: 0; padding: 0; background: rgba(0,0,0,0.92); }
.lightbox::backdrop { background: rgba(0,0,0,0.8); }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; grid-template-rows: 1fr auto; padding: 40px; }
.lb-stage img { max-width: 100%; max-height: 80vh; object-fit: contain; }
.lb-stage figcaption { color: #fff; padding-top: 16px; font-size: 14px; }
.lb-close, .lb-prev, .lb-next { position: absolute; color: #fff; font-size: 32px; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.2); }

/* --- Course cards (used by courses.js) --- */
.course-card { background: var(--surface); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); position: relative; transition: box-shadow .2s; }
.course-card:hover { box-shadow: var(--shadow-md); }
.course-card.highlight { outline: 3px solid var(--accent); }
.course-status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--status-color); background: color-mix(in srgb, var(--status-color) 15%, transparent); margin-bottom: 12px; }
.course-title { font-size: clamp(24px, 4vw, 40px); margin-bottom: 8px; }
.course-open, .course-dday { color: var(--text-soft); margin-bottom: 4px; font-size: 15px; }
.course-dday strong { color: var(--accent); font-size: 18px; }
.course-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 16px 0; font-size: 14px; color: var(--text-soft); }
.course-facts li { padding: 4px 0; }
.course-desc { margin: 12px 0; color: var(--text-soft); }
.course-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.courses-timeline { display: grid; gap: 4px; }
.timeline-row { display: grid; grid-template-columns: 60px 90px 1fr; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.timeline-year { font-weight: 600; color: var(--accent); }
.timeline-status { color: var(--status-color); font-size: 12px; }
