/* 공통 컴포넌트 v2 — 유리 헤더·사진 히어로·카드·퀵메뉴·폼·푸터 */

/* ── 헤더 (유리 효과) ─────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--glass-border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: var(--space-2);
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 19px; letter-spacing: -0.01em;
  color: var(--primary); text-decoration: none;
}
.logo img { height: 28px; width: auto; display: block; flex: none; }
.logo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .logo img { height: 24px; }
  .logo { font-size: 17px; }
}
/* 영어 이름은 길어서 좁은 화면에서 버튼과 부딪힌다. 로고를 줄어들게 둔다. */
.site-header .container > .logo { flex: 0 1 auto; min-width: 0; }
.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 8px 10px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--text);
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.main-nav a:hover { background: rgba(62, 86, 65, 0.07); color: var(--primary); }
.main-nav a[aria-current="page"] { color: var(--primary); font-weight: 700; }
.main-nav .nav-apply {
  background: var(--primary); color: var(--white); font-weight: 600;
  margin-left: 8px; padding: 8px 20px;
}
.main-nav .nav-apply:hover { background: var(--primary-soft); color: var(--white); }
/* 신청 페이지에서도 흰 글자 유지 (현재 페이지 규칙이 덮어쓰지 않도록) */
.main-nav .nav-apply[aria-current="page"] { color: var(--white); font-weight: 700; }

/* 언어 전환 드롭다운 — 지구본 아이콘 + 한국어/English */
.lang-menu { position: relative; margin-left: 18px; }
.lang-menu summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 8px 13px; border-radius: 999px;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  transition: background 150ms ease, color 150ms ease;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: rgba(62, 86, 65, 0.07); color: var(--primary); }
.lang-menu .lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 132px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lift); overflow: hidden; z-index: 60;
}
.lang-menu .lang-list a, .lang-menu .lang-list .lang-on {
  display: block; padding: 12px 16px; font-size: 15px;
  text-decoration: none; color: var(--text);
}
.lang-menu .lang-list .lang-on { background: var(--primary); color: var(--white); font-weight: 600; }
.lang-menu .lang-list a:hover { background: var(--bg-alt); color: var(--primary); }
@media (max-width: 1199px) {
  .lang-menu { margin-left: 0; }
  .lang-menu .lang-list { position: static; box-shadow: none; border: none; border-radius: 0; }
  .lang-menu .lang-list .lang-on { border-radius: 10px; }
}

.nav-toggle {
  display: none; width: 48px; height: 48px;
  border: none; background: none; cursor: pointer; color: var(--primary);
  align-items: center; justify-content: center; border-radius: 10px;
}
.nav-toggle:hover { background: rgba(62, 86, 65, 0.07); }

@media (max-width: 1199px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-1) var(--space-3) var(--space-3);
    box-shadow: var(--shadow-soft);
  }
  .main-nav.open { display: flex; }
  .main-nav a { min-height: 48px; font-size: 16.5px; border-radius: 12px; }
  .main-nav .nav-apply { margin: var(--space-1) 0 0; justify-content: center; }

  /* 항목이 둘뿐인 머리글(영어 페이지)은 좁은 화면에서도 접지 않는다.
     햄버거가 없으므로 서랍으로 바뀌면 열 방법이 없어 화면을 덮은 채로 남는다. */
  .main-nav.nav-simple {
    display: flex; position: static; flex-direction: row; align-items: center; gap: 2px;
    background: none; backdrop-filter: none; border: 0; padding: 0; box-shadow: none;
  }
  .main-nav.nav-simple a { min-height: 44px; font-size: 14.5px; border-radius: 999px; }
  .main-nav.nav-simple .nav-apply { margin: 0 0 0 8px; padding: 8px 18px; }
  .main-nav.nav-simple .lang-menu { margin-left: 4px; }
  .main-nav.nav-simple .lang-menu .lang-list {
    position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--white); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--shadow-lift);
  }
}

@media (max-width: 420px) {
  /* 아주 좁은 화면에서는 로고 글자를 줄여 머리글이 두 줄로 넘어가지 않게 한다 */
  .main-nav.nav-simple .lang-menu summary { padding: 8px 9px; font-size: 0; gap: 0; }
  .main-nav.nav-simple .lang-menu summary svg { width: 18px; height: 18px; }
  .main-nav.nav-simple .nav-apply { padding: 8px 14px; font-size: 14px; }
}

/* ── 사진 히어로 (홈) ─────────────────── */
.hero-photo {
  position: relative; overflow: hidden;
  min-height: min(88vh, 780px);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--white);
  margin-top: -69px;                    /* 유리 헤더가 사진 위에 뜨도록 */
  padding: 140px 0 100px;
}
.hero-photo .hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -2;
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--overlay-top) 0%, var(--overlay-bottom) 100%);
}
.hero-photo h1 { color: var(--white); text-shadow: var(--text-shadow); margin-bottom: var(--space-3); }
.hero-photo .scripture { color: rgba(255, 255, 255, 0.94); text-shadow: var(--text-shadow); margin-bottom: var(--space-2); }
.hero-photo .hero-sub { color: rgba(255, 255, 255, 0.92); text-shadow: var(--text-shadow); max-width: 580px; margin: 0 auto var(--space-4); }
.hero-actions { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; }

/* 사진 위 유리 버튼 */
.btn-glass {
  background: var(--glass-dark); border-color: var(--glass-border); color: var(--white);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.3); border-color: var(--white); color: var(--white); }
.hero-photo .btn-strong { background: var(--white); border-color: var(--white); color: var(--primary); }
.hero-photo .btn-strong:hover { background: rgba(255, 255, 255, 0.9); }

/* ── 서브 페이지 사진 히어로 ──────────── */
.page-hero {
  position: relative; overflow: hidden;
  min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--white);
  margin-top: -69px;
  padding: 120px 0 64px;
}
.page-hero .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--overlay-top) 0%, var(--overlay-bottom) 100%);
}
.page-hero h1 { color: var(--white); text-shadow: var(--text-shadow); }
.page-hero p { max-width: 640px; margin: var(--space-2) auto 0; color: rgba(255, 255, 255, 0.92); text-shadow: var(--text-shadow); }
.page-hero.no-photo { background: linear-gradient(160deg, var(--primary) 0%, var(--primary-soft) 100%); }

/* ── 풀블리드 사진 밴드 ───────────────── */
.photo-band { position: relative; overflow: hidden; min-height: 380px; display: flex; align-items: flex-end; color: var(--white); }
.photo-band .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.photo-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, var(--overlay-bottom) 100%); }
.photo-band .container { padding-top: var(--space-5); padding-bottom: var(--space-4); }
.photo-band h2, .photo-band p { color: var(--white); text-shadow: var(--text-shadow); }

/* ── 카드 ─────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--space-3); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-1);
  box-shadow: var(--shadow-soft);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card h3 { margin-bottom: 2px; }
.card .card-link { margin-top: auto; padding-top: var(--space-2); font-weight: 600; text-decoration: none; color: var(--primary-soft); }
.card .card-link:hover { color: var(--primary); text-decoration: underline; }

/* 사진 카드 — 이미지가 위, 내용이 아래 */
.photo-card { padding: 0; overflow: hidden; }
.photo-card img, .photo-card .media-slot { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; }
.photo-card .pc-body { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); flex: 1; }

/* ── 빈 미디어 슬롯 (교수님이 나중에 사진·영상 업로드) ── */
.media-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-alt);
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--text-muted); font-size: 14.5px; text-align: center;
  min-height: 200px; padding: var(--space-3);
}
.media-slot code { font-size: 13px; color: var(--primary-soft); word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  .card:hover { transform: none; }
}

/* ── 정보 표(dl) ──────────────────────── */
.info-list { display: grid; grid-template-columns: 96px 1fr; gap: 6px var(--space-2); margin: var(--space-2) 0; }
.info-list dt { color: var(--text-muted); font-size: 15px; }
.info-list dd { margin: 0; }

/* ── 타임라인 ─────────────────────────── */
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 var(--space-3) var(--space-3); }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary-soft); border: 2px solid var(--bg);
}
.timeline .tl-year { font-weight: 800; color: var(--primary); letter-spacing: 0.02em; }

/* ── 공지 ─────────────────────────────── */
.notice-item { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.notice-item time { font-size: 14px; color: var(--text-muted); }
.notice-item h3 { margin: 4px 0 6px; }
.notice-item p { margin: 0; white-space: pre-line; }
/* 공지에 붙는 포스터 — 시트 '포스터' 칸에 사진 주소를 넣으면 나타난다.
   눌러서 원본을 크게 볼 수 있다. 주소가 잘못됐으면 스스로 사라진다. */
.notice-poster { display: block; margin-top: var(--space-2); max-width: 420px; }
.notice-poster img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-soft);
}
.notice-poster:hover img { border-color: var(--primary-soft); }

/* ── 폼 ───────────────────────────────── */
.form-grid { display: grid; gap: var(--space-3); max-width: 560px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .req { color: var(--accent-deep); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--text);
  font: 400 16px/1.5 var(--font-sans);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(92, 122, 94, 0.18);
}
.field-error { display: none; color: var(--accent-deep); font-size: 14.5px; margin-top: 6px; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--accent-deep); }
.field.invalid .field-error { display: block; }
.field-hint { font-size: 14.5px; color: var(--text-muted); margin-top: 6px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot 숨김 */

.result-card {
  display: none; max-width: 560px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); box-shadow: var(--shadow-soft);
}
.result-card.show { display: block; }

/* ── 지도 ─────────────────────────────── */
.map-frame { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius); }

/* ── 퀵메뉴 (유리) ────────────────────── */
.quick-menu {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 8px;
}
.quick-menu a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 70px; min-height: 62px; padding: 8px 4px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border); border-radius: 16px;
  color: var(--text); text-decoration: none; font-size: 12.5px; font-weight: 500; line-height: 1.3;
  box-shadow: var(--shadow-soft);
  transition: transform 150ms ease, box-shadow 150ms ease, color 150ms ease;
}
.quick-menu a:hover { transform: translateX(-3px); box-shadow: var(--shadow-lift); color: var(--primary); }
.quick-menu a svg { width: 20px; height: 20px; }
.quick-menu .qm-apply { background: var(--accent); border-color: var(--accent); color: var(--white); }
.quick-menu .qm-apply:hover { color: var(--white); }

@media (max-width: 860px) {
  .quick-menu {
    top: auto; right: 0; left: 0; bottom: 0; transform: none;
    flex-direction: row; gap: 0;
    background: var(--glass);
    backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
    border-top: 1px solid var(--glass-border); border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 14px rgba(45, 60, 48, 0.07);
  }
  .quick-menu a { flex: 1; width: auto; min-height: 58px; border: none; border-radius: 0; box-shadow: none; background: transparent; }
  .quick-menu a:hover { transform: none; box-shadow: none; }
  .quick-menu .qm-apply { background: var(--accent); }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom)); } /* 하단 바에 가리지 않게 */
}

/* ── 푸터 ─────────────────────────────── */
.site-footer { background: var(--primary); color: rgba(255, 255, 255, 0.88); margin-top: var(--space-6); }
.site-footer .container { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.site-footer .f-name { font-size: 19px; font-weight: 800; color: var(--white); margin-bottom: var(--space-2); }
.site-footer a { color: var(--white); }
.site-footer .f-copy { margin-top: var(--space-3); font-size: 14px; color: rgba(255, 255, 255, 0.6); }
