/* =========================================================
   🌞 GLOBAL BASE (기본 초기화)
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: "Noto Sans KR", sans-serif;
  color: #222;
  background: #fff;
  overflow-x: hidden;  /* 좌우 스크롤 완전 차단 */
}

/* =========================================================
   🏔️ BANNER (상단 베너 – 가로 전체 + 높이 조절 가능)
   ========================================================= */
.banner {
  width: 100%;          /* 화면 전체 가로 */
  overflow: hidden;
  text-align: center;
  background: #fff;
  position: relative;
  z-index: 10;
  border: none;
}

.banner img {
  display: block;         /* ✅ 인라인 여백 제거 */
  width: 100%;            /* ✅ 항상 화면 전체를 가로지름 */
  height: auto;           /* 세로 비율 자동 유지 */
  max-height: 240px;      /* ✅ 필요 시 이 값만 수정해서 높이 조절 */
  object-fit: cover;      /* 이미지 비율 유지하며 꽉 채우기 */
  transition: max-height 0.4s ease; /* 부드럽게 변화 */
}

/* =========================================================
   🧩 LAYOUT (메인 레이아웃)
   ========================================================= */
.content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 20px;
  padding: 0 20px;
}

/* =========================================================
   📜 MAIN CONTENT (본문 영역)
   ========================================================= */

/* 본문 기본 설정 */
  #main-content {
  flex: 1;
  background: #fff;
  padding: 45px 60px;
  line-height: 1.8; /*본문 줄간격 조절 */
  min-height: 150vh;
  color: #222;
  border: none;
  box-shadow: none;
  max-width: 900px;
  margin-top: 0px; /* 여기서 베너와 간격 조절 */
  padding-bottom: 60px;   /* 긴 문서도 과하게 길어 보이지 않는 적당한 여백 */
}

/* --- 본문 제목 --- */
#main-content h1 {
  background: #3b5c7a;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 0;        /* ✅ 라운드 제거 → 직각 */
  margin: 0 0 34px;        /* ✅ 아래쪽만 여유있게 */
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* --- 본문 문단 --- */
#main-content p {
  text-align: left;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.78;
  max-width: 780px;
  margin: 0 auto 1.4em;
}

/* ✅ 본문 이미지 크기 자동 맞춤 */
#main-content img {
  max-width: 100%;     /* 화면(본문 폭)을 넘지 않게 조정 */
  height: auto;        /* 비율 유지 */
  display: block;      /* 인라인 여백 제거 */
  margin: 1.2em auto;  /* 위아래 여백 + 중앙 정렬 */
  border-radius: 0;    /* 이미지 라운드 제거 */
}

/* ✅ 본문 내 강조글자(볼드) 위쪽에만 간격 2칸 정도 주기 */
#main-content strong {
  display: inline-block;     /* 줄 간격 제어를 위해 인라인블록으로 전환 */
  margin-top: 1.2em;         /* 대략 두 줄 정도 위 여백 */
}

/* Poem 전체 설정 */
.poem-body {
  white-space: normal;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.06rem;
  line-height: 1.8;
  color: #333;
  letter-spacing: 0.01em;
  font-weight: 400;
  text-align: left;
  max-width: 680px;
  margin: 0 auto;
  padding-left: 1.2em;
  margin-bottom: 1.2em;
}

.poem-body p:empty {
  margin: 0;            /* p 간격 제거 */
  display: none;        /* 공백 단락 제거 */
}

/* 리스트 전체 설정 */
.page-list-body,
.page-list-middle-body,
.page-list-small-body {
  display: inline-block;
  text-align: left;
  margin-left: 32%;
  margin-right: auto;
}

/* 글자 크기 단계 설정 */
.page-list-body p {
  font-size: 1rem;
  line-height: 0.8;
}

.page-list-middle-body{
  margin-top: 10%;
}

.page-list-middle-body p {
  font-size: 1.2rem;
  line-height: 1.0;
  align-items: center;
}

.page-list-small-body{
  margin-top: 16%;
}

.page-list-small-body p {
  font-size: 1.4rem;
  line-height: 1.2;
  align-items: center;
}

/* FOOTER (하단 카피라이트 영역) */
.site-footer {
  text-align: center;
  padding: 20px 10px;
  width: 100%;
  max-width: 100%;
  font-size: 0.9rem;
  color: #666;
  background: #f8f8f8;
  border-top: 1px solid #ddd;
}

/* 아래 문단과 간격 확보용 여백 */
#main-content div[align="center"] {
  margin-bottom: 2.5em;
}


/* =========================================================
   📘 MENU PANEL (오른쪽 메뉴 영역)
   ========================================================= */

/* 메뉴 영역 전체 */
#menu-panel {
  position: relative;
  width: 280px;
  flex-shrink: 0;
  color: #fff;
  padding: 25px 20px;
  background-color: #fff;
  background: url("./_Images/Fluigel.png") no-repeat center top;
  background-size: cover;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 0; /* ✅ 직각 유지 */
  margin-top: 45px; /* 여기서 베너와 간격 조절 */
}

/* 어두운 반투명 레이어 */
#menu-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 0;
  border-radius: 0;
}

/* 메뉴 내부 내용은 오버레이 위에 표시 */
#menu-panel * {
  position: relative;
  z-index: 1;
}

/* 타이틀 전체적인 설정 */
#menu-panel h1 {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 15px;
  color: #e6d28a;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

#menu-panel hr {
  margin: 10px 0;  /* 구분선 상하 여백 */
}

/* 타이틀 'Tower of Life Energy' 부분 */
#menu-panel h1 em.glow {
  color: #e6d28a; /* ✨ 은은한 황금빛 (기본 상태) */
  font-style: italic;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

/* hover 시 찬란하게 빛남 */
#menu-panel h1:hover em.glow {
  color: #ffeb91; /* 🌟 찬란하지만 부드러운 황금빛 (호버) */
  text-shadow: 0 0 12px #ffeaaa;
}

/* 메뉴 항목 */
#menu-panel nav a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 6px 20px;   /* 문단 간격과 관계 O */
  line-height: 1.35;    /* 문단 간격을 명시해 조절 */
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 1rem;
  letter-spacing: 0.2px;
}

#menu-panel nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* 메뉴 그룹 */
#menu-panel .menu-group {
  margin-top: 0px;
  margin-bottom: 0px;
  padding-top: 0px;
}

#menu-panel .menu-group ul {
  list-style: none;
  margin-left: 10px;
}

#menu-panel .menu-group ul a {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* 방문자 카운터 */
.menu-counter-wrap {
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  justify-content: center;
}

.menu-counter-mask {
  background: #000;          /* ✅ 전체 검정 */
  padding: 6px 10px;
  border-radius: 0;          /* ✅ 직각 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-counter-mask img {
  display: block;
  height: 20px;
  border-radius: 0 !important;   /* ✅ hits 기본 라운드 강제 제거 */
  filter: grayscale(100%) brightness(1.1);
}

/* =========================================================
   💫 MISC (기타 요소)
   ========================================================= */
.loading {
  text-align: center;
  padding: 40px;
  color: #777;
  font-style: italic;
}

/* 스크롤바 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}

/* 기본 메뉴 토글 버튼 */
.menu-toggle {
  display: none; /* ✅ PC에서는 감춤 */
  position: fixed;
  top: 18px;
  right: 22px;
  background: rgba(59, 92, 122, 0.85);
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 1.2rem;
  border-radius: 6px;
  z-index: 999;
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-toggle:hover {
  background: rgba(59, 92, 122, 1);
}

/* 위로 가기 버튼 (Fluegel Blue Elegance) */
#scroll-top-btn {
  position: fixed;
  bottom: 80px; /* 바닥에서 부터 버튼 높이 */
  right: 500px; /* 버튼은 우측에서 부터 계산 */
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  font-size: 1.55rem;
  font-weight: 500;
  background: rgba(59, 92, 122, 0.85); /* Fluegel Blue 투명 */
  color: #ffffff;
  box-shadow:
    0 6px 18px rgba(59, 92, 122, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
  backdrop-filter: blur(8px);        /* 유리 느낌 */
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

/* 나타날 때 */
#scroll-top-btn.show {
  opacity: 1;
  pointer-events: auto;
}

/* 호버 시 글래스 느낌 */
#scroll-top-btn:hover {
  background: rgba(59, 92, 122, 0.72);
  transform: scale(1.07);
  box-shadow:
    0 8px 22px rgba(59, 92, 122, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

/* =========================================================
   📱 MOBILE SECTION
   - 치마현상(스크롤 끝에서 필름 끊김) 해결
   - 디자인(배경 이미지/필름 느낌) 유지
   ========================================================= */
@media screen and (max-width: 1060px) {

  .content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  #menu-panel {
    position: fixed;
    top: 0;
    bottom: 0;                 /* ✅ 패널 자체는 화면 끝까지 */
    right: -100%;
    width: 80%;
    max-width: 300px;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    z-index: 998;
    padding: 40px 20px 120px;
    padding-bottom: 140px !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
    isolation: isolate;

    /* ✅ 핵심: 필름을 pseudo-element가 아니라 “배경 2겹”으로 */
    background:
      linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25)),
      url("./_Images/Fluigel.png") no-repeat center top;
    background-size: cover;
  }

  #menu-panel.open { right: 0; }

  /* ✅ pseudo-element는 끔 (끊김/치마 원인) */
  #menu-panel::before,
  #menu-panel::after { content: none !important; }

  /* 메뉴 내용은 그대로 */
  #menu-panel * { position: relative; z-index: 1; }

  #main-content {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;
    padding: 25px 20px;
  }

  #main-content p {
    text-align: left !important;
    word-break: keep-all !important;
    line-height: 1.58;
  }

  #menu-panel nav a {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    font-size: 1.1rem;
    line-height: 1.20;
    padding: 4px 16px;
  }

  #menu-panel nav a:hover { background: rgba(255, 255, 255, 0.18); }

  #menu-panel .menu-group ul a {
    font-size: 1.0rem;
    line-height: 1.18;
    padding: 3px 16px;
  }

  .banner img { max-height: 200px; }

  #scroll-top-btn { display: none !important; }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: fixed;
    top: 18px;
    right: 22px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #e6eaf0;
    padding: 8px 12px;
    font-size: 1.3rem;
    border-radius: 10px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  }

  .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
  }

  .menu-toggle::before {
    content: "☰ 메뉴";
    font-size: 1.2rem;
    line-height: 1;
  }
}
