/* ===== Font ===== */
@font-face {
  font-family: 'Paperlogy';
  src: url('/fonts/Paperlogy-5Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('/fonts/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ===== Reset & tokens ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #e6007e;
  --secondary: #1b2756;
  --program-bg: #384180;
  --light-blue: #eef5ff;
  --text: #333333;
  --dark: #111111;
  --header-h: 64px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Paperlogy', 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', sans-serif;
  color: var(--text);
  line-height: 1.5;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  max-width: 1920px;
  margin: auto;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid #eaeaea;
}
.header-inner {
  max-width: 1200px; margin: auto;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
}
.logo { display: flex; align-items: center; height: 40px; }
.logo img { height: 100%; width: auto; }

.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 32px; height: 32px; background: none; border: 0; cursor: pointer;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--dark); }

.site-nav ul { display: flex; gap: 28px; }
.site-nav a {
  font-weight: 500; font-size: 15px; color: var(--text);
  padding: 8px 0; position: relative;
}
.site-nav a[aria-current="page"] { color: var(--primary); font-weight: 700; }
.site-nav a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #fff;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .site-nav.open { transform: translateX(0); }
  .site-nav ul { flex-direction: column; gap: 0; padding: 12px 20px; }
  .site-nav a { display: block; padding: 16px 0; border-bottom: 1px solid #f3f4f6; font-size: 17px; }
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 24px 0 40px; position: relative; }
.main-title { display: block; width: 100%; height: auto; margin: 0 auto 16px; } /* 콘텐츠 영역(최대 1200px) 가로 꽉 채움 */
.hero-sub { font-size: 20px; font-weight: 700; color: var(--secondary); padding: 0 20px; }

.cta-event-btn {
  display: block;
  width: calc(100% - 40px);
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 30px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5fa8, var(--primary) 55%, #c2005f);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(230, 0, 126, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cta-event-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(230, 0, 126, .45); }
@media (max-width: 700px) {
  .cta-event-btn { width: calc(100% - 32px); font-size: 22px; padding: 24px 16px; }
}
@media (min-width: 700px) {
  .main-title { border-radius: 12px; }
}
.char-runners, .char-seagull { display: none; } /* 데코 요소 — 데스크톱 대형 화면에서만 노출 예정 (레이아웃 미세조정 필요) */

/* ===== Sections (공통) ===== */
main > section, section.page-header {
  max-width: 1200px; margin: 0 auto; padding: 40px 20px;
}
section h2 { font-size: 24px; color: var(--secondary); margin-bottom: 20px; }
.more-link { display: inline-block; padding: 10px 4px; font-weight: 500; } /* 터치 타겟 최소 24px 확보 */
.page-header { text-align: center; padding-top: 48px; }
.page-header h1 { font-size: 28px; color: var(--secondary); margin: 8px 0; }

/* ===== Program info / dl ===== */
.program-info, .runbase-info dl { display: grid; gap: 12px; background: var(--light-blue); border-radius: 12px; padding: 24px; }
.program-info div, .runbase-info dl div { display: flex; gap: 12px; }
.program-info dt, .runbase-info dt { min-width: 64px; font-weight: 700; color: var(--secondary); } /* 원래 primary(핑크)였으나 연한 배경 위 대비율 4.1:1로 접근성 기준(4.5:1) 미달 → secondary로 교체 */

/* ===== Cards / grids ===== */
.course-cards, .features ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.features ul { grid-template-columns: repeat(3, 1fr); }
.course-cards li, .features li {
  background: #f8f9fa; border-radius: 12px; padding: 20px; overflow: hidden;
}
.course-cards li img { border-radius: 8px; margin-bottom: 12px; aspect-ratio: 16/10; object-fit: cover; }
@media (max-width: 700px) {
  .course-cards, .features ul { grid-template-columns: 1fr; }
}

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.photo-grid li a { display: block; background: #f8f9fa; border-radius: 10px; overflow: hidden; }
.photo-grid .thumb {
  display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: linear-gradient(135deg, var(--light-blue), #fff); /* 로딩 전/실패 시 대체 배경 */
}
.photo-grid .caption { display: block; padding: 10px 12px 4px; font-size: 14px; font-weight: 500; }
.photo-grid .date { display: block; padding: 0 12px 12px; font-size: 12px; color: #6b7280; } /* #9ca3af는 흰 배경에서 대비율 2.54:1로 미달 → 4.83:1로 통과하는 색으로 조정 */
@media (max-width: 700px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Notice list ===== */
.notice-list ul { border-top: 2px solid var(--secondary); }
.notice-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 4px; border-bottom: 1px solid #eaeaea; flex-wrap: wrap;
}
.notice-item a { font-weight: 500; flex: 1; min-width: 200px; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; color: #ad0059; /* primary(#e6007e)는 이 배경 위에서 대비율 4.01:1로 미달 → 6.41:1로 통과하는 색으로 조정 */
  background: #fdeef5; border-radius: 999px; padding: 3px 10px;
}
.notice-item .date, .notice-item .hit { font-size: 13px; color: #6b7280; }
.empty-msg { text-align: center; padding: 60px 0; color: #6b7280; }

/* ===== Pagination ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pagination a {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 14px; color: var(--text);
}
.pagination a.active { background: var(--primary); color: #fff; font-weight: 700; }

/* ===== Detail pages ===== */
.notice-detail, .photo-detail { max-width: 800px; margin: 0 auto; padding: 40px 20px; }
.notice-detail h1, .photo-detail h1 { font-size: 22px; margin: 12px 0; color: var(--dark); }
.notice-detail .meta, .photo-detail .meta { color: #6b7280; font-size: 13px; margin-bottom: 24px; }
.content img { margin-bottom: 12px; border-radius: 8px; }
.content iframe { width: 100%; aspect-ratio: 16/9; height: auto; border-radius: 8px; margin-bottom: 12px; }
.back-link { margin-top: 32px; }
.todo-note {
  background: #fff8e1; border: 1px dashed #e0c060; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: #7a5c00;
}

/* ===== Course detail ===== */
.course-detail { border-top: 1px solid #eaeaea; padding-top: 32px; }
.course-detail .meta { color: #6b7280; margin: 6px 0 12px; }
.route-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.route-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.map-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 700px) { .map-gallery { grid-template-columns: repeat(2, 1fr); } }

/* ===== Accept / events ===== */
.accept-guide ul { background: var(--light-blue); border-radius: 12px; padding: 24px; }
.accept-guide li { padding: 6px 0; }
.event-group { margin-bottom: 28px; }
.event-group h3 { color: var(--secondary); margin-bottom: 10px; }
.event-group li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eaeaea; }
.status-cancelled { opacity: .5; }
.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  background: var(--secondary); color: #fff; font-weight: 700; font-size: 14px;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-primary { background: var(--primary); }
.cta { text-align: center; padding: 40px 20px 60px; }

.floating-bottom-bar {
  position: fixed; left: 0; right: 0; bottom: -100px; z-index: 90;
  background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: 12px 20px; text-align: center;
  transition: bottom .25s ease;
}
.floating-bottom-bar.show { bottom: 0; }
.floating-bottom-bar .btn { width: 100%; max-width: 480px; }

/* ===== 긴급 공지 배너 (관리자 발행) ===== */
.site-banner-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--primary); color: #fff; padding: 10px 20px; text-align: center;
  font-size: 14px; font-weight: 500; position: relative;
}
.site-banner-bar .site-banner-close {
  position: absolute; right: 16px; background: none; border: 0; color: #fff;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.site-banner-modal-overlay {
  position: fixed; inset: 0; background: rgba(17,17,17,.5); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.site-banner-modal {
  background: #fff; border-radius: 14px; padding: 28px 24px; max-width: 420px; width: 100%;
  position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.site-banner-modal .site-banner-content { font-size: 15px; line-height: 1.6; white-space: pre-line; }
.site-banner-modal .site-banner-close {
  position: absolute; top: 10px; right: 14px; background: none; border: 0;
  font-size: 22px; cursor: pointer; color: var(--muted, #6b7280);
}

/* ===== Footer ===== */
.site-footer { background: var(--secondary); color: #cbd5e1; margin-top: 60px; }
.footer-inner { max-width: 1200px; margin: auto; padding: 32px 20px; }
.footer-name { color: #fff; font-weight: 700; margin-bottom: 8px; }
.footer-contact li { font-size: 13px; padding: 2px 0; }
.footer-copyright { font-size: 12px; margin-top: 16px; opacity: .7; }

/* ===== Back-to-top button ===== */
.btn-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--secondary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.btn-top.show { opacity: 1; pointer-events: auto; }
