/* ==========================================================================
   부안임씨 전서공파 대종회 - Main Style System
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* ==========================================================================
   순바탕 (SunBatang) 웹폰트 — 한국출판문화산업진흥원 (https://noonnu.cc/font_page/289)
   ========================================================================== */
@font-face {
  font-family: 'SunBatang';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SunBatang';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Medium.woff') format('woff');
  font-weight: 400 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SunBatang';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Bold.woff') format('woff');
  font-weight: 700 800 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SunBatang-Light';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SunBatang-Medium';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'SunBatang-Bold';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_eight@1.0/SunBatang-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color Palette - Traditional Elegance meets Modern Luxury */
  --bg-main: #f4ede4;   /* 스크롤월드 배경(js/scrub-engine.js 의 --sw-bg / .sw-sky)과 동일 */
  --bg-surface: #ffffff;
  --bg-subtle: #f3f4f6;
  --bg-dark: #0f172a;
  
  --text-main: #0f172a;     /* 70대 시니어 가독성을 위한 진하고 또렷한 텍스트 */
  --text-muted: #334155;    /* 흐린 회색 배제, 뚜렷한 대비 */
  --text-light: #475569;
  --text-inverse: #ffffff;
  
  --primary: #6c7aff;       /* 메인 프라이머리 컬러 (#6c7aff) */
  --primary-hover: #5865f2;
  --primary-light: #eef0ff;
  
  --gold: #d97706;          /* 은행나무 황금빛 & 충절의 금빛 */
  --gold-light: #fef3c7;
  --gold-dark: #b45309;
  
  --accent: #15803d;         /* 유서 깊은 고목의 녹음 */
  
  --border-color: #cbd5e1;
  --border-focus: #d97706;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --font-serif: 'SunBatang', 'SunBatang-Bold', 'SunBatang-Medium', serif;
  
  /* Font Scaling for Senior Accessibility */
  --font-scale: 1;
}

/* Senior Accessibility Mode */
body.font-large {
  --font-scale: 1.15;
}
body.font-xlarge {
  --font-scale: 1.3;
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: calc(17.5px * var(--font-scale)); /* 70대 어르신 가독성을 위해 기본 17.5px로 시원하게 확대 */
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.75; /* 넉넉하고 편안한 행간 */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scroll-World Stage Container Protection */
.sw-scene__still, .sw-scene__video {
  max-width: 100% !important;
  max-height: 100% !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  transform: none !important;
  border-radius: 20px !important;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Sticky Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-cal-logo {
  height: 40px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.brand-logo:hover .brand-cal-logo {
  transform: scale(1.02);
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #4f5de8);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-serif);
  box-shadow: 0 4px 10px rgba(108, 122, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-hanja {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-dark);
}

.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.5rem 0.2rem;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Nav Utility & Accessibility Controls */
.nav-utility {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.font-size-btn-group {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.2rem;
}

.font-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.font-btn.active, .font-btn:hover {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-contact-btn {
  background: linear-gradient(135deg, var(--primary), #4f5de8);
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(108, 122, 255, 0.25);
  transition: var(--transition);
}

.nav-contact-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 122, 255, 0.35);
}

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-main);
}

/* ==========================================================================
   Section Title & Header Component
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  background: var(--gold-light);
  color: var(--gold-dark);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
  word-break: keep-all;
}

/* ==========================================================================
   Gallery Section (Gallery-First Core)
   ========================================================================== */
.gallery-section {
  padding: 6rem 0;
  background: transparent !important;
}

/* Gallery Filter Tabs */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-tab {
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 1.02rem;
  font-weight: 800;
  min-height: 48px; /* 70대 손떨림/오터치 방지 48px 이상 보장 */
  border: 1px solid #d1d5db;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.filter-tab:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: #94a3b8;
}

.filter-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(153, 27, 27, 0.35);
}

/* Gallery Search & Controls */
.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

.gallery-count span {
  color: var(--primary);
  font-weight: 800;
}

.gallery-search-box {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  max-width: 320px;
}

.gallery-search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.gallery-search-input:focus {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Gallery Grid (Responsive Masonry Style) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.gallery-card {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  background: #e9e4da;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

/* 사진이 카드를 가득 채운다 */
.gallery-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-thumb {
  transform: scale(1.06);
}

/* 사진 위에 말머리(좌상단) · 날짜(우상단) · 제목(하단)만 얹는다
   — 그라데이션 대신 단색 반투명 판, 카드가 나타날 때 은은하게 떠오른다 */
.gallery-badge,
.gallery-date {
  position: absolute;
  top: 0.85rem;
  z-index: 2;
  padding: 0.24rem 0.7rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #ffffff;
}

.gallery-badge {
  left: 0.85rem;
  background: var(--primary);
  font-weight: 800;
}

.gallery-date {
  right: 0.85rem;
  background: rgba(15, 18, 32, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* 제목 뒤 어두운 판 대신, 사진 아래쪽이 서서히 어두워지도록 부드럽게 깔아준다
   (경계선이 보이지 않게 하려면 이 자리만 예외적으로 부드러운 농도 변화를 쓴다) */
.gallery-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 68%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(12, 14, 24, 0.86) 0%,
    rgba(12, 14, 24, 0.62) 26%,
    rgba(12, 14, 24, 0.28) 55%,
    rgba(12, 14, 24, 0) 100%
  );
  transition: opacity 0.35s ease;
  opacity: 0.95;
}

.gallery-card:hover::after {
  opacity: 1;
}

.gallery-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.9rem 1.15rem 1.05rem;
  background: none;
}

.gallery-item-title {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.5;
  margin: 0;
  word-break: keep-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 마우스를 올리면 제목이 살짝 떠오른다 */
.gallery-card:hover .gallery-item-title {
  transform: translateY(-3px);
}

/* 카드가 그려질 때(필터·검색 포함) 글자가 아래에서 은은하게 올라온다 */
@keyframes gallery-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-badge,
.gallery-date,
.gallery-overlay {
  animation: gallery-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.gallery-card:nth-child(2) .gallery-badge,
.gallery-card:nth-child(2) .gallery-date,
.gallery-card:nth-child(2) .gallery-overlay { animation-delay: 0.07s; }
.gallery-card:nth-child(3) .gallery-badge,
.gallery-card:nth-child(3) .gallery-date,
.gallery-card:nth-child(3) .gallery-overlay { animation-delay: 0.14s; }
.gallery-card:nth-child(4) .gallery-badge,
.gallery-card:nth-child(4) .gallery-date,
.gallery-card:nth-child(4) .gallery-overlay { animation-delay: 0.21s; }
.gallery-card:nth-child(5) .gallery-badge,
.gallery-card:nth-child(5) .gallery-date,
.gallery-card:nth-child(5) .gallery-overlay { animation-delay: 0.28s; }
.gallery-card:nth-child(n + 6) .gallery-badge,
.gallery-card:nth-child(n + 6) .gallery-date,
.gallery-card:nth-child(n + 6) .gallery-overlay { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  .gallery-badge,
  .gallery-date,
  .gallery-overlay {
    animation: none;
  }
  .gallery-card:hover .gallery-item-title {
    transform: none;
  }
}

/* ==========================================================================
   Clan History & General Im Nansu Feature Section
   ========================================================================== */
.history-section {
  padding: 6.5rem 0;
  background: linear-gradient(180deg, #fdfbf6 0%, #f6efe1 100%);
  position: relative;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.history-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 4px solid #ffffff;
}

.history-visual img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.history-stamp {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(153, 27, 27, 0.92);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 12px;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

.history-content {
  display: flex;
  flex-direction: column;
}

.history-badge {
  align-self: flex-start;
  padding: 0.35rem 0.9rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.history-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 900;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 1.4rem;
}

.history-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.6rem;
  word-break: keep-all;
}

.history-keypoints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.keypoint-item {
  background: #ffffff;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.keypoint-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #111827;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.keypoint-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Historic Sites Section (세종 양화리 은행나무 & 숭모각 & 독락정)
   ========================================================================== */
.monuments-section {
  padding: 6.5rem 0;
  background: linear-gradient(180deg, #fbf7ee 0%, #f5ecd7 100%);
}

.monuments-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.monument-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.monument-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--gold);
}

.monument-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.monument-body {
  padding: 1.6rem;
}

.monument-tag {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-dark);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.monument-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.8rem;
}

.monument-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.2rem;
}

.monument-location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Genealogy & Historic Archives Section (족보 · 고문서)
   ========================================================================== */
.genealogy-section {
  padding: 6.5rem 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.genealogy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2.5rem;
}

.genealogy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.genealogy-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(108, 122, 255, 0.4);
}

.genealogy-thumb-wrap {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #1e293b;
}

.genealogy-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.genealogy-card:hover .genealogy-thumb {
  transform: scale(1.05);
}

.genealogy-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  color: #fbbf24;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.genealogy-body {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.genealogy-name {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
  line-height: 1.45;
}

.genealogy-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  flex-grow: 1;
}

.genealogy-footer {
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

@media (max-width: 960px) {
  .genealogy-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Notice & Schedule Section
   ========================================================================== */
.notice-section {
  padding: 4.5rem 0 5rem 0;
  background: #fbf8f2;
  border-top: 1px solid #ded5c2;
  border-bottom: 1px solid #ded5c2;
}

.notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.notice-box {
  background: #ffffff;
  padding: 2.2rem 2.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid #ded5c2;
  box-shadow: 0 4px 16px -6px rgba(28, 22, 14, 0.08);
}

.notice-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.notice-box-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notice-list {
  list-style: none;
}

.notice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.notice-item:last-child {
  border-bottom: none;
}

.notice-item-link {
  color: var(--text-main);
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notice-item-link:hover {
  color: var(--primary);
}

.notice-date {
  font-size: 0.82rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 4.5rem 0 2rem 0;
  border-top: 1px solid #1e293b;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 2rem;
}

.footer-brand-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.8rem;
}

.footer-brand-desc {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 450px;
  margin-bottom: 1.2rem;
}

.footer-col-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.2rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-link {
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: #ffffff;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #64748b;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   Lightbox Modal for High-Res Gallery Inspection
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(10, 15, 25, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  padding: 2rem;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 1000px;
  width: 100%;
  background: #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.active .lightbox-container {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 10;
  padding: 0.65rem 1.3rem;
  background: #dc2626;
  border-radius: 999px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: var(--transition);
}

.lightbox-close:hover {
  background: #b91c1c;
  transform: scale(1.05);
}

.lightbox-bottom-close {
  padding: 0.75rem 1.5rem;
  background: #334155;
  color: #ffffff;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.lightbox-bottom-close:hover {
  background: #dc2626;
}

.lightbox-image-wrap {
  width: 100%;
  max-height: 65vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

.lightbox-info {
  padding: 1.8rem;
  background: #1e293b;
  color: #f8fafc;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.lightbox-desc {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.7;
}

/* 시니어 종친을 위한 원클릭 전화걸기 스타일 */
.contact-card.is-primary-card {
  border: 2px solid #dc2626;
  background: #fffafa;
  box-shadow: 0 6px 20px rgba(185, 28, 28, 0.12);
}

.contact-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.2rem;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff !important;
  font-size: 1.08rem;
  font-weight: 800;
  border-radius: 12px;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.35);
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.contact-call-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.45);
  background: #991b1b;
}

/* 화면 우측 하단 플로팅 전화상담 위젯 */
.senior-floating-call {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.35rem;
  background: var(--primary);
  color: #ffffff !important;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(108, 122, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
  text-decoration: none;
}

.senior-floating-call:hover {
  transform: translateY(-3px) scale(1.03);
  background: var(--primary-hover);
  box-shadow: 0 14px 30px rgba(88, 101, 242, 0.5);
}

.senior-floating-call .call-icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
}

.senior-floating-call .call-text {
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--primary-light);
}

.senior-floating-call .call-text strong {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  display: block;
}

@media (max-width: 1024px) {
  .senior-floating-call {
    bottom: 16px;
    right: 16px;
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .senior-floating-call .call-icon {
    font-size: 1.2rem;
  }
  .senior-floating-call .call-text {
    font-size: 0.8rem;
  }
  .senior-floating-call .call-text strong {
    font-size: 0.98rem;
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .history-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .monuments-grid {
    grid-template-columns: 1fr;
  }
  .notice-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 10px 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
  }
  .nav-wrapper {
    flex-direction: column;
    height: auto;
    gap: 10px;
    justify-content: center;
    align-items: center;
  }
  .brand-logo {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .brand-cal-logo {
    height: 48px;
    max-width: 280px;
  }
  .nav-utility {
    width: 100%;
    justify-content: center;
  }
  .nav-menu {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .sw-megamenu-toggle {
    display: none !important;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .executives-grid {
    grid-template-columns: 1fr !important;
  }
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
  .comm-board-header {
    display: none !important;
  }
  .comm-board-item {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  .comm-item-link {
    width: 100% !important;
  }
}

/* ==========================================================================
   Executives Section (종친회 임원 소개)
   ========================================================================== */
.executives-section {
  padding: 5rem 0 5.5rem 0;
  background: #ffffff;
}
.executives-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.exec-card {
  background: #fbf9f5;
  border: 1px solid #e5dcce;
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px -4px rgba(28, 22, 14, 0.06);
}
.exec-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 24px -6px rgba(28, 22, 14, 0.12);
  background: #ffffff;
}
.exec-role {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  background: #f0f4ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  margin-bottom: 0.8rem;
}
.exec-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.6rem;
}
.exec-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
}

/* ==========================================================================
   Community Section (자유게시판, 소식나눔, 종원 명부)
   ========================================================================== */
.community-section {
  padding: 6.5rem 0;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}
.comm-tabs-bar {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.comm-tab {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1.5px dashed #93c5fd;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.comm-tab:hover,
.comm-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  border-style: solid;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.comm-board-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
}
.comm-board-header {
  display: flex;
  padding: 0.8rem 1rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 0.5rem;
}
.comm-col-num { width: 60px; text-align: center; }
.comm-col-title { flex: 1; padding-left: 1rem; }
.comm-col-author { width: 120px; text-align: center; }
.comm-col-date { width: 100px; text-align: center; }

.comm-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comm-board-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.95rem;
  transition: background 0.18s ease;
}
.comm-board-item:hover {
  background: #f8fafc;
}
.comm-badge {
  padding: 0.2rem 0.5rem;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.8rem;
}
.comm-badge.is-blue {
  background: #eff6ff;
  color: #2563eb;
}
.comm-item-link {
  flex: 1;
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}
.comm-item-link:hover {
  color: #2563eb;
}
.comm-author {
  width: 120px;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}
.comm-date {
  width: 100px;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}
.comm-write-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.6rem;
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}
.comm-write-btn:hover {
  background: #1e293b;
  transform: translateY(-2px);
}

/* ==========================================================================
   Contact Section (문의 안내)
   ========================================================================== */
.contact-section {
  padding: 6rem 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}
.contact-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 2.2rem 1.6rem;
  text-align: center;
  transition: all 0.2s ease;
}
.contact-card:hover {
  border-color: #2563eb;
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.contact-icon {
  font-size: 2.4rem;
  margin-bottom: 1rem;
}
.contact-card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.6rem;
}
.contact-card-text {
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 0.5rem;
}
.contact-sub {
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ==========================================================================
   통합검색 (메인 사진첩 상단 · 검색 결과 페이지 공용)
   ========================================================================== */
.unisearch-section {
  padding: 1.8rem 0 1.2rem 0;
  position: relative;
}

.unisearch-wrap {
  margin: 0 auto;
}

.unisearch {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
}

.unisearch__form,
.searchpage__form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.45rem 1.4rem;
  background: #ffffff;
  border: 2px solid #ddd3c0;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 18px -4px rgba(28, 22, 14, 0.08);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.unisearch__form:hover,
.searchpage__form:hover {
  border-color: #c9bc9f;
}

.unisearch__form:focus-within,
.searchpage__form:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.16), 0 8px 24px -6px rgba(28, 22, 14, 0.12);
}

.unisearch__icon {
  font-size: 1.25rem;
  color: #8c7e6b;
  flex-shrink: 0;
}

.unisearch__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 0.65rem 0;
}

.unisearch__input::placeholder {
  color: #9c9282;
  font-weight: 500;
}

.unisearch__btn {
  flex-shrink: 0;
  min-height: 50px;
  padding: 0 1.9rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  transition: var(--transition);
}

.unisearch__btn:hover {
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.28);
}

.unisearch__btn:active {
  transform: translateY(0);
}

/* 실시간 결과 패널 */
.unisearch__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 50;
  background: #ffffff;
  border: 1px solid #e2d8c3;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 52px -16px rgba(28, 22, 14, 0.22);
  overflow: hidden;
  text-align: left;
}

.unisearch__panel-head {
  padding: 0.85rem 1.3rem;
  background: #f9f5ee;
  border-bottom: 1px solid #eee5d3;
  font-size: 0.92rem;
  font-weight: 700;
  color: #5c5243;
}

.unisearch__panel-head strong {
  color: var(--gold-dark);
}

.unisearch-result {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.3rem;
  border-bottom: 1px solid #f6f0e4;
  transition: background 0.16s ease;
}

.unisearch-result:hover {
  background: #fdfaf4;
}

.unisearch-result__icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.unisearch-result__body {
  flex: 1;
  min-width: 0;
}

.unisearch-result__title {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unisearch-result__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.86rem;
  color: #6d6252;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unisearch-result__type {
  flex-shrink: 0;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: #f3ecdb;
  border: 1px solid #e4dac3;
  font-size: 0.78rem;
  font-weight: 800;
  color: #574a38;
}

.unisearch__more {
  display: block;
  padding: 0.95rem 1.3rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-dark);
  background: #fcf8f0;
  border-top: 1px solid #eee5d3;
  transition: var(--transition);
}

.unisearch__more:hover {
  background: var(--gold-light);
  color: #92400e;
}

.unisearch__empty {
  padding: 2.4rem 1.3rem;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.75;
}

.unisearch mark,
.searchpage__item mark {
  background: #fef08a;
  color: #1e293b;
  padding: 0.05em 0.25em;
  border-radius: 4px;
}

/* 검색 결과 페이지 */
.searchpage__summary {
  margin: 1.6rem 0 1rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 600;
}

.searchpage__summary strong {
  color: var(--gold-dark);
  font-weight: 800;
}

.searchpage__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
}

.searchpage__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid #ded4c0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #443c30;
  transition: var(--transition);
  cursor: pointer;
}

.searchpage__chip em {
  font-style: normal;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--gold-dark);
}

.searchpage__chip:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: var(--gold-light);
}

.searchpage__chip.is-active {
  background: linear-gradient(135deg, #b45309, #92400e);
  border-color: #92400e;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.25);
}

.searchpage__chip.is-active em {
  color: #ffffff;
}

.searchpage__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.searchpage__item {
  display: block;
  padding: 1.4rem 1.6rem;
  background: #ffffff;
  border: 1px solid #e7decb;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transition: var(--transition);
}

.searchpage__item:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 24px -8px rgba(28, 22, 14, 0.12);
  transform: translateY(-2px);
}

.searchpage__type {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid rgba(217, 119, 6, 0.2);
  font-size: 0.82rem;
  font-weight: 800;
}

.searchpage__title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #14100a;
  line-height: 1.5;
  margin-bottom: 0.35rem;
  word-break: keep-all;
}

.searchpage__desc {
  display: block;
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.7;
  word-break: keep-all;
}

.searchpage__meta {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #716655;
}

.searchpage__empty {
  padding: 4rem 1.5rem;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #d5cab5;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .unisearch-section {
    padding: 1.2rem 0 0.8rem 0;
  }
  .unisearch {
    padding: 0;
  }
  .unisearch__form,
  .searchpage__form {
    padding: 0.4rem 0.4rem 0.4rem 0.95rem;
    gap: 0.4rem;
  }
  .unisearch__input {
    font-size: 1rem;
  }
  .unisearch__btn {
    min-height: 44px;
    padding: 0 1.2rem;
    font-size: 0.95rem;
  }
  .unisearch__panel {
    left: 0;
    right: 0;
  }
}
