/* =========================================================
   YH Image Gallery Layout (NO MASONRY)
   - 기본: Grid (1장 자동 1열 / 2장 이상 2열)
   - 모바일: 항상 1열
   - 이미지: 원본 비율 유지(늘림/크롭 X)
   - Masonry 제거: 순서/좌우 안정성 최우선
========================================================= */

/* ---------- 카드(공통) ---------- */
.yh-ig-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  margin: 0 0 22px 0;
}

.yh-ig-head{
  text-align: center;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

/* ---------- 아이템(공통) ---------- */
.yh-ig-item{
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  overflow: hidden;
}

/* ✅ 원본 유지: 작으면 그대로, 크면 줄어듦 */
.yh-ig-item img{
  width: auto;          /* 강제 확대 X */
  max-width: 100%;      /* 부모 넘치면 축소 */
  height: auto;
  display: block;
  margin: 0 auto;       /* 원본 크기일 때 중앙 */
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0,0,0,.10);
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

/* 미세 호버(PC에서만) */
@media (hover:hover){
  .yh-ig-item:hover img{
    transform: scale(1.015);
    box-shadow: 0 10px 22px rgba(0,0,0,.14);
    filter: saturate(1.03);
  }
}

/* =========================================================
   기본 레이아웃: Grid (모든 섹션 공통)
   - PC: 기본 2열(콘텐츠 폭 기준)
   - 1장일 때: 자동 1열(:has)
========================================================= */
.yh-ig-grid{
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  align-items: start;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;

  /* 레이아웃 안정화(불필요한 재배치 체감 줄이기) */
  grid-auto-flow: row;
}

/* ✅ B안: 1장만 있을 때 자동 1열 (클래스 실수 방지) */
.yh-ig-grid:has(> .yh-ig-item:only-child){
  grid-template-columns: 1fr;
  justify-content: stretch;
}

/* 모바일: 무조건 1열 */
@media (max-width:768px){
  .yh-ig-grid{
    grid-template-columns: 1fr;
    justify-content: stretch;
  }
}

/* 접근성: 모션 줄이기 */
@media (prefers-reduced-motion: reduce){
  .yh-ig-item img{ transition: none; }
}

/* =========================================================
   ❌ Masonry 제거(안전망)
========================================================= */
.yh-ig-grid.yh-ig-masonry{
  display: grid !important;
  column-count: initial !important;
  column-gap: initial !important;
}

/* =========================================================
   YH IG Head 2-Column (Before / After) + Divider (Brand)
   - 헤더 2열
   - 중앙 구분선: 브랜드 컬러 #169179 포인트
   - 모바일: 1열 + 구분선 제거
========================================================= */
.yh-ig-head.yh-ig-head-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 12px;
  position: relative;

  /* .yh-ig-head 기본 스타일 유지 */
  padding: 12px 14px;
}

/* ✅ 중앙 구분선 (브랜드 포인트) */
.yh-ig-head.yh-ig-head-2::after{
  content: "";
  position: absolute;
  top: 22%;
  bottom: 22%;
  left: 50%;
  width: 2px;
  border-radius: 2px;
  transform: translateX(-50%);

  /* 브랜드 컬러 포인트 라인 */
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(22,145,121,.85),
    transparent
  );
}

/* 헤더 텍스트(컬럼) */
.yh-ig-head.yh-ig-head-2 .yh-ig-head-col{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  padding: 4px 8px;

  /* 길어질 때 안전 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 모바일: 1열 + 구분선 제거 */
@media (max-width:768px){
  .yh-ig-head.yh-ig-head-2{
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .yh-ig-head.yh-ig-head-2::after{
    display: none;
  }

  .yh-ig-head.yh-ig-head-2 .yh-ig-head-col{
    white-space: normal;
  }
}