:root {
  --primary-color: #2c3e50;
  --primary-light: #34495e;
  --accent-color: #c0392b;
  --accent-hover: #e74c3c;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --transition: all 0.3s ease;
  --shadow: 0 8px 24px rgba(149, 157, 165, 0.15);
  --shadow-lg: 0 16px 40px rgba(149, 157, 165, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-color);
  overscroll-behavior-x: none; /* 모바일 브라우저 네이티브 스와이프 방지 */
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 탑바 */
.top-bar {
  background-color: #1a202c;
  color: #a0aec0;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #2d3748;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-bar-left span {
  margin-right: 15px;
}

.top-bar-left i {
  margin-right: 5px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-right a {
  color: #a0aec0;
}

.top-bar-right a:hover,
.top-bar-right a.active {
  color: #ffffff;
}

.top-bar-right .divider {
  color: #4a5568;
}

/* 헤더 */
.main-header {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  color: var(--primary-color);
}

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

.logo-ko {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
}

.logo-en {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  display: inline-block;
  transform: scaleX(0.9);
  transform-origin: left;
}

.main-nav > ul {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  padding: 25px 0;
  display: inline-block;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent-color);
}

.main-nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition);
}

.main-nav > ul > li:hover > a::after,
.main-nav > ul > li > a.active::after {
  width: 100%;
}

.main-nav > ul > li > a > i {
  transition: transform 0.2s ease;
}

.main-nav > ul > li:hover > a > i {
  transform: rotate(180deg);
}

/* 드롭다운 메뉴 스타일링 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-color);
  list-style: none;
  z-index: 1001;
}

.dropdown-menu li {
  width: 100%;
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-main);
  white-space: nowrap;
  transition: var(--transition);
  text-align: left;
}

.dropdown-menu a::after {
  display: none !important;
}

.dropdown-menu a:hover {
  background-color: #f8f9fa;
  color: var(--accent-color);
}

/* 호버 시 드롭다운 표시 */
.main-nav > ul > li:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 10000;
}


.mobile-menu-btn span {
  width: 24px;
  height: 3px;
  background-color: var(--primary-color);
  transition: var(--transition);
  transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 히어로 배너 */
.hero {
  position: relative;
  height: 550px;
  background: linear-gradient(135deg, rgba(20, 55, 74, 0.90), rgba(40, 100, 150, 0.76)), url('/images/hero-bg.jpg') no-repeat center center/cover;
  display: flex;
  align-items: center;
  color: #ffffff;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-content h1 {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-content p {
  font-size: 20px;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* 히어로 대시보드 카드 스타일 */
.hero-cards-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* Serving Page Grids */
.associate-pastors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.elders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lead-pastor-card {
  display: flex;
  flex-direction: row;
  gap: 30px;
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  border-top: 4px solid var(--primary-color);
  align-items: center;
  flex-wrap: wrap;
}

/* Serving Page Shortcut Nav */
.serving-shortcut-nav {
  background-color: #ffffff;
  position: sticky;
  top: 135px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.people-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}
@media (max-width: 768px) {
  .people-chip-container {
    justify-content: center;
  }
}

.people-chip {
  background-color: #f8fafc;
  padding: 8px 18px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.people-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  border-color: #cbd5e0;
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.menu-overlay.active {
  display: block;
  opacity: 1;
}


.serving-shortcut-nav .nav-container {
  overflow-x: auto;
  white-space: nowrap;
  padding: 12px 15px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.serving-shortcut-nav .nav-container::-webkit-scrollbar {
  display: none;
}

@media (max-width: 768px) {
  .serving-shortcut-nav .nav-container {
    justify-content: flex-start;
  }
}

/* Greeting Page Responsive Classes */
.greeting-welcome-msg {
  font-size: 34px;
  color: #e91e63;
  font-weight: 500;
  margin-bottom: 40px;
}

.greeting-text-content {
  flex: 1;
  min-width: 280px;
  font-size: 16px;
  color: #111;
  line-height: 1.9;
  font-weight: 600;
  padding-right: 30px;
}

.greeting-pastor-portrait {
  width: 250px;
  flex-shrink: 0;
  margin-top: 40px;
  position: relative;
  z-index: 5;
}

.greeting-banner-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Noto Serif KR', 'Nanum Myeongjo', 'Playfair Display', 'Batang', serif;
  font-size: clamp(18px, 3.1vw, 36px);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fffdf9;
  text-shadow: 0 3px 16px rgba(10, 7, 4, 0.85), 0 1px 4px rgba(0, 0, 0, 0.65);
  width: 90%;
  text-align: center;
}

.greeting-content {
  position: relative;
  z-index: 2;
  padding: 0 40px;
}

.hero-box-card {
  flex: 1;
  min-width: 189px;
  max-width: 231px;
  background-color: rgba(18, 28, 51, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 23px 16px;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.hero-box-card i {
  font-size: 1.89rem;
  color: var(--accent-color);
  margin-bottom: 10px;
}

.hero-box-card span.card-title {
  color: #ffffff;
  font-size: 1.155rem;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.hero-box-card span.card-desc {
  font-size: 0.84rem;
  color: #e2e8f0;
  font-weight: 500;
}

.hero-box-card:hover {
  transform: translateY(-5px);
  background-color: rgba(18, 28, 51, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .hero-cards-row {
    gap: 12px;
    margin-top: 25px;
  }
  .hero-box-card {
    min-width: 145px !important;
    padding: 15px 10px;
  }
  .hero-box-card i {
    font-size: 1.6rem;
    margin-bottom: 6px;
  }
  .hero-box-card span.card-title {
    font-size: 1.05rem;
  }
  .hero-box-card span.card-desc {
    font-size: 0.75rem;
  }
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  font-weight: 500;
  border-radius: 30px;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* 필터 탭 버튼 (cell-groups 등) */
.filter-btn {
  display: inline-block;
  background-color: #fff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  padding: 6px 16px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.filter-btn.active {
  background-color: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  font-weight: 700;
}

.filter-btn:hover:not(.active) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 샘터 그룹 목록 아이템 */
.group-item {
  padding: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 6px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.group-item.active {
  border-color: var(--primary-color);
  background: #faf5ff;
}

.group-item:hover:not(.active) {
  border-color: var(--border-color);
  background: #f8f9fa;
}

/* 샘터 그룹 필터 소버튼 */
.group-filter-btn {
  display: inline-block;
  font-size: 0.8rem;
  padding: 4px 10px;
  background: #f8f9fa;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.group-filter-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.group-filter-btn:hover:not(.active) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 샘터 구성원 아바타 */
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.member-avatar.leader {
  background: linear-gradient(135deg, #e11d48, #f97316);
}

.member-name {
  font-weight: 400;
}

.member-name.leader {
  font-weight: 600;
}

/* 페이지네이션 버튼 */
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 8px 12px;
  background: #e2e8f0;
  color: #4a5568;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-btn.active {
  background: var(--accent-color);
  color: #fff;
}

.pagination-btn:hover:not(.active) {
  background: #cbd5e0;
  color: #2d3748;
}

/* 홈 섹션 */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 32px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 16px;
}

/* 카드 그리드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card-img {
  height: 200px;
  background-color: #edf2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 24px;
}

.card-category {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 8px;
}

.card-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: 12px;
  font-weight: 600;
}

.card-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* 예배 시간 안내 */
.worship-section {
  background-color: #0d4a5e;
  color: #ffffff;
}

.worship-section .section-title h2 {
  color: #ffffff;
}

.worship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.worship-card {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 12px;
  border-radius: 12px;
  text-align: center;
  transition: var(--transition);
  width: 180px;
  flex: 0 0 auto;
}

.worship-card:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

@media (max-width: 768px) {
  .worship-card {
    width: calc(50% - 7.5px);
    padding: 15px 10px;
  }
}

.worship-icon {
  font-size: 26px;
  margin-bottom: 12px;
  color: #e2e8f0;
}

.worship-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.worship-time {
  font-size: 13px;
  color: #cbd5e0;
}

/* 푸터 */
.main-footer {
  background-color: #1a202c;
  color: #cbd5e0;
  padding: 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 50px;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 16px;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-color);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 15px;
}

.footer-logo small {
  font-size: 11px;
  font-weight: 400;
  color: #a0aec0;
  display: block;
  margin-top: 2px;
}

.footer-tagline {
  margin-bottom: 5px;
  color: #a0aec0;
}

.footer-tagline-en {
  font-size: 12px;
  color: #718096;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul a:hover {
  color: #ffffff;
  padding-left: 5px;
}

.worship-times li {
  display: flex;
  justify-content: space-between;
}

.contact-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.contact-list i {
  color: var(--accent-color);
  margin-top: 4px;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #2d3748;
  border-radius: 50%;
  color: #cbd5e0;
}

.social-links a:hover {
  background-color: var(--accent-color);
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #2d3748;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #718096;
  font-size: 13px;
}

.footer-bottom a {
  color: #718096;
}

.footer-bottom a:hover {
  color: #ffffff;
}

/* Flash 메시지 */
.flash {
  position: fixed;
  top: 90px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: slideIn 0.3s forwards;
}

.flash-success {
  background-color: #2f855a;
}

.flash-error {
  background-color: #c53030;
}

.flash-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  margin-left: 10px;
}

/* Responsive Grid Utilities */
.responsive-grid-3-1 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 40px;
}
.responsive-grid-1-1 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Global Responsive Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Premium Form Styling for Public Site */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--primary-color);
}
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main);
  background-color: #ffffff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

@keyframes slideIn {
  from { transform: translateX(120%); }
  to { transform: translateX(0); }
}

/* 반응형 모바일 */
@media (max-width: 768px) {
  .logo {
    gap: 8px;
  }
  .logo-img {
    height: 38px !important;
  }
  .logo-ko {
    font-size: 16px;
  }
  .logo-en {
    font-size: 8px;
  }

  .top-bar-left {
    display: none;
  }
  .top-bar .container {
    justify-content: center;
  }
  .main-nav {
    display: block;
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    border-top: none;
    max-height: none;
    overflow-y: auto;
    z-index: 9999 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 80px;
  }
  .main-nav.active {
    transform: translateX(-300px);
  }
  .main-nav > ul {
    flex-direction: column;
    padding: 20px;
    gap: 10px;
    align-items: flex-start;
  }
  .main-nav > ul > li {
    width: 100%;
  }
  .main-nav > ul > li > a {
    color: var(--text-main) !important;
    padding: 14px 10px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f7fafc;
    font-size: 16px;
    font-weight: 600;
  }
  .main-nav > ul > li > a:hover,
  .main-nav > ul > li > a.active {
    color: var(--accent-color) !important;
  }
  .main-nav > ul > li > a::after {
    display: none;
  }
  .main-nav > ul > li > a > i {
    display: inline-block; /* Show mobile chevron */
    transition: transform 0.2s ease;
    font-size: 0.85rem;
    color: var(--text-muted);
  }

  /* Disable hover dropdown on mobile, unless it is open */
  .main-nav > ul > li:hover:not(.open) .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: none !important;
    position: static;
  }

  /* 모바일용 드롭다운 메뉴 스타일 */
  .dropdown-menu {
    display: none; /* Collapsed by default */
    position: static;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none;
    border: none;
    background-color: #f8f9fa;
    border-left: 2px solid var(--border-color);
    padding: 5px 0 5px 15px;
    margin-top: 5px;
    flex-direction: column;
    gap: 5px;
    min-width: unset;
    z-index: auto;
  }
  .main-nav > ul > li.open .dropdown-menu {
    display: flex; /* Expand when parent li has .open */
    transform: none !important;
  }
  .main-nav > ul > li.open > a > i {
    transform: rotate(180deg) !important; /* Rotate chevron when open */
    color: var(--accent-color);
  }

  .dropdown-menu li {
    width: 100%;
  }

  .dropdown-menu a {
    color: var(--text-main) !important;
    padding: 8px 10px;
    font-size: 14px;
    text-align: left;
    border-bottom: none;
    display: block;
    width: 100%;
  }
  .dropdown-menu a:hover {
    color: var(--accent-color) !important;
    background-color: #edf2f7;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .info-card {
    padding: 20px !important;
  }

  /* Responsive Grids Stack */
  .associate-pastors-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .associate-pastors-grid > div {
    padding: 15px 10px 10px !important;
  }
  .associate-pastors-grid img {
    width: 90px !important;
    height: 90px !important;
  }
  .elders-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .elders-grid > div {
    padding: 10px 5px !important;
  }
  .lead-pastor-card {
    flex-direction: column !important;
    padding: 25px 20px !important;
    gap: 15px !important;
    text-align: center !important;
  }
  .lead-pastor-card img {
    width: 140px !important;
    height: 140px !important;
  }
  .serving-shortcut-nav {
    position: static !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--border-color) !important;
  }

  /* Greeting Responsive Overrides */
  .greeting-content {
    padding: 0 15px !important;
  }
  .greeting-welcome-msg {
    font-size: 22px !important;
    margin-bottom: 25px !important;
    line-height: 1.4 !important;
  }
  .greeting-text-content {
    padding-right: 0 !important;
    font-size: 15px !important;
  }
  .greeting-pastor-portrait {
    margin: 30px auto 0 auto !important;
  }
  
  .hero {
    height: auto;
    padding: 60px 0;
  }
  .hero-content h1 {
    font-size: 32px;
  }
  .hero-content p {
    font-size: 16px;
  }

  .section {
    padding: 40px 0; /* reduce section spacing */
  }
  
  article.card, .card {
    padding: 20px !important; /* reduce card padding */
  }

  /* Grid Stack Helpers */
  .responsive-grid-3-1,
  .responsive-grid-1-1 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Tabs Grid Layout on Mobile (2x2 Segmented Controls) */
  .tabs-container {
    width: 100% !important;
  }
  .tabs-container > div {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr !important;
    gap: 10px !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    overflow-x: visible !important;
    white-space: normal !important;
    width: 100% !important;
  }
  .tabs-container .tab-btn {
    width: 100% !important;
    min-height: 46px !important;
    height: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
    color: #4a5568 !important;
    text-align: center !important;
    transition: none !important;
    box-shadow: none !important;
  }
  .tabs-container .tab-btn:hover {
    color: var(--primary-color) !important;
    border-color: #cbd5e1 !important;
    background-color: #f8fafc !important;
  }
  .tabs-container .tab-btn.active,
  .tabs-container .tab-btn.active:hover,
  .tabs-container .tab-btn.active:focus,
  .tabs-container .tab-btn.active:active {
    background-color: #344256 !important;
    color: #ffffff !important;
    border: 1px solid #344256 !important;
    box-shadow: inset 0 -3px 0 #d9534f !important;
    font-weight: 600 !important;
  }
  .tabs-container .tab-btn i {
    font-size: 13px !important;
    margin-right: 0 !important;
    opacity: 0.85;
  }

  /* 모바일용 서브페이지 네비게이션 및 콘텐츠 */
  .subpage-nav {
    top: 80px;
  }
  .subpage-nav .container {
    gap: 15px;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 15px;
  }
  .subpage-nav-link {
    font-size: 14px;
    padding: 12px 5px;
    white-space: nowrap;
  }
  .greeting-container {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  .pastor-profile {
    flex: 0 0 100%;
    width: 100%;
    max-width: 280px;
  }
  .greeting-title {
    font-size: 20px;
    text-align: center;
  }
  .worship-table th,
  .worship-table td {
    padding: 12px 10px;
    font-size: 13px;
  }
}

/* 서브페이지 네비게이션 (데스크톱) */
.subpage-nav {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 80px;
  z-index: 999;
}

.subpage-nav .container {
  display: flex;
  justify-content: center;
  gap: 40px;
}

.subpage-nav-link {
  padding: 18px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: var(--transition);
  display: inline-block;
}

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

.subpage-nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--accent-color);
  transition: var(--transition);
}

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

/* 인사말 페이지 스타일 */
.greeting-container {
  display: flex;
  gap: 50px;
  align-items: flex-start;
  text-align: left;
  margin-top: 40px;
}

.pastor-profile {
  flex: 0 0 280px;
  text-align: center;
}

.pastor-photo {
  width: 100%;
  height: 350px;
  border-radius: 12px;
  background-color: #edf2f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.pastor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.pastor-photo i {
  font-size: 48px;
  color: #a0aec0;
}

.pastor-info {
  margin-top: 15px;
}

.pastor-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.pastor-title {
  font-size: 14px;
  color: var(--text-muted);
}

.greeting-text {
  flex: 1;
}

.greeting-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.4;
  margin-bottom: 25px;
}

.greeting-body p {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
}

/* 예배 시간 테이블 */
.worship-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 30px;
  box-shadow: var(--shadow);
  border-radius: 8px;
  overflow: hidden;
}

.worship-table th,
.worship-table td {
  padding: 16px 20px;
  text-align: center;
}

.worship-table th {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
}

.worship-table td {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 15px;
}

.worship-table tr:last-child td {
  border-bottom: none;
}

.worship-table tr:hover td {
  background-color: #f7fafc;
}

/* 새가족 가이드 */
.newcomer-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.step-card {
  background: #ffffff;
  padding: 30px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.step-num {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.step-icon {
  font-size: 36px;
  color: var(--primary-color);
  margin-bottom: 20px;
  margin-top: 10px;
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .associate-pastors-grid,
  .elders-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Page Header & Subnav Global Center Alignment */
.page-header {
  text-align: center;
}

.tabs-container > div,
.vision-subnav-wrap > div {
  justify-content: center !important;
}

