@charset "utf-8";

/* ===== Variables ===== */
:root {
  --color-bg: #e3e4df;
  --color-surface: #f8f9f6;
}

/* ===== Reset ===== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);

  font-family:
    'Open Sans',
    'Noto Sans KR',
    'Malgun Gothic',
    'Apple SD Gothic Neo',
    sans-serif;
}

hr {
  display: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

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

/* ===== 공통 ===== */
.container {
  width: 1200px;
  max-width: 100%;
  padding: 0 20px;
  background: #f8f9f6;
}

/* ===== Header ===== */
.header {
  margin: 0 auto;
  width: 1200px;
  max-width: 100%;
  padding: 0;
}

.header-main__inner {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 0;
  flex-wrap: wrap;
}

.brand {
  margin: 0 0 0 36px;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.brand a {
  display: block;
  text-decoration: none;
  color: #111;
  overflow-wrap: anywhere;
}

/* ===== Header User ===== */
.header-user {
  margin-left: auto;
  padding-right: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
}

.user-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-links li {
  display: flex;
  align-items: center;
}

.user-links li + li::before {
  content: "|";
  margin-right: 10px;
  color: #a4a69f;
}

.user-links a {
  display: block;
  text-decoration: none;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

.user-links a:hover {
  text-decoration: underline;
}

/* ===== GNB ===== */
.gnb {
  border-top: 1px solid #d6d8d2;
  border-bottom: 1px solid #d6d8d2;
  position: relative;
  z-index: 1000;
}

.gnb .menu {
  display: flex;
  align-items: stretch;
}

.gnb .menu > li {
  position: relative;
}

.gnb .menu > li > a {
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  color: #111;
  font-weight: 700;
  line-height: 1.2;
}

.gnb .menu > li > a:hover {
  background: #eceee8;
  text-decoration: none;
}

/* ===== 공통 드롭다운 (Welcome + Engineering 등) ===== */
.gnb .menu > li.menu-all,
.gnb .menu > li.menu-dropdown {
  position: relative;
}

.gnb .menu > li.menu-all > ul,
.gnb .menu > li.menu-dropdown > ul {
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 160px;
  max-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid #d6d8d2;
  border-radius: 10px;
  background: #f8f9f6;
  box-shadow: 0 12px 28px rgba(40, 42, 36, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
  z-index: 1001;
}

.gnb .menu > li.menu-all:hover > ul,
.gnb .menu > li.menu-dropdown:hover > ul {
  max-height: 360px;
  padding: 8px 0;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gnb .menu > li > ul > li {
  display: block;
}

.gnb .menu > li > ul > li > a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: #222;
  white-space: nowrap;
  font-weight: 600;
}

.gnb .menu > li > ul > li > a:hover {
  background: #eef0ea;
  text-decoration: none;
}

/* depth2 */
.gnb .menu-depth2 {
  margin: 0;
  padding: 0 0 6px;
  background: #f1f2ee;
}

.gnb .menu-depth2 > li > a {
  display: block;
  padding: 10px 24px;
  text-decoration: none;
  color: #555;
  font-size: 13px;
  white-space: nowrap;
}

.gnb .menu-depth2 > li > a:hover {
  background: #e9ebe5;
  text-decoration: none;
}

.gnb .menu-depth2 > li.active > a {
  font-weight: 700;
  background: #e9ebe5;
}

/* 스크롤바 공통 */
.gnb .menu > li > ul::-webkit-scrollbar {
  width: 8px;
}

.gnb .menu > li > ul::-webkit-scrollbar-thumb {
  background: #c9cbc4;
  border-radius: 999px;
}

.gnb .menu > li > ul::-webkit-scrollbar-track {
  background: #f1f2ee;
  border-radius: 999px;
}

/* ===== Main ===== */
.main {
  margin: 0 auto;
  width: 1200px;
  max-width: 100%;
}

.main__inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 20px 0;
  align-items: start;
}

.lnb {
  padding: 16px;
}

.lnb__title--spaced {
  margin-top: 30px;
}

.content {
  min-width: 0;
  padding: 20px;
  overflow-wrap: anywhere;
}

.home {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-right: 12px;
}

.home-banner {
  grid-column: 1 / -1;
}

.home-left,
.home-right {
  min-width: 0;
}

.home p {
  overflow-wrap: anywhere;
}

/* ===== Footer ===== */
.footer {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  background: #f8f9f6;
  padding: 16px 0;
}

.footer p {
  margin: 6px 0;
}

/* ===== Login Modal ===== */
.login-modal[hidden] {
  display: none;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.login-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 32, 28, 0.45);
}

.login-modal__dialog {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  margin: 80px auto 0;
  background: #f8f9f6;
  border: 1px solid #d6d8d2;
  padding: 24px;
  z-index: 1;
  box-shadow: 0 10px 30px rgba(40, 42, 36, 0.18);
}

.login-modal__title {
  margin: 0 0 16px;
  font-size: 20px;
}

.login-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.login-modal__message {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #e0b4b4;
  background: #fff6f6;
  color: #9f3a38;
  font-size: 14px;
  line-height: 1.45;
}

.login-form__group {
  margin-bottom: 12px;
}

.login-form__group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.login-form__group input {
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #c9cbc4;
  background: #f8f9f6;
  font-size: 14px;
}

.login-form__group input:focus {
  outline: none;
  border-color: #aeb1a8;
}

.login-form__option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 14px;
  font-size: 14px;
  color: #333;
}

.login-form__option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.login-form__actions button {
  width: 100%;
  padding: 10px;
  border: 1px solid #d6d8d2;
  background: #f1f2ee;
  cursor: pointer;
  font-size: 14px;
}

.login-form__actions button:hover {
  background: #e9ebe5;
}

.login-form__links {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.login-form__links a {
  text-decoration: none;
  color: #333;
}

.login-form__links a:hover {
  text-decoration: underline;
}

/* ===== Responsive: 중간 화면폭 헤더 보정 ===== */
@media (max-width: 980px) {
  .container {
    width: 100%;
  }

  .header {
    width: 100%;
  }

  .header-main__inner {
    align-items: flex-start;
    min-height: auto;
    padding: 12px 16px;
    row-gap: 8px;
  }

  .brand {
    width: 100%;
    margin-left: 0;
    font-size: 26px;
  }

  .header-user {
    width: 100%;
    margin-left: 0;
    padding-right: 0;
    justify-content: flex-start;
  }

  .user-links {
    justify-content: flex-start;
    gap: 8px;
  }

  .user-links li + li::before {
    margin-right: 8px;
  }

  .user-links a {
    font-size: 13px;
  }

  .main {
    width: 100%;
  }

  .footer {
    width: 100%;
  }
}

/* ===== Responsive: 태블릿/모바일 ===== */
@media (max-width: 768px) {
  .container {
    width: 100%;
    padding: 0 16px;
  }

  .header {
    width: 100%;
  }

  .header-main__inner {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .brand {
    width: 100%;
    margin-left: 0;
    font-size: 24px;
  }

  .header-user {
    margin-left: 0;
    width: 100%;
    padding-right: 0;
    justify-content: flex-start;
  }

  .user-links {
    justify-content: flex-start;
    gap: 8px;
  }

  .user-links a {
    font-size: 13px;
  }

  .main {
    width: 100%;
  }

  .main__inner {
    grid-template-columns: 1fr;
  }

  .footer {
    width: 100%;
  }

  .gnb .menu > li > ul {
    min-width: 220px;
  }
}