/* Penile fracture page styles.
   Builds on page-venous-leak.css (.vl-page) and page-frenuloplasty.css
   (.fr-included strip). New here: the click-through organ viewer (.pfv),
   used twice: "what happens" in the overview and the repair steps in the
   treatment section. Each step is a 3D render with one pulsing hotspot and
   a short caption; the script at the bottom of the page switches steps. */

.pfv{background:#fff;border:1px solid var(--c-line)}
.pfv-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--c-line)}
.pfv-tab{display:flex;align-items:center;justify-content:center;gap:8px;padding:14px 8px;background:#fff;border:0;border-right:1px solid var(--c-line);font:inherit;font-size:15px;font-weight:600;color:var(--c-text-soft);cursor:pointer;transition:background .2s,color .2s}
.pfv-tab:last-child{border-right:0}
.pfv-tab span{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;border:1px solid var(--c-primary-600);font-size:13px;color:var(--c-primary-700);transition:background .2s,color .2s}
.pfv-tab:hover{background:var(--c-bg-alt)}
.pfv-tab.is-on{background:var(--c-primary-950);color:#fff}
.pfv-tab.is-on span{background:var(--c-primary-300);border-color:var(--c-primary-300);color:var(--c-primary-950)}
.pfv-tab:focus-visible{outline:2px solid var(--c-primary-600);outline-offset:-2px}

/* Steps are stacked in one grid cell so the box keeps the height of the
   tallest caption and switching steps never makes the page jump. */
.pfv-stage{position:relative;display:grid}
.pfv-step{grid-area:1/1;margin:0;opacity:0;visibility:hidden;transition:opacity .45s ease,visibility .45s}
.pfv-step.is-on{opacity:1;visibility:visible}
.pfv-media{position:relative;aspect-ratio:1376/768;background:#dfe6ec;overflow:hidden}
.pfv-media img{display:block;width:100%;height:100%;object-fit:cover;transform:scale(1.04);transition:transform 1.2s ease}
.pfv-step.is-on .pfv-media img{transform:scale(1)}

.pfv-spot{position:absolute;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;background:#fff;border:4px solid var(--c-primary-600);box-shadow:0 2px 6px rgba(0,0,0,.25)}
.pfv-spot::before{content:"";position:absolute;inset:-12px;border-radius:50%;border:2px solid #fff;animation:pfv-pulse 1.8s ease-out infinite}
.pfv-spot em{position:absolute;left:50%;bottom:calc(100% + 12px);transform:translateX(-50%);padding:5px 10px;background:var(--c-primary-950);color:#fff;font-size:13px;font-style:normal;font-weight:600;white-space:nowrap}
.pfv-spot em::after{content:"";position:absolute;left:50%;top:100%;margin-left:-6px;border:6px solid transparent;border-top-color:var(--c-primary-950)}
@keyframes pfv-pulse{0%{transform:scale(.5);opacity:1}100%{transform:scale(1.6);opacity:0}}

.pfv-step figcaption{padding:18px 22px 20px;font-size:15px;line-height:1.6;color:var(--c-text-soft)}
.pfv-step figcaption strong{display:block;margin-bottom:4px;font-size:17px;color:var(--c-text)}

.pfv-navs{position:absolute;top:0;left:0;right:0;z-index:2;aspect-ratio:1376/768;display:flex;align-items:center;justify-content:space-between;padding:0 12px;pointer-events:none}
.pfv-nav{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.92);box-shadow:0 2px 8px rgba(0,0,0,.18);color:var(--c-primary-950);font-size:22px;line-height:1;cursor:pointer;pointer-events:auto}
.pfv-nav:disabled{opacity:.35;cursor:default}

.pfv-bar{height:3px;background:var(--c-bg-alt)}
.pfv-bar span{display:block;height:100%;width:33.34%;background:var(--c-primary-600);transition:width .45s ease}

@media (max-width:560px){
  .pfv-tab{flex-direction:column;gap:4px;font-size:13px;padding:10px 4px}
  .pfv-spot em{font-size:12px}
  .pfv-step figcaption{padding:14px 16px 16px}
}
@media (prefers-reduced-motion:reduce){
  .pfv-step,.pfv-media img,.pfv-bar span{transition:none}
  .pfv-spot::before{animation:none}
}
