/* ==========================================================================
   Top Hexagon Gallery (Inspired by J-FONT.com)
   Flat-topped 2-block columns Swiper carousel
   ========================================================================== */

.bk-top-gallery {
  position: relative;
  background: #ffffff;
  padding: 70px 0 35px;
  overflow: hidden;
  border-top: none !important;
  border-bottom: none !important;
  border: none !important;
  transition: padding 0.4s ease, background 0.4s ease;
}

.bk-top-gallery.is-collapsed {
  padding: 0 !important;
  background: transparent !important;
}

/* --------------------------------------------------------------------------
   0. 全幅黒帯ボタン（背景写真ティッカー ＋ 50%黒透過 ＋ 白文字 GALLERY）
   -------------------------------------------------------------------------- */
.bk-gallery-black-bar {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background: #0d1318;
  height: 230px;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.bk-gallery-black-bar.is-leaving {
  position: absolute !important;
  top: 0 !important;
  left: 50% !important;
  margin-left: -50vw !important;
  width: 100vw !important;
  z-index: 10 !important;
  pointer-events: none !important;
}

.bk-top-gallery:not(.is-collapsed) .bk-gallery-black-bar:not(.is-leaving) {
  display: none;
}

/* 0-1. 背景写真ティッカー（左方向へ常にゆっくり流れる） */
.bk-bar-ticker {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.bk-bar-ticker-track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: bk-bar-ticker-scroll 120s linear infinite;
  will-change: transform;
}

.bk-top-gallery:not(.is-collapsed) .bk-bar-ticker-track,
.rc-motion-paused .bk-bar-ticker-track,
html.rc-motion-paused .bk-bar-ticker-track {
  animation-play-state: paused !important;
}

.bk-bar-ticker-group {
  display: flex;
  height: 100%;
  gap: 12px;
  padding-right: 12px;
}

.bk-bar-ticker-item {
  height: 100%;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
  overflow: hidden;
}

.bk-bar-ticker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9);
}

@keyframes bk-bar-ticker-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

/* 0-2. 写真の上の50%程度の黒の透過レイヤー（写真を暗く見せる） */
.bk-bar-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 15, 20, 0.52); /* 50%強の黒透過 */
  pointer-events: none;
  z-index: 2;
  transition: background 0.3s ease;
}

.bk-gallery-black-bar:hover .bk-bar-overlay {
  background: rgba(10, 15, 20, 0.44); /* ホバー時にわずかに明るく */
}

/* 0-3. 前面の白文字 GALLERY ボタン */
.bk-gallery-trigger-btn {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  transition: transform 0.25s ease;
}

.bk-gallery-trigger-btn:hover {
  transform: translateY(-2px);
}

.bk-gallery-trigger-btn:focus-visible {
  outline: 2px solid #eb7e00;
  outline-offset: -4px;
}

.bk-gallery-trigger-text {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: clamp(44px, 6.5vw, 76px) !important;
  font-weight: 800 !important;
  letter-spacing: 0.16em !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
  line-height: 1.15;
  transition: text-shadow 0.3s ease, letter-spacing 0.3s ease, transform 0.25s ease;
}

.bk-gallery-trigger-btn:hover .bk-gallery-trigger-text {
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.75), 0 0 50px rgba(235, 126, 0, 0.45);
  letter-spacing: 0.18em !important;
}

/* --------------------------------------------------------------------------
   1. 展開される六角形ギャラリー本体
   -------------------------------------------------------------------------- */
.bk-gallery-content {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.bk-top-gallery.is-collapsed .bk-gallery-content {
  display: none;
}

/* 1. Header (GALLERY) */
.bk-gallery-header {
  text-align: center;
  margin-bottom: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bk-gallery-title {
  display: inline-block !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 68.4px !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  color: #12324e !important;
  margin: 0 0 14px 0 !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease, opacity 0.25s ease, color 0.25s ease;
  outline: none;
}

.bk-gallery-title:hover {
  opacity: 0.82;
  transform: translateY(-2px);
  color: #0b2236 !important;
}

.bk-gallery-title:focus-visible {
  outline: 2px solid #eb7e00;
  outline-offset: 4px;
  border-radius: 4px;
}

.bk-gallery-deco {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 202px;
  gap: 0;
  color: #12324e;
}

.bk-gallery-deco-line {
  display: inline-block;
  width: 24px;
  height: 2px;
  background-color: #eb7e00; /* Bikosha Yellow/Orange Accent */
  flex-shrink: 0;
}

.bk-gallery-deco-arrow {
  background: transparent;
  border: none;
  padding: 4px 0 !important;
  margin: 0 !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  color: #12324e;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  border-radius: 4px;
}

.bk-gallery-deco-arrow:hover {
  color: #eb7e00;
  transform: scale(1.15);
}

.bk-gallery-deco-arrow:active {
  transform: scale(0.95);
}

.bk-gallery-deco-arrow svg {
  display: block;
}

/* 2. Slider Wrap & Swiper */
.bk-gallery-slider-wrap {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 10px 0 35px;
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}

.bk-gallery-swiper {
  width: 100%;
  overflow: visible !important;
  position: relative;
}

.bk-gallery-swiper .swiper-wrapper {
  align-items: flex-start;
  transition-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* 3. 2-Block Columns Honeycomb Layout */
.bk-hex-col.swiper-slide {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
  width: 184px !important;
  flex-shrink: 0 !important;
  margin-right: -40px !important; /* Interlock horizontally */
  position: relative !important;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.bk-hex-col.is-even {
  margin-top: 0 !important;
}

.bk-hex-col.is-odd {
  margin-top: 87px !important; /* (160px + 14px) / 2 */
}

/* 4. Hexagon Cell (横向き: Flat-topped hexagon) */
.bk-hex-cell {
  position: relative;
  width: 184px;
  height: 160px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background-color: #12324e;
  padding: 0;
  margin: 0;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), filter 0.28s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.bk-hex-cell:hover,
.bk-hex-cell:focus-visible {
  transform: scale(1.08);
  z-index: 10;
  filter: brightness(1.1) drop-shadow(0 6px 16px rgba(0, 0, 0, 0.28));
  outline: none;
}

.bk-hex-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.bk-hex-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.35s ease;
}

.bk-hex-cell:hover .bk-hex-inner img {
  transform: scale(1.06);
}

/* ==========================================================================
   5. Modal Lightbox (拡大表示)
   ========================================================================== */
.bk-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.bk-gallery-modal[aria-hidden="false"],
.bk-gallery-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.bk-gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.bk-gallery-modal-container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 clamp(20px, 6vw, 80px);
  box-sizing: border-box;
}

/* Modal Arrow Button (くの字型矢印・美工舎ブルー #12324e) */
.bk-gallery-modal-arrow {
  position: fixed !important;
  top: 50% !important;
  width: 40px !important;
  height: 60px !important;
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  color: var(--rc-blue, #12324e) !important;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  z-index: 1020 !important;
  outline: none !important;
  outline-style: none !important;
  outline-width: 0 !important;
  outline-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
}

.bk-gallery-modal-prev {
  left: clamp(16px, 3.5vw, 48px) !important;
  transform: translateY(-50%) !important;
}

.bk-gallery-modal-next {
  right: clamp(16px, 3.5vw, 48px) !important;
  transform: translateY(-50%) !important;
}

.bk-gallery-modal-arrow:focus,
.bk-gallery-modal-arrow:focus-visible,
.bk-gallery-modal-arrow:active {
  outline: none !important;
  outline-style: none !important;
  outline-width: 0 !important;
  outline-color: transparent !important;
  -webkit-focus-ring-color: transparent !important;
  box-shadow: none !important;
}

.bk-gallery-modal-arrow:hover {
  background: transparent !important;
  box-shadow: none !important;
  color: #1a4f78 !important;
  opacity: 0.9 !important;
}

.bk-gallery-modal-prev:hover {
  transform: translateY(-50%) scale(1.15) !important;
}

.bk-gallery-modal-next:hover {
  transform: translateY(-50%) scale(1.15) !important;
}

.bk-gallery-modal-prev:active {
  transform: translateY(-50%) scale(0.96) !important;
}

.bk-gallery-modal-next:active {
  transform: translateY(-50%) scale(0.96) !important;
}

.bk-gallery-modal-arrow svg {
  width: 30px !important;
  height: 48px !important;
  display: block !important;
  fill: currentColor !important;
  filter: drop-shadow(0 0 3px #ffffff) drop-shadow(0 0 8px #ffffff) drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)) !important;
  outline: none !important;
  pointer-events: none !important;
}

/* Modal Figure (Click to close) */
.bk-gallery-modal-figure {
  position: relative;
  max-width: min(84vw, 980px);
  max-height: 82vh;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.bk-gallery-modal-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.16) !important;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  user-select: none;
}

.bk-gallery-modal.is-active .bk-gallery-modal-img {
  transform: scale(1);
  opacity: 1;
}

/* ==========================================================================
   Responsive (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 900px) {
  .bk-top-gallery {
    padding: 50px 0 65px;
  }
  .bk-gallery-title {
    font-size: 50.4px !important;
  }
  .bk-gallery-deco {
    width: 149px;
  }
  .bk-gallery-deco-line {
    width: 20px;
  }
  .bk-hex-col.swiper-slide {
    width: 140px !important;
    gap: 10px !important;
    margin-right: -30px !important;
  }
  .bk-hex-col.is-odd {
    margin-top: 65px !important;
  }
  .bk-hex-cell {
    width: 140px;
    height: 121px;
  }
  .bk-gallery-modal-arrow {
    width: 30px !important;
    height: 48px !important;
  }
  .bk-gallery-modal-arrow svg {
    width: 26px !important;
    height: 42px !important;
  }
}

/* 768px以下のスマートフォン・タブレット縦：ティッカー速度をさらに穏やか（160s）に減速 */
@media (max-width: 768px) {
  .bk-bar-ticker-track {
    animation-duration: 160s !important;
  }
}

@media (max-width: 600px) {
  .bk-top-gallery {
    padding: 40px 0 50px;
  }
  .bk-gallery-header {
    margin-bottom: 30px;
  }
  .bk-gallery-title {
    font-size: 43.2px !important;
  }
  .bk-gallery-deco {
    width: 128px;
  }
  .bk-gallery-deco-line {
    width: 16px;
  }
  .bk-hex-col.swiper-slide {
    width: 105px !important;
    gap: 8px !important;
    margin-right: -23px !important;
  }
  .bk-hex-col.is-odd {
    margin-top: 49px !important;
  }
  .bk-hex-cell {
    width: 105px;
    height: 91px;
  }
  .bk-gallery-modal-prev {
    left: 8px !important;
  }
  .bk-gallery-modal-next {
    right: 8px !important;
  }
  .bk-gallery-modal-arrow {
    width: 24px !important;
    height: 38px !important;
  }
  .bk-gallery-modal-arrow svg {
    width: 22px !important;
    height: 35px !important;
  }
  .bk-gallery-modal-figure {
    max-width: 90vw;
    max-height: 75vh;
  }
  .bk-gallery-modal-img {
    max-height: 75vh;
  }
}
