/* 서브페이지 공통 레이아웃 */

/* ── Sub Header (Daesung Text Centered Style) ── */
.sub-header {
  position: relative;
  padding: 180px 0;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 40%, var(--color-bg-alt) 100%);
  overflow: visible;
  font-family: var(--font-primary);
}

/* Subtle decorative pattern (fallback for pages without bg image) */
.sub-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.015) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── Sub Header with Background Image ── */
.sub-header[class*="sub-header--"] {
  background: var(--color-primary);
  overflow: hidden;
}

.sub-header[class*="sub-header--"]::before {
  background-image: none;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1;
}

@keyframes sub-header-zoom {
  from { transform: scale(1.15); }
  to   { transform: scale(1); }
}

.sub-header[class*="sub-header--"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: sub-header-zoom 5s ease-out forwards;
  z-index: 0;
}

.sub-header[class*="sub-header--"] .sub-header__category {
  color: rgba(255, 255, 255, 0.8);
}

.sub-header[class*="sub-header--"] .sub-header__title-text {
  color: #fff;
}

.sub-header[class*="sub-header--"] .sub-header__crumb-home svg path {
  stroke: #fff;
}

.sub-header[class*="sub-header--"] .sub-header__crumb-btn,
.sub-header[class*="sub-header--"] .sub-header__crumb-text {
  color: rgba(255, 255, 255, 0.9);
}

.sub-header[class*="sub-header--"] .sub-header__crumb-arrow path {
  stroke: rgba(255, 255, 255, 0.9);
}

.sub-header[class*="sub-header--"] .sub-header__crumb + .sub-header__crumb::before {
  background-color: rgba(255, 255, 255, 0.4);
}

.sub-header--about::after {
  background-image: url('../images/sub-about.jpg');
}

.sub-header--consulting::after {
  background-image: url('../images/sub-consulting.jpg');
}

.sub-header--safety::after {
  background-image: url('../images/sub-safety.jpg');
}

.sub-header--resources::after {
  background-image: url('../images/sub-resources.jpg');
}

/* ── Content ── */
.sub-header__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

/* ── Breadcrumb ── */
.sub-header__breadcrumb {
  position: relative;
  z-index: 10;
  margin-bottom: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-header__crumb {
  position: relative;
  display: flex;
  align-items: center;
}

.sub-header__crumb + .sub-header__crumb::before {
  content: '';
  display: block;
  width: 1px;
  height: 10px;
  margin: 0 15px;
  background-color: var(--color-border);
  transform: rotate(30deg);
}

/* Home icon */
.sub-header__crumb-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  vertical-align: middle;
  text-decoration: none;
}

/* Crumb text */
.sub-header__crumb-text {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  vertical-align: middle;
  padding: 4px 0;
  font-family: var(--font-primary);
}

.sub-header__crumb-arrow {
  transition: transform 0.3s;
}

.sub-header__crumb-btn[aria-expanded="true"] .sub-header__crumb-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.sub-header__crumb-dropdown {
  position: absolute;
  z-index: 10;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.sub-header__crumb-dropdown.is-open {
  display: block;
  opacity: 1;
}

.sub-header__crumb-dropdown ul {
  padding: 20px 0;
  border: 1px solid var(--color-border-light);
  border-radius: 5px;
  text-align: center;
  background: var(--color-bg);
  box-shadow: 0 3px 20px rgba(0, 0, 0, 0.1);
}

.sub-header__crumb-dropdown a {
  display: inline-block;
  padding: 5px 0;
  font-size: 0.9375rem;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color 0.3s;
}

.sub-header__crumb-dropdown a:hover,
.sub-header__crumb-dropdown a[aria-current="page"] {
  color: var(--color-text);
}

/* ── Title ── */
.sub-header__title {
  overflow: hidden;
}

.sub-header__category {
  display: block;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.sub-header__title-text {
  display: block;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.04em;
  color: var(--color-text);
}

/* ── SR Only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 서브페이지 본문 영역 ── */
.subpage {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height) - 200px);
}

.subpage__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: var(--space-xl) 20px 0;
}

/* ── Tab List (Hanwha Energy Style) ── */
.subpage__tab-list {
  display: flex;
  align-items: stretch;
  border-radius: 12px;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
}

.subpage__tab-item {
  flex: 1;
  background-color: var(--color-bg-alt);
  border-right: 1px solid #e8e8e8;
  transition: background-color 0.3s;
}

.subpage__tab-item:last-child {
  border-right: 0;
}

.subpage__tab-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.25rem 0;
  color: var(--color-text-light);
  font-size: 1.0625rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  line-height: 1;
  transition: color 0.3s;
}

.subpage__tab-item.is-active {
  background-color: var(--color-text);
}

.subpage__tab-item.is-active a {
  color: #fff;
}

.subpage__tab-item:hover {
  background-color: var(--color-text);
}

.subpage__tab-item:hover a {
  color: #fff;
}

/* ── Content ── */
.subpage__content {
  flex: 1;
  padding: var(--space-3xl) 0;
}

@media (max-width: 1080px) {
  .sub-header {
    padding: 140px 0;
  }

  .sub-header__title-text {
    font-size: 2.5rem;
  }
}

@media (max-width: 767px) {
  .sub-header {
    padding: 120px 0;
  }

  .sub-header__title-text {
    font-size: 2.25rem;
  }

  .sub-header__category {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .sub-header__crumb-text {
    font-size: 0.875rem;
  }

  .sub-header__crumb-btn {
    font-size: 0.875rem;
  }

  .sub-header__crumb-dropdown a {
    font-size: 0.875rem;
  }

  /* 탭바 2컬럼 래핑 (모바일) — 각 탭 50% */
  .subpage__tab-list {
    flex-wrap: wrap;
    border-radius: 0;
  }

  .subpage__tab-item {
    flex: 0 0 50%;
  }

  .subpage__tab-item:nth-child(2n) {
    border-right: 0;
  }

  .subpage__tab-item:nth-child(n+3) {
    border-top: 1px solid #e8e8e8;
  }

  .subpage__tab-item a {
    padding: 1rem 0.5rem;
    font-size: 0.9375rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .sub-header {
    padding: 100px 0;
  }

  .sub-header__title-text {
    font-size: 1.875rem;
  }

  .sub-header__category {
    font-size: 0.875rem;
  }

  .sub-header__crumb-text {
    font-size: 0.8125rem;
  }

  .sub-header__breadcrumb {
    margin-bottom: 20px;
  }

  .sub-header__crumb + .sub-header__crumb::before {
    margin: 0 10px;
  }

  .sub-header__crumb-btn {
    font-size: 0.8125rem;
    gap: 6px;
  }

  .sub-header__crumb-dropdown {
    width: 130px;
  }

  .sub-header__crumb-dropdown a {
    font-size: 0.8125rem;
  }
}

/* ── 서브페이지 리드 문구 ── */
.subpage__lead {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.5;
  letter-spacing: -0.045em;
  margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
  .subpage__lead {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .subpage__lead {
    font-size: 2.5rem;
  }
}
