/**
 * Horizon Fuel Cell Technologies — Layout Style
 * themes/horizonfuelcell/layout/style.css
 */

/* ══ 공통 리셋 ════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ══ HFC HEADER ══════════════════════════════════════════ */
.hfc-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.hfc-header.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,.1);
}

.hfc-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  gap: 32px;
}

/* 로고 */
.hfc-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.hfc-logo-mark { display: flex; align-items: center; }
.hfc-logo-texts {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.hfc-logo-brand {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--p);
  letter-spacing: .04em;
}
.hfc-logo-sub {
  font-size: .6rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .05em;
  margin-top: 1px;
}

/* GNB */
.hfc-gnb {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: flex-start;
  padding-left: 32px;
}

.hfc-nav-item {
  position: relative;
}

.hfc-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 70px;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.hfc-nav-item:hover .hfc-nav-link,
.hfc-nav-item.active .hfc-nav-link {
  color: var(--p);
  border-bottom-color: var(--p);
}

.hfc-nav-arrow {
  font-size: .55rem;
  opacity: .5;
  transition: transform .2s;
}
.hfc-nav-item:hover .hfc-nav-arrow {
  transform: rotate(180deg);
}

/* 드롭다운 */
.hfc-dropdown {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px;
  z-index: 100;
  animation: hfcDropIn .15s ease;
}

@keyframes hfcDropIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.hfc-nav-item:hover .hfc-dropdown {
  display: block;
}

.hfc-dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-main);
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.hfc-dropdown-item:hover,
.hfc-dropdown-item.active {
  background: rgba(26,75,140,.07);
  color: var(--p);
  font-weight: 700;
}

/* 헤더 우측 유틸 */
.hfc-header-utils {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hfc-util-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.hfc-util-btn:hover {
  border-color: var(--p);
  color: var(--p);
}

.hfc-user-btn {
  background: var(--bg-body);
}

.hfc-admin-btn {
  background: var(--bg-body);
}

.hfc-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: #0f172a;
  color: #fff;
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid #1e293b;
  transition: background .15s;
}
.hfc-login-btn:hover { background: #1e293b; }

.hfc-util-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 2px;
  transition: color .15s;
}
.hfc-util-link:hover { color: var(--text-main); }

/* 햄버거 (모바일) */
.hfc-mob-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  padding: 6px;
}
.hfc-mob-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text-muted);
  transition: all .2s;
}

/* ══ MOBILE NAV ══════════════════════════════════════════ */
.dx-mob-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
}
.dx-mob-nav.open {
  pointer-events: auto;
}
.dx-mob-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32,1,.53,1);
  display: flex;
  flex-direction: column;
}
.dx-mob-nav.open .dx-mob-panel {
  transform: translateX(0);
}
.dx-mob-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .3s;
}
.dx-mob-nav.open .dx-mob-overlay {
  opacity: 1;
}

/* ══ dxp 모달 ══════════════════════════════════════════ */
.dxp-mm-card {
  background: #1e293b;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  position: relative;
}
.dxp-mm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
#dxp-memo-content {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f1f5f9;
  font-size: .875rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.6;
  min-height: 100px;
  transition: border-color .15s;
}
#dxp-memo-content:focus {
  border-color: rgba(99,102,241,.5);
}

/* ══ HFC FOOTER ══════════════════════════════════════════ */
.hfc-footer {
  background: #0d1526;
  color: #94a3b8;
  padding: 0;
  margin-top: auto;
}

.hfc-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 24px 0;
}

.hfc-footer-top {
  display: grid;
  grid-template-columns: 220px repeat(4, 1fr) 200px;
  gap: 36px;
  margin-bottom: 44px;
}

/* 푸터 브랜드 */
.hfc-footer-brand {}

.hfc-footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-bottom: 14px;
}
.hfc-footer-logo-brand {
  font-family: var(--font-en);
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: .04em;
  line-height: 1;
}
.hfc-footer-logo-sub {
  font-size: .58rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: .04em;
  margin-top: 2px;
}

.hfc-footer-desc {
  font-size: .75rem;
  line-height: 1.8;
  color: #64748b;
  margin: 0 0 16px;
}

.hfc-mfield {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(74,222,128,.25);
  border-radius: 6px;
}

/* 푸터 컬럼 */
.hfc-footer-col {}

.hfc-footer-col-title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 16px;
}

.hfc-footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hfc-footer-link {
  font-size: .75rem;
  color: #64748b;
  text-decoration: none;
  transition: color .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.hfc-footer-link:hover { color: #fff; }

/* 연락처 */
.hfc-footer-contact {}
.hfc-contact-label {
  font-size: .68rem;
  font-weight: 700;
  color: #475569;
  margin-right: 4px;
  letter-spacing: .05em;
}

/* 하단 카피라이트 */
.hfc-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 18px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}

.hfc-copyright {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #334155;
  margin: 0;
}

.hfc-footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hfc-footer-bottom-link {
  font-size: .7rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  letter-spacing: .04em;
  transition: color .15s;
}
.hfc-footer-bottom-link:hover { color: #94a3b8; }

.hfc-footer-divider {
  color: #1e2a3a;
  font-size: .7rem;
}

.hfc-top-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #1e2a3a;
  border-radius: 50%;
  background: transparent;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.hfc-top-btn:hover {
  border-color: #475569;
  color: #94a3b8;
}

/* ══ 반응형 ══════════════════════════════════════════════ */
@media (max-width: 1199px) {
  .hfc-footer-top {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .hfc-gnb { justify-content: flex-start; }
}

@media (max-width: 1023px) {
  .hfc-gnb { display: none; }
  .hfc-mob-btn { display: flex; }
  .hfc-header-inner { gap: 16px; }
  .hfc-footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hfc-header-inner { padding: 0 16px; height: 60px; }
  .hfc-logo-sub { display: none; }
  .hfc-footer-top { grid-template-columns: 1fr; gap: 24px; }
  .hfc-footer-bottom { flex-direction: column; align-items: flex-start; }
  .hfc-util-link { display: none; }
}

/* ══ 스크롤 헤더 효과 ═══════════════════════════════════ */
.hfc-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.1);
}

/* ══ main 콘텐츠 영역 ══════════════════════════════════ */
#dx-main {
  padding: 0 !important;
  max-width: 100% !important;
}

/* ══ 사이드바 페이지는 패딩 복원 ══════════════════════ */
#dx-main .dx-with-sidebar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 16px;
}

/* ══ 다크모드 ══════════════════════════════════════════ */
body.dark .hfc-header {
  background: var(--bg-header);
  border-color: var(--border);
}
body.dark .hfc-dropdown {
  background: var(--bg-card);
  border-color: var(--border);
}
body.dark .hfc-util-btn { background: var(--bg-card); }
body.dark .hfc-mob-btn { background: var(--bg-card); }

/* ══ 노스크롤바 ══════════════════════════════════════════ */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ══ dx-nav-item 오버라이드 (기본 테마 호환) ═══════════ */
.dx-nav-item { position: relative; }
.dx-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  padding: 6px;
  z-index: 100;
}
.dx-nav-item:hover .dx-dropdown { display: block; }
.dx-card { background: var(--bg-card); }

/* ══ FAB (스크롤 TOP + 목록 + 글쓰기) ══════════════════ */
#dx-fab { z-index: 500; }

#dx-fab-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .35s cubic-bezier(.4,0,.2,1), transform .35s cubic-bezier(.4,0,.2,1);
}
#dx-fab-wrap.dx-fab-show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dx-fab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: filter .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
}
.dx-fab-btn:active { transform: scale(.94); }
#dx-fab-list {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226,232,240,.9) !important;
  color: var(--text-muted, #64748b);
  display: none;
}
body.dark #dx-fab-list {
  background: rgba(15,23,42,.85);
  border-color: rgba(51,65,85,.7) !important;
  color: #94a3b8;
}
#dx-fab-top {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226,232,240,.9) !important;
  color: var(--text-main, #1e293b);
  flex-direction: column;
  padding: 8px 14px;
  gap: 2px;
}
body.dark #dx-fab-top {
  background: rgba(15,23,42,.85);
  border-color: rgba(51,65,85,.7) !important;
  color: #e2e8f0;
}
#dx-fab-top:hover { filter: brightness(.96); }
#dx-fab-svg-wrap { position: relative; width: 28px; height: 28px; flex-shrink: 0; }
#dx-fab-svg { width: 28px; height: 28px; transform: rotate(-90deg); }
#dx-fab-track { fill: none; stroke: rgba(203,213,225,.6); stroke-width: 2.5; }
body.dark #dx-fab-track { stroke: rgba(71,85,105,.6); }
#dx-fab-ring { fill: none; stroke: url(#dx-fab-grad); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset .12s linear; }
#dx-fab-arrow { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-main, #1e293b); }
body.dark #dx-fab-arrow { color: #e2e8f0; }
#dx-fab-pct { font-size: .65rem; font-weight: 600; color: var(--text-muted, #94a3b8); font-variant-numeric: tabular-nums; line-height: 1; }
#dx-fab-write { background: var(--p, #1a73e8); color: #fff; box-shadow: 0 2px 12px rgba(26,115,232,.35); display: none; }
#dx-fab-write:hover { filter: brightness(1.1); }
@media (max-width: 640px) {
  #dx-fab-wrap { bottom: 16px; gap: 6px; }
  .dx-fab-btn  { padding: 8px 13px; font-size: .75rem; }
  #dx-fab-top  { padding: 7px 10px; }
}

/* ══ 플래시 메시지 ══════════════════════════════════ */
.dx-flash-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  min-width: 280px;
}

/* ══ 우측 빠른메뉴 (전체 페이지 공통) ══════════════════ */
.hfc-hero-side {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(100%); /* 기본: 화면 밖 숨김 */
  width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 800;
  background: rgba(10,20,40,.88);
  border-left: 1px solid rgba(255,255,255,.1);
  border-radius: 8px 0 0 8px;
  opacity: 0;
  transition: transform .55s cubic-bezier(.32,1,.53,1), opacity .55s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: -4px 0 20px rgba(0,0,0,.3);
}
/* 스크롤 80px 이상: 화면 안으로 스르르 등장 */
.hfc-hero-side.visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}
.hfc-hero-side-a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 0;
  color: rgba(255,255,255,.65);
  font-size: .52rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .04em;
  border-bottom: 1px solid rgba(255,255,255,.06);
  width: 100%;
  text-align: center;
  transition: background .15s, color .15s;
}
.hfc-hero-side-a:hover { background: rgba(255,255,255,.08); color: #fff; }
.hfc-hero-side-a i { font-size: .85rem; }
.hfc-side-nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  margin-top: auto;
}
.hfc-side-arrow {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,.55);
  font-size: .55rem;
  transition: all .15s;
  background: none;
}
.hfc-side-arrow:hover { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); }

@media (max-width: 640px) { .hfc-hero-side { display: none !important; } }

/* ══ 서브 페이지 히어로 배너 ════════════════════════════ */
.hfc-sub-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #05111f;
  display: block;
  min-height: 200px; /* style 속성 height가 없을 때 폴백 */
}
.hfc-sub-banner-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  transform: scale(1.04);
  transition: transform 8s ease-out;
  will-change: transform;
}
.hfc-sub-banner:hover .hfc-sub-banner-img {
  transform: scale(1.0);
}
.hfc-sub-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(3,9,20,.75)  0%,
    rgba(5,15,30,.5)  40%,
    rgba(5,15,30,.15) 80%,
    rgba(0,0,0,.05)   100%
  );
}
/* 타이틀: 배너 높이를 채우면서 세로 중앙 정렬 */
.hfc-sub-banner-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
}
.hfc-sub-banner-content-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.hfc-sub-banner-title {
  font-family: 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: -.02em;
  text-shadow: 0 2px 20px rgba(0,0,0,.6), 0 1px 4px rgba(0,0,0,.4);
  -webkit-font-smoothing: auto;
}

@media (max-width: 768px) {
  .hfc-sub-banner-content-inner { padding: 0 20px; }
  .hfc-sub-banner-title { font-size: 1.7rem; }
}

/* ══ 게시판 뷰 — 이미지 콘텐츠 너비 꽉 채움 ════════════ */
/* 본문 에디터 이미지가 콘텐츠 영역을 넘지 않고 꽉 차게 */
.dx-post-content img,
.ck-content img,
.board-content img,
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
}
