/* 1024px 이하 */
@media all and (max-width: 1024px) {
  .gnb_wrap .inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .mobile-pd {
    padding: 20px !important;
  }
}

/* Rebuilder Overwrite */
.rb_module_border_solid .module_widget_wrap {
  border: 1px solid var(--line) !important;
}

.rb_module_border_dashed .module_widget_wrap {
  border: 1px dashed var(--line) !important;
}

/* 게시판 서브 버튼 높이 조정 */
.rb_bbs_wrap .btns_gr_wrap {
  top: 168px !important;
}

.rb_sidemenu.rb_sidemenu_right {
  top: 70px !important;
}

.contents_wrap {
  /*
  background: #F2F4F6;
  */
}

/* 접근성 */
.sr-only {
  position: absolute;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

/* 변수 */
:root {
  --col-left: 220px;
  --col-right: 320px;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
}

/* 헤더 */
.site-header {
  background: var(--header-bg);
  color: var(--text);
  transition: top 0.5s ease;
}

.site-header_inner {
  max-width: var(--tb-max-width);
  margin: 0 auto;
  padding-top: 25px;
  padding-bottom: 25px;
  display: grid;
  column-gap: 16px;
  row-gap: 10px;
  grid-template-columns: 1fr minmax(220px, var(--col-right));
  grid-template-rows: auto;
  grid-template-areas: "left utils";
  align-items: center;
}

.header_left {
  grid-area: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header_logo {
  display: flex;
  align-items: center;
}

.header_logo img {
  height: 35px;
  display: block;
}

/* 검색 */
.header_search {
  position: relative;
  display: block;
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 520px;
  margin-inline: 0;
  margin-left: 20px;
}

.header_search input {
  width: 100%;
  height: 44px;
  padding: 0 48px 0 16px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
}

.header_search input:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.header_search input::placeholder {
  color: #9CA3AF;
}

.header_search button.search_button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  display: inline-block;
  font-size: 0;
  line-height: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
}

.header_search button.search_button:hover,
.header_search button.search_button:focus {
  background-color: color-mix(in srgb, var(--accent) 8%, transparent);
  outline: none;
}

/* 유틸 */
.header_utils {
  grid-area: utils;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.header_utils a {
  color: inherit;
  text-decoration: none;
}

.header_utils a.connect {
  margin-top: 2px;
}

.header_utils a:hover {
  color: var(--text);
}

.header_utils .divider {
  opacity: .4;
  user-select: none;
}

/* 유저 메뉴 */
.header_utils .user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header_utils .user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}

.header_utils .user-avatar img {
  display: block;
  width: 100%;
  height: 100%;
}

.header_utils .user-avatar:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* 유저 카드 */
.header_utils .user-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  display: none;
  z-index: 1200;
}

.header_utils .user-card::after {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.header_utils .user-card::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 11px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: rotate(45deg);
}

.header_utils .user-menu:hover .user-card,
.header_utils .user-menu:focus-within .user-card {
  display: block;
}

.user-card .uc-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
}

.user-card .uc-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: block;
}

.user-card .uc-meta {
  min-width: 0;
  flex: 1;
}

.user-card .uc-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-card .uc-name strong {
  font-weight: 700;
  color: var(--text);
}

.user-card .uc-logout-mini {
  margin-left: auto;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--muted);
  background: #fff;
}

.user-card .uc-logout-mini:hover {
  color: var(--accent);
  background: #f9fafb;
}

.user-card .uc-email {
  color: #6b7280;
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card .uc-divider {
  height: 1px;
  background: var(--line);
  margin-top: 5px;
}

.user-card .uc-quickline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #6b7280;
  font-size: 13px;
  flex-wrap: wrap;
}

.user-card .uc-quickline > li {
  flex-grow: 1;
  padding: 10px 0;
  text-align: center;
}

.user-card .uc-quickline a {
  text-decoration: none;
  color: inherit;
}

.user-card .uc-quickline a .label {
  color: var(--accent);
}

.user-card .uc-quickline a:hover {
  color: var(--accent);
}

.user-card .uc-quickline .sep {
  opacity: .5;
  user-select: none;
}

.user-card .uc-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  background: #fafafa;
}

.user-card .uc-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  text-decoration: none;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
}

.user-card .uc-tab + .uc-tab {
  border-left: 1px solid var(--line);
}

.user-card .uc-tab:hover,
.user-card .uc-tab:focus {
  background: #f3f4f6;
  color: var(--accent);
  outline: none;
}

/* GNB */
.site-gnb {
  background: #fff;
  border-bottom: 1px solid #EAEAEA;
  position: relative;
  z-index: 1010;
}

.site-gnb_inner {
  max-width: var(--tb-max-width);
  margin: 0 auto;
  padding-top: 0;
  padding-bottom: 0;
  display: grid;
  column-gap: 16px;
  align-items: center;
  grid-template-columns: 1fr minmax(220px, var(--col-right));
  grid-template-areas: "gnb promo";
  overflow: visible;
}

.site-gnb .header_gnb {
  grid-area: gnb;
}

.site-gnb .header_promo {
  grid-area: promo;
  justify-self: end;
}

.header_gnb {
  overflow: visible !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px;
}

.header_promo a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

/* RB Scope */
.rb-scope {
  --line: #e5e7eb;
  --text: #111827;
  --muted: #4b5563;
  --pop-bg: #fff;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  position: relative;
  z-index: 1000;
  min-width: 0;
}

.rb-scope .rb-scope_nav {
  display: block;
  width: 100%;
  color: var(--text);
  font: inherit;
}

.gnb_hamburger {
  position: absolute;
  flex: 0 0 auto !important;
  margin: 0 !important;
  width: 24px;
  height: 26px;
  color: var(--text);
  position: relative;
  margin-right: 10px !important;
}

.rb-scope .rb-scope_list {
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
  overflow: visible !important;
}

.rb-scope .rb-scope_list::-webkit-scrollbar {
  display: none;
}

.rb-scope .rb-scope_item {
  position: relative;
  list-style: none;
}

.rb-scope .rb-scope_link {
  display: inline-block;
  padding: 15px 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
}

.rb-scope .rb-scope_link:hover {
  color: var(--accent);
}

.rb-scope .rb-scope_sub {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% - 15px);
  padding-top: 8px;
  z-index: 1020;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-width: 220px;
  max-width: calc(100vw - 32px);
}

.rb-scope .rb-scope_inner {
  background: var(--pop-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 10px;
}

.rb-scope .rb-scope_sublist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.rb-scope .rb-scope_sublink {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}

.rb-scope .rb-scope_sublink:hover {
  background: #f8fafc;
  color: var(--accent);
}

.rb-scope .rb-scope_item:hover > .rb-scope_sub {
  display: block;
}

.header_gnb .vbar {
  width: 1px;
  height: 14px;
  background: var(--line);
  display: inline-block;
}

.header_gnb .accent {
  color: var(--accent);
  font-weight: 700;
}

.rb-scope .is-accent > .rb-scope_link {
  color: #ef6b2e;
  font-weight: 700;
}

/* 1024px 이하 */
@media (max-width: 1024px) {
  :root {
    --col-left: 180px;
    --col-right: 260px;
  }
}

/* 800px 이하 */
@media (max-width: 800px) {
  .site-header_inner {
    padding: 15px;
    padding-bottom: 10px;
    grid-template-areas: "left left";
  }

  .site-gnb_inner {
    grid-template-areas: "gnb gnb";
  }

  .header_search {
    max-width: inherit;
  }

  .header_utils {
    display: none !important;
  }

  .site-gnb .header_promo {
    display: none !important;
  }

  .site-gnb .header_gnb {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    padding-left: 16px;
  }

  .gnb_hamburger {
    flex: 0 0 auto !important;
    margin: 0 !important;
    width: 24px;
    height: 24px;
    color: var(--text);
    position: relative;
  }

  .rb-scope .rb-scope_nav {
    display: block;
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .rb-scope .rb-scope_nav::-webkit-scrollbar {
    display: none;
  }

  .rb-scope .rb-scope_list {
    display: flex;
    flex-wrap: nowrap !important;
    min-width: max-content;
    white-space: nowrap;
    padding: 0 12px !important;
    margin: 0 !important;
    gap: 16px !important;
  }

  .rb-scope .rb-scope_item {
    flex: 0 0 auto;
  }

  .rb-scope .rb-scope_link {
    padding: 12px 4px;
    font-size: 14px;
  }
}
