/* ===== 리셋 & 변수 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1a3a6e;
  --navy-lt:#e8edf5;
  --gold:   #a07820;
  --text:   #1a1a1a;
  --sub:    #555;
  --border: #d8dbe2;
  --bg:     #f4f5f7;
  --white:  #fff;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', '맑은 고딕', sans-serif;
  color: var(--text); background: var(--bg);
  font-size: 18px;
  line-height: 1.75;
  display: flex; flex-direction: column; min-height: 100vh;
}
.main { flex: 1; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.2rem; }

/* ================================================
   상단 영역 — 전체 비중의 약 20%
   유틸 바(28px) + 헤더(52px) + 히어로(약 72px)
================================================ */

/* 유틸 바 — 28px 고정 */
.util-bar {
  background: #e8eaed;
  border-bottom: 1px solid var(--border);
  font-size: .78rem; color: var(--sub);
  line-height: 1;
}
.util-bar .wrap {
  height: 28px;
  display: flex; justify-content: space-between; align-items: center;
}
.util-bar a { color: var(--navy); }
.util-bar a:hover { text-decoration: underline; }

/* 헤더 — 52px 고정 */
.header {
  background: var(--white);
  border-bottom: 2px solid var(--navy);
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; gap: 1rem;
}

/* 브랜드 */
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand-logo-link,
.brand-seal-link { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; object-fit: contain; }
.brand-seal { height: 34px; width: auto; object-fit: contain; }
.brand-center { display: flex; align-items: center; }
.brand-text  { line-height: 1.2; }
.brand-sub   { display: block; font-size: .68rem; color: var(--sub); }
.brand-name  { display: block; font-size: 1rem; font-weight: 900; color: var(--navy); }

/* GNB */
.gnb { display: flex; align-items: stretch; }
.gnb > ul { display: flex; align-items: stretch; }
.gnb > ul > li { position: relative; display: flex; align-items: center; }
.gnb > ul > li > a {
  display: block; padding: 0 .85rem;
  line-height: 52px;
  font-size: 1rem; font-weight: 700; color: #222;
  white-space: nowrap; transition: color .15s;
}
.gnb > ul > li:hover > a { color: var(--navy); }
.gnb > ul > li::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--navy);
  transform: scaleX(0); transition: transform .2s;
}
.gnb > ul > li:hover::after { transform: scaleX(1); }

/* 드롭다운 */
.sub {
  display: none; position: absolute; top: 52px; left: 0;
  min-width: 180px; background: var(--white);
  border: 1px solid var(--border); border-top: 2px solid var(--navy);
  box-shadow: 0 4px 16px rgba(0,0,0,.08); z-index: 300;
}
.has-sub:hover .sub { display: block; }
.sub li a {
  display: block; padding: .7rem 1.1rem;
  font-size: .95rem; color: #444;
  border-bottom: 1px solid #f0f0f0; transition: background .12s;
}
.sub li:last-child a { border-bottom: none; }
.sub li a:hover { background: var(--navy-lt); color: var(--navy); }

/* 모바일 버튼 */
.mobile-btn {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; background: none; border: none; cursor: pointer; padding: .4rem;
  flex-shrink: 0;
}
.mobile-btn span { display: block; width: 24px; height: 2px; background: #333; }

/* 오버레이 */
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 150;
}
.mobile-overlay.show { display: block; }

/* 드로어 */
.mobile-drawer {
  display: none; position: fixed; top: 0; right: 0;
  width: min(300px, 82vw); height: 100%; background: var(--white);
  z-index: 300; overflow-y: auto;
  transform: translateX(100%); transition: transform .3s;
  box-shadow: -4px 0 20px rgba(0,0,0,.15);
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.2rem; border-bottom: 2px solid var(--navy);
  background: var(--navy-lt);
}
.drawer-head strong { font-size: 1rem; color: var(--navy); }
.drawer-close {
  background: none; border: none; font-size: 1.6rem;
  cursor: pointer; color: var(--sub); line-height: 1;
}
.drawer-menu > li { border-bottom: 1px solid #ebebeb; }
.drawer-menu > li > a {
  display: block; padding: .9rem 1.2rem;
  font-size: 1.05rem; font-weight: 700; color: var(--text);
}
.drawer-sub li a {
  display: block; padding: .65rem 1.2rem .65rem 2rem;
  font-size: .95rem; color: var(--sub);
  border-bottom: 1px solid #f5f5f5; background: #fafafa;
}
.drawer-sub li:last-child a { border-bottom: none; }

/* 히어로 — 한 줄 가로 배치 */
.hero {
  background: var(--navy);
  padding: .85rem 1.2rem;
  text-align: center; color: var(--white);
  border-bottom: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
}
.hero-period {
  font-size: 1rem; font-weight: 700;
  letter-spacing: .2em; color: #f5e07a;   /* 노란색 계열 — 파란 배경 대비 선명 */
}
.hero-motto  {
  font-size: 1.35rem; font-weight: 700;
  font-family: 'Noto Serif KR', serif;
  color: #fff;
}
.hero-verse  { font-size: .9rem; color: #f5c842; font-weight: 500; }
.hero-sep { color: rgba(255,255,255,.3); font-size: 1.1rem; }

/* ================================================
   본문 — 전체 비중의 약 70%
================================================ */
.main { padding: 1.2rem 0 1.5rem; }
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.2rem;
}

/* 박스 공통 */
.board-box { background: var(--white); border: 1px solid var(--border); }
.box-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.1rem; border-bottom: 1px solid var(--border);
}
.box-title {
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  padding-left: .7rem; border-left: 3px solid var(--navy);
}
.more-link { font-size: .88rem; color: var(--sub); }
.more-link:hover { color: var(--navy); text-decoration: underline; }

/* 게시판 목록 */
.board-list li {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid #f0f1f3; font-size: 1.05rem;
}
.board-list li:last-child { border-bottom: none; }
.board-list li a {
  flex: 1; color: #222;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board-list li a:hover { color: var(--navy); text-decoration: underline; }
.badge {
  flex-shrink: 0; font-size: .75rem; font-weight: 800;
  color: var(--white); background: var(--navy);
  padding: .1rem .4rem; line-height: 1.5;
}
.date { flex-shrink: 0; font-size: .85rem; color: #aaa; }

/* 일정 목록 */
.sch-list li {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .75rem 1.1rem;
  border-bottom: 1px solid #f0f1f3; font-size: 1.02rem;
}
.sch-list li:last-child { border-bottom: none; }
.sch-month { flex-shrink: 0; min-width: 50px; font-weight: 800; color: var(--navy); }
.sch-desc  { color: #333; }
.sch-em .sch-month { color: #c0392b; }
.sch-em .sch-desc  { font-weight: 700; }

/* ================================================
   하단 — 전체 비중의 약 10%, 1줄 구성
================================================ */
.footer {
  background: #1c2333;
  border-top: 2px solid var(--navy);
  padding: .45rem 0 .35rem;
}
.footer-inner {
  display: flex; align-items: center; gap: .75rem;
  padding: 0 1.2rem .3rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.footer-seal { height: 26px; width: auto; opacity: .4; flex-shrink: 0; }
.footer-info {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0 .45rem; flex: 1;
  font-size: .78rem; color: #60708a; line-height: 1.6;
}
.footer-info strong { color: #cdd5e4; font-weight: 700; margin-right: .2rem; }
.footer-info .sep { color: #3d4d62; margin: 0 .1rem; }
/* 회장·총무 줄 — 가운데 정렬 */
.footer-copy {
  text-align: center; font-size: .73rem;
  padding: .25rem 1.2rem .2rem;
  color: #60708a;
}
.footer-copy .footer-contact {
  color: #8090a8; margin-bottom: .1rem;
}
.footer-copy .footer-cr { color: #3d4d62; }
.footer-copy .footer-policy { margin-bottom: .1rem; }
.footer-copy .footer-policy a { color: rgba(255,255,255,.55); font-size: .73rem; }
.footer-copy .footer-policy a:hover { color: #fff; text-decoration: underline; }

/* ===== 모바일 드로어 auth ===== */
.drawer-auth {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem 1.2rem;
  background: var(--navy-lt);
  border-bottom: 1px solid var(--border);
}
.drawer-auth a {
  font-size: .9rem; font-weight: 700; color: var(--navy);
  padding: .3rem .7rem;
  border: 1px solid var(--navy); border-radius: 3px;
}
.drawer-auth a:hover { background: var(--navy); color: #fff; }
.drawer-auth-name { flex: 1; font-size: .9rem; color: var(--text); }

/* ===== 위로 가기 버튼 ===== */
#scrollTopBtn {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500;
  width: 44px; height: 44px;
  background: var(--navy); color: #fff;
  border: none; border-radius: 50%;
  cursor: pointer; opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .25s;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
}
#scrollTopBtn svg { width: 20px; height: 20px; }
#scrollTopBtn.visible { opacity: 1; visibility: visible; }
#scrollTopBtn:hover { transform: translateY(-3px); background: #254d96; }

/* auth-links in util-bar */
.util-bar .wrap { flex-wrap: nowrap; }
.auth-links { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
.auth-links a { color: var(--navy); font-weight: 700; }
.auth-links a:hover { text-decoration: underline; }
.auth-links span { color: var(--sub); }
.auth-sep { color: var(--border) !important; }

/* ================================================
   반응형
================================================ */

/* 태블릿 (≤900px) */
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
}

/* 모바일 (≤720px) */
@media (max-width: 720px) {
  .gnb          { display: none !important; }
  .mobile-btn   { display: flex; }
  .mobile-drawer{ display: block; }
  .brand-seal-link { display: none; }

  /* 유틸 바 숨김 — 공간 확보 */
  .util-bar { display: none; }

  /* 헤더 */
  .brand-name { font-size: .92rem; }
  .brand-logo { height: 30px; }

  /* 히어로 — 1줄 압축 */
  .hero { padding: .65rem 1rem; gap: .6rem; }
  .hero-period { display: none; }
  .hero-sep    { display: none; }
  .hero-motto  { font-size: 1.1rem; }
  .hero-verse  { font-size: .8rem; }

  /* 본문 폰트 */
  body { font-size: 17px; }
  .board-list li { font-size: 1rem; padding: .7rem .9rem; }
  .sch-list li   { font-size: .97rem; padding: .7rem .9rem; }
  .box-title     { font-size: 1.05rem; }
  .date { display: none; }

  /* 푸터 */
  .footer-inner { padding: .6rem 1rem; }
  .footer-info strong { font-size: .85rem; }
  .footer-info span   { font-size: .74rem; }
}

/* 소형 (≤420px) */
@media (max-width: 420px) {
  body { font-size: 16px; }
  .brand-name { font-size: .84rem; }
  .brand-logo { height: 28px; }
  .hero-motto { font-size: 1rem; }
  .board-list li { font-size: .95rem; }
}
