/* 메인 홈 그리드 레이아웃 */

.home-hero {
  background: var(--bg-main);
}

/*
 * 홈/이용약관/개인정보: main 높이를 콘텐츠에 맞춤 (근본 해결)
 */
.template-homepage .site-main {
  flex: 1 0 auto;
  display: block;
  min-height: 0;
}

/* site-main 직계 래퍼: container 밖으로 나가지 않도록 */
.site-main > .container,
.site-main > .container-fluid,
.site-main > .page-content-wrap,
.site-main > .page-content-wide,
.site-main > .list-detail-layout,
.site-main > section,
.site-main > section > .container {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

/* 개별 페이지 공통: 최대 폭 990px, 홈과 동일 섹션 배경 */
.page-content-wrap {
  max-width: 990px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}
@media (min-width: 576px) {
  .page-content-wrap {
    padding: 0 1.5rem;
  }
}

/* 앱 메인용: 최대 폭 1440px, 가로 넘침 시 래퍼 안에서 스크롤 */
.page-content-wide {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  min-width: 0;
  box-sizing: border-box;
}
@media (min-width: 576px) {
  .page-content-wide {
    padding: 0 1.5rem;
  }
}

/* 리스트-디테일(족보트리/종중/결의/공지): 패딩 축소 */
.list-detail-page .page-content-wide {
  padding: 0 0.5rem;
}
@media (min-width: 576px) {
  .list-detail-page .page-content-wide {
    padding: 0 0.75rem;
  }
}

/* 리스트-디테일: 모바일에서는 바깥 여백 제거 */
@media (max-width: 767.98px) {
  .list-detail-page .page-content-wide {
    max-width: 100%;
    padding: 0 !important;
  }
}

.home-hero-heading .home-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .home-hero-heading .home-title {
    font-size: 32px;
  }
}

.home-hero-heading .home-subtitle {
  font-size: 18px;
  color: var(--text-muted);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* 홈 카드: 네이비·골드 톤 (보더 + 타이틀, 배경은 밝게 유지) */
.home-card-box {
  border: 1px solid var(--primary);
  border-radius: 12px;
  background: var(--bg-panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-card-box:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.home-card-box .card-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.home-card-box .card-text {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--text-main);
}

.home-card-box .card-text:not(ul) {
  color: var(--text-muted);
}

.home-grid .home-form .form-label {
  font-size: 18px;
  color: var(--primary);
  font-weight: 600;
}

.home-grid .home-form .form-control-lg {
  font-size: 18px;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.home-grid .card-body ul.card-text {
  font-size: 18px;
  line-height: 1.7;
  padding-left: 1.2rem;
  color: var(--text-main);
}

.home-grid .card-body ul.card-text li {
  position: relative;
  color: var(--text-main);
}

.home-grid .card-body ul.card-text li + li {
  margin-top: 6px;
}

.home-grid .card-body ul.card-text li::marker {
  color: var(--accent);
}

.home-naver-wrapper {
  text-align: center;
}

.home-naver-link {
  display: inline-block;
}

.home-naver-img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.home-sns-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.home-sns-link {
  display: inline-block;
}

.home-sns-img {
  display: block;
  width: 100%;
  height: auto;
}

.home-helper-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* 하단 통계: 얇은 카드 (네이비·골드 톤) */
.home-stats {
  border-top: 1px solid var(--border);
}

.home-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.home-stat-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--bg-panel);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.home-stat-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.home-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  flex-shrink: 0;
}

.home-stat-label {
  font-size: 14px;
  color: var(--text-muted);
  text-align: left;
}

@media (max-width: 575.98px) {
  .home-card-box .card-title {
    font-size: 20px;
  }

  .home-card-box .card-text,
  .home-grid .card-body ul.card-text {
    font-size: 17px;
  }

  .home-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-stat-card {
    padding: 12px 10px;
  }

  .home-stat-value {
    font-size: 1.35rem;
  }

  .home-stat-label {
    font-size: 12px;
  }
}


/* =========================
   메인페이지 총회 안내 배너
========================= */
.home-notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 24px;
  padding: 20px 24px;
  background: var(--primary);
  color: var(--text-on-dark);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border-left: 6px solid var(--accent);
}

.home-notice-banner-text {
  min-width: 0;
  flex: 1 1 auto;
}

.home-notice-banner-tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.home-notice-banner-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
}

.home-notice-banner-title .home-notice-banner-gold,
.home-notice-banner-sub .home-notice-banner-gold {
  color: var(--accent-light);
  font-weight: 700;
}

.home-notice-banner-sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-on-dark);
  opacity: 0.95;
}

.home-notice-banner-sep {
  margin: 0 6px;
  opacity: 0.7;
}

.home-notice-banner-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-notice-banner-btn:hover {
  background: var(--accent-light);
  color: var(--primary);
}

@media (max-width: 767.98px) {
  .home-notice-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 18px 16px;
  }
  .home-notice-banner-title {
    font-size: 19px;
  }
  .home-notice-banner-sub {
    font-size: 15px;
  }
  .home-notice-banner-btn {
    width: 100%;
  }
}

/* ======================================================
   관리자 화면 공통: 체크박스를 크고 또렷하게 (노인 친화)
====================================================== */
.manage-page .form-check-input {
  width: 1.35em;
  height: 1.35em;
  border: 2px solid #4b5563;
  background-color: #fff;
}
.manage-page .form-check-input:checked {
  background-color: #0f766e;
  border-color: #0f766e;
}
.manage-page .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.25);
}
.manage-page .form-check-input:disabled {
  opacity: 0.45;
}
