/* ============================================================
   블리스내과의원 — 메인 페이지 전용 스타일 (home.css)
   ============================================================ */

/* ── 메인 히어로 배너 ── */
#hero {
  position: relative;
  height: calc(100dvh - 130px);
  min-height: 460px;
  max-height: 860px;
  overflow: hidden;
  background: #eef5f1;
}

/* 슬라이드 컨테이너 */
.hero-slides {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* 밝은 배경 — 오른쪽에 약한 흰색 그라데이션으로 텍스트 가독성 보조 */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to left,
    rgba(255,255,255,0.72) 0%,
    rgba(255,255,255,0.55) 35%,
    rgba(255,255,255,0.0) 65%
  );
  pointer-events: none;
  z-index: 1;
}

/* 텍스트 오버레이 — 오른쪽 배치 (로고 워터마크가 왼쪽에 있으므로) */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8%;
}
.hero-text {
  color: var(--ink);
  max-width: 500px;
  text-align: right;
}
.hero-sub {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
}
.hero-title {
  font-size: clamp(24px, 2.6vw, 42px);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 18px;
  letter-spacing: -.02em;
  color: var(--ink);
  word-break: keep-all;
  white-space: pre-line;
}
.hero-desc {
  font-size: clamp(13px, 1.3vw, 17px);
  line-height: 1.85;
  color: var(--ink-soft);
  font-weight: 400;
}



/* ── 진료 정보 바 ── */
#info-bar {
  background: var(--ink);
  color: rgba(255,255,255,.8);
  padding: 16px 0;
}
.info-bar-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.info-item strong { color: var(--accent-mid); font-weight: 600; }
.info-divider { width: 1px; height: 20px; background: rgba(255,255,255,.2); }

/* ── 주요 현황 바 ── */
#clinic-stats {
  background: var(--accent-soft);
  border-top: 1px solid var(--accent-mid);
  border-bottom: 1px solid var(--accent-mid);
  padding: 20px 0;
}
.clinic-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.clinic-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 16px;
  border-right: 1px solid var(--accent-mid);
}
.clinic-stat-item:last-child { border-right: none; }
.stat-label {
  font-size: 11px;
  color: var(--ink-lighter);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-dark);
}
@media (max-width: 767px) {
  .clinic-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .clinic-stat-item:nth-child(2) { border-right: none; }
  .clinic-stat-item:nth-child(3) { border-right: 1px solid var(--accent-mid); }
  .clinic-stat-item:nth-child(3),
  .clinic-stat-item:nth-child(4) { border-top: 1px solid var(--accent-mid); }
}

/* ── 진료과목 섹션 ── */
#services {
  padding: 96px 0;
  background: var(--white);
}
.services-header { text-align: center; margin-bottom: 56px; }
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.service-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
  group: true;
}
.service-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.service-card:hover img { transform: scale(1.06); }
.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,46,37,.88) 0%, rgba(26,46,37,.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 24px;
  transition: var(--transition);
}
.service-en {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-mid);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  margin-bottom: 6px;
}
.service-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.service-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
}
.service-card:hover .service-list,
.service-card.active .service-list { opacity: 1; transform: none; }
.service-list li {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  padding-left: 10px;
  position: relative;
}
.service-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent-mid);
}
.service-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-mid);
  opacity: 0;
  transform: translateY(8px);
  transition: var(--transition);
  transition-delay: 0.05s;
}
.service-card:hover .service-link,
.service-card.active .service-link { opacity: 1; transform: none; }

/* ── 인사말 섹션 ── */
#greeting {
  padding: 96px 0;
  background: var(--paper);
  overflow: hidden; /* iOS 가로 오버플로 차단 */
}
.greeting-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.greeting-inner > * {
  min-width: 0; /* iOS WebKit 그리드 아이템 수축 강제 */
  max-width: 100%;
}
.greeting-img-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden; /* 뱃지 overflow 차단 */
}
.greeting-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  width: 100%;
}
.greeting-img img { width: 100%; height: 100%; object-fit: cover; }
.greeting-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.greeting-badge .num {
  display: block;
  font-size: 32px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}
.greeting-badge .label { font-size: 12px; font-weight: 500; opacity: .9; }
.greeting-text .section-label { margin-bottom: 8px; }
.greeting-quote {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 24px;
}
.greeting-body {
  font-size: 15px;
  line-height: 1.95;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.greeting-sig {
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
}
.greeting-sig span { color: var(--accent-dark); }

/* ── 특장점 섹션 ── */
#advantages {
  padding: 96px 0;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  position: relative;
  overflow: hidden;
}
#advantages::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.advantages-header { text-align: center; margin-bottom: 56px; }
.advantages-header .section-label { color: var(--accent-mid); }
.advantages-header .section-title { color: var(--white); }
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.advantage-item {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.advantage-item:hover {
  background: rgba(255,255,255,.18);
  transform: translateY(-4px);
}
.advantage-num {
  font-size: 40px;
  font-weight: 800;
  color: rgba(255,255,255,.2);
  font-family: 'Inter', sans-serif;
  line-height: 1;
  margin-bottom: 16px;
}
.advantage-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.advantage-desc {
  font-size: 13px;
  color: rgba(255,255,255,.75);
  line-height: 1.7;
}

/* ── FAQ 섹션 (홈) ── */
#home-faq {
  padding: 96px 0;
  background: var(--white);
}
.home-faq-inner {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 80px;
  align-items: start;
  min-width: 0;
}
.faq-cta-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 16px;
}
.faq-cta-desc { font-size: 15px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 24px; }

/* ── 공지사항 + 위치 합성 섹션 ── */
#home-bottom {
  padding: 80px 0;
  background: var(--paper);
  overflow: hidden;        /* Chrome/Android */
  overflow-x: clip;        /* iOS Safari 보조 */
  max-width: 100vw;
}
/* 상단: 병원소식 | 건강정보 */
.home-board-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
  margin-bottom: 48px;
  min-width: 0;
  width: 100%;
}
.home-board-row > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
/* 하단: 오시는길 섹션 */
.home-map-row { min-width: 0; }
.home-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.home-board-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.more-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.home-notice-list { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.home-notice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: var(--transition);
  min-width: 0;
  max-width: 100%;
}
.home-notice-item:last-child { border-bottom: none; }
.home-notice-item:hover .notice-title { color: var(--accent); }
.notice-title {
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  transition: color var(--transition);
}
.notice-date { font-size: 12px; color: var(--ink-lighter); flex-shrink: 0; margin-left: 12px; font-family: 'Inter', sans-serif; }

/* 홈 위치 카드 (지도+주소 하나의 카드) */
.home-location-card {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.home-map {
  min-height: 300px;
  background: var(--accent-soft);
  position: relative;
}
.home-map iframe { width: 100%; height: 100%; display: block; }
.home-location-body {
  padding: 28px 28px;
  background: var(--white);
  border-left: 1px solid var(--line);
}
.home-location-body h4 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.home-hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.home-hours-row:last-child { border-bottom: none; }
.home-hours-row .day { font-weight: 600; color: var(--ink); }
.home-hours-row .time { color: var(--ink-soft); font-family: 'Inter', sans-serif; }

/* 더보기 버튼 (우하단) */
.home-more-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* 교통안내 */
.home-transport {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.home-transport-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-lighter);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.home-transport-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.home-transport-item:last-child { margin-bottom: 0; }
.home-transport-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-transport-body { min-width: 0; }
.home-transport-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 2px;
}
.home-transport-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ── 협력병원 홈 ── */
#home-partners {
  padding: 64px 0;
  background: var(--white);
  border-top: 1px solid var(--line);
}
.partner-scroll {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  scrollbar-width: none;
}
.partner-scroll::-webkit-scrollbar { display: none; }
.partner-logo {
  flex-shrink: 0;
  height: 52px;
  filter: grayscale(1);
  opacity: .5;
  transition: var(--transition);
  object-fit: contain;
}
.partner-logo:hover { filter: none; opacity: 1; }

/* ================================================================
   홈 반응형
   ================================================================ */
@media (max-width: 1024px) {
  #hero { height: 60dvh; max-height: none; min-height: 360px; }
  .hero-overlay { justify-content: center; padding: 0 6%; }
  .hero-text { text-align: center; max-width: 100%; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages-grid { grid-template-columns: repeat(2, 1fr); }
  .greeting-inner { gap: 48px; }
  .home-faq-inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 767px) {
  #hero { height: 56vw; min-height: 200px; max-height: 280px; }
  #hero::after { background: rgba(255,255,255,0.25); }
  .hero-overlay { justify-content: center; padding: 0 5%; }
  .hero-text { text-align: center; }
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .service-card { aspect-ratio: 2/3; }
  .service-name { font-size: 16px; }
  .advantages-grid { grid-template-columns: 1fr; gap: 10px; }
  .advantage-item { padding: 18px 16px; text-align: left; }
  .advantage-num { font-size: 18px; display: inline; margin-bottom: 0; margin-right: 8px; vertical-align: middle; }
  .advantage-title { display: inline; font-size: 16px; vertical-align: middle; }
  .advantage-desc { margin-top: 8px; font-size: 13px; }
  .greeting-inner { grid-template-columns: 1fr; gap: 32px; }
  .greeting-badge { display: none; } /* 모바일에서 뱃지 숨김 — overflow 원천 제거 */
  .home-board-row { grid-template-columns: 1fr; gap: 24px; margin-bottom: 24px; }
  .home-board-header { margin-bottom: 10px; }
  .home-location-card { grid-template-columns: 1fr; }
  .home-map { min-height: 220px; aspect-ratio: unset; height: 220px; }
  .home-location-body { padding: 16px 18px; border-left: none; border-top: 1px solid var(--line); overflow: hidden; }
  .home-location-body h4 { font-size: 14px; overflow-wrap: break-word; word-break: keep-all; }
  .home-hours-row { font-size: 12px; flex-wrap: nowrap; }
  .home-hours-row .day { flex-shrink: 0; }
  .home-hours-row .time { flex-shrink: 0; }
  .info-bar-inner { gap: 16px; }
  .info-divider { display: none; }
  #services { padding: 40px 0; }
  #greeting { padding: 40px 0; }
  #advantages { padding: 40px 0; }
  #home-faq { padding: 40px 0; }
  #home-faq .section-title { font-size: 20px; white-space: nowrap; }
  #home-bottom { padding: 40px 0; }
  #home-partners { padding: 36px 0; }
  .services-header { margin-bottom: 28px; }
  .advantages-header { margin-bottom: 28px; }

}
