/* 레이아웃 layout.css */

/* 헤더 */
.site-header {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.04);
}

.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.logo {
  margin: 0;
}

.logo a {
  color: var(--primary-active);
  display: block;
}

.logo-img {
  display: block;
  height: 43px;
  width: auto;
  object-fit: contain;
}

.gnb ul {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gnb a {
  color: var(--text);
  font-weight: 500;
  padding: 6px 0;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.gnb a.gnb-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  line-height: 0;
  caret-color: transparent;
  user-select: none;
}

.gnb a.gnb-search .gnb-ico {
  width: 22px;
  height: 22px;
  display: block;
}

.gnb a.gnb-btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.gnb a.gnb-btn-line:hover {
  background-color: var(--bg-sub);
  border-color: var(--focus-border);
}

.gnb a.gnb-btn-line:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.gnb a.gnb-search:hover {
  opacity: 0.72;
}

.gnb a.gnb-search:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 알링 2차개발 display:none*/
.gnb a.gnb-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  line-height: 0;
  color: #1e293b;
  display: none;
}

.gnb a.gnb-bell .gnb-ico {
  width: 22px;
  height: 22px;
  display: block;
}

.gnb a.gnb-bell:hover {
  opacity: 0.72;
}

.gnb a.gnb-bell:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 헤더 · 로그인 전/후 .guest | .member */
.site-header.guest .gnb li.member,
.site-header.member .gnb li.guest {
  display: none;
}

.gnb .gnb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  line-height: 0;
  caret-color: transparent;
  user-select: none;
  cursor: pointer;
  appearance: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gnb .gnb-avatar:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.gnb .gnb-avatar:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.gnb .gnb-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 푸터 */
.site-footer {
  margin-top: auto;
  background-color: #141414;
  border-top: 1px solid #2a2a2a;
}

.footer-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 40px 24px 36px;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 32px;
  width: 100%;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.site-footer .footer-trail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: min(100%, 36rem);
  gap: 16px;
}

.site-footer .footer-trail .footer-links {
  justify-content: flex-end;
}

.footer-logo {
  margin: 0;
}

.footer-logo-link {
  display: inline-block;
  line-height: 0;
}

.footer-logo-link img {
  display: block;
  height: 26px;
}

.footer-logo-link:hover img {
  opacity: 0.88;
}

.footer-logo-link:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 3px;
  border-radius: 4px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 15px;
  font-weight: 500;
  color: #a3a3a3;
}

.footer-links a:hover {
  color: #d4d4d4;
}

.footer-links a:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
  border-radius: 4px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-info p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #a3a3a3;
}

.footer-info-split {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
  flex-wrap: wrap;
}

/* PC: 각 span은 한 줄로 유지 */
.footer-info-split>span {
  white-space: nowrap;
}

/* PC: 두 번째 항목 앞에 구분자 '|' */
.footer-info-split>span+span::before {
  content: '|';
  padding: 0 0.35em;
  color: #a3a3a3;
}

/* CEO(첫 줄): 두 번째 항목 앞에 '|' (PC만) */
.footer-ceo {
  display: flex;
  align-items: baseline;
  gap: 0.35em;
}

/* PC: CEO line도 각 span은 한 줄로 유지 */
.footer-ceo>span {
  white-space: nowrap;
}

.footer-ceo>span+span::before {
  content: '|';
  padding: 0 0.35em;
  color: #a3a3a3;
}

.site-footer .footer-patent {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.site-footer .footer-patent-mark {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1.3;
  color: #a3a3a3;
}

.site-footer .footer-patent-mark img {
  display: block;
  width: 36px;
  object-fit: contain;
}

.site-footer .footer-patent-text {
  flex: 1;
  min-width: min(100%, 12rem);
}

.site-footer .footer-patent-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #d4d4d4;
}

.site-footer .footer-patent-text p+p {
  margin-top: 6px;
  font-size: 12px;
  color: #a3a3a3;
}

.site-footer .copyright {
  margin: 0;
  padding-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #666666;
}

@media (max-width: 640px) {
  .footer-inner {
    padding: 32px 16px 28px;
    gap: 20px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* MO: 특허 스트립 → MyFC 로고 → 회사정보 → 저작권 → 링크 (PC는 그대로) */
  .site-footer {
    background-color: #000000;
  }

  .footer-col {
    display: contents;
  }

  .site-footer .footer-trail {
    display: contents;
    width: auto;
    max-width: none;
  }

  .site-footer .footer-patent {
    order: 1;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-top: -32px;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 0;
    width: calc(100% + 32px);
    max-width: none;
    box-sizing: border-box;
    padding: 16px 16px 18px;
    background-color: #222222;
    border-bottom: 1px solid #2a2a2a;
  }

  .footer-logo {
    order: 2;
    width: 100%;
    padding-top: 4px;
  }

  .site-footer .footer-patent-mark {
    align-items: flex-start;
  }

  .site-footer .footer-patent-text {
    flex: 1;
    min-width: 0;
    text-align: start;
  }

  .footer-info {
    order: 3;
    width: 100%;
  }

  .copyright {
    order: 4;
    width: 100%;
  }

  .footer-links {
    order: 5;
    width: 100%;
    gap: 16px 15px;
  }

  .site-footer .footer-trail .footer-links {
    justify-content: flex-start;
  }

  .footer-info-split {
    flex-direction: column;
    gap: 2px;
  }

  .footer-info-split>span {
    white-space: normal;
  }

  /* MO: '|' 구분자 숨김(줄바꿈으로만 표시) */
  .footer-info-split>span+span::before {
    content: none;
    padding: 0;
  }

  /* MO: CEO 구분자 숨김 */
  .footer-ceo>span+span::before {
    content: none;
    padding: 0;
  }

  .footer-ceo>span {
    white-space: normal;
  }
}

/* 레이아웃 래퍼 · 세로 흐름(자연 높이, 100vh 미고정) */
.layout-wrapper {
  display: flex;
  flex-direction: column;
  min-height: auto;
}

/* 본문 영역 공통 · 여유 있는 최소 높이 */
.layout-wrapper>main {
  min-height: calc(100vh - 140px);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .layout-wrapper>main {
    min-height: calc(100vh - 151px);
  }
}