/**
 * 공유 반응형 CSS — 구찌야놀자
 * ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries
 * ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout
 * ref: https://www.w3.org/WAI/WCAG21/quickref/
 */

/* ── 리셋 & 기본 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg:        #040f1c;
  --color-bg-2:      #071a2e;
  --color-gold:      #f5c842;
  --color-gold-dark: #e6a800;
  --color-text:      #c8d8e8;
  --color-muted:     #8898aa;
  --color-dim:       #6b7c93;
  --color-border:    rgba(245,200,66,0.15);
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       16px;
  --transition:      0.25s ease;
  --font-main:       'SchoolSafetyTteokbokki', sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── 접근성: 본문 바로가기 */
.skip-to-main {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-gold);
  color: var(--color-bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-to-main:focus { top: 1rem; }

/* ── 컨테이너 */
.g-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ── 섹션 공통 */
.g-section {
  padding: 4rem 0;
}

.g-section-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--color-gold);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.g-section-sub {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--color-muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* ── 버튼 공통 */
.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  min-height: 48px;
  min-width: 48px;
}

.g-btn-primary {
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
  color: var(--color-bg);
  box-shadow: 0 4px 16px rgba(245,200,66,0.35);
}
.g-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,200,66,0.5);
}

.g-btn-outline {
  background: transparent;
  color: var(--color-gold);
  border: 2px solid rgba(245,200,66,0.4);
}
.g-btn-outline:hover {
  background: rgba(245,200,66,0.08);
  border-color: var(--color-gold);
  transform: translateY(-2px);
}

.g-btn:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* ── 카드 공통 */
.g-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}
.g-card:hover {
  border-color: rgba(245,200,66,0.3);
  background: rgba(245,200,66,0.03);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

/* ── 배지 */
.g-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.25);
  border-radius: 50px;
  padding: 0.3rem 0.875rem;
  font-size: 0.82rem;
  color: var(--color-gold);
}

/* ── 라이브 뱃지 */
.g-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(229,62,62,0.9);
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}
.g-live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: liveDotBlink 1.5s ease-in-out infinite;
}
@keyframes liveDotBlink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* ── 구분선 */
.g-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 2rem 0;
}

/* ── 텍스트 유틸 */
.g-text-gold   { color: var(--color-gold); }
.g-text-muted  { color: var(--color-muted); }
.g-text-center { text-align: center; }

/* ── 그리드 유틸 */
.g-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.g-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── 페이지 헤더 (각 메뉴 페이지 상단) */
.page-hero {
  background: linear-gradient(180deg, #071a2e 0%, var(--color-bg) 100%);
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
}
.page-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
  margin-bottom: 0.5rem;
}
.page-hero-title span { color: var(--color-gold); }
.page-hero-desc {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--color-muted);
  line-height: 1.7;
}

/* ── 빵 부스러기 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-dim);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--color-dim);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--color-gold); }
.breadcrumb-sep { color: rgba(255,255,255,0.2); }
.breadcrumb-current { color: var(--color-gold); }

/* ── 폼 공통 */
.g-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.g-form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}
.g-form-input,
.g-form-textarea,
.g-form-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: border-color var(--transition);
  width: 100%;
}
.g-form-input:focus,
.g-form-textarea:focus,
.g-form-select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.15);
}
.g-form-textarea { resize: vertical; min-height: 120px; }

/* ── 알림 박스 */
.g-alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.g-alert-info {
  background: rgba(99,91,255,0.1);
  border: 1px solid rgba(99,91,255,0.25);
  color: #a5b4fc;
}
.g-alert-success {
  background: rgba(72,187,120,0.1);
  border: 1px solid rgba(72,187,120,0.25);
  color: #68d391;
}
.g-alert-warning {
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.25);
  color: var(--color-gold);
}
.g-alert-error {
  background: rgba(229,62,62,0.1);
  border: 1px solid rgba(229,62,62,0.25);
  color: #fc8181;
}

/* ── 로딩 스피너 */
.g-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(245,200,66,0.2);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── 반응형 미디어 쿼리 */
@media (max-width: 1024px) {
  .g-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .g-section { padding: 2.5rem 0; }
  .g-grid-2,
  .g-grid-3 { grid-template-columns: 1fr; }
  .g-container { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .g-btn { padding: 0.7rem 1.25rem; font-size: 0.9rem; }
}

/* ── 접근성: 포커스 링 */
:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

/* ── 이미지 기본 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 링크 기본 */
a { color: inherit; }

/* ── 선택 색상 */
::selection {
  background: rgba(245,200,66,0.3);
  color: #fff;
}
