/* =============================================
   手しごと美術館 — style.css
   配色: アイボリー・ベージュ・ウォームグレー・ゴールド
   ============================================= */

/* ── カラー変数 ── */
:root {
  --ivory:       #F8F4EE;
  --ivory-deep:  #EDE7DC;
  --beige:       #D9CEBC;
  --beige-mid:   #C8BAA4;
  --warm-gray:   #8C857A;
  --warm-gray-lt:#B5ADA4;
  --brown-soft:  #6B5C4E;
  --gold:        #B49256;
  --gold-lt:     #D4AE6A;
  --gold-dark:   #8A6C38;
  --text:        #3A3028;
  --text-mid:    #5A5048;
  --text-muted:  #8C857A;
  --white:       #FFFFFF;
  --shadow:      rgba(90, 70, 40, 0.10);
  --shadow-deep: rgba(90, 70, 40, 0.18);
}

/* ── リセット ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ivory);
  color: var(--text);
  font-family: 'Noto Serif JP', 'Noto Sans JP', serif;
  font-weight: 300;
  line-height: 1.8;
  min-height: 100vh;
}
img { display: block; width: 100%; height: auto; }
button { background: none; border: none; cursor: pointer; font: inherit; }
a { text-decoration: none; color: inherit; }

/* ── ヘッダー ── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(248, 244, 238, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--beige);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}
.logo-ja {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  color: var(--text);
}
.logo-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
}

/* ── メイン ── */
#app {
  padding-top: 64px;
}

/* ── フェードアニメーション ── */
.fade-enter { opacity: 0; transform: translateY(10px); }
.fade-active { opacity: 1; transform: translateY(0); transition: opacity 0.5s ease, transform 0.5s ease; }

/* ============================================
   ① TOPページ
   ============================================ */
#view-top {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(180, 146, 86, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(180, 146, 86, 0.06) 0%, transparent 60%),
    var(--ivory);
}

/* 背景画像（薄く） */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('public/images/display/quilt-sampler.jpg') center center / cover no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

/* 装飾フレーム */
.hero-frame {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 64px;
  max-width: 620px;
  width: 90%;
}
.hero-ornament {
  position: absolute;
  width: 40px;
  height: 40px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.6;
}
.hero-ornament.top-left    { top: 0; left: 0; border-width: 1.5px 0 0 1.5px; }
.hero-ornament.top-right   { top: 0; right: 0; border-width: 1.5px 1.5px 0 0; }
.hero-ornament.bottom-left { bottom: 0; left: 0; border-width: 0 0 1.5px 1.5px; }
.hero-ornament.bottom-right{ bottom: 0; right: 0; border-width: 0 1.5px 1.5px 0; }

.hero-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero-title {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.4;
}

/* 罫線＋ダイヤ */
.hero-rule, .gallery-header-rule {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 auto 28px;
  max-width: 240px;
}
.rule-line {
  flex: 1;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}
.rule-diamond {
  font-size: 0.6rem;
  color: var(--gold);
}

.hero-copy {
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--text-mid);
  margin-bottom: 36px;
}

/* 名言 */
.hero-quote {
  margin: 0 auto 52px;
  padding: 20px 24px;
  border-top: 1px solid rgba(180, 146, 86, 0.3);
  border-bottom: 1px solid rgba(180, 146, 86, 0.3);
  max-width: 440px;
}
.hero-quote-text {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  color: var(--text-mid);
  line-height: 1.9;
  margin-bottom: 8px;
}
.hero-quote-en {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* ── 扉ボタン ── */
.btn-door {
  position: relative;
  width: 200px;
  height: 64px;
  margin: 0 auto;
  display: block;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid var(--gold);
}
/* 左右の扉パネル */
.door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--gold);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.door-left  { left: 0;  transform-origin: left center; }
.door-right { right: 0; transform-origin: right center; }

/* ホバーで扉が開く */
.btn-door:hover .door-left  { transform: scaleX(0); }
.btn-door:hover .door-right { transform: scaleX(0); }

/* 扉の中のテキスト */
.door-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}
.door-label-ja {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  color: var(--white);
  transition: color 0.3s 0.2s;
}
.door-label-en {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
  transition: color 0.3s 0.2s;
}
.btn-door:hover .door-label-ja { color: var(--gold-dark); }
.btn-door:hover .door-label-en { color: var(--gold); }

/* ── 扉オーバーレイ（遷移時） ── */
#door-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
#door-overlay.active { display: flex; }
.overlay-door {
  width: 50%;
  height: 100%;
  background: var(--ivory-deep);
}
.overlay-door.left  { transform-origin: left center; }
.overlay-door.right { transform-origin: right center; }
/* 開くアニメ */
#door-overlay.opening .overlay-door.left  { animation: doorOpenL 0.7s cubic-bezier(0.4,0,0.2,1) forwards; }
#door-overlay.opening .overlay-door.right { animation: doorOpenR 0.7s cubic-bezier(0.4,0,0.2,1) forwards; }
/* 閉じるアニメ */
#door-overlay.closing .overlay-door.left  { animation: doorCloseL 0.55s cubic-bezier(0.4,0,0.2,1) forwards; }
#door-overlay.closing .overlay-door.right { animation: doorCloseR 0.55s cubic-bezier(0.4,0,0.2,1) forwards; }

@keyframes doorCloseL { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes doorCloseR { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes doorOpenL  { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes doorOpenR  { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── ページ下部ホームボタン ── */
.bottom-nav {
  text-align: center;
  margin-top: 72px;
  padding-top: 40px;
  border-top: 1px solid var(--beige);
}
.btn-home-bottom {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--text-mid);
  border: 1px solid var(--gold);
  padding: 12px 36px;
  transition: background 0.25s, color 0.25s;
}
.btn-home-bottom:hover {
  background: var(--gold);
  color: var(--white);
}

/* ============================================
   ② ギャラリー
   ============================================ */
#view-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 32px 120px;
}

.gallery-header {
  text-align: center;
  margin-bottom: 52px;
}
.gallery-header-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.gallery-header-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  color: var(--text);
  margin-bottom: 20px;
}
.gallery-header-rule {
  justify-content: center;
}

/* 音楽プレーヤー */
#music-player {
  display: flex;
  align-items: center;
  gap: 10px;
}
#music-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s, transform 0.2s;
}
#music-play-btn:hover { background: var(--gold); color: var(--white); transform: scale(1.08); }
#music-play-btn.playing { background: var(--gold); color: var(--white); }
.music-info { display: flex; flex-direction: column; line-height: 1.3; }
#music-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* カードグリッド */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

/* 作品カード */
.artwork-card {
  background: var(--white);
  border: 1px solid var(--beige);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease,
              box-shadow 0.3s ease, border-color 0.3s ease;
  outline: none;
}
.artwork-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.artwork-card:hover {
  box-shadow: 0 8px 32px var(--shadow-deep);
  border-color: var(--gold-lt);
}
.artwork-card:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(180, 146, 86, 0.25);
}

/* カード画像 */
.card-img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ivory-deep);
  position: relative;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.artwork-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

/* カード情報 */
.card-info {
  padding: 18px 20px 20px;
  border-top: 1px solid var(--ivory-deep);
}
.card-category {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.card-title {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.5;
}
.card-maker {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* 空状態 */
.empty-state {
  text-align: center;
  padding: 80px 0;
}
.empty-ornament {
  font-size: 1.5rem;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: 16px;
}
.empty-text {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* ============================================
   ③ 作品詳細
   ============================================ */
#view-detail {
  max-width: 960px;
  margin: 0 auto;
  padding: 60px 32px 120px;
}

/* 詳細ナビ（戻るボタン） */
.detail-nav {
  margin-bottom: 48px;
}

/* 戻るボタン */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Noto Serif JP', serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-mid);
  border: 1px solid var(--gold);
  padding: 10px 24px;
  transition: background 0.25s, color 0.25s, gap 0.25s;
}
.btn-back:hover {
  background: var(--gold);
  color: var(--white);
  gap: 14px;
}

/* 詳細ヘッダー */
.detail-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--beige);
}
.detail-category {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.detail-title {
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}
.detail-maker {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.detail-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--warm-gray-lt);
  margin-top: 6px;
}

/* メイン画像 */
.detail-main-wrap {
  cursor: zoom-in;
  margin-bottom: 48px;
  border: 1px solid var(--beige);
  background: var(--ivory-deep);
  overflow: hidden;
  position: relative;
}
.detail-main-wrap img {
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}
.detail-main-wrap:hover img { transform: scale(1.02); }
.detail-zoom-hint {
  position: absolute;
  bottom: 14px; right: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  opacity: 0.8;
}

/* 仕切り線 */
.detail-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0;
}
.detail-divider::before,
.detail-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--beige);
}
.detail-divider::before { content: ''; }
.detail-divider-ornament {
  font-size: 0.6rem;
  color: var(--gold);
  opacity: 0.6;
}

/* 解説テキスト */
.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.detail-body.no-sub { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; }
.detail-section-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.detail-description {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--text-mid);
  line-height: 2;
}
.detail-memo {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--ivory-deep);
  border-left: 2px solid var(--gold);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.9;
}

/* サブ画像（素材・制作過程など） */
.detail-sub-wrap {
  border: 1px solid var(--beige);
  background: var(--ivory-deep);
  overflow: hidden;
}
.detail-sub-wrap img {
  width: 100%;
  object-fit: cover;
}

/* ============================================
   モーダル
   ============================================ */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 14, 0.88);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
#modal-overlay.open { display: flex; }

.modal-frame {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid rgba(180, 146, 86, 0.3);
}
#modal-close {
  position: fixed;
  top: 24px; right: 28px;
  font-size: 1.2rem;
  color: rgba(180, 146, 86, 0.8);
  transition: color 0.2s, transform 0.2s;
  z-index: 201;
}
#modal-close:hover { color: var(--gold-lt); transform: rotate(90deg); }

/* ============================================
   フッター
   ============================================ */
footer {
  background: var(--ivory-deep);
  border-top: 1px solid var(--beige);
  padding: 48px 32px;
  text-align: center;
}
.footer-logo {
  font-family: 'Noto Serif JP', serif;
  font-size: 1rem;
  letter-spacing: 0.3em;
  color: var(--text-mid);
  margin-bottom: 16px;
}
.footer-rule-line {
  width: 48px;
  height: 1px;
  background: var(--gold);
  opacity: 0.4;
  margin: 0 auto 16px;
}
.footer-copy {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--text-muted);
}

/* ============================================
   レスポンシブ
   ============================================ */

/* タブレット */
@media (max-width: 768px) {
  /* ヘッダー */
  .header-inner { padding: 0 16px; }
  .logo-ja { font-size: 0.95rem; letter-spacing: 0.18em; }
  .logo-en { font-size: 0.58rem; }
  #music-title { max-width: 90px; font-size: 0.58rem; }

  /* TOP */
  #view-top { padding: 0 16px; }
  .hero-frame { padding: 52px 24px; width: 100%; max-width: 100%; }
  .hero-label { font-size: 0.65rem; letter-spacing: 0.2em; margin-bottom: 20px; }
  .hero-title { font-size: clamp(1.6rem, 6vw, 2.2rem); letter-spacing: 0.25em; margin-bottom: 20px; }
  .hero-copy  { font-size: 0.88rem; letter-spacing: 0.15em; }
  .hero-quote { padding: 16px 16px; margin-bottom: 36px; }
  .hero-quote-text { font-size: 0.88rem; letter-spacing: 0.15em; }
  .hero-quote-en   { font-size: 0.68rem; }
  .btn-door { width: 180px; height: 58px; }
  .door-label-ja { font-size: 0.8rem; letter-spacing: 0.28em; }

  /* ギャラリー */
  #view-gallery { padding: 32px 16px 80px; }
  .gallery-header { margin-bottom: 36px; }
  .gallery-header-title { font-size: 1.25rem; letter-spacing: 0.25em; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card-info { padding: 12px 14px 14px; }
  .card-title { font-size: 0.85rem; letter-spacing: 0.08em; }

  /* 詳細 */
  #view-detail { padding: 32px 16px 80px; }
  .detail-title { font-size: clamp(1.2rem, 5vw, 1.6rem); letter-spacing: 0.2em; }
  .detail-body { grid-template-columns: 1fr; gap: 28px; }
  .detail-description { font-size: 0.88rem; }
  .detail-divider { margin: 32px 0; }
  .detail-main-wrap img { max-height: 480px; }
  .bottom-nav { margin-top: 52px; }

  /* 共通ボタン */
  .btn-back { font-size: 0.8rem; padding: 9px 18px; }
  .btn-home-bottom { font-size: 0.8rem; padding: 11px 28px; }
}

/* スマホ */
@media (max-width: 480px) {
  /* ヘッダー */
  .logo-ja { font-size: 0.9rem; letter-spacing: 0.15em; }
  #music-title { display: none; }

  /* TOP */
  .hero-frame { padding: 44px 20px; }
  .hero-label { display: none; }
  .hero-title { font-size: 1.7rem; letter-spacing: 0.2em; }
  .hero-rule  { margin-bottom: 18px; max-width: 180px; }
  .hero-copy  { font-size: 0.82rem; letter-spacing: 0.1em; margin-bottom: 24px; }
  .hero-quote { padding: 14px 12px; margin-bottom: 32px; }
  .hero-quote-text { font-size: 0.82rem; letter-spacing: 0.1em; }
  .hero-ornament { width: 28px; height: 28px; }
  .btn-door { width: 168px; height: 54px; }
  .door-label-ja { font-size: 0.78rem; letter-spacing: 0.22em; }

  /* ギャラリー */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-info { padding: 10px 10px 12px; }
  .card-title { font-size: 0.78rem; letter-spacing: 0.05em; line-height: 1.4; }
  .card-maker { font-size: 0.7rem; }
  .gallery-header-label { font-size: 0.62rem; }
  .gallery-header-title { font-size: 1.1rem; letter-spacing: 0.2em; }

  /* 詳細 */
  .detail-title { font-size: 1.15rem; letter-spacing: 0.15em; }
  .detail-maker { font-size: 0.8rem; }
  .detail-description { font-size: 0.85rem; line-height: 1.9; }
  .detail-main-wrap img { max-height: 320px; }
  .detail-zoom-hint { font-size: 0.58rem; }
  .detail-memo { font-size: 0.78rem; padding: 12px 14px; }
  .bottom-nav { margin-top: 40px; padding-top: 32px; }
  .btn-home-bottom { font-size: 0.78rem; padding: 10px 24px; letter-spacing: 0.15em; }
  .btn-back { font-size: 0.76rem; padding: 8px 14px; }
}
