/* ============================================================================
   AL-JUMAN DENTAL — DESIGN TOKENS & CUSTOM STYLES
   ----------------------------------------------------------------------------
   Palette:   --navy-950/800/600  (primary, trust)
              --ivory / --gray-100/300  (background, whitespace)
              --gold-500  (single premium accent, used sparingly — echoes a
              porcelain crown / gold filling, never a generic gradient)
   Type:      Display  -> "Fraunces"  (editorial serif, used only for large
                           headlines — carries the "specialist" feel)
              Body     -> "Inter"     (clean, highly legible at small sizes)
              Arabic   -> "Tajawal"   (display + body, warm geometric Naskh-
                           influenced sans, reads elegantly at both sizes)
   Signature: "The Arc" — a single thin arcing line, echoing a dental arch /
              an X-ray sweep. Appears once in the hero (large, ambient) and
              as a recurring section-divider motif. Everything else stays quiet.
   ============================================================================ */

:root {
  --navy-950: #071B30;
  --navy-800: #0A2540;
  --navy-600: #14385C;
  --navy-400: #3D5A78;
  --ivory: #FBFAF7;
  --gray-100: #F1F3F5;
  --gray-300: #DDE2E6;
  --gray-500: #8B98A5;
  --gold-500: #B8935A;
  --gold-300: #D8BD8E;

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-ar: "Tajawal", -apple-system, sans-serif;

  --shadow-soft: 0 4px 24px rgba(10, 37, 64, 0.06);
  --shadow-lift: 0 16px 40px rgba(10, 37, 64, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--navy-950);
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body,
html[lang="ar"] .font-display {
  font-family: var(--font-ar) !important;
}

.font-display { font-family: var(--font-display); }

/* Focus visibility — accessibility floor, never removed */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   THE ARC — signature motif
   -------------------------------------------------------------------------*/
.arc-divider {
  width: 100%;
  height: 48px;
  display: block;
  overflow: visible;
}
.arc-divider path {
  fill: none;
  stroke: var(--gold-500);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.55;
}
.hero-arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-arc path {
  fill: none;
  stroke: var(--gold-300);
  stroke-width: 1;
  opacity: 0.35;
}
.hero-arc .arc-draw {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawArc 2.2s var(--ease) 0.3s forwards;
}
@keyframes drawArc { to { stroke-dashoffset: 0; } }

/* ---------------------------------------------------------------------------
   LANGUAGE GATE
   -------------------------------------------------------------------------*/
#lang-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--navy-950);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
#lang-gate.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#lang-gate .gate-inner {
  text-align: center;
  padding: 2rem;
  max-width: 40rem;
}
#lang-gate .gate-logo {
  display: block;
  width: auto;
  height: 6rem;
  max-width: 8rem;
  object-fit: contain;
  margin: 0 auto 1.5rem;
}
@media (max-width: 640px) {
  #lang-gate .gate-logo {
    height: 5rem;
    max-width: 7rem;
  }
}
.lang-btn {
  font-family: var(--font-body);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.lang-btn:hover { transform: translateY(-3px); border-color: var(--gold-500); }

/* ---------------------------------------------------------------------------
   REVEAL-ON-SCROLL
   -------------------------------------------------------------------------*/
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------------------------------------------------------------------------
   CARDS
   -------------------------------------------------------------------------*/
.card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.card:hover { box-shadow: var(--shadow-lift); transform: translateY(-4px); }

/* ---------------------------------------------------------------------------
   NAV
   -------------------------------------------------------------------------*/
#main-nav {
  backdrop-filter: blur(10px);
  background: rgba(251, 250, 247, 0.88);
  transition: box-shadow 0.3s var(--ease);
}
#main-nav.scrolled { box-shadow: 0 1px 0 var(--gray-300); }
.nav-link {
  position: relative;
  color: var(--navy-800);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--gold-500);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease);
}
.nav-link:hover::after { transform: scaleX(1); }

/* Mobile nav */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease);
}
#mobile-menu.open { max-height: 32rem; }

/* ---------------------------------------------------------------------------
   BUTTONS
   -------------------------------------------------------------------------*/
.btn-primary {
  background: var(--navy-800);
  color: var(--ivory);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn-primary:hover { background: var(--navy-950); transform: translateY(-2px); }

.btn-gold {
  background: var(--gold-500);
  color: var(--navy-950);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn-gold:hover { background: var(--gold-300); transform: translateY(-2px); }

.btn-outline {
  border: 1px solid var(--navy-800);
  color: var(--navy-800);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn-outline:hover { background: var(--navy-800); color: var(--ivory); }

.btn-outline-light {
  border: 1px solid rgba(251, 250, 247, 0.5);
  color: var(--ivory);
  transition: background 0.3s var(--ease);
}
.btn-outline-light:hover { background: rgba(251, 250, 247, 0.12); }

/* ---------------------------------------------------------------------------
   FLOATING ACTION BUTTONS
   -------------------------------------------------------------------------*/
.fab {
  box-shadow: var(--shadow-lift);
  transition: transform 0.3s var(--ease);
}
.fab:hover { transform: scale(1.08); }

/* ---------------------------------------------------------------------------
   FAQ ACCORDION
   -------------------------------------------------------------------------*/
details.faq-item summary { list-style: none; cursor: pointer; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item .faq-icon { transition: transform 0.35s var(--ease); }
details.faq-item[open] .faq-icon { transform: rotate(45deg); }
details.faq-item .faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--ease);
}
details.faq-item[open] .faq-body { grid-template-rows: 1fr; }
details.faq-item .faq-body-inner { overflow: hidden; }

/* ---------------------------------------------------------------------------
   TESTIMONIAL MARQUEE (row of cards, gentle auto-scroll, pauses on hover)
   -------------------------------------------------------------------------*/
.review-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  animation: scrollTrack 46s linear infinite;
}
.review-track:hover { animation-play-state: paused; }
@keyframes scrollTrack {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
html[dir="rtl"] .review-track { animation-name: scrollTrackRTL; }
@keyframes scrollTrackRTL {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}
.review-card { flex: 0 0 21rem; }

/* ---------------------------------------------------------------------------
   LOADER
   -------------------------------------------------------------------------*/
#page-loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ivory);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------------
   MISC
   -------------------------------------------------------------------------*/
.section-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold-500);
  font-weight: 600;
}
.gray-bg { background: var(--gray-100); }

.star { color: var(--gold-500); }
.star-empty { color: var(--gray-300); }

#back-to-top {
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
}
#back-to-top.hidden-btn { opacity: 0; visibility: hidden; transform: translateY(10px); }

@media (max-width: 640px) {
  .review-card { flex: 0 0 16rem; }
  .fab-social-icon { width: 48px !important; height: 48px !important; }
}

/* ---------------------------------------------------------------------------
   ABOUT HEADING — Arabic-only size/weight bump. The Arabic heading ("قصة
   النجاح") is much shorter than its English counterpart, so it gets a
   slightly larger, bolder treatment to keep visual balance with the rest
   of the section. Same font family, color, and alignment as before.
   -------------------------------------------------------------------------*/
html[dir="rtl"] #about-title {
  font-size: 2.15rem;
  font-weight: 600;
}
@media (min-width: 640px) {
  html[dir="rtl"] #about-title { font-size: 2.6rem; }
}

/* ============================================================================
   V2 ADDITIONS — hero polish, treatment cards, modal, validation, animations
   ============================================================================ */

/* ---------------------------------------------------------------------------
   HERO — floating ambient orbs (behind the arc, very subtle, on-brand gold/navy)
   -------------------------------------------------------------------------*/
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.35;
}
.hero-orb--1 { width: 320px; height: 320px; background: radial-gradient(circle, var(--gold-500), transparent 70%); top: -60px; inset-inline-end: -60px; animation: floatOrb 12s ease-in-out infinite; }
.hero-orb--2 { width: 260px; height: 260px; background: radial-gradient(circle, var(--navy-400), transparent 70%); bottom: -80px; inset-inline-start: 10%; animation: floatOrb 15s ease-in-out infinite reverse; }
.hero-orb--3 { width: 180px; height: 180px; background: radial-gradient(circle, var(--gold-300), transparent 70%); top: 30%; inset-inline-start: -40px; animation: floatOrb 9s ease-in-out infinite; }
@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -22px) scale(1.06); }
}

/* Hero entrance choreography — staggered children */
.hero-stagger > * {
  opacity: 0;
  transform: translateY(18px);
  animation: heroIn 0.9s var(--ease) forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.hero-stagger > *:nth-child(2) { animation-delay: 0.18s; }
.hero-stagger > *:nth-child(3) { animation-delay: 0.32s; }
.hero-stagger > *:nth-child(4) { animation-delay: 0.46s; }
.hero-stagger > *:nth-child(5) { animation-delay: 0.6s; }
@keyframes heroIn { to { opacity: 1; transform: translateY(0); } }

.hero-image-in {
  opacity: 0;
  transform: translateY(0) scale(0.96);
  animation: heroImageIn 1.1s var(--ease) 0.3s forwards;
}
@keyframes heroImageIn { to { opacity: 1; transform: scale(1); } }

/* ---------------------------------------------------------------------------
   HERO STATS — counters + badges
   -------------------------------------------------------------------------*/
.stat-card {
  background: rgba(251, 250, 247, 0.06);
  border: 1px solid rgba(251, 250, 247, 0.12);
  border-radius: 1rem;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}
.stat-card:hover { border-color: var(--gold-500); background: rgba(251, 250, 247, 0.1); transform: translateY(-3px); }
.stat-value { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   TREATMENT CARDS — Apple-style: quiet by default, precise motion on hover
   -------------------------------------------------------------------------*/
.tx-book-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--navy-800); font-weight: 600; font-size: 0.875rem;
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}
.tx-book-btn svg { transition: transform 0.3s var(--ease); }
html[dir="rtl"] .tx-book-btn svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------------------
   SECTION DIVIDER GLOW — quiet ambient glow behind eyebrow labels
   -------------------------------------------------------------------------*/
.label-glow { position: relative; display: inline-block; }
.label-glow::before {
  content: "";
  position: absolute;
  inset: -12px -24px;
  background: radial-gradient(ellipse, rgba(184, 147, 90, 0.15), transparent 70%);
  z-index: -1;
}

/* ---------------------------------------------------------------------------
   REVIEW CARDS V3 — Google-review-inspired: source indicator, avatar/name/
   stars header, clamped body text so varying review lengths stay uniform.
   -------------------------------------------------------------------------*/
.review-card { position: relative; }
.review-card .line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   FAQ — refined icon rotation already handled by [open]; add subtle bg shift
   -------------------------------------------------------------------------*/
details.faq-item { transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
details.faq-item[open] { border-color: var(--gold-500); box-shadow: var(--shadow-lift); }

/* ---------------------------------------------------------------------------
   CONTACT FORM — live validation states
   -------------------------------------------------------------------------*/
.form-field { position: relative; }
.form-field input, .form-field textarea {
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.form-field.is-valid input, .form-field.is-valid textarea { border-color: #3F9D6E; }
.form-field.is-invalid input, .form-field.is-invalid textarea { border-color: #C15B4A; }
.form-check {
  position: absolute;
  top: 2.55rem;
  inset-inline-end: 0.9rem;
  color: #3F9D6E;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
}
.form-field.is-valid .form-check { opacity: 1; transform: scale(1); }
.form-error {
  font-size: 0.78rem;
  color: #C15B4A;
  margin-top: 0.4rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease), margin-top 0.3s var(--ease);
}
.form-field.is-invalid .form-error { max-height: 2rem; opacity: 1; }

.btn-primary[disabled] { opacity: 0.75; cursor: progress; }
.btn-spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(251, 250, 247, 0.35);
  border-top-color: var(--ivory);
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-primary.is-loading .btn-spinner { display: inline-block; }
.btn-primary.is-loading .btn-label { opacity: 0.85; }

#form-success {
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
#form-success.show { opacity: 1; transform: translateY(0) scale(1); }
#form-success svg { animation: checkPop 0.5s var(--ease) 0.1s backwards; }
@keyframes checkPop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------------------------------------------------------------------------
   BOOKING MODAL
   -------------------------------------------------------------------------*/
#booking-modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
}
#booking-modal.open { opacity: 1; visibility: visible; }
#booking-modal .modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(7, 27, 48, 0.6);
  backdrop-filter: blur(3px);
}
#booking-modal .modal-panel {
  position: relative;
  background: var(--ivory);
  border-radius: 1.75rem;
  max-width: 34rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lift);
  padding: 2.25rem;
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
}
#booking-modal.open .modal-panel { transform: translateY(0) scale(1); opacity: 1; }
.modal-close {
  position: absolute; top: 1.25rem; inset-inline-end: 1.25rem;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.modal-close:hover { background: var(--gray-300); transform: rotate(90deg); }

/* Small legal modal reuses the same shell with a smaller panel */
#legal-modal .modal-panel { max-width: 38rem; }

/* ---------------------------------------------------------------------------
   FLOATING BUTTONS — expand to reveal label on hover
   -------------------------------------------------------------------------*/
.fab-group { display: flex; align-items: center; }
.fab-expand {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 0.85rem;
  font-weight: 600;
  transition: max-width 0.35s var(--ease), opacity 0.3s var(--ease), padding 0.35s var(--ease);
}
.fab-group:hover .fab-expand,
.fab-group:focus-within .fab-expand {
  max-width: 10rem;
  opacity: 1;
  padding-inline-end: 1.1rem;
  padding-inline-start: 0.15rem;
}
.fab-group {
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  transition: transform 0.3s var(--ease);
}
.fab-group:hover { transform: scale(1.03); }

/* ---------------------------------------------------------------------------
   LOADER V2 — arch-drawing tooth/smile motif
   -------------------------------------------------------------------------*/
/* ---------------------------------------------------------------------------
   LOADER V2 — official logo, gentle premium pulse (replaces the old
   stroke-draw animation, which only works on an SVG path, now that the
   loader shows the real raster logo)
   -------------------------------------------------------------------------*/
#page-loader .loader-mark {
  height: 84px;
  width: auto;
  object-fit: contain;
  animation: loaderPulse 1.6s var(--ease) infinite;
}
@keyframes loaderPulse {
  0% { opacity: 0.5; transform: scale(0.94); }
  55% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 0.5; transform: scale(0.94); }
}
#page-loader .loader-text {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--gray-500);
}

/* ---------------------------------------------------------------------------
   DIRECTIONAL SCROLL REVEALS — data-anim on any section/element
   -------------------------------------------------------------------------*/
.reveal[data-anim="up"] { transform: translateY(28px); }
.reveal[data-anim="left"] { transform: translateX(-32px); }
.reveal[data-anim="right"] { transform: translateX(32px); }
.reveal[data-anim="scale"] { transform: scale(0.94); }
.reveal.in-view[data-anim] { transform: translate(0, 0) scale(1); }
html[dir="rtl"] .reveal[data-anim="left"] { transform: translateX(32px); }
html[dir="rtl"] .reveal[data-anim="right"] { transform: translateX(-32px); }

/* ---------------------------------------------------------------------------
   MISC POLISH — consistent radius language, softer card shadow default
   -------------------------------------------------------------------------*/
.card, .review-card, .modal-panel { border-radius: 1.5rem; }
.section-divider {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--gold-500);
  opacity: 0.6;
}
.section-divider::before, .section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

/* ---------------------------------------------------------------------------
   MAP EMBED — official clinic location, responsive width, fixed height band
   -------------------------------------------------------------------------*/
.map-embed-wrap {
  width: 100%;
  line-height: 0; /* collapse the iframe's inline-element gap */
}
.map-embed-iframe {
  display: block;
  width: 100% !important;
  height: 450px;
  border: 0;
}
@media (max-width: 640px) {
  .map-embed-iframe { height: 300px; }
}

/* ---------------------------------------------------------------------------
   BEFORE & AFTER CASE CAROUSELS — reuses the reviews track's exact
   continuous-slide technique (duplicated card set, seamless wrap) via
   JS transform, so the motion/pace/pause-on-hover feel is identical to
   .review-track above, with arrows/dots/drag layered on top in script.js.
   -------------------------------------------------------------------------*/
.case-carousel { display: flex; align-items: center; gap: 0.75rem; }
.case-viewport { flex: 1; overflow: hidden; }
.case-track {
  display: flex;
  gap: 1.25rem;
  width: max-content;
  will-change: transform;
}
.case-card { flex: 0 0 15.5rem; }
.case-image { box-shadow: var(--shadow-soft); transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease); }
.case-card:hover .case-image { box-shadow: var(--shadow-lift); transform: translateY(-3px); }

.case-arrow {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy-800);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease);
  flex-shrink: 0;
  cursor: pointer;
}
.case-arrow:hover { background: var(--navy-800); border-color: var(--navy-800); color: var(--ivory); }
html[dir="rtl"] .case-arrow-prev svg,
html[dir="rtl"] .case-arrow-next svg { transform: scaleX(-1); }

.case-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.case-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: background 0.3s var(--ease), transform 0.3s var(--ease);
}
.case-dot.active { background: var(--gold-500); transform: scale(1.25); }

@media (max-width: 640px) {
  .case-card { flex: 0 0 12rem; }
}

/* ---------------------------------------------------------------------------
   STORY IMAGE — landscape image + its container rotated 90deg as one unit.
   Reserves the exact swapped (rotated) footprint via a padding-percentage
   aspect box (no cropping/stretching — the inner box is sized to the
   image's exact natural ratio, 1280:435, then the whole box is rotated).
   .story-rotate-frame caps the unit's width so the rotated unit reads as a
   slim architectural accent (~same height as the section) rather than a
   full-column, oversized element.
   Disabled below the lg breakpoint (1024px), where the layout is
   single-column and the image is shown normally, unrotated, full width.
   -------------------------------------------------------------------------*/
.story-rotate-frame {
  width: clamp(120px, 13vw, 160px);
  margin-inline: auto;
}
.story-rotate-outer {
  position: relative;
  width: 100%;
  padding-top: 294.2529%; /* rotated footprint: width * (1280/435) */
  overflow: hidden;
}
.story-rotate-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 294.2529%;   /* pre-rotation width, matches image's natural ratio */
  height: 0;
  padding-top: 100%;  /* pre-rotation height = outer's width, i.e. 435:1280 ratio */
  transform: translate(-50%, -50%) rotate(90deg);
}
.story-rotate-inner img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@media (max-width: 1023.98px) {
  .story-rotate-frame { width: 100%; margin-inline: 0; }
  .story-rotate-outer { padding-top: 0; }
  .story-rotate-inner {
    position: static;
    width: 100%;
    height: auto;
    padding-top: 0;
    transform: none;
  }
  .story-rotate-inner img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}
