/**
 * Package PDP editorial story.
 *
 * Owner: frontend/pdp_story library, attached by page--menu.html.twig.
 * Replaces the centered, vertically stacked section_content_a story
 * (heading -> 1-up slider -> drop-cap copy wall) with an asymmetric,
 * sticky two-column editorial layout on a dark surface.
 */

/* ---------------------------------------------------------------------------
 * Editorial two-column story (dark band): sticky media + article copy.
 * Typography inherits [data-arts-theme-text=light] from main.css.
 * ------------------------------------------------------------------------- */
.pdp-story {
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
}

.pdp-story__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3.75rem);
}

@media (min-width: 992px) {
  .pdp-story__grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: start;
  }

  .pdp-story__media {
    position: sticky;
    top: calc(var(--smokeempyr-header-offset, 5rem) + 1.25rem);
  }
}

.pdp-story__media-primary {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 0.85rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.pdp-story__media-primary img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-story__media-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.6rem, 1.5vw, 1rem);
  margin-top: clamp(0.6rem, 1.5vw, 1rem);
}

.pdp-story__media-secondary figure {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 0.6rem;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.pdp-story__media-secondary img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pdp-story__media,
.pdp-story__copy {
  min-width: 0;
}

.pdp-story__copy {
  max-width: 44rem;
}

.pdp-story__eyebrow {
  color: var(--color-accent);
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0 0 0.5rem;
}

.pdp-story__heading {
  font-family: var(--font-secondary, "Cinzel", serif);
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 1.1rem;
}

.pdp-story__rule {
  width: 3.5rem;
  height: 2px;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
  background-color: var(--color-accent);
}

.pdp-story__policy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: clamp(1.25rem, 2.5vw, 1.75rem);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.pdp-story__policy a {
  color: color-mix(in srgb, currentColor 72%, transparent);
  text-decoration: none;
}

.pdp-story__policy a:hover,
.pdp-story__policy a:focus-visible {
  color: var(--color-accent);
  text-decoration: underline;
}

.pdp-story__body {
  font-size: 1rem;
  line-height: 1.8;
}

.pdp-story__body > :first-child {
  margin-top: 0;
}

.pdp-story__body h2,
.pdp-story__body h3,
.pdp-story__body h4 {
  font-family: var(--font-secondary, "Cinzel", serif);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.2;
  margin: 2.25rem 0 0.85rem;
  padding-top: 1.35rem;
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.pdp-story__body ul {
  margin: 0 0 1.25rem;
  padding-left: 0;
  list-style: none;
}

.pdp-story__body ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.6rem;
}

.pdp-story__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--color-accent);
}

.pdp-tabs,
.pdp-tabs__panel {
  min-width: 0;
}

/* ---------------------------------------------------------------------------
 * Tabbed story module (Story / Details / Reviews).
 *
 * Progressive enhancement: with no JS the tab chrome is hidden and every panel
 * stacks (fully readable + crawlable). pdp-tabs.js adds `is-enhanced`, which
 * reveals the tablist and hides inactive [hidden] panels.
 * ------------------------------------------------------------------------- */
.pdp-tabs__list {
  display: none;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  margin: 0 0 clamp(1.4rem, 3vw, 2rem);
  border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pdp-tabs__list::-webkit-scrollbar {
  display: none;
}

.pdp-tabs.is-enhanced .pdp-tabs__list {
  display: flex;
}

.pdp-tabs__tab {
  position: relative;
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.15rem;
  margin-bottom: -1px;
  font-family: var(--font-secondary, "Cinzel", serif);
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase;
  color: color-mix(in srgb, currentColor 50%, transparent);
  cursor: pointer;
  transition: color 0.2s ease;
}

.pdp-tabs__tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.pdp-tabs__tab:hover,
.pdp-tabs__tab:focus-visible {
  color: currentColor;
}

.pdp-tabs__tab[aria-selected="true"] {
  color: currentColor;
}

.pdp-tabs__tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.pdp-tabs__tab:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Stack all panels with separators until JS enhances into a real tab set. */
.pdp-tabs__panel + .pdp-tabs__panel {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.pdp-tabs.is-enhanced .pdp-tabs__panel + .pdp-tabs__panel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.pdp-tabs.is-enhanced .pdp-tabs__panel[hidden] {
  display: none;
}

.pdp-tabs__panel:focus {
  outline: none;
}

/* Details facts list overrides the bulleted story-body list styling. */
.pdp-details__facts {
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
}

.pdp-details__facts li {
  padding-left: 0;
  margin-bottom: 0.55rem;
  line-height: 1.6;
}

.pdp-details__facts li::before {
  content: none;
}

.pdp-details__facts strong {
  font-family: var(--font-secondary, "Cinzel", serif);
  letter-spacing: 0.04em;
}

/* Reviews inside the tab panel — horizontal scroll rail. */
.pdp-reviews {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: clamp(0.85rem, 1.8vw, 1.25rem);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
  scrollbar-width: thin;
}

.pdp-reviews::-webkit-scrollbar {
  height: 0.45rem;
}

.pdp-reviews::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 999px;
}

/*
 * Shared testimonial-card pipeline for every live review rail: the PDP story
 * "Reviews" tab and the storefront front-page rail (which reuses .pdp-reviews
 * via .bbq-styles-reviews__rail). Mirrors the .bbq-styles-gallery-card
 * treatment (gradient fill, elevation, hover glow) so social
 * proof reads as merchandised trust cards instead of flat hairline columns.
 */
.pdp-reviews__item {
  display: flex;
  flex-direction: column;
  flex: 0 0 clamp(16rem, 40vw, 22rem);
  width: clamp(16rem, 40vw, 22rem);
  margin: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: clamp(1.35rem, 2.4vw, 1.9rem);
  border: 1px solid var(--bbq-styles-card-border, rgba(255, 255, 255, 0.34));
  border-radius: 0.65rem;
  background: linear-gradient(180deg, var(--color-dark-1) 0%, var(--color-dark-2) 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  text-align: left;
}

.pdp-reviews__item .menu-product-rating--review-row {
  display: block;
  margin-bottom: 0.4rem;
}

.pdp-reviews__item .menu-product-rating--review-row .menu-product-rating__stars {
  justify-content: flex-start;
}

.pdp-reviews__item .menu-product-rating--review-row,
.pdp-reviews__item .menu-product-rating--review-row .menu-product-rating__display {
  opacity: 1;
  visibility: visible;
}

.pdp-reviews__title {
  color: currentColor;
  letter-spacing: 0.08em;
}

/*
 * Signature pinned to the card base behind a gold hairline so authors align
 * across uneven quote lengths.
 */
.pdp-reviews__item .figure-testimonial__author {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--color-accent) 22%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .pdp-reviews__item {
    transition:
      transform 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86),
      border-color 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86),
      box-shadow 0.2s cubic-bezier(0.785, 0.135, 0.15, 0.86);
  }

  @media screen and (min-width: 768px) {
    .pdp-reviews__item:hover {
      border-color: var(--color-accent);
      box-shadow: 0 12px 36px rgba(0, 0, 0, 0.42), 0 0 22px var(--color-accent-soft);
      transform: translateY(-3px);
    }
  }
}
