/* ==========================================================================
   SAJ Dental Clinic — "Patient Stories" section
   Scope: every selector is prefixed patient-stories / patient-story. Visual
   values are CSS custom properties for future Elementor widget controls.
   ========================================================================== */

/* Standalone preview page only (patient-stories.html) */
.patient-stories-preview {
  margin: 0;
  background: #FFFFFF;
}

.patient-stories-section {
  /* ---- Colours ---- */
  --ps-navy: #10265B;
  --ps-orange: #FF4B0B;
  --ps-orange-strong: #E23D00;
  --ps-bg: #F4F9FF;
  --ps-light-blue: #DDEEFF;
  --ps-card-bg: #FFFFFF;
  --ps-text: #53658B;

  /* ---- Typography ---- */
  --ps-font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --ps-font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ps-heading-size: clamp(44px, 6.2vw, 94px);

  /* ---- Layout ---- */
  --ps-max-width: 1360px;
  --ps-gutter: clamp(20px, 3.6vw, 56px);
  --ps-spacing: clamp(64px, 7vw, 110px);
  --ps-gap: 24px;
  --ps-per-view: 3;                        /* cards visible at once */
  --ps-radius: 30px;
  --ps-image-height: 245px;

  /* ---- Background (set to none for gradients only) ---- */
  --ps-bg-image: url("../images/testimonial-bg.png");
  --ps-bg-position: center top;

  --ps-ease: cubic-bezier(0.22, 1, 0.36, 1);

  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: var(--ps-spacing) 0;
  background-color: var(--ps-bg);
  background-image:
    radial-gradient(55% 40% at 50% 14%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 70%),
    var(--ps-bg-image),
    linear-gradient(180deg, #F7FBFF 0%, var(--ps-bg) 100%);
  background-position: center, var(--ps-bg-position), center;
  background-size: auto, cover, auto;
  background-repeat: no-repeat;
  font-family: var(--ps-font-body);
  color: var(--ps-text);
  -webkit-font-smoothing: antialiased;
}

.patient-stories-section *,
.patient-stories-section *::before,
.patient-stories-section *::after {
  box-sizing: border-box;
}

.patient-stories-container {
  max-width: var(--ps-max-width);
  margin: 0 auto;
  padding: 0 var(--ps-gutter);
}

.patient-stories-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   Header
   ========================================================================== */
.patient-stories-header {
  max-width: 820px;
  margin: 0 auto clamp(32px, 3.6vw, 48px);
  text-align: center;
}

.patient-stories-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2vw, 28px);
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ps-navy);
}

.patient-stories-line {
  display: block;
  flex: 0 0 auto;
  width: clamp(36px, 6.6vw, 96px);
  height: 1.5px;
  background: var(--ps-orange);
  transform-origin: 100% 50%;          /* grows outward from the text */
}

.patient-stories-line--end {
  transform-origin: 0 50%;
}

.patient-stories-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 0.24em;
  margin: clamp(12px, 1.4vw, 18px) 0 clamp(12px, 1.4vw, 18px);
  font-family: var(--ps-font-display);
  font-size: var(--ps-heading-size);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ps-navy);
}

.patient-stories-word {
  display: inline-block;
  overflow: hidden;
  padding: 0.04em 0.08em 0.14em;
  margin: 0 -0.08em -0.14em;
}

.patient-stories-word-inner {
  display: inline-block;
}

.patient-stories-highlight {
  font-style: italic;
  font-weight: 500;
  color: var(--ps-orange);
}

.patient-stories-description {
  max-width: 750px;
  margin: 0 auto;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.4;
  color: var(--ps-text);
}

/* ==========================================================================
   Carousel
   ========================================================================== */
.patient-stories-carousel {
  position: relative;
  outline: none;
}

.patient-stories-carousel:focus-visible {
  outline: 3px solid var(--ps-orange);
  outline-offset: 8px;
  border-radius: 12px;
}

/* Extra padding lets card shadows breathe inside the clipped viewport. */
.patient-stories-viewport {
  overflow: hidden;
  margin: -40px -40px -24px;
  padding: 40px 40px 60px;          /* room for the full card shadow (no hard clip line) */
  touch-action: pan-y;
}

.patient-stories-track {
  display: flex;
  gap: var(--ps-gap);
  will-change: transform;
}

.patient-story-card {
  display: flex;
  flex: 0 0 calc((100% - var(--ps-gap) * (var(--ps-per-view) - 1)) / var(--ps-per-view));
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 6px;
  border-radius: var(--ps-radius);
  background: var(--ps-card-bg);
  box-shadow: 0 26px 50px -34px rgba(16, 38, 91, 0.42), 0 2px 8px -4px rgba(16, 38, 91, 0.08);
}

.patient-story-image {
  position: relative;
  height: var(--ps-image-height);
  overflow: hidden;
  border-radius: calc(var(--ps-radius) - 6px) calc(var(--ps-radius) - 6px) 0 0;
  background: var(--ps-light-blue);
}

.patient-story-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--ps-image-position, 50% 30%);
  -webkit-user-drag: none;
  user-select: none;
}

.patient-story-content {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 44px clamp(22px, 2.2vw, 32px) clamp(22px, 2.2vw, 30px);
}

.patient-story-quote-icon {
  position: absolute;
  top: -32px;
  left: clamp(22px, 2.2vw, 32px);
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 12px 26px -12px rgba(16, 38, 91, 0.35);
  color: var(--ps-orange);
}

.patient-story-quote-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.patient-story-quote {
  flex: 1 1 auto;                      /* equal card heights: meta pinned to bottom */
  margin: 0;
}

.patient-story-quote p {
  margin: 0;
  font-size: clamp(16.5px, 1.35vw, 20px);
  line-height: 1.5;
  color: var(--ps-text);
}

.patient-story-divider {
  display: block;
  width: 45px;
  height: 2px;
  margin: 22px 0 20px;
  border-radius: 2px;
  background: var(--ps-orange);
}

.patient-story-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.patient-story-person {
  min-width: 0;
}

.patient-story-name {
  margin: 0 0 4px;
  font-family: var(--ps-font-display);
  font-size: clamp(19px, 1.5vw, 22px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ps-navy);
}

.patient-story-treatment {
  margin: 0;
  font-size: clamp(14px, 1.1vw, 16px);
  color: var(--ps-text);
}

.patient-story-rating {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
  color: var(--ps-orange);
}

.patient-story-rating svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.patient-story-rating svg.is-empty {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* ---- Controls ---- */
.patient-stories-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 4px;
}

.patient-stories-arrow {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ps-navy);
  box-shadow: 0 12px 26px -14px rgba(16, 38, 91, 0.45);
  cursor: pointer;
  transition: transform 0.35s var(--ps-ease), box-shadow 0.35s ease, background-color 0.3s ease;
}

.patient-stories-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ps-ease);
}

.patient-stories-arrow:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 30px -14px rgba(16, 38, 91, 0.55);
}

.patient-stories-arrow[data-ps-prev]:hover svg { transform: translateX(-2px); }
.patient-stories-arrow[data-ps-next]:hover svg { transform: translateX(2px); }

.patient-stories-arrow:active {
  transform: scale(0.96);
}

.patient-stories-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 24px hit area around a 10px dot */
.patient-stories-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.patient-stories-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ps-light-blue);
  transition: background-color 0.3s ease, transform 0.3s var(--ps-ease);
}

.patient-stories-dot:hover::before {
  transform: scale(1.2);
}

.patient-stories-dot[aria-current="true"]::before {
  background: var(--ps-orange);
  transform: scale(1.15);
}

.patient-stories-arrow:focus-visible,
.patient-stories-dot:focus-visible {
  outline: 3px solid var(--ps-orange);
  outline-offset: 2px;
  border-radius: 50%;
}

/* ==========================================================================
   CTA
   ========================================================================== */
.patient-stories-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: clamp(24px, 2.6vw, 36px);
}

.patient-stories-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  width: 325px;
  max-width: 100%;
  min-height: 70px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--ps-orange);
  color: #FFFFFF;
  font-family: var(--ps-font-display);
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 20px 36px -18px rgba(255, 75, 11, 0.85);
  transition: transform 0.4s var(--ps-ease), box-shadow 0.4s ease, background-color 0.3s ease;
}

.patient-stories-cta-arrow {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.4s var(--ps-ease);
}

.patient-stories-cta:hover,
.patient-stories-cta:focus-visible {
  background: var(--ps-orange-strong);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 26px 40px -18px rgba(226, 61, 0, 0.9);
}

.patient-stories-cta:hover .patient-stories-cta-arrow,
.patient-stories-cta:focus-visible .patient-stories-cta-arrow {
  transform: translateX(5px);
}

.patient-stories-cta:focus-visible {
  outline: 3px solid var(--ps-navy);
  outline-offset: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet: two cards */
@media (max-width: 1199.98px) {
  .patient-stories-section {
    --ps-per-view: 2;
    --ps-gap: 20px;
    --ps-image-height: 240px;
  }
}

/* Mobile: one card, swipeable */
@media (max-width: 767.98px) {
  .patient-stories-section {
    --ps-per-view: 1;
    --ps-gutter: 20px;
    --ps-spacing: 60px;
    --ps-heading-size: clamp(42px, 13vw, 52px);
    --ps-image-height: clamp(220px, 62vw, 260px);
    --ps-radius: 24px;
  }

  .patient-stories-eyebrow {
    font-size: 12px;
    letter-spacing: 2.5px;
  }

  .patient-stories-viewport {
    margin: -20px -20px -20px;
    padding: 20px 20px 48px;
  }

  .patient-story-content {
    padding: 42px 20px 22px;
  }

  .patient-story-quote-icon {
    left: 20px;
  }

  .patient-stories-navigation {
    gap: 14px;
  }

  .patient-stories-arrow {
    width: 48px;
    height: 48px;
  }

  .patient-stories-cta {
    width: 100%;
    max-width: 340px;
  }
}

@media (max-width: 359.98px) {
  .patient-stories-eyebrow {
    letter-spacing: 1.5px;
    gap: 10px;
  }

  .patient-stories-line {
    width: 24px;
  }

  .patient-story-meta {
    flex-wrap: wrap;
  }

  .patient-story-rating svg {
    width: 18px;
    height: 18px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .patient-stories-section *,
  .patient-stories-section *::before {
    transition-duration: 0.01ms !important;
  }
}
