@charset "UTF-8";
/* Bridal Gift page */
:root {
  --bg-color: #fbfbfb;
}

body {
  background-color: var(--bg-color);
  /* NOTE: ヘッダー/メニューまで巻き込まないため、ページ固有で body のフォントは上書きしない */
}

.gift-gallery {
  padding: 0 4vw clamp(3rem, 9vh, 6rem);
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.gift-card {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  transition: opacity 0.3s var(--ui-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.gift-card:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.gift-card:hover,
.gift-card:focus-visible {
  opacity: 0.7;
}

.gift-card__figure {
  margin: 0;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 12px; /* 画像だけ整える（カード風の枠は作らない） */
  background: #eee;
}

.gift-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gift-card__title {
  padding: 0.8rem 0 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: #1c1c1c;
  /* 3カラム固定でも見切れないように折り返し優先 */
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Modal: align with ROOM modal layering */
.gift-modal {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 200;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.8s var(--ui-ease, cubic-bezier(0.4, 0, 0.2, 1));
  overflow-y: auto;
}

.gift-modal.is-open {
  clip-path: inset(0 0 0 0);
}

.gift-modal .close-btn {
  position: fixed;
  top: clamp(1.5rem, 4vw, 2.2rem);
  right: clamp(1.5rem, 4vw, 2.2rem);
  border: 0;
  background: transparent;
  font-family: var(--font-display-brand);
  font-size: 1rem;
  color: #fff;
  mix-blend-mode: difference;
  z-index: 210;
  cursor: pointer;
}

.gift-modal-container {
  min-height: 100%;
  padding: clamp(5rem, 10vh, 7rem) 6vw clamp(3rem, 9vh, 5rem);
  display: grid;
  gap: clamp(1.5rem, 3vh, 2.5rem);
  justify-items: center;
}

.gift-modal-header {
  max-width: 900px;
  width: 100%;
  text-align: center;
}

.gift-modal-title {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  letter-spacing: 0.12em;
  margin: 0 0 0.8rem;
  font-family: var(--font-display-jp);
  white-space: pre-line;
}

.gift-modal-text {
  margin: 0;
  font-size: clamp(0.98rem, 1.1vw, 1.06rem);
  line-height: 1.7;
  white-space: pre-line;
  font-family: var(--font-serif-jp);
}

.gift-modal-gallery {
  display: grid;
  gap: clamp(1.2rem, 2vh, 1.8rem);
  width: min(1100px, 100%);
  justify-items: center; /* モーダル内の画像ブロックを中央へ */
}

.gift-modal-media {
  display: grid;
  gap: 0.9rem;
  justify-items: center; /* main + thumbs を中央寄せ */
}

.gift-modal-main {
  margin: 0;
  position: relative;
  aspect-ratio: 1/1;
  width: min(560px, 100%); /* 大画面でも中央の正方形として見える */
}

.gift-modal-main img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
  opacity: 1;
  transition: opacity 0.25s var(--ui-ease, cubic-bezier(0.4, 0, 0.2, 1));
  object-fit: cover;
}

.gift-modal-main img.is-swapping {
  opacity: 0;
}

.gift-modal-thumbs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.gift-modal-thumb {
  appearance: none;
  border: 1px solid transparent; /* active を視認できるようにする */
  padding: 0;
  background: transparent;
  width: 74px;
  aspect-ratio: 1/1;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.2s var(--ui-ease, cubic-bezier(0.4, 0, 0.2, 1));
  flex: 0 0 auto;
}

.gift-modal-thumb:hover,
.gift-modal-thumb:focus-visible {
  opacity: 0.85;
}

.gift-modal-thumb.active {
  opacity: 1;
  border-color: rgba(0, 0, 0, 0.28);
}

.gift-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Legacy (older render path) */
.gift-modal-figure {
  margin: 0;
}

.gift-modal-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.08);
}

.gift-modal-details {
  width: min(900px, 100%);
  display: grid;
  gap: 0.6rem;
}

.gift-modal-header {
  text-align: left;
}

.gift-modal-title {
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.6rem;
}

.gift-modal-meta {
  margin: 0;
  padding: 0;
  border-top: 1px solid #ccc;
}

.gift-modal-meta__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid #eee;
}

.gift-modal-meta__row dt {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #444;
}

.gift-modal-meta__row dd {
  margin: 0;
  white-space: pre-line;
}

.gift-modal-meta__row[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .gift-grid {
    gap: 10px;
  }
  .gift-card__title {
    font-size: 11px;
    padding: 0.6rem 0 0;
    line-height: 1.25;
  }
  .gift-modal-thumb {
    width: 56px;
    border-radius: 8px;
  }
}
@media (max-width: 640px) {
  .gift-gallery {
    padding: 0 6vw clamp(2.6rem, 9vh, 4rem);
  }
  .gift-modal .close-btn {
    right: 1.2rem;
  }
  .gift-modal-container {
    padding: clamp(4rem, 9vh, 5rem) 7vw clamp(2.2rem, 8vh, 3.5rem);
    gap: 1.2rem;
  }
  .gift-modal-meta__row {
    grid-template-columns: 100px 1fr;
  }
}
