/* =========================
   Couple Greeting (섹션 & 모달 전용) - FINAL SAFE (data-role & overlay state 지원)
   ========================= */

/* 섹션 배너/버튼(그대로) */
.couple-greeting{
  background:linear-gradient(45deg,#ffffff 100%,#94a4ff 10%);
  border-radius:10px; padding:40px 20px; margin:0 0;
}
.couple-buttons{ display:flex; gap:30px; justify-content:center; flex-wrap:wrap; }
.couple-btn{
  background:#fff; border:none; border-radius:20px; padding:30px 40px; text-align:center;
  box-shadow:0 10px 30px rgba(0,0,0,.1); transition:.3s; cursor:pointer; min-width:200px;
}
.couple-btn:hover{ transform:translateY(-10px); box-shadow:0 20px 40px rgba(0,0,0,.2); }
.couple-btn img{
  width:80px; height:80px; border-radius:50%; object-fit:cover; margin-bottom:15px;
  border:3px solid #fff; box-shadow:0 5px 15px rgba(0,0,0,.2);
}
.couple-btn h5{ color:#333; margin-bottom:10px; font-weight:600; }
.couple-btn p{ color:#666; font-size:.9rem; margin:0; }

/* =========================
   Greeting Modal
   ========================= */

/* 오버레이 */
.greeting-modal-overlay{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background:rgba(0,0,0,.4); z-index:1050;
}

/* 모달 박스(바깥은 숨기고 안쪽만 스크롤) */
.greeting-modal{
  width:min(940px,92vw);
  max-height:92vh;
  background:#fff; border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,.25);
  display:flex; flex-direction:column;
  overflow:hidden;
  overflow-x:hidden !important;  /* 가로 스크롤 차단 */
}
html, body{ overflow-x:hidden; }

/* 스크롤 영역 */
.g-modal-scroll{
  overflow-y:auto; max-height:calc(92vh - 96px); -webkit-overflow-scrolling:touch;
}

/* ▽ 슬라이더(레이아웃) ▽ */
.greeting-slider{
  display:flex;
  width:100%;
}

/* 기본: 모든 슬라이드를 가림 (상태에 따라 필요한 것만 보이게) */
.greeting-modal .greeting-slide{
  display:none !important;
  flex:0 0 100%;
  max-width:100%;
  box-sizing:border-box;
  padding:0 24px 20px;
}
@media (max-width:480px){
  .greeting-slide{ padding:0 16px 16px; }
}

/* ===== 표시 규칙 (overlay 또는 inner 상태 클래스를 모두 지원) ===== */
/* 1) 상태가 전혀 없을 때는 기본으로 '신랑' 보이기 */
#greetingModal:not(.show-bride) .greeting-slide[data-role="groom"],
.greeting-modal:not(.show-bride) .greeting-slide[data-role="groom"]{
  display:block !important;
}

/* 2) show-groom: 신랑만 보이기 */
#greetingModal.show-groom .greeting-slide[data-role="groom"],
.greeting-modal.show-groom .greeting-slide[data-role="groom"]{
  display:block !important;
}
#greetingModal.show-groom .greeting-slide[data-role="bride"],
.greeting-modal.show-groom .greeting-slide[data-role="bride"]{
  display:none !important;
}

/* 3) show-bride: 신부만 보이기 */
#greetingModal.show-bride .greeting-slide[data-role="bride"],
.greeting-modal.show-bride .greeting-slide[data-role="bride"]{
  display:block !important;
}
#greetingModal.show-bride .greeting-slide[data-role="groom"],
.greeting-modal.show-bride .greeting-slide[data-role="groom"]{
  display:none !important;
}

/* 탭/헤더/푸터 */
.greeting-tabs{ flex:0 0 auto; display:flex; gap:8px; padding:12px 16px; }
.g-card-header{ flex:0 0 auto; }
.g-footer{ flex:0 0 auto; }

/* 헤더(3분할) */
.g-card-header{
  display:grid; grid-template-columns:120px 1fr 1.25fr; gap:16px; align-items:center;
  background:#f6f7f9; border:1px solid #e9edf3; border-radius:20px; padding:24px;
  box-shadow:0 8px 24px rgba(17,23,41,.08); margin-bottom:14px;
}
@media (max-width:768px){ .g-card-header{ grid-template-columns:1fr; align-items:start; } }
.g-hd-photo{ display:flex; justify-content:center; }
.g-photo.rectangular{ width:120px; height:120px; object-fit:cover; border-radius:18px; box-shadow:0 6px 20px rgba(0,0,0,.08); border:1px solid #e9edf3; }

.g-name-row h3,.g-role,.g-pill,.g-section-title,.g-vow .vow-title{
  font-family:'Paperlogy','Noto Serif KR',serif;
}
.g-role{ color:#6b7280; margin-bottom:6px; }
.g-name-row{ display:flex; align-items:center; gap:8px; }
.g-name-row h3{ font-size:1.5rem; margin:0; color:#2b2f36; }
.g-pill{ display:inline-block; padding:6px 12px; border-radius:999px; font-weight:600; border:1px solid #e5e7eb; background:#eef2ff; color:#4f46e5; }
.g-pill.groom{ background:#eef2ff; color:#3730a3; }
.g-pill.bride{ background:#ffeef5; color:#be185d; }

.g-first-quote{ margin:0; background:#fff; border:1px solid #e9edf3; border-radius:14px; padding:12px 14px; }
.g-first-text{ color:#2b2f36; line-height:1.6; }
.g-quote-author{ display:block; color:#6b7280; margin-top:6px; font-style:normal; }

/* 본문 공통 */
.g-body{ margin-top:8px; padding:0 24px; box-sizing:border-box; }
.g-section-title{ margin:16px 0 10px; font-weight:600; color:#2b2f36; }
.g-badges,.g-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.g-badge{ background:#f3f4f6; color:#374151; border-radius:999px; padding:6px 10px; font-size:.95rem; }
.g-chip{ background:#eef2ff; color:#4f46e5; border-radius:999px; padding:6px 10px; font-size:.95rem; }

/* 서약 카드 */
.g-vow{
  margin:20px 0; background:linear-gradient(180deg,#f9fafb 0%,#fff 100%);
  border:1px solid #e9edf3; border-radius:20px; padding:20px;
  box-shadow:0 8px 24px rgba(17,23,41,.08);
}
.g-vow .vow-title{ font-weight:600; color:#5b86e5; letter-spacing:.04em; font-size:.95rem; margin-bottom:10px; }
.g-vow .vow-body{ color:#2b2f36; line-height:1.7; white-space:pre-line; }
.g-vow .vow-sign{ margin-top:12px; color:#6b7280; text-align:right; font-style:italic; }

/* 사진 – 그리드(공통) */
.g-gallery-grid .g-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
@media (min-width:640px){ .g-gallery-grid .g-grid{ grid-template-columns:repeat(4,1fr); } }
.g-tile{ margin:0; border-radius:12px; overflow:hidden; background:#fff; box-shadow:0 8px 20px rgba(0,0,0,.06); }
.g-tile img{ width:100%; aspect-ratio:4/3; object-fit:cover; display:block; }
.g-tile figcaption{ padding:8px 10px; font-size:.85rem; color:#555; }

/* 장식 따옴표 제거 */
.greeting-modal::before,.greeting-modal::after,
.greeting-modal .g-card-header::before,.greeting-modal .g-card-header::after,
.g-card-header::before,.g-card-header::after{ content:none!important; display:none!important; }

/* 탭 스타일 */
.greeting-tab{
  padding:8px 14px; border:1px solid #e5e7eb; border-radius:999px;
  background:#fff; color:#374151; font-weight:600; cursor:pointer;
}
.greeting-tab.is-active{ background:#eef2ff; color:#3730a3; border-color:#c7d2fe; }
