/* =====================================================
   AID Project Detail — FINAL (Desktop + Mobile)
   - 기본: cover(잘림 허용, 여백 없음)
   - .detail-hero.contain 사용 시 contain(안 잘림, 레터박스)
   - aid-left 정렬 안정화
   - Sticky Footer
===================================================== */

/* ---------- 페이지 뼈대 / Sticky footer ---------- */
html {
  height: 100%;
}
body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: #000; /* 레터박스/여백 배경 */
}
main,
.page,
.content {
  flex: 1 0 auto;
}

/* ---------- HERO ---------- */
.detail-hero {
  position: relative;
  height: 100svh; /* 한 화면 꽉 */
  min-height: 100svh;
  max-height: 100vh;
  overflow: hidden;
  background: #000;
}
.detail-hero > picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.detail-hero > picture img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ✅ 기본: 꽉 채움(잘림 허용, 여백 없음) */
  object-position: center;
  display: block;
}
/* 안 잘리게 보여야 하는 히어로에만 class="detail-hero contain" */
.detail-hero.contain > picture img {
  object-fit: contain;
}

/* 텍스트 오버레이 */
.detail-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: end; /* 기본 오른쪽 정렬 */
  padding: clamp(20px, 6vw, 56px);
}
.detail-overlay.aid-left {
  justify-items: start;
}

.detail-panel {
  max-width: min(640px, 92vw);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.detail-title {
  margin: 0 0 clamp(14px, 1.8vw, 18px);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 5.2vw, 72px);
}

/* 라인 */
.detail-line {
  display: block;
  height: 2px;
  width: 82%;
  max-width: 560px;
  margin: 8px 0 16px auto; /* 오른쪽 정렬 */
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  opacity: 0.95;
}
.detail-overlay.aid-left .detail-line {
  margin-left: 0;
  margin-right: auto; /* 왼쪽 정렬 */
}

/* 리스트 */
.detail-info {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(10px, 1.4vw, 16px);
}
.detail-info li {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  column-gap: 2.2em;
  align-items: baseline;
  font-weight: 800;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.7;
}
.detail-info .label {
  letter-spacing: 0.28em;
  opacity: 0.95;
}

/* ---------- 모바일(≤575.98px) ---------- */
@media (max-width: 575.98px) {
  /* 한 화면 꽉 → 블랙 여백 방지 */
  .detail-hero {
    height: 100svh;
  }

  .detail-overlay {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.42),
      rgba(0, 0, 0, 0.1) 40%,
      transparent 70%
    );
    padding: 0 calc(env(safe-area-inset-right) + 12px) 0 12px;
    justify-items: end;
  }
  .detail-panel {
    max-width: none;
    text-align: right;
  }

  .detail-title {
    font-size: clamp(26px, 7vw, 36px);
    margin: 0 0 8px;
  }
  .detail-line {
    height: 1.5px;
    max-width: 520px;
    margin: 8px 0 16px auto;
  }

  .detail-info {
    display: block;
    margin: 8px calc(env(safe-area-inset-right)+12px) 0 auto;
  }
  .detail-info li {
    grid-template-columns: minmax(7.6em, 1fr) 10.8em;
    justify-content: end;
    align-items: center;
    column-gap: 14px;
    margin: 6px 0;
  }
  .detail-info .label,
  .detail-info .value {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
    line-height: 1.35;
  }
  .detail-info .label {
    font-weight: 700;
    color: #f3f3f3;
  }
  .detail-info .value {
    font-weight: 800;
    color: #fff;
    font-family: 'Roboto Mono', 'Noto Sans KR', system-ui, sans-serif;
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: 'tnum', 'lnum';
  }

  /* aid-left 모바일 정렬 */
  .detail-overlay.aid-left {
    justify-items: start !important;
    padding-left: calc(env(safe-area-inset-left) + 12px) !important;
    padding-right: 12px !important;
  }
  .detail-overlay.aid-left .detail-panel {
    text-align: left !important;
  }
  .detail-overlay.aid-left .detail-line {
    margin: 8px 0 16px 0 !important;
  }
  .detail-overlay.aid-left .detail-info {
    margin: 8px auto 0 calc(env(safe-area-inset-left)+12px) !important;
  }
  .detail-overlay.aid-left .detail-info li,
  .detail-overlay.aid-left .detail-info .label,
  .detail-overlay.aid-left .detail-info .value {
    justify-self: start !important;
    text-align: left !important;
  }

  /* 필요 시 포커스 이동 */
  .detail-hero.hero--right > picture img {
    object-position: right center;
  }
  .detail-hero.hero--left > picture img {
    object-position: left center;
  }
  .detail-hero.hero--top > picture img {
    object-position: center top;
  }
  .detail-hero.hero--70 > picture img {
    object-position: 70% center;
  }
}

/* 초소형 */
@media (max-width: 360px) {
  .detail-info li {
    grid-template-columns: minmax(6.8em, 1fr) 9.8em;
    column-gap: 10px;
  }
  .detail-info .label,
  .detail-info .value {
    font-size: 0.95rem;
  }
}

/* ---------- 데스크탑 aid-left 안전장치 ---------- */
@media (min-width: 576px) {
  .detail-overlay.aid-left {
    justify-items: start;
  }
  .detail-overlay.aid-left .detail-panel {
    text-align: left;
  }
  .detail-overlay.aid-left .detail-line {
    margin-left: 0;
    margin-right: auto;
  }
  .detail-overlay.aid-left .detail-info {
    margin-left: 20px;
    margin-right: auto;
  }
  .detail-overlay.aid-left .detail-info .label,
  .detail-overlay.aid-left .detail-info .value {
    justify-self: start;
    text-align: left;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto; /* sticky footer */
  background: #1b3b34;
  color: #f4e8ce;
  padding: 20px 0 calc(env(safe-area-inset-bottom) + 12px);
}
body::after {
  content: '';
  display: block;
  height: 0 !important;
}

/* 밝은 배경 히어로일 때 글자 검정 */
.detail-hero.is-light .detail-panel,
.detail-hero.is-light .detail-title,
.detail-hero.is-light .detail-info,
.detail-hero.is-light .detail-info .label,
.detail-hero.is-light .detail-info .value {
  color: #111 !important;
  text-shadow: none !important;
}
.detail-hero.is-light .detail-line {
  background: #111;
  opacity: 0.9;
}
/* ========== SNS Floating (size fix) ========== */
.sns-floating-popup {
  position: fixed;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(1.2) blur(2px);
  z-index: 1000;
}

.sns-floating-popup a {
  width: 22px !important; /* ✅ 크기 고정 */
  height: 22px !important;
  border-radius: 5px;
  background: #1b3b34;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sns-floating-popup .custom-icon {
  width: 12px !important;
  height: 12px !important;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
/* 히어로 공통 스크림 */
.detail-hero.has-scrim::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 아래 둘 중 하나 골라 쓰세요 */
  background: rgba(0, 0, 0, 0.35); /* 균일 스크림 */
  /* background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.12) 60%, transparent 100%); */ /* 그라데이션 스크림 */
  z-index: 1;
}

/* 이미지 오른쪽이 밝으면 오른쪽만 진하게 */
.detail-hero.scrim-right::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 80%);
}

/* 이미지 왼쪽이 밝으면 왼쪽만 진하게 */
.detail-hero.scrim-left::after {
  background: linear-gradient(270deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.55) 80%);
}
/* 패널 뒷배경을 아주 살짝 */
.detail-panel.panel-glass {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 10px;
  padding: clamp(12px, 2vw, 18px);
}

/* 모바일에서는 조금 더 진하게 */
@media (max-width: 575.98px) {
  .detail-panel.panel-glass {
    background: rgba(0, 0, 0, 0.38);
  }
}
/* 텍스트 그림자 강화 */
.detail-title,
.detail-info {
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* 아주 밝은 이미지 위에서만 검정 글자로 전환하고 싶을 때 */
.detail-hero.is-light .detail-title,
.detail-hero.is-light .detail-info,
.detail-hero.is-light .detail-info .label,
.detail-hero.is-light .detail-info .value {
  color: #111 !important;
  text-shadow: none !important;
}
.detail-hero.is-light .detail-line {
  background: #111;
  opacity: 0.9;
}
