/* =========================================================
   0) Reset & Base (가로 오버플로우 차단)
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body { font: 14px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial; }
img, video, svg, canvas { max-width: 100%; display:inline-block; }
a, button { -webkit-tap-highlight-color: transparent; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; }
.ext-link:hover { color: #1267a5; }
.icon { width: 24px; height: 24px; vertical-align: middle; }
.hidden { display: none !important; }
html.no-scroll { overflow: hidden; }
/* 긴 단어/URL로 인한 가로 스크롤 방지 */
body, .container, .main { overflow-wrap: anywhere; word-break: break-word; }

/* 공통 컨테이너: 가운데 정렬 + 폭 제한 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.flx-row{display:flex;justify-content: space-between;}
.footer-txt{text-align:right;}
@media(max-width:1200px){
	.flx-row{display:block;}
	.footer-txt{text-align:center;}
}
@media (max-width: 1200px) {
  .search-wrap,
  .search-toggle-btn{
    display:none !important;
  }
}

@media (min-width: 1200px) {
  .search-toggle-btn{
    background:#fff;
    z-index:999999;
    width:40px;
    height:40px;
    font-size:24px;
    color:#f1692f;
    border:none;
    cursor:pointer;
    font-weight:600;
  }
}
/* 버튼 */
.btn {
  display: inline-block; line-height: 1;
  padding: 8px 12px; border: 1px solid #ccc; border-radius: 8px;
  background: #fff; color: #222; text-decoration: none;
}
.btn.primary { background: #222; color: #fff; border-color: #222; }
.account { position: relative; margin-left:5px;}
.auth-link { text-decoration: none; color: #222; background: #fff; padding: 5px 10px; border: 1px solid #ddd; border-radius: 8px; display:inline-block; }
/* 메인 래퍼 (vh → dvh로 수정) */
.main { max-width: 100%; margin: 0 auto; min-height: calc(100dvh - 235px); }
.main.is-sub { margin-top: 80px; padding: 50px 0; }
@media (max-width:1200px){
	.main.is-sub { margin-top: 60px; padding: 0; }
}

/* 관리자 로그인 링크 */
.admin_login a {
  display: inline-block; border: 1px solid #ccc; padding: 3px 5px; border-radius: 5px;
}
.admin_login > a:hover { background: #fff; color: #000 !important; text-decoration: none !important; }

.sub-layout { max-width: 1200px; margin: 0 auto; }

/* =========================================================
   1) Header / Logo / Desktop Nav
   ========================================================= */
.hdr {
  position: fixed; inset: 0 0 auto 0;
  width: 100%; height: 80px; padding: 0 10px;
  display: flex; align-items: center; z-index: 2000;
  border-bottom: 1px solid #e9e9e9; background: transparent;
}
.hdr.is-scrolled, .hdr.is-hover {
  background: #fff !important; box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* 헤더 내부 컨테이너가 폭 제한 담당 */
.hdr .container {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: 1200px; width: 100%; padding: 0 16px; margin: 0 auto;
}

/* 로고 */
.logo { margin: 0; }
.logo a { display: inline-flex; align-items: center; height: 60px; }
.logo img { display: block; height: 100%; }

/* 데스크톱 내비 */
.nav .menu { display: flex; align-items: center; gap: 16px; margin: 0; padding: 0; list-style: none; }
.nav .menu > li { position: relative;  }
.nav .menu > li > a {
  display: inline-block; padding: 10px 12px; font-size: 15px; font-weight: 600;
  color: #222; text-decoration: none;
}
.nav .menu > li > a:hover { text-decoration: underline; font-weight: 700; }
.nav .menu > li.has-sub > a::after { content: "▾"; font-size: 10px; margin-left: 6px; opacity: .7; }

/* 드롭다운: 폭 초과 방지 */
.nav .submenu {
  position: absolute; top: 100%; left: 0; min-width: 200px; max-width: min(92vw, 320px);
  padding: 8px 0; margin: 0; list-style: none;
  background: #fff; border: 1px solid #e7e7e7; border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08); display: none; z-index: 2001;
  overflow: hidden;
}
.nav .menu > li:last-child > .submenu { left: auto; right: 0; } /* 우측 끝 항목 튐 방지 */
.nav .submenu li a { display: block; padding: 10px 14px; text-decoration: none; color: #333; white-space: nowrap; }
.nav .submenu li a:hover { background: #f6f7f9; }
.nav .menu > li:hover > .submenu, .nav .menu > li:focus-within > .submenu { display: block; }
.nav .menu a:focus { outline: 2px solid #9cc; outline-offset: 2px; }

/* 우측 영역 */
.hdr__right { display: flex; flex-direction: row; }
.auth { display: flex; align-items: center; gap: 8px; }

/* 언어 드롭다운 */
.lang-switch.dropdown { position: relative; margin-left: 10px; }
.dropdown__btn {
  --btn-bg: #1267a5; --btn-bd: #1267a5; --btn-fg: #fff;
  --btn-bg-hover: #0f578c; --btn-bd-hover: #0f578c;
  height: 36px; padding: 0 12px; line-height: 1; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  transition: background-color .3s, border-color .3s, color .3s, transform .06s, box-shadow .2s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04) inset, 0 2px 6px rgba(0,0,0,.06);
}
.dropdown__btn:hover { background-color: var(--btn-bg-hover); border-color: var(--btn-bd-hover); filter: brightness(.95); }
.dropdown__btn:active { transform: scale(.98); }
.dropdown__btn:focus-visible { outline: 2px solid #2d9cdb; outline-offset: 2px; }
.dropdown__btn svg, .dropdown__btn .caret { color: currentColor; fill: currentColor; }

.hdr.is-scrolled .dropdown__btn,
.hdr.is-hover .dropdown__btn {
  --btn-bg: #0a3d62; --btn-bd: #0a3d62; --btn-fg: #fff;
  --btn-bg-hover: #093551; --btn-bd-hover: #093551;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.04) inset, 0 4px 10px rgba(0,0,0,.08);
}

/* =========================================================
   2) Mobile Toggle & Off-Canvas (Clean)
   ========================================================= */
#mnav-toggle{
  display:none;
  width:40px;height:36px;margin-left:8px;
  border:none;background:transparent;border-radius:8px;cursor:pointer;
  font-size:30px;line-height:1;text-align:center;
}

/* Drawer */
#mnav{
  position:fixed; top:60px; right:0;
  width:min(70vw,360px);
  height:calc(100dvh - 60px);
  background:#fff; border-left:1px solid #eee;
  overflow-y:auto; padding:20px;

  /* 상태 기본값(닫힘) */
  transform:translateX(100%);
  transition:transform .25s ease;
  z-index:3000;                 /* 헤더(2000)보다 위 */
  display:block;                /* 다른 CSS의 display:none 무시 */
}

/* 열림 */
#mnav.open{ transform:translateX(0); }

/* Backdrop */
#mnav-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.35);
  opacity:0; visibility:hidden;
  transition:opacity .2s ease, visibility .2s ease;
  z-index:2900;                 /* 드로어 바로 아래 */
  display:block;
  top:60px;
}
#mnav-backdrop.show{ opacity:1; visibility:visible; }

/* 모바일 드로어 내부 */
.mobile-menu > ul{ margin:0; padding:0; }
.mobile-menu > ul > li{ list-style:none; padding:0 0 10px 20px;}
.mobile-menu > ul > li > a{ text-decoration:none; color:#333; }
.mnav-section { padding: 16px 18px; border-bottom: 1px solid #f1f1f3; }
.mnav-title { font-weight: 700; font-size: 14px; color: #222; margin-bottom: 10px; }
.mnav-links { display: flex; flex-direction: column; gap: 5px; }
.mnav-links a { display: block; padding: 3px 8px; background: #efefef; text-decoration: none; color: #222; border-radius: 8px; }
.mnav-links a:hover { background: #f6f7f9; }
.auth-desktop { display: inline-flex; gap: 10px; align-items: center; margin-left: 10px; }
.auth-desktop .auth-link { text-decoration: none; color: #222; background: #fff; padding: 6px 10px; border: 1px solid #ddd; border-radius: 8px; }
#mnav .auth-mobile { display: none; }
#mnav .auth-mobile-sep { display: none; border-top: 1px solid #eee; margin: 8px 0; }
/* ===== Mobile Drawer ===== */
.mobile-menu{
  position: fixed;
  top: 0;
  right: 0;
  width: 82%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  z-index: 1200;
  box-shadow: -6px 0 24px rgba(0,0,0,.08);
}

.mnav-inner{
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ===== Main Menu ===== */
.mnav-list{
  list-style: none;
  padding: 0;
  margin: 0;
}

.mnav-list li{
  border-bottom: 1px solid #f1f1f3;
}

.mnav-list a{
  display: flex;
  align-items: center;
  padding: 14px 4px;
  font-size: 16px;
  font-weight: 500;
  color: #111827;
  text-decoration: none;
}

.mnav-list a::after{
  content: '›';
  margin-left: auto;
  color: #9ca3af;
  font-size: 18px;
}

.mnav-list a:active{
  background: #f9fafb;
}

/* ===== Auth Area ===== */
.mnav-auth{
  padding-top: 18px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mnav-auth a{
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

/* primary / secondary */
.auth-primary{
  background: #0b5ed7;
  color: #fff;
}

.auth-secondary{
  background: #f3f4f6;
  color: #111827;
}

.auth-admin{
  margin-top: 6px;
  font-size: 14px;
  background: #111827;
  color: #fff;
}


/* =========================================================
   3) Footer
   ========================================================= */
.ftr {
  background: #ebebeb; color: #000;
  padding: 20px 0; font-size: 13px; text-align: center; line-height: 1.6;
}
.ftr p { margin: 4px 0; }
.ftr a { color: #ddd; text-decoration: none; }
.ftr a:hover { text-decoration: underline; color: #fff; }
.ftr small { display: block; margin-top: 10px; color: #888; }
.ftr .lang-switch { font-size: 12px; margin-left: 10px; }
.ftr .lang-switch a { margin: 0 4px; color: #ddd; text-decoration: none; }
.ftr .lang-switch a:hover { color: #fff; text-decoration: underline; }

/* =========================================================
   4) Flash
   ========================================================= */
.flash {
  max-width: 550px; margin: 12px auto; padding: 12px 14px;
  border-radius: 10px; font-size: 14px; text-align: center; display: block;
  border: 1px solid #e5e5e5; background: #f9f9f9;
}
.flash-success { border-color: #cce7d0; background: #f3fbf5; color: #166534; }
.flash-error   { border-color: #f5c2c7; background: #fff1f2; color: #b91c1c; }
.flash-info    { border-color: #c7d2fe; background: #eef2ff; color: #1e40af; }

/* =========================================================
   5) Responsive
   ========================================================= */
@media (max-width: 1200px) {
  .hdr { height: 60px; }
  .hdr .container { justify-content: space-between; gap: 12px; }
  .container { padding: 0 12px; }
  .is-home .hdr { background: transparent; }
  .is-sub  .hdr { background: #fff; }

  .nav, .lang-switch-top, .auth { display: none; }
  #mnav-toggle { display: inline-block; }
  .logo a { height: 40px; }

  .auth-desktop { display: none; }
  #mnav .auth-mobile { display: block; }
  #mnav .auth-mobile-sep { display: block; }
  .lang-switch.dropdown { margin-left: 0; }
}

@media (max-width: 768px) {
  .main.is-sub {
    margin-top: 61px;
    padding: 10px 10px 30px;
    min-height: auto; /* 모바일에서는 고정 높이 풀어 튐 방지 */
  }
  .auth-user,
  .auth-guest{display:flex;gap:10px;justify-content:center}
  .auth-user a,
  .auth-guest a{border-radius:5px;background:#025a9b;color:#fff;}
  .auth-admin {display:flex;justify-content:center;padding:0 !important; margin:10px auto 0;}
  .auth-admin a{display:inline-block; padding:5px 12px; background:#029b32;color:#fff !important;border-radius:5px;}
  .log-type{padding:0 !important;}
  .log-type a{display:inline-block;padding:5px 8px;border:1px solid #ccc;text-decoration:none;}
  /* 배경 이미지가 세로 100% 기준일 때 가로 튐 방지 */
  .top-container { background-size: auto 100% !important; background-repeat: no-repeat; background-position: center; }
}

@media (max-width: 420px) {
  .hdr { height: 60px; padding: 0; }
  .hdr .container { padding: 0 8px; }
  .container { padding: 0 8px; }
  .account{display:none}

  #mnav {
    top: 60px;
    height: calc(100dvh - 54px);
    padding-bottom: 8px;
    box-shadow: -10px 0 30px rgba(0,0,0,.15);
  }
  .mnav-links a { font-size: 12px; }
  .lang-switch.dropdown { margin-top: 5px; height: 25px; }
  .dropdown__btn { height: 28px; padding: 2px 8px; font-size: .8rem; border-radius: 6px; }
}
/* --- Lang dropdown: 강제 우선순위 보정 --- */
.hdr .lang-switch { position: relative; }

/* 기본 숨김 규칙이 다른 곳에 있어도 이 규칙이 최종 승리하도록 */
.hdr .lang-switch > .dropdown__menu{
  position: absolute; top:100%; right:0; transform: translateY(6px);
  min-width: 110px; max-height: min(50vh, 320px); overflow: auto;
  margin: 0; padding: 6px; list-style: none;
  background:#fff; border:1px solid #eaeaea; border-radius:12px;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  z-index: 2100;
  display: none !important; /* 기본은 무조건 숨김 */
}

/* 열림 상태: 반드시 보이게 */
.hdr .lang-switch.open > .dropdown__menu{
  display: block !important; visibility: visible; opacity: 1;
}

/* 항목 스타일 */
.hdr .lang-switch .dropdown__menu li{ list-style:none; }
.hdr .lang-switch .dropdown__menu a{
  display:flex; align-items:center; gap:10px;
  padding:5px 8px; border-radius:8px;
  color:#1f2937; text-decoration:none; font-size:14px;justify-content:end;
}
.hdr .lang-switch .dropdown__menu a:hover,
.hdr .lang-switch .dropdown__menu a:focus{ background:#f6f7f9; outline:0; }
.hdr .lang-switch .dropdown__menu li[aria-selected="true"] > a{ font-weight:700; }
.hdr .lang-switch .dropdown__menu li[aria-selected="true"] > a::before{ content:"✔"; font-size:12px; }

/* 버튼-메뉴 사이 끊김 방지 다리 */
.hdr .lang-switch::before{ content:""; position:absolute; left:0; right:0; top:100%; height:8px; }

/* RTL */
html[dir="rtl"] .hdr .lang-switch > .dropdown__menu{ right:auto; left:0; }
/* 햄버거 드로어가 다른 CSS에 의해 숨겨져도 이 규칙이 이기게 */
/* ==== Mobile drawer visibility hardening ==== */
#mnav {
  display: block !important;         /* 다른 파일이 display:none 해도 무시 */
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateX(100%);       /* 기본은 오른쪽 밖 */
  transition: transform .25s ease;
  z-index: 3000 !important;          /* 헤더(2000)보다 위 */
}
/* aria-hidden 전역 규칙 무력화 */
#mnav[aria-hidden="true"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 열림 상태 */
#mnav.open {
  transform: translateX(0) !important;
}

/* 백드롭도 확실히 보이게 */
#mnav-backdrop {
  display: block !important;
  visibility: hidden;
  opacity: 0;
  z-index: 2900 !important;
}
#mnav-backdrop.show {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ── Avatar account button ───────────────────────── */
.account { position: relative; }

.account__btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:3px; border:1px solid var(--line, #e5e7eb);
  background:#fff; border-radius:9999px; cursor:pointer;line-height:28px;
}
.account__btn:focus { outline:1px solid #2563eb; outline-offset:2px; }
.avatar-img{
  width:28px; height:28px; border-radius:50%; object-fit:cover; display:block;
}
.avatar-fallback_big {
	line-height:120px !important;
	font-size:48px;
	width:100%;
	height:100%;
    color: #6b7280;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #e1e1e1;
}
.avatar-fallback {
    font-size: 18px;
    color: #6b7280;
    line-height: 28px !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #e1e1e1;
}

.account__btn:hover .avatar-fallback {
  color: #2563eb; /* hover 시 포인트 색상 */
}
.account__btn .caret{ font-size:12px; opacity:.75; }

/* dropdown common */
.dropdown__menu{
  position:absolute; right:0; top:calc(100% + 8px);
  min-width:180px; padding:8px; margin:0; list-style:none;
  background:#fff; border:1px solid var(--line, #e5e7eb);
  border-radius:12px; box-shadow:0 12px 28px rgba(0,0,0,.08);
  display:none; z-index:1000;
}
.dropdown__menu.show{ display:block; }
.dropdown__menu a{
  display:block; padding:10px 12px; border-radius:8px; color:#111827; text-decoration:none;
}
.dropdown__menu a:hover{ background:#f3f4f6; }
.dropdown__menu .sep{
  height:1px; margin:6px 4px; background:#e5e7eb; pointer-events:none;
}
.wa-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 62px;
    height: 62px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.25s ease;
}

/* 나타날 때 */
.wa-btn.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* 살짝 호버 효과 */
.wa-btn:hover {
    transform: scale(1.08);
}

@media (max-width: 768px) {
	.wa-btn {
		bottom: 180px;
		right: 20px;
		width: 50px;
		height: 50px;
		font-size: 30px;
	}
}