/**
 * index-carousel.js 向けカルーセル（Bootstrap 3 とは併用しない）。
 * Bootstrap 読み込みページでは二重適用になるため読み込まないこと。
 *
 * HTML: bootstrap-plus を参照し、直下に本ファイルを読み込むページのみが対象
 * （index / gallery / project / contact 等）。
 */

/* Carousel (Bootstrap なし — index-carousel.js と併用) */
.carousel {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  isolation: isolate;
}
.carousel-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
}
/* 矢印は .carousel-inner 内に置き、画像枠の左右に固定 */
.carousel-inner > .carousel-control,
.carousel > .carousel-control {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12%;
  max-width: 72px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin: 0;
  text-decoration: none;
  background: none !important;
  border: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.carousel-inner > .carousel-control:hover,
.carousel-inner > .carousel-control:focus,
.carousel > .carousel-control:hover,
.carousel > .carousel-control:focus {
  opacity: 1;
  text-decoration: none;
}
.carousel-inner > .carousel-control.left,
.carousel > .carousel-control.left {
  left: 0;
  right: auto;
}
.carousel-inner > .carousel-control.right,
.carousel > .carousel-control.right {
  right: 0;
  left: auto;
}
.carousel-inner > .item {
  display: none;
  position: relative;
  backface-visibility: hidden;
  transition: transform 0.6s ease-in-out;
}
.carousel-inner > .active,
.carousel-inner > .next,
.carousel-inner > .prev {
  display: block;
}
.carousel-inner > .active {
  transform: translate3d(0, 0, 0);
}
.carousel-inner > .next,
.carousel-inner > .prev {
  position: absolute;
  top: 0;
  width: 100%;
}
.carousel-inner > .next {
  transform: translate3d(100%, 0, 0);
}
.carousel-inner > .prev {
  transform: translate3d(-100%, 0, 0);
}
.carousel-inner > .next.left,
.carousel-inner > .prev.right {
  transform: translate3d(0, 0, 0);
}
.carousel-inner > .active.left {
  transform: translate3d(-100%, 0, 0);
}
.carousel-inner > .active.right {
  transform: translate3d(100%, 0, 0);
}
@media (prefers-reduced-motion: reduce) {
  .carousel-inner > .item {
    transition: none;
  }
}
.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-bottom: clamp(20px, 5vw, 48px);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.carousel-caption h3,
.carousel-caption p {
  color: #fff;
  margin: 0;
}
.index-carousel-arrow,
.carousel-control .index-carousel-arrow {
  display: block;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.carousel-indicators {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 3;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  pointer-events: none;
}
.carousel-indicators li {
  pointer-events: auto;
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
}
.carousel-indicators .active {
  background: #fff;
  transform: scale(1.2);
}
.center-block {
  display: block;
  width: 100%;
  height: auto;
}

.carousel-inner > .item > img,
.carousel-inner > .item > a > img {
  width: 100%;
  height: auto;
  display: block;
}
/* #carousel1 ヒーロー寸法（index は site-chrome-legacy 非読込のためここでも定義） */

[class*="col-"] .carousel-inner .item,
.index-grid__cell .carousel .carousel-inner .item {
  min-height: 0 !important;
}
[class*="col-"] .carousel-inner > .item > img,
[class*="col-"] .carousel-inner > .item > a > img {
  height: auto !important;
  object-fit: unset !important;
}
/* グリッド内埋め込みカルーセル（旧 Bootstrap col-* 内と同じ: 横幅100%・高さ自動） */
.index-grid__cell > .carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}
.index-grid__cell:has(> .carousel) {
  align-self: start;
  overflow: hidden;
  min-width: 0;
}
.index-grid__cell > .carousel .carousel-inner {
  overflow: hidden;
  width: 100%;
}
.index-grid__cell > .carousel .carousel-inner > .item > img,
.index-grid__cell > .carousel .carousel-inner > .item > a > img,
.index-grid__cell > .carousel .carousel-inner > .item .center-block {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: unset !important;
}
.index-grid__cell > .carousel .carousel-caption {
  padding-bottom: 10px;
}
.index-grid__cell > .carousel .carousel-caption h3 {
  font-size: clamp(11px, 1.8vw, 16px);
}
.index-grid__cell > .carousel .carousel-caption p {
  font-size: 8px;
  letter-spacing: 0.14em;
}
.index-hero-img {
  display: block;
  width: 100%;
  height: auto;
}
#carousel1 .carousel-inner {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 7;
  max-height: 720px;
}
#carousel1 .carousel-inner > .item {
  height: 100%;
  min-height: 0;
}
#carousel1 .carousel-inner > .item > img,
#carousel1 .carousel-inner > .item > a > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}
#carousel1 .index-hero-img {
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  #carousel1 .carousel-inner {
    height: 60vh;
    min-height: 240px;
    max-height: 520px;
    aspect-ratio: auto;
  }
  #carousel1 .carousel-inner > .item {
    height: 60vh;
    min-height: 240px;
    max-height: 520px;
  }
  #carousel1 .carousel-inner > .item > img,
  #carousel1 .carousel-inner > .item > a > img {
    height: 100% !important;
    width: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.carousel-caption h3 {
  font-family: var(--font-display) !important;
  font-size: clamp(16px, 2.2vw, 28px);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1.2;
}
.carousel-caption p {
  font-size: 11px;
  letter-spacing: 0.18em;
  line-height: 1.3;
  text-transform: uppercase;
}
