@charset "UTF-8";
:root {
  --bg-color: #f8f8f8;
  --text-color: #1a1a1a;
  --accent-color: #8c7b75;
}

.style-page {
  font-family: var(--font-serif-jp);
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  width: 100%;
}

.style-page img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.gallery-section {
  padding-bottom: 15vh;
}

.art-piece {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 150px;
  padding: 0 5vw;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.art-piece.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.art-img-wrap {
  width: 75%;
  max-width: 900px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.art-piece:nth-child(odd) .art-img-wrap {
  margin-right: auto;
  margin-left: 5%;
}

.art-piece:nth-child(even) .art-img-wrap {
  margin-left: auto;
  margin-right: 5%;
}

.art-img-wrap img {
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  width: 100%;
  will-change: transform;
}

.art-img-wrap:hover img {
  transform: scale(1.05);
}

.view-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: background 0.4s ease;
  z-index: 10;
}

.view-label span {
  font-family: var(--font-futura-like);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  font-weight: 500;
  color: #1a1a1a;
  text-transform: uppercase;
}

.view-label::before {
  content: "+";
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1;
}

.art-img-wrap:hover .view-label {
  background: rgba(255, 255, 255, 0.95);
}

.modal {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 200;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.8s cubic-bezier(0.7, 0, 0.2, 1);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) #f0f0f0;
}

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

.close-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-family: var(--font-display-brand);
  font-size: 1rem;
  z-index: 220;
  cursor: pointer;
  mix-blend-mode: difference;
  color: #fff;
  padding: 0.5rem 1rem;
}

.close-btn:hover {
  opacity: 0.7;
}

.modal-container {
  width: 100%;
  /* 余白を確保しつつ、内容が少ない時に“間延び”しすぎない */
  min-height: 100%;
  background: #fff;
  padding-bottom: clamp(2.5rem, 8vh, 5rem);
}

.modal-header {
  /* ヘッダ余白を可変にして、モーダルの縦密度を上げる */
  padding: clamp(3rem, 6vw, 5rem) 10vw clamp(2rem, 4vw, 3rem);
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.modal-title {
  font-family: var(--font-display-latin);
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #000;
}

.modal-text {
  font-size: 0.95rem;
  line-height: 2;
  color: #444;
  font-family: var(--font-serif-jp);
}

/* モーダル内は“詰めて流す”：余白を分配しない */
.modal .gallery-grid {
  align-content: start;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
  padding: 0 4vw;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.gallery-grid .grid-item {
  position: relative;
  overflow: hidden;
  background: #f7f7f7;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.5s ease;
}

.gallery-grid.layout-editorial {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
}

.gallery-grid.layout-editorial .grid-item {
  grid-column: span 1;
  aspect-ratio: 3/4;
}

.gallery-grid.layout-editorial .grid-item.span-w2 {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

.gallery-grid.layout-editorial .grid-item.span-2 {
  grid-column: 1/-1;
  aspect-ratio: 16/9;
}

.gallery-grid.layout-editorial .grid-item.fit-contain img {
  object-fit: contain;
  background: #fff;
}

/*
  fit-contain（トリミングなし）の場合、
  固定aspect-ratio枠 × contain が “白い面積” を増やしやすいので、
  モーダル内だけは自然比率で高さが決まるようにする。
  （一覧サムネイル等は現状維持）
*/
.modal .gallery-grid.layout-editorial .grid-item.fit-contain {
  aspect-ratio: auto;
}

.modal .gallery-grid.layout-editorial .grid-item.fit-contain img {
  height: auto;
}

.gallery-grid.layout-editorial .grid-item.fit-cover img {
  object-fit: cover;
}

.placeholder-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 6rem;
  padding: 0 1.5rem;
}

.placeholder-gallery img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .gallery-section {
    padding-bottom: 10vh;
  }
  .art-piece {
    margin-bottom: 80px;
    padding: 0 1.5rem;
  }
  .art-img-wrap {
    width: 100%;
    margin: 0 !important;
    max-width: none;
  }
  .view-label {
    padding: 0.8rem 1.2rem;
  }
  .view-label span {
    font-size: 0.65rem;
  }
  .close-btn {
    top: 1.5rem;
    right: 1.5rem;
    color: #000;
    mix-blend-mode: normal;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
  }
  .modal-header {
    padding: 3.75rem 1.25rem 1.5rem;
  }
  .modal-title {
    font-size: 2rem;
  }
  .gallery-grid {
    padding: 0 1rem;
    gap: 0.5rem;
  }
  .gallery-grid.layout-editorial {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
  }
  .gallery-grid.layout-editorial .grid-item,
  .gallery-grid.layout-editorial .grid-item.span-w2 {
    grid-column: span 1;
    aspect-ratio: 4/5;
  }
  .placeholder-gallery {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1024px) {
  .gallery-grid.layout-editorial {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
  }
  .gallery-grid.layout-editorial .grid-item {
    aspect-ratio: 4/5;
  }
  .gallery-grid.layout-editorial .grid-item.span-w2,
  .gallery-grid.layout-editorial .grid-item.span-2 {
    grid-column: 1/-1;
    aspect-ratio: 16/9;
  }
  .modal .gallery-grid.layout-editorial .grid-item.fit-contain img {
    object-fit: contain;
    background: #fff;
  }
}
/* =========================================================
   Responsive balance fix (mobile/tablet)
   - Reduce hero "empty time" on small screens
   - Prevent gallery cards from looking narrow/floating on tablets
   - Desktop behavior remains unchanged
========================================================= */
/* Tablet (<= 1024px): reduce hero whitespace + make gallery cards feel intentional */
@media (max-width: 1024px) {
  .style-page .art-piece {
    /* Reduce vertical "gaps" that feel like dead space on tablets */
    margin: 0 auto 110px;
    padding: 0 4vw;
  }
  .style-page .art-img-wrap {
    /* Avoid the “75% width floating card” look on iPad portrait */
    width: 100%;
    max-width: 1000px;
  }
  /* Reset the odd/even offset on tablet so images sit confidently centered */
  .style-page .art-piece:nth-child(odd) .art-img-wrap,
  .style-page .art-piece:nth-child(even) .art-img-wrap {
    margin-left: 0;
    margin-right: 0;
  }
}
/* Mobile (<= 768px): shorten hero to reduce "blank first view" */
@media (max-width: 768px) {
  .style-page .gallery-section {
    padding-bottom: 12vh;
  }
}
