/* Pacific Pain Clinic — UI & Motion Polish v1.0
   Scoped to existing theme components. No structural/content changes. */
:root{--ppc-polish-ease:cubic-bezier(.22,1,.36,1)}
/* Contrast and typography are accessibility fixes at all viewport widths. */
.medx-fast-grid .medx-fast-card{min-width:0}
.medx-fast-grid .medx-fast-top{min-width:0}
.medx-fast-grid .medx-fast-card h2{
  min-width:0;max-width:100%;overflow-wrap:break-word;
  font-size:clamp(19px,1.7vw,23px);line-height:1.18;letter-spacing:-.038em;
}
.medx-fast-grid .medx-fast-card.medx-fast-1 h2,
.medx-fast-grid .medx-fast-card.medx-fast-3 h2{
  color:#fff!important;-webkit-text-fill-color:#fff!important
}
.medx-fast-grid .medx-fast-card.medx-fast-1 p,
.medx-fast-grid .medx-fast-card.medx-fast-3 p{color:#f0f5fa!important;opacity:1}
.medx-fast-grid .medx-fast-card.medx-fast-1 .medx-feature-number,
.medx-fast-grid .medx-fast-card.medx-fast-3 .medx-feature-number{color:#dbe9f6!important;opacity:1}
/* Make content motion lighter and consistent instead of multiple full-section reveals. */
.medx-motion-ready .medx-reveal{
  transform:translate3d(0,22px,0);
  transition:opacity .54s var(--ppc-polish-ease),transform .54s var(--ppc-polish-ease);
}
.medx-motion-ready .medx-reveal.is-inview{transform:translate3d(0,0,0)}
/* Polished hero copy stagger without affecting slide layout or focus. */
@keyframes ppcPolishHeroEnter{
  from{opacity:0;transform:translate3d(0,19px,0)}
  to{opacity:1;transform:translate3d(0,0,0)}
}
@media(prefers-reduced-motion:no-preference){
  .medx-slide.is-active .medx-hero-content>.medx-eyebrow,
  .medx-slide.is-active .medx-hero-content>h1,
  .medx-slide.is-active .medx-hero-content>.medx-hero-heading,
  .medx-slide.is-active .medx-hero-content>p,
  .medx-slide.is-active .medx-hero-content>.medx-btn{
    animation:ppcPolishHeroEnter .58s var(--ppc-polish-ease) both
  }
  .medx-slide.is-active .medx-hero-content>h1,
  .medx-slide.is-active .medx-hero-content>.medx-hero-heading{animation-delay:.07s}
  .medx-slide.is-active .medx-hero-content>p{animation-delay:.13s}
  .medx-slide.is-active .medx-hero-content>.medx-btn{animation-delay:.19s}
}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .medx-fast-grid .medx-fast-card{
    transition:transform .32s var(--ppc-polish-ease),box-shadow .32s var(--ppc-polish-ease)
  }
  .medx-fast-grid .medx-fast-card:hover{transform:translate3d(0,-5px,0)}
  .medx-fast-grid .medx-fast-card .medx-feature-icon{transition:transform .36s var(--ppc-polish-ease),opacity .36s ease}
  .medx-fast-grid .medx-fast-card:hover .medx-feature-icon{transform:rotate(-6deg) scale(1.04);opacity:.56}
  .medx-btn-primary:hover .medx-btn-icon{transform:translate3d(2px,-2px,0)}
}
.medx-btn-primary .medx-btn-icon{transition:transform .24s var(--ppc-polish-ease)}
/* More reliable focus indication for card links and interactive buttons. */
.medx-fast-card:focus-visible,.medx-category-card:focus-visible,
.ppcx-carousel-controls button:focus-visible{
  outline:3px solid #247da2;outline-offset:3px;
}
@media(max-width:1199px){
  .medx-fast-grid .medx-fast-card h2{font-size:clamp(19px,2.4vw,23px)}
}
@media(max-width:630px){
  .medx-fast-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .medx-fast-grid .medx-fast-card{
    min-width:0;min-height:230px;padding:16px 14px;border-radius:16px;
  }
  .medx-fast-grid .medx-fast-top{display:block;position:relative;min-height:66px}
  .medx-fast-grid .medx-fast-card h2{
    display:block;max-width:100%;margin:0 0 12px;
    padding:20px 0 0;font-size:clamp(14px,3.8vw,17px);
    line-height:1.21;letter-spacing:-.04em;overflow-wrap:anywhere;
  }
  .medx-fast-grid .medx-fast-card .medx-feature-number{
    position:absolute;right:0;top:0;font-size:12px;line-height:1.2;
  }
  .medx-fast-grid .medx-fast-card p{
    max-width:100%;font-size:clamp(11px,2.8vw,12px);line-height:1.58;
    overflow-wrap:break-word;
  }
  .medx-fast-grid .medx-feature-icon{margin-top:auto}
  .medx-fast-grid .medx-feature-icon svg{width:42px;height:42px}
  .medx-fast-services{padding-top:33px;padding-bottom:44px}
  /* Keep mobile transitions subtle and do not hide content until observed. */
  .medx-motion-ready .medx-reveal{
    transform:translate3d(0,11px,0);
    transition:opacity .37s ease-out,transform .37s ease-out;
    transition-delay:0ms;
  }
  .medx-motion-ready .medx-reveal.is-inview{transform:none}
  /* Larger hit areas for carousel pagination on touch devices. */
  .ppcx-carousel-dots button{
    width:36px!important;height:36px!important;position:relative;
    background:transparent!important;transform:none!important;
    display:grid;place-items:center;
  }
  .ppcx-carousel-dots button::after{
    content:"";width:8px;height:8px;border-radius:50%;
    background:#a7bdd9;transition:background .2s ease,transform .2s ease;
  }
  .ppcx-carousel-dots button.is-active::after,
  .ppcx-carousel-dots button[aria-current="true"]::after{
    background:#286da3;transform:scale(1.35)
  }
  .medx-slide.is-active .medx-hero-content>h1,
  .medx-slide.is-active .medx-hero-content>.medx-hero-heading{animation-duration:.43s}
}
/* Ensure very narrow phones don't crop long medical labels. */
@media(max-width:359px){
  .medx-fast-grid{grid-template-columns:1fr;gap:12px}
  .medx-fast-grid .medx-fast-card{min-height:200px;padding:20px}
  .medx-fast-grid .medx-fast-card h2{font-size:21px;padding-top:16px}
  .medx-fast-grid .medx-fast-card p{font-size:13px}
}
/* Retain the original two reverse-moving review rows on touch devices.
   Movement is still paused by the existing reduced-motion accessibility control. */
/* Complete the six-card care grid without affecting other sections. */
@media(min-width:992px){.medx-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
.medx-category-grid .medx-category-all{background:#eff8fb;border-color:#cde6ef}
.medx-category-grid .medx-category-all .medx-category-emblem{color:#298aa4}
.medx-category-grid .medx-category-all[aria-pressed="true"]{background:#0f1e4c;color:#fff}
/* Back-to-top remains opposite the default right-side ElevenLabs button.
   The AI widget itself has no theme-specific sizing or positioning. */
.medx-back-to-top{
 right:auto!important;
 left:14px!important;
 bottom:22px!important;
}
@media(max-width:630px){
 .medx-back-to-top{
  right:auto!important;
  left:12px!important;
  bottom:calc(103px + env(safe-area-inset-bottom))!important;
 }
}
@media(max-width:380px){
 .medx-back-to-top{width:44px;height:44px}
 .medx-back-to-top span{width:36px;height:36px;font-size:20px}
}
/* Stable mobile ElevenLabs position. The initial dock gap is calibrated once
   when the original widget loads, never recalculated while scrolling/resizing.
   Keep desktop and the native widget's width and internal appearance untouched. */
@media (max-width:630px){
  elevenlabs-convai{
    bottom:var(--ppc-elevenlabs-mobile-bottom,calc(72px + env(safe-area-inset-bottom)))!important;
    transition:none!important;
  }
}

/* ElevenLabs uses its official Shadow DOM host and internal layout. Do not constrain it from the theme. */
/* Reduced motion preference always wins. */
@media(prefers-reduced-motion:reduce){
  .medx-slide .medx-hero-content>*{animation:none!important}
  .medx-motion-ready .medx-reveal{opacity:1!important;transform:none!important;transition:none!important}
  .medx-fast-grid .medx-fast-card,.medx-fast-grid .medx-feature-icon{transition:none!important}
}
