/* Homepage carousel: inherit PieceGSM's existing visual tokens. */
.pgsm-carousel { position: relative; background: var(--pg-white, #fff); }
.pgsm-hero-slide { position: relative; isolation: isolate; }
.pgsm-hero-slide[hidden], .pgsm-carousel-controls[hidden] { display: none !important; }
#index .pgsm-carousel .piecegsm-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: auto;
  min-height: 510px;
  align-items: stretch;
  padding-right: 0;
}
#index .pgsm-carousel .piecegsm-hero-copy {
  min-width: 0;
  max-width: none;
  padding: 3rem 1.5rem;
}
#index .pgsm-carousel .pgsm-slide-title {
  margin: 0 0 1.25rem;
  color: var(--pg-ink, #07142f);
  font-family: var(--pg-font-heading, inherit);
  font-size: clamp(2.15rem, 4.4vw, 4.45rem);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -.045em;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#index .pgsm-carousel .pgsm-slide-description {
  margin: 0 0 2rem;
  color: var(--pg-ink-soft, #17243d);
  font-size: clamp(1rem, 1.7vw, 1.55rem);
  line-height: 1.48;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
#index .pgsm-carousel .piecegsm-hero-media {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 510px;
  height: auto;
  margin: 0;
}
#index .pgsm-carousel .piecegsm-hero-media::before { display: none; }
#index .pgsm-carousel .piecegsm-hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#index .pgsm-carousel .pgsm-fit-cover img { object-fit: cover; }
#index .pgsm-carousel .pgsm-hero-slide--image-only .piecegsm-hero-grid { grid-template-columns: minmax(0, 1fr); }
.pgsm-hero-slide-link { position: absolute; inset: 0; z-index: 1; }
.pgsm-carousel .piecegsm-hero-actions { position: relative; z-index: 2; }
#index .pgsm-carousel .piecegsm-hero-actions .btn {
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
#index .pgsm-carousel .piecegsm-hero-actions .piecegsm-btn-secondary { display: inline-flex; }
.pgsm-carousel a:focus-visible, .pgsm-carousel button:focus-visible {
  outline: 3px solid var(--pg-blue, #075fd9);
  outline-offset: 2px;
}
.pgsm-carousel .pgsm-hero-slide-link:focus-visible { outline-offset: -4px; }
.pgsm-carousel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
}
.pgsm-carousel-arrow, .pgsm-carousel-play, .pgsm-carousel-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: .5rem;
  border: 1px solid var(--pg-border, #dfe5ec);
  border-radius: var(--pg-radius-sm, 8px);
  background: var(--pg-white, #fff);
  color: var(--pg-ink, #07142f);
  cursor: pointer;
  line-height: 1;
}
.pgsm-carousel-arrow { font-size: 2rem; }
.pgsm-carousel-play { padding: .5rem .75rem; font-size: .85rem; line-height: 1.3; }
.pgsm-carousel-dots { display: flex; max-width: min(500px, calc(100vw - 144px)); overflow-x: auto; }
.pgsm-carousel-dot { border: 0; background: transparent; }
.pgsm-carousel-dot::before { content: ""; display: block; width: 8px; height: 8px; border-radius: 8px; background: var(--pg-muted, #667085); }
.pgsm-carousel-dot[aria-current="true"]::before { width: 20px; background: var(--pg-blue, #075fd9); }
.pgsm-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 992px) {
  #index .pgsm-carousel .pgsm-fit-cover::before {
    display: block;
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 1;
    width: clamp(72px, 9vw, 128px);
    background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.92) 24%, rgba(255,255,255,.52) 58%, rgba(255,255,255,0) 100%);
    content: "";
    pointer-events: none;
  }
  #index .pgsm-carousel .pgsm-hero-slide--image-only .piecegsm-hero-media::before { display: none; }
}
@media (max-width: 991px) {
  #index .pgsm-carousel .piecegsm-hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 0; }
  #index .pgsm-carousel .piecegsm-hero-copy { padding: 2rem 20px 1.5rem; }
  #index .pgsm-carousel .piecegsm-hero-media { min-height: 0; aspect-ratio: 3 / 2; max-height: 440px; }
  #index .pgsm-carousel .pgsm-fit-cover { aspect-ratio: 50 / 39; }
}
@media (max-width: 767px) {
  #index .pgsm-carousel .pgsm-slide-title { font-size: clamp(2.15rem, 10.5vw, 2.65rem); }
  #index .pgsm-carousel .piecegsm-hero-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  #index .pgsm-carousel .piecegsm-hero-actions .btn { width: 100%; }
  #index .pgsm-carousel .piecegsm-hero-media { max-height: 390px; }
}
/* Keep homepage category names intact on narrow phones. */
#index .piecegsm-category-card > span.piecegsm-category-body { min-width: 0; max-width: 100%; }
#index .piecegsm-category-name { overflow-wrap: anywhere; }
@media (max-width: 479px) { #index .piecegsm-category-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
