/* ==========================================================================
   CourtStub — RTL overrides (html[dir="rtl"])
   Most layout already uses logical properties; this file mirrors the
   physical bits: masks, transforms, transform-origins and directional icons.
   ========================================================================== */

/* Directional icons (arrows, chevrons pointing sideways) */
[dir="rtl"] .i-dir { transform: scaleX(-1); }
[dir="rtl"] .link-arrow svg { transform: scaleX(-1); }
[dir="rtl"] .link-arrow:hover svg { transform: scaleX(-1) translateX(4px); }

/* Horizontal tickets: stub moves to the left, notches follow the perforation */
@media (min-width: 768px) {
  [dir="rtl"] .tk--h > .tk__body {
    border-radius: 4px var(--radius) var(--radius) 4px;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 0 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 0 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  }
  [dir="rtl"] .tk--h > .tk__stub {
    border-radius: var(--radius) 4px 4px var(--radius);
    background: linear-gradient(var(--line-strong) 50%, transparent 0) 100% var(--notch) / 2px 12px repeat-y, var(--grain), var(--paper);
    -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 100% 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
            mask: radial-gradient(circle var(--notch) at 100% 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at 100% 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  }
  /* Tear-off goes the other way */
  [dir="rtl"] .tk--h.is-tearing > .tk__stub { transform: translateX(-12px) rotate(-3deg); }
  [dir="rtl"] .tour-grid.is-list .tk > .tk__body { border-radius: 4px var(--radius) var(--radius) 4px; }
}
[dir="rtl"] .tk.is-tearing > .tk__stub { transform: translateY(10px) rotate(-2.5deg); }

/* Hero passes fan the other way and deal in from the left */
[dir="rtl"] .pass[data-pos="1"] { transform: translateX(-22%) rotate(-6deg) scale(.94); }
[dir="rtl"] .pass[data-pos="2"] { transform: translateX(22%) rotate(6deg) scale(.94); }
[dir="rtl"] .pass.is-dealing { animation-name: deal-rtl; }
[dir="rtl"] .pass.is-flipped .pass__inner { transform: rotateY(-180deg); }
[dir="rtl"] .pass__back { transform: rotateY(-180deg); }
[dir="rtl"] .flipcard.is-flipped .flipcard__btn { transform: rotateY(-180deg); }
[dir="rtl"] .flipcard__back { transform: rotateY(-180deg); }
@keyframes deal-rtl { from { opacity: 0; transform: translate(-40%, -30%) rotate(-18deg) scale(.9); } }
@media (max-width: 767.98px) {
  [dir="rtl"] .pass[data-pos="1"], [dir="rtl"] .pass[data-pos="2"] { transform: scale(.92); }
}

/* Off-canvas panels slide from the mirrored side */
[dir="rtl"] .mpanel__sheet { transform: translateX(-100%); }
[dir="rtl"] .mpanel.is-open .mpanel__sheet { transform: none; }
[dir="rtl"] .mnav > li { transform: translateX(-16px); }
[dir="rtl"] .mpanel.is-open .mnav > li { transform: none; }
@media (max-width: 1199.98px) {
  [dir="rtl"] .filters__panel { transform: translateX(100%); }
  [dir="rtl"] .filters.is-open .filters__panel { transform: none; }
}
@media (max-width: 767.98px) {
  [dir="rtl"] .dash-side { transform: translateX(100%); }
  [dir="rtl"] .dash.is-drawer .dash-side { transform: none; }
}

/* Switches, selects and progress fills */
[dir="rtl"] .switch input:checked + .switch__track::after { transform: translateX(-22px); }
[dir="rtl"] .select { background-position: 20px 21px, 15px 21px; }
[dir="rtl"] .toast__bar, [dir="rtl"] .bar__fill, [dir="rtl"] .progress i { transform-origin: right; }

/* Motion that travels sideways */
[dir="rtl"] .toast { animation-name: toast-in-rtl; }
[dir="rtl"] .toast.is-leaving { animation-name: toast-out-rtl; }
[dir="rtl"] .step-panel.is-entering { animation-name: step-in-rtl; }
@keyframes toast-in-rtl { from { opacity: 0; transform: translateX(-40px); } }
@keyframes toast-out-rtl { to { opacity: 0; transform: translateX(-40px); } }
@keyframes step-in-rtl { from { opacity: 0; transform: translateX(-16px); } }

/* Torn 404 ticket: the torn edges face each other */
[dir="rtl"] .torn-ticket__half:first-child {
  border-radius: 0 var(--radius) var(--radius) 0; transform: rotate(5deg);
  -webkit-mask: conic-gradient(from -135deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 10px 20px repeat-y, linear-gradient(#000 0 0) right / calc(100% - 10px) 100% no-repeat;
          mask: conic-gradient(from -135deg at left, #0000, #000 1deg 89deg, #0000 90deg) left / 10px 20px repeat-y, linear-gradient(#000 0 0) right / calc(100% - 10px) 100% no-repeat;
}
[dir="rtl"] .torn-ticket__half:last-child {
  border-radius: var(--radius) 0 0 var(--radius); transform: rotate(-4deg) translateY(10px);
  -webkit-mask: conic-gradient(from 45deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 10px 20px repeat-y, linear-gradient(#000 0 0) left / calc(100% - 10px) 100% no-repeat;
          mask: conic-gradient(from 45deg at right, #0000, #000 1deg 89deg, #0000 90deg) right / 10px 20px repeat-y, linear-gradient(#000 0 0) left / calc(100% - 10px) 100% no-repeat;
}

/* Admit stubs tilt the other way */
[dir="rtl"] .admit:hover { transform: rotate(-2deg) translateY(-2px); }

/* Numbers, prices, serials and IDs stay left-to-right and readable */
[dir="rtl"] .mono, [dir="rtl"] code, [dir="rtl"] .serial, [dir="rtl"] .countdown,
[dir="rtl"] .rline__v, [dir="rtl"] .tk__price b, [dir="rtl"] .plan__price b { unicode-bidi: isolate; }
[dir="rtl"] .rline__v { text-align: start; }
