/* ==========================================================================
   programs.css — 프로그램 안내 전용 스타일
   Path: /assets/css/pages/programs.css
   Updated: 2025-09-12
   --------------------------------------------------------------------------
   - index 라우터에서 header/footer가 먼저 로드된 뒤, JS가 이 CSS를 head에 주입합니다.
   - 모든 선택자는 .pg-* 네임스페이스로 한정됨.
   ========================================================================== */

:root{
  /* Color system */
  --pg-bg: #ffffff;
  --pg-text: #111827;      /* gray-900 */
  --pg-muted: #6b7280;     /* gray-500 */
  --pg-line: #e5e7eb;      /* gray-200 */
  --pg-surface: #ffffff;

  --pg-brand: #e8c447;     /* sky-500 */
  --pg-brand-2: #614620;   /* green-500 */
  --pg-chip: #f3f4f6;      /* gray-100 */

  /* Badges */
  --pg-exp-bg: #ecfeff;    /* cyan-50 */
  --pg-exp-tx: #0e7490;    /* cyan-700 */
  --pg-evt-bg: #fef3c7;    /* amber-100 */
  --pg-evt-tx: #9a3412;    /* amber-800 */

  /* Elevation & Radius */
  --pg-shadow: 0 2px 10px rgba(0,0,0,.06);
  --pg-shadow-hover: 0 6px 20px rgba(0,0,0,.10);
  --pg-radius: 16px;

  /* Sizing */
  --pg-maxw: 1100px;

  /* Motion */
  --pg-ease: cubic-bezier(.2,.8,.2,1);
  --pg-dur: .22s;
}

/* Container */
.pg-wrap{
  max-width: var(--pg-maxw);
  margin: 24px auto;
  padding: 0 16px;
  color: var(--pg-text);
}

/* Header */
.pg-header{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pg-title{
  font-size: clamp(20px, 3.2vw, 32px);
  font-weight: 800;
  line-height: 1.2;
}

/* Tabs */
.pg-tabs{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-tab{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--pg-chip);
  border: 1px solid var(--pg-line);
  text-decoration: none;
  color: #111;
  font-weight: 700;
  font-size: 14px;
  transition: background var(--pg-dur) var(--pg-ease), box-shadow var(--pg-dur) var(--pg-ease), transform var(--pg-dur) var(--pg-ease);
}
.pg-tab:hover{ transform: translateY(-1px); box-shadow: 0 2px 0 rgba(0,0,0,.04); }
.pg-tab.active{ border-color: var(--pg-text); box-shadow: 0 0 0 2px rgba(17,24,39,.08) inset; }
.pg-cnt{ color: var(--pg-muted); font-weight: 800; }

/* Search */
.pg-search{
  display: flex;
  gap: 8px;
  margin: 8px 0 18px;
}
.pg-search input[type="text"]{
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  font-size: 15px;
  background: var(--pg-surface);
}
.pg-search input::placeholder{ color: #9ca3af; }
.pg-search button{
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--pg-brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--pg-dur) var(--pg-ease), box-shadow var(--pg-dur) var(--pg-ease);
}
.pg-search button:hover{ transform: translateY(-1px); box-shadow: 0 6px 18px rgba(14,165,233,.28); }

/* Grid */
.pg-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pg-grid2{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 980px){
  .pg-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px){
  .pg-grid{ grid-template-columns: 1fr; }
}

/* Card */
.pg-card{
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  overflow: hidden;
  background: var(--pg-surface);
  box-shadow: var(--pg-shadow);
  transition: transform var(--pg-dur) var(--pg-ease), box-shadow var(--pg-dur) var(--pg-ease);
}
.pg-card:hover{ transform: translateY(-2px); box-shadow: var(--pg-shadow-hover); }

/* Thumbnail */
.pg-thumb{
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f3f4f6;
  overflow: hidden;
}
.pg-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-imgcnt{
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

/* Body */
.pg-body{
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pg-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
}
.pg-badge.exp{ background: var(--pg-exp-bg); color: var(--pg-exp-tx); }
.pg-badge.evt{ background: var(--pg-evt-bg); color: var(--pg-evt-tx); }

.pg-name{
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
}
.pg-meta{
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--pg-muted);
  font-size: 13px;
}
.pg-row{ display: flex; gap: 8px; align-items: flex-start; }
.pg-lbl{ min-width: 64px; color: #374151; font-weight: 800; }

/* Actions */
.pg-actions{
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
}
.pg-btn{
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--pg-line);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  transition: transform var(--pg-dur) var(--pg-ease), box-shadow var(--pg-dur) var(--pg-ease), background var(--pg-dur) var(--pg-ease);
}
.pg-btn:hover{ transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.pg-btn.primary{
  background: var(--pg-brand-2);
  color: #fff;
  border-color: transparent;
}
.pg-btn.primary:hover{ box-shadow: 0 6px 18px rgba(34,197,94,.28); }

/* Details */
.pg-details{
  display: none;
  padding: 0 14px 14px;
  color: #1f2937;
  font-size: 14px;
}
.pg-details.open{ display: block; }

/* Empty */
.pg-empty{
  color: var(--pg-muted);
}

/* Modal */
.pg-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;            /* JS로 .open 제어 */
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.pg-modal.open{ display: flex; }
.pg-carousel{
  position: relative;
  width: min(1000px, 96vw);
  height: min(72vh, 86svh);
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-carousel img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.pg-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 10px 14px;
  background: rgba(255,255,255,.85);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  font-size: 18px;
}
.pg-nav.prev{ left: 10px; }
.pg-nav.next{ right: 10px; }
.pg-close{
  position: absolute;
  top: 10px; right: 10px;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: rgba(0,0,0,.6);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 16px;
}
.pg-ind{
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}

/* Accessibility: focus-visible */
.pg-tab:focus-visible,
.pg-search input:focus-visible,
.pg-search button:focus-visible,
.pg-btn:focus-visible,
.pg-nav:focus-visible,
.pg-close:focus-visible{
  outline: 3px solid rgba(14,165,233,.6);
  outline-offset: 2px;
}

/* Mobile tweaks */
@media (max-width: 520px){
  .pg-search{ flex-direction: column; }
  .pg-search button{ width: 100%; }
  .pg-actions{ flex-direction: column; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .pg-tab, .pg-card, .pg-search button, .pg-btn{
    transition: none !important;
  }
  .pg-card:hover, .pg-tab:hover, .pg-search button:hover, .pg-btn:hover{
    transform: none !important;
    box-shadow: var(--pg-shadow) !important;
  }
}

/* Dark mode (optional subtle support) */
@media (prefers-color-scheme: dark){
  :root{
    --pg-bg: #0b0f19;
    --pg-text: #e5e7eb;
    --pg-muted: #9ca3af;
    --pg-line: #1f2937;
    --pg-surface: #0f1626;
    --pg-chip: #0f1626;
    --pg-shadow: 0 2px 10px rgba(0,0,0,.4);
    --pg-shadow-hover: 0 6px 20px rgba(0,0,0,.5);
    --pg-exp-bg: #083344;
    --pg-exp-tx: #67e8f9;
    --pg-evt-bg: #3f2d0c;
    --pg-evt-tx: #fcd34d;
  }
  .pg-tab{ color: var(--pg-text); }
  .pg-btn{ background: #111827; color: var(--pg-text); border-color: #273046; }
  .pg-card{ border-color: #1f2937; }
}

/* ===== Stage pre-registration notice banner ============================= */
.pg-banner{
  margin-bottom: 16px;
}
.pg-banner__inner{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-evt-bg);   /* 은은한 주황톤 (이벤트 계열) */
  color: var(--pg-evt-tx);
}
.pg-banner__badge{
  background: #fff;
  color: var(--pg-evt-tx);
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
}
.pg-banner__text{
  margin: 0;
  font-weight: 700;
}
.pg-banner__close{
  margin-left: auto;
  background: transparent;
  border: 0;
  color: inherit;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 8px;
}
.pg-banner__close:hover{
  background: rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark){
  .pg-banner__inner{
    background: #3f2d0c; /* 다크에서 더 짙게 */
    color: #fcd34d;
    border-color: #1f2937;
  }
  .pg-banner__badge{ background: #111827; }
}

/* ==========================================================================
   Apply/Intro 페이지 호환 섹션 (namespace 충돌 핫픽스)
   - 기존 마크업: <article class="apply-card"><div class="body">...</div>
   - 다른 CSS에서 .body가 숨겨지는 이슈를 무조건 덮어쓰기
   ========================================================================== */

/* 카드 본문 강제 노출 + 기본 여백 */
.apply-card .body{
  display: block !important;
  padding: 16px;
}

/* 카드 기본 프레임(목록 카드와 톤 맞춤) */
.apply-card{
  background: #f9fafb;
  border: 1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  overflow: hidden;
  box-shadow: var(--pg-shadow);
}
.apply-card img{
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #ddd;
}

/* 카드 내 메타칩(일정/장소) */
.apply-card .meta{
  display: flex; gap: 8px; flex-wrap: wrap;
  color: #334155; font-size: 13px; margin: 8px 0;
}
.apply-card .meta .pill{
  background: var(--pg-chip);
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
}

/* 버튼 톤 공용(.pg-btn과 어울리게) */
.apply-card .pg-btn.ghost{
  background: #fff; color: var(--pg-brand); border: 1px solid var(--pg-line);
}

/* 상태 배지(성공/오류 알림) */
.badge{
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--pg-line);
  background: #ecfeff;
  margin-bottom: 16px;
  font-weight: 700;
}
.badge.ok{ background:#ecfdf5; border-color:#bbf7d0; color: var(--pg-ok, #16a34a); }
.badge.err{ background:#fef2f2; border-color:#fecaca; color: var(--pg-bad, #dc2626); }

/* 폼 공통(신청 폼 가독성) */
.apply-form{
  background:#fff;
  border:1px solid var(--pg-line);
  border-radius: var(--pg-radius);
  padding:16px; margin-top:20px;
}
.apply-form .row{ display:grid; gap:12px; margin-bottom:12px; }
@media (min-width:680px){ .apply-form .row.cols-2{ grid-template-columns:1fr 1fr; } }
.apply-form label{ font-weight:700; font-size:14px; }
.apply-form input[type="text"],
.apply-form input[type="tel"],
.apply-form select,
.apply-form textarea{
  width:100%; padding:10px 12px;
  border:1px solid var(--pg-line); border-radius:10px;
  background:#fff; font-size:15px;
}
.apply-form textarea{ min-height:100px; resize:vertical; }
.apply-form .muted{ color: var(--pg-muted); font-size: 13px; }

/* 신청 섹션 제목 통일 */
.section-title{
  font-size: 20px;
  margin: 24px 0 12px;
}

/* 접근성: focus 표시 */
.apply-form input:focus-visible,
.apply-form select:focus-visible,
.apply-form textarea:focus-visible{
  outline: 3px solid rgba(14,165,233,.6);
  outline-offset: 2px;
}

/* === 신청 프로그램 라디오 카드 === */
#programRadios {
  gap: 12px !important;
}
#programRadios .pg-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--pg-line, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .05s ease-in-out;
  min-width: 260px;
}
#programRadios .pg-radio:hover {
  border-color: var(--pg-primary-300, #86efac);
  box-shadow: 0 2px 10px rgba(16,185,129,.08);
}
#programRadios .pg-radio:active {
  transform: translateY(1px);
}
#programRadios .pg-radio input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--pg-line, #e5e7eb);
  border-radius: 999px;
  display: inline-block;
  position: relative;
  flex: 0 0 auto;
  background: #fff;
  outline: none;
}
#programRadios .pg-radio input[type="radio"]:checked {
  border-color: var(--pg-primary-500, #10b981);
  box-shadow: inset 0 0 0 4px var(--pg-primary-100, #d1fae5);
}
#programRadios .pg-radio input[type="radio"]:focus-visible {
  box-shadow:
    inset 0 0 0 4px var(--pg-primary-100, #d1fae5),
    0 0 0 3px rgba(16,185,129,.35);
  border-color: var(--pg-primary-500, #10b981);
}
#programRadios .pg-radio .radio-text {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
#programRadios .pg-radio .radio-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
#programRadios .pg-radio .radio-meta {
  font-size: 12px;
  color: #64748b;
}

/* 체크된 카드 전체 강조 */
#programRadios .pg-radio:has(input[type="radio"]:checked) {
  border-color: var(--pg-primary-500, #10b981);
  background: linear-gradient(0deg, #f0fdf4 0%, #ffffff 45%);
  box-shadow: 0 4px 16px rgba(16,185,129,.12);
}

