/* ============================================
   Gallery Page Styles
============================================ */

/* ============================================
   Header Static (for sub pages)
============================================ */
.header-static {
  position: fixed;
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Page Header
============================================ */
.page-header {
  position: relative;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
  margin-top: 70px;
  background-color: var(--color-primary);
  overflow: hidden;
}

.page-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  opacity: 1;
}

.page-header-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../../images/common/pattern-dots.svg') repeat;
  opacity: 0.05;
}

.page-header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.page-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: white;
  font-weight: 900;
  margin-bottom: 0.5rem;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: 0.1em;
}

.page-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  margin: 0;
  font-weight: 400;
}

/* ============================================
   Gallery Introduction
============================================ */
.gallery-intro {
  padding: var(--spacing-lg) 0;
  background-color: var(--color-bg);
}

.gallery-intro-text {
  text-align: center;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--color-text);
  line-height: 2;
  margin: 0;
}

/* ============================================
   Gallery Section
============================================ */
.gallery-section {
  padding: clamp(2rem, 5vw, 6rem) 0;
  background-color: var(--color-bg);
}

.gallery-section-dark {
  background-color: var(--color-primary);
}

.gallery-section-dark .section-title {
  color: white;
}

.gallery-section-dark .section-title-ja {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Gallery Grid
============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  background-color: var(--color-bg-light);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.gallery-item::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23054394'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3Cpath d='M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 準備中マスク — gallery-item に .is-preparing を付け外しするだけで切替可能 */
.gallery-item.is-preparing {
  pointer-events: none;
}

.gallery-item.is-preparing::before {
  background: rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.gallery-item.is-preparing::after {
  content: '準備中';
  width: auto;
  height: auto;
  background: none;
  background-image: none;
  color: #fff;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 募集中マスク — gallery-item に .is-recruiting を付け外しするだけで切替可能 */
.gallery-item.is-recruiting {
  pointer-events: none;
}

.gallery-item.is-recruiting::before {
  background: rgba(255, 255, 255, 0.85);
  opacity: 1;
}

.gallery-item.is-recruiting::after {
  content: '募集中';
  width: auto;
  height: auto;
  background: none;
  background-image: none;
  color: var(--color-primary);
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* セクション非表示 — is-hidden を外すだけで表示復帰 */
.is-hidden {
  display: none;
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .gallery-item {
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ============================================
   Gallery CTA Section
============================================ */
.gallery-cta {
  padding: var(--spacing-xl) 0;
  background: linear-gradient(135deg, var(--color-bg-light) 0%, #d4e8ff 100%);
}

.gallery-cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.gallery-cta-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.gallery-cta-text {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--color-text);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.gallery-cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-outline-white {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-outline-white:hover {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

/* ============================================
   Lightbox Modal
============================================ */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.lightbox.active .lightbox-image {
  opacity: 1;
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev svg,
.lightbox-next svg {
  width: 32px;
  height: 32px;
}

@media (max-width: 768px) {
  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-prev svg,
  .lightbox-next svg {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   Mobile Menu Styles (inherited from common)
============================================ */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
  }

  .nav.active {
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .nav-link {
    color: white;
    font-size: 1.2rem;
  }

  .nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
  }

  .hamburger {
    z-index: 999;
  }

  .hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* ============================================
   Section Title Area Adjustments
============================================ */
.gallery-section .section-title-area {
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.gallery-section .section-title {
  text-align: center;
}

.gallery-section .section-title-ja {
  justify-content: center;
}
