.p-cosplay__main {
  padding: 8rem 0;
  position: relative;
  z-index: 2;
  text-align: center;
  background-color: #f5f0ed;
}


/* ========================================
   Tab Navigation
======================================== */
.p-cosplay__tab-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  margin: 4rem 0 0 0;
}

.p-cosplay__tab-button {
  padding: 2rem 2.8rem;
  background-color: #333;
  border-radius: 1rem 1rem 0 0;
  color: #fff;
  font-size: 2rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
    font-family: "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}

.p-cosplay__tab-button.is-active,
.p-cosplay__tab-button:hover {
  background-color: #ef3340;
  color: #fff;
}

/* ========================================
   Tab Panel
======================================== */
.p-cosplay__tab-panel {
  display: none;
  background-color: #fff;
  padding: 4rem 2rem;
}

.p-cosplay__tab-panel.is-active {
  display: block;
}

/* ========================================
   Gallery
======================================== */
.p-cosplay__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin-top: 4rem;
}

.p-cosplay__tab-panel-ttl{
  font-size: 4.2rem;
  font-weight: bold;
}

.p-cosplay__gallery-item {
  cursor: pointer;
  overflow: hidden;
  border: 1px solid rgb(209, 209, 209);
  width:24%;
  background-color: #e8e0d8;
}

.p-cosplay__gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.p-cosplay__gallery-item:hover img {
  transform: scale(1.05);
}

/* ========================================
   Popup
======================================== */
.p-cosplay__popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.p-cosplay__popup.is-open {
  display: flex;
}

.p-cosplay__popup-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.p-cosplay__popup-inner {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.p-cosplay__popup-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.p-cosplay__popup-caption {
  color: #fff;
  font-size: 1.4rem;
  text-align: center;
  margin-top: 1rem;
  letter-spacing: 0.05em;
}

.p-cosplay__popup-close {
  position: absolute;
  top: -4rem;
  right: 0;
  width: 3.2rem;
  height: 3.2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.p-cosplay__popup-close::before,
.p-cosplay__popup-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.4rem;
  height: 2px;
  background-color: #fff;
  transform-origin: center;
}

.p-cosplay__popup-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.p-cosplay__popup-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1024px) {
  .p-cosplay__gallery-item {
    width: calc((100% - 3rem) / 4);
  }
}

@media (max-width: 768px) {
  .p-cosplay__tab-button {
        font-size: 1rem;
        padding:2rem .6rem;
  }

  .p-cosplay__tab-panel-ttl{
    font-size: 2.8rem;
  }

  .p-cosplay__tab-navigation{
    gap: 0.2rem;
  }

  .p-cosplay__tab-panel{
    padding: 2rem 0;
  }

  .p-cosplay__gallery {
    gap: 0.6rem;
    padding: 0 1rem;
    margin-top: 2rem;
  }

  .p-cosplay__gallery-item {
    width: calc((100% - 1.2rem) / 3);
  }
}

@media (max-width: 480px) {
  .p-cosplay__gallery-item {
    width: calc((100% - 0.6rem) / 2);
  }

  .p-cosplay__popup-close {
    top: -3.2rem;
  }
}

.p-cosplay__main-ttl::before {
  display: block;
  content: "";
  border-bottom: 1px solid #1d1d1d;
  width: 100%;
  z-index: -1;
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
}