/* HealTrip navigation polish (pairs with enhance.js). */

/* Page transitions: the logo and header stay put while the page content fades and rises. */
@view-transition { navigation: auto; }
[data-m="hm-hdr"], .ht-top { view-transition-name: ht-header; }
[data-m="hm-brand"] .ht-logo, .ht-top .brand { view-transition-name: ht-logo; }
::view-transition-old(root) { animation: ht-vt-out .28s ease both; }
::view-transition-new(root) { animation: ht-vt-in .46s cubic-bezier(.16, 1, .3, 1) both; }
::view-transition-group(ht-logo) { animation-duration: .46s; }
::view-transition-new(ht-logo) { animation: ht-vt-logo .7s ease both; }
@keyframes ht-vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes ht-vt-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes ht-vt-logo { 0% { filter: brightness(1); } 40% { filter: brightness(1.35) drop-shadow(0 0 10px rgba(25, 195, 214, .55)); } 100% { filter: none; } }

/* Brand progress bar */
.ht-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 2147483002; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  background: linear-gradient(90deg, #011F55, #0a4fd6 45%, #19c3d6); box-shadow: 0 0 12px rgba(25, 195, 214, .6); }
[dir="rtl"] .ht-progress, html[dir="rtl"] .ht-progress { transform-origin: 100% 50%; }
.ht-progress.run { opacity: 1; transition: transform 1.2s cubic-bezier(.1, .8, .2, 1); transform: scaleX(.8); }
.ht-progress.run.done { transition: transform .25s ease, opacity .35s ease .2s; transform: scaleX(1); opacity: 0; }

/* Services mega menu */
.ht-mega { position: fixed; inset-inline: 0; margin: 0 auto; width: min(1080px, 94vw); z-index: 2147482000; display: grid; grid-template-columns: 1fr 260px; gap: 0;
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(16px); border: 1px solid #e3ecf5; border-radius: 22px; box-shadow: 0 30px 80px rgba(1, 31, 85, .18);
  font-family: "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif; color: #0b2347; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s ease, transform .25s ease, visibility .2s; }
.ht-mega.open { opacity: 1; visibility: visible; transform: none; }
.ht-mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 18px; }
.ht-mega-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: inherit; transition: background .15s; }
.ht-mega-item:hover, .ht-mega-item:focus-visible { background: #eef5fd; outline: none; }
.ht-mega-item .n { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 13px "Readex Pro", sans-serif; color: #fff;
  background: linear-gradient(135deg, #011F55, #0a4fd6 60%, #19c3d6); }
.ht-mega-item b { display: block; font-size: 15px; color: #011F55; }
.ht-mega-item small { display: block; font-size: 13px; color: #5b6d86; line-height: 1.6; }
.ht-mega-side { background: radial-gradient(400px 260px at 80% 0%, #0b3f86, #011F55 70%); color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.ht-mega-kicker { align-self: flex-start; font-size: 12px; color: #bff9ff; border: 1px solid rgba(191, 249, 255, .35); border-radius: 999px; padding: 2px 10px; }
.ht-mega-side strong { font-size: 20px; line-height: 1.5; }
.ht-mega-side a { display: block; text-align: center; text-decoration: none; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14px; }
.ht-mega-all { background: #fff; color: #011F55; margin-top: auto; }
.ht-mega-join { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
@media (max-width: 1099px) { .ht-mega { display: none; } }

/* Breadcrumbs */
.ht-bc { position: relative; z-index: 5; background: rgba(245, 249, 252, .92); border-bottom: 1px solid #e3ecf5; font: 500 13.5px "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif; }
.ht-bc .in { max-width: 1240px; margin: 0 auto; padding: 9px 20px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: #5b6d86; }
.ht-bc a { color: #0a4fd6; text-decoration: none; }
.ht-bc a:hover { text-decoration: underline; }
.ht-bc i { font-style: normal; color: #9fb0c6; }
[dir="rtl"] .ht-bc i { display: inline-block; transform: scaleX(-1); }
.ht-bc span { color: #0b2347; font-weight: 600; }

/* Previous / next service */
.ht-pn { max-width: 1120px; margin: 40px auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-family: "IBM Plex Sans Arabic", "Readex Pro", system-ui, sans-serif; }
.ht-pn a { display: block; text-decoration: none; background: #fff; border: 1px solid #e3ecf5; border-radius: 18px; padding: 18px 22px; transition: transform .2s, box-shadow .2s; }
.ht-pn a:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(1, 31, 85, .12); }
.ht-pn small { display: block; color: #5b6d86; font-size: 13px; }
.ht-pn b { display: block; color: #011F55; font-size: 18px; margin-top: 4px; }
.ht-pn .next { text-align: end; }
@media (max-width: 640px) { .ht-pn { grid-template-columns: 1fr; } }

/* Back to top */
.ht-top-btn { position: fixed; bottom: 20px; right: 20px; z-index: 2147482500; width: 50px; height: 50px; border-radius: 50%; border: 1px solid #e3ecf5; cursor: pointer;
  background: #fff; color: #0a4fd6; box-shadow: 0 10px 30px rgba(1, 31, 85, .18); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility .25s; }
.ht-top-btn.show { opacity: 1; visibility: visible; transform: none; }
.ht-top-btn:hover { color: #fff; background: linear-gradient(135deg, #011F55, #0a4fd6 60%, #19c3d6); }
.ht-top-btn svg { width: 28px; height: 28px; }
@media (max-width: 480px) { .ht-top-btn { width: 44px; height: 44px; bottom: 14px; right: 14px; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .ht-progress, .ht-mega, .ht-top-btn { transition: none !important; }
}

/* ---------- accessibility: skip link + visible keyboard focus ---------- */
.ht-skip { position: fixed; top: 10px; inset-inline-start: 10px; z-index: 10000; transform: translateY(-160%);
  background: #011F55; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; text-decoration: none;
  box-shadow: 0 8px 24px rgba(1, 31, 85, .3); transition: transform .2s ease; }
.ht-skip:focus { transform: none; outline: 3px solid #19c3d6; outline-offset: 2px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #19c3d6 !important; outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
