.pc-carousel,
.pc-carousel * {
  box-sizing: border-box;
}

.pc-carousel {
  container-type: inline-size;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: hidden;
  padding: clamp(40px, 6vw, 72px) clamp(20px, 5.5vw, 80px) clamp(32px, 4vw, 44px);
  background: transparent;
  color: #111111;
  font-family: Arial, Helvetica, sans-serif;
}

.pc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto 18px;
}

.pc-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
}

.pc-controls {
  display: flex;
  gap: 12px;
}

.pc-arrow,
.pc-close {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.pc-arrow {
  width: 48px;
  height: 48px;
  background: #f2f2f2;
  color: #111111;
  font-size: 28px;
}

.pc-arrow {
  -webkit-tap-highlight-color: transparent;
}

.pc-arrow:hover,
.pc-close:hover {
  transform: scale(1.06);
}

/* Both arrows are the same colour; black only while pressed */
.pc-arrow:active,
.pc-arrow.pc-pressed {
  background: #0b0b0b;
  color: #ffffff;
  transform: scale(0.96);
}

.pc-arrow:focus:not(:focus-visible) {
  outline: none;
}

.pc-track-wrapper {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

.pc-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.pc-track::-webkit-scrollbar {
  display: none;
}

.pc-card {
  flex: 0 0 240px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 3px solid #ececec;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.pc-card:hover {
  opacity: 0.85;
}

.pc-card.pc-active {
  border-bottom-color: #111111;
}

.pc-card-image {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.pc-card-title,
.pc-card-category {
  display: block;
}

.pc-card-title {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 700;
}

.pc-card-category {
  margin: 4px 0 13px;
  color: #777777;
  font-size: 12px;
}

/* Detail panel: two columns by default, no fixed minimum widths */
.pc-detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  width: 100%;
  max-width: 1280px;
  min-height: 420px;
  margin: 40px auto 0;
  overflow: hidden;
  background: #f5f5f3;
  border-radius: 10px;
}

.pc-detail > * {
  min-width: 0;
}

.pc-detail.pc-hidden {
  display: none;
}

.pc-detail-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.pc-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 32px;
  height: 32px;
  background: #e4e4e1;
  color: #555555;
  font-size: 18px;
}

.pc-detail-content {
  min-width: 0;
  padding: 32px;
}

.pc-detail-title {
  margin: 0;
  padding-left: 12px;
  padding-right: 40px;
  border-left: 4px solid #111111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pc-detail-meta {
  margin: 8px 0 0;
  color: #777777;
  font-size: 12px;
}

.pc-detail-description {
  max-width: 650px;
  margin: 20px 0;
  color: #4e4e4e;
  font-size: 14px;
  line-height: 1.65;
}

.pc-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 46px;
  margin-bottom: 22px;
}

.pc-stat {
  min-width: 76px;
}

.pc-stat strong,
.pc-stat span {
  display: block;
}

.pc-stat strong {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.2;
}

.pc-stat span {
  color: #777777;
  font-size: 12px;
}

.pc-stat .pc-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #318b51;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 500;
}

.pc-status i {
  width: 8px;
  height: 8px;
  background: #318b51;
  border-radius: 50%;
}

.pc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.pc-gallery img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 5px;
}

/* Container queries: react to the component's own width, not the screen */
@container (max-width: 900px) {
  .pc-detail {
    grid-template-columns: 1fr;
  }

  .pc-detail-image {
    min-height: 300px;
    max-height: 420px;
  }
}

@container (max-width: 560px) {
  .pc-header h2 {
    font-size: 23px;
  }

  .pc-arrow {
    width: 40px;
    height: 40px;
  }

  .pc-card {
    flex-basis: 78%;
  }

  .pc-card-image {
    height: 220px;
  }

  .pc-detail-content {
    padding: 26px 20px;
  }

  .pc-detail-title {
    font-size: 25px;
  }

  .pc-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Lightbox ---------- */
html.pc-lb-lock {
  overflow: hidden;
}

.pc-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(10, 10, 10, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.pc-lightbox.pc-lb-open {
  display: flex;
  animation: pc-lb-fade 0.2s ease;
}

@keyframes pc-lb-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.pc-lb-img {
  display: block;
  max-width: min(1200px, 100%);
  max-height: 100%;
  object-fit: contain;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pc-lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease;
}

.pc-lb-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pc-lb-close {
  top: 16px;
  right: 16px;
}

.pc-lb-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.pc-lb-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.pc-lb-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

@media (max-width: 600px) {
  .pc-lb-btn {
    width: 40px;
    height: 40px;
  }

  .pc-lb-prev {
    left: 8px;
  }

  .pc-lb-next {
    right: 8px;
  }
}
