/* digest-photo-gallery BEM */

.digest-photo-gallery {
  position: relative;
  width: 100%;
  margin: 0 auto 20px;
}

.digest-photo-gallery__expand-btn {
  display: none;
  font-size: 16px;
  color: #333 !important;
  text-decoration: underline;
  cursor: pointer;
}

.digest-photo-gallery__expand-btn:hover {
  color: #000 !important;
}

/* ツールバー */
.digest-photo-gallery__toolbar {
  margin: 8px 0;
}

.digest-photo-gallery__toolbar-pc {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.digest-photo-gallery__toolbar-sp {
  display: none;
}

.digest-photo-gallery__toolbar-prev,
.digest-photo-gallery__toolbar-prev--disabled {
  justify-self: start;
}

.digest-photo-gallery__toolbar-next,
.digest-photo-gallery__toolbar-next--disabled {
  justify-self: end;
}

.digest-photo-gallery__toolbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.digest-photo-gallery__counter {
  font-size: 16px;
  color: #333;
}

/* SP専用ナビ（前の写真・次の写真）*/
.digest-photo-gallery__sp-nav {
  display: none;
}

.digest-photo-gallery__toolbar-prev,
.digest-photo-gallery__toolbar-next,
.digest-photo-gallery__toolbar-prev--disabled,
.digest-photo-gallery__toolbar-next--disabled {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 16px;
  text-decoration: none;
}

.digest-photo-gallery__toolbar-prev,
.digest-photo-gallery__toolbar-next {
  color: #333 !important;
}

.digest-photo-gallery__toolbar-prev--disabled,
.digest-photo-gallery__toolbar-next--disabled {
  color: #bbb !important;
  cursor: default;
  pointer-events: none;
}

.digest-photo-gallery__toolbar-prev:hover,
.digest-photo-gallery__toolbar-next:hover {
  color: #000;
}

.digest-photo-gallery__toolbar-prev svg,
.digest-photo-gallery__toolbar-next svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* メイン写真エリア */
.digest-photo-gallery__main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2d2d2d;
  overflow: hidden;
}

.digest-photo-gallery__main-image {
  flex-shrink: 0;
}

.digest-photo-gallery__main-image img {
  object-fit: contain;
  display: block;
}

.digest-photo-gallery__main-image--wide {
  width: 100%;
}

.digest-photo-gallery__main-image--wide img {
  width: 100%;
  object-fit: cover;
}

.digest-photo-gallery__main-image--tall img {
  object-fit: contain;
  max-height: 440px;
}

/* メイン写真の左右ナビ（縦長チェブロン） */
.digest-photo-gallery__nav {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  background: none;
  border: none;
  color: #fff;
  width: 33%;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.digest-photo-gallery__nav:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.1);
}

.digest-photo-gallery__nav:active {
  background: rgba(255, 255, 255, 0.25);
}

.digest-photo-gallery__nav--prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 0;
}

.digest-photo-gallery__nav--prev svg {
  margin-left: -20px;
}

.digest-photo-gallery__nav--next {
  right: 0;
  justify-content: flex-end;
  padding-right: 0;
}

.digest-photo-gallery__nav--next svg {
  margin-right: -20px;
}

.digest-photo-gallery__nav svg {
  width: 120px;
  height: 120px;
}

.digest-photo-gallery__carousel-nav svg {
  width: 80px;
  height: 80px;
}

/* キャプション */
.digest-photo-gallery__caption {
  background: #000;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  padding: 0 10px;
  height: 12vw;
  max-height: 56px;
  display: flex;
  align-items: center;
  text-align: left;
}

.digest-photo-gallery__caption a {
  color: #fff;
  text-decoration: underline;
}

/* カルーセルエリア */
.digest-photo-gallery__carousel {
  display: flex;
  align-items: center;
  background: #555;
  padding: 8px 0;
  position: relative;
  overflow: hidden;
}

.digest-photo-gallery__carousel-nav {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fff;
  width: 32px;
  height: 15vw;
  max-height: 100px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.2s;
}

.digest-photo-gallery__carousel-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

.digest-photo-gallery__carousel-nav--disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.digest-photo-gallery__carousel-track {
  flex: 1;
  overflow: hidden;
}

.digest-photo-gallery__carousel-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: transform 0.3s ease;
}

.digest-photo-gallery__carousel-item {
  flex: 0 0 25%;
  box-sizing: border-box;
  padding: 0 4px;
  background: #555;
}

.digest-photo-gallery__carousel-item a {
  display: block;
  background: #555;
}

.digest-photo-gallery__carousel-item img {
  width: 100%;
  height: 15vw;
  max-height: 100px;
  object-fit: contain;
  display: block;
  background: #555;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.digest-photo-gallery__carousel-item--wide img {
  object-fit: cover;
}

.digest-photo-gallery__carousel-item--tall img {
  object-fit: contain;
}

.digest-photo-gallery__carousel-item a:hover img {
  opacity: 1;
}

.digest-photo-gallery__carousel-item--active img {
  opacity: 1;
}

/* モーダル */
.digest-photo-gallery__modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.digest-photo-gallery__modal--active {
  display: flex;
}

.digest-photo-gallery__modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.digest-photo-gallery__modal-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.digest-photo-gallery__modal-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.digest-photo-gallery__modal-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

/* SP レスポンシブ */
@media (max-width: 767px) {
  .digest-photo-gallery__toolbar-pc {
    display: none;
  }

  .digest-photo-gallery__toolbar-sp {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .digest-photo-gallery__toolbar-sp .digest-photo-gallery__expand-btn {
    display: inline;
    position: absolute;
    right: 4px;
  }

  .digest-photo-gallery__sp-nav {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
  }

  .digest-photo-gallery__main {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
  }

  .digest-photo-gallery__main-image {
    width: 100%;
    height: auto;
  }

  .digest-photo-gallery__main-image img {
    width: 100%;
    height: 100%;
  }

  .digest-photo-gallery__main-image--tall img {
    max-height: 66.67vw;
  }

  .digest-photo-gallery__nav {
    width: 33%;
    height: 100%;
    top: 0;
    bottom: 0;
    transform: none;
  }

  .digest-photo-gallery__nav svg {
    width: 80px;
    height: 80px;
  }

  .digest-photo-gallery__nav--prev svg {
    margin-left: -12px;
  }

  .digest-photo-gallery__nav--next svg {
    margin-right: -12px;
  }

  .digest-photo-gallery__carousel-item {
    flex: 0 0 33.333%;
  }

  .digest-photo-gallery__carousel-item img {
    height: 20vw;
  }

  .digest-photo-gallery__carousel-nav {
    width: 20px;
  }

  .digest-photo-gallery__carousel-nav--prev {
    margin-left: 4px;
  }

  .digest-photo-gallery__carousel-nav--next {
    margin-right: 4px;
  }

  .digest-photo-gallery__carousel-nav svg {
    width: 20px;
    height: 20px;
  }

  .digest-photo-gallery__carousel {
    padding: 1.5vw 0;
  }

  .digest-photo-gallery__caption {
    font-size: 10px;
    line-height: 1.5;
  }
}