/* ==========================================================================
   momenmedhat.com — home.css  (one-page "vCard": / and /ar/)
   Desktop ≥1100px: [icon rail] [profile card] [content]  — rail + card stay in view (sticky)
   Below 1100px: single column + floating menu pill (as the original mobile layout)
   ========================================================================== */

body.home {
  background: var(--home-bg);
  color: var(--text);
  font-family: var(--font-home);
  font-size: 15px;
  line-height: 32px;
}

/* ---------- shared bits ---------- */
.card {
  position: relative;
  padding: clamp(22px, 4%, 36px);
  border: 1px solid var(--line-1);
  background: var(--home-card);
}
.badge {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  padding: 7px 24px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  font-size: 15px; line-height: 24px; font-weight: 400; letter-spacing: .01em; text-transform: uppercase;
}
:lang(ar) .badge { text-transform: none; }
.badge .icon { font-size: 15px; }
.card h2 { font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -.005em; }
.card p { font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- layout ---------- */
.vcard {
  display: grid;
  grid-template-columns: 6fr 28fr 60fr;
  column-gap: 1vw;
  align-items: start;
  padding: 2vw 2vw 3vw;
  max-width: 2000px;
  margin-inline: auto;
}

/* ---------- icon rail ---------- */
.rail {
  position: sticky; top: 2.5vw;
  display: flex; flex-direction: column; align-items: center; gap: 36px;
  padding: 36px 0 34px;
  border: 1px solid var(--line-1); border-radius: var(--r-lg);
  background: var(--home-card);
  z-index: var(--z-sticky);
}
.rail__list { display: flex; flex-direction: column; gap: 9px; list-style: none; padding: 0; margin: 0; }
.rail__link {
  position: relative; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50px;
  color: var(--text); text-decoration: none;
  transition: color var(--dur), background-color var(--dur);
}
.rail__link .icon { width: 19px; height: 19px; }
.rail__link:hover { color: var(--gold); }
.rail__link[aria-current="true"] { background: var(--gold); color: var(--on-gold); }
.rail__tip {
  position: absolute; inset-inline-start: calc(100% + 14px); top: 50%;
  padding: 4px 12px; border-radius: 8px; white-space: nowrap;
  background: var(--gold); color: var(--on-gold);
  font-size: 13px; line-height: 20px; font-weight: 600;
  opacity: 0; transform: translate(-6px, -50%); pointer-events: none;
  transition: opacity var(--dur), transform var(--dur) var(--ease-out);
}
[dir="rtl"] .rail__tip { transform: translate(6px, -50%); }
.rail__link:hover .rail__tip, .rail__link:focus-visible .rail__tip { opacity: 1; transform: translate(0, -50%); }
.lang { display: flex; align-items: center; justify-content: center; gap: 14px; }
.lang a { display: grid; place-items: center; min-width: 30px; min-height: 30px; border-radius: 6px; opacity: .75; transition: opacity var(--dur); }
.lang a:hover, .lang a[aria-current="true"] { opacity: 1; }
.lang img { width: 18px; height: 12px; border-radius: 2px; }

/* ---------- profile card ---------- */
.profile {
  position: sticky; top: 2.5vw;
  display: flex; flex-direction: column; gap: 14px;
  max-height: calc(100vh - 5vw); overflow: auto; scrollbar-width: none;
  border: 1px solid var(--line-1); border-radius: 31px 0 31px 31px;
  background: var(--home-card);
  text-align: center;
}
[dir="rtl"] .profile { border-radius: 0 31px 31px 31px; }
.profile::-webkit-scrollbar { display: none; }
.profile__photo { padding: 2% 2% 0; }
/* Always square (the portrait is square), so it is never cropped: on short screens it gets
   smaller instead of wider-than-tall, which used to cut off the top of the head. */
.profile__photo img {
  /* as big as the card allows, but never taller than the screen space left after the rest of the card (~380px) */
  width: min(90%, max(180px, calc(100vh - 2.5vw - 380px)));
  margin-inline: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 0%;
  border-radius: 30px 0 30px 30px;
}
[dir="rtl"] .profile__photo img { border-radius: 0 30px 30px 30px; }
.profile__role { margin-top: 10px; color: var(--gold); font-size: 18px; line-height: 26px; font-weight: 300; }
.profile__name { padding-inline: 12px; font-size: 27px; line-height: 32px; font-weight: 500; }
.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; padding: 4px 10% 22px; list-style: none; margin: 0; }
.social a {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line-4); border-radius: var(--r-sm);
  color: var(--text); transition: color var(--dur), border-color var(--dur), background-color var(--dur);
}
.social a:hover { color: var(--gold); border-color: var(--gold); }
.social .icon { width: 16px; height: 16px; }
.profile__cta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-4); }
.profile__cta a {
  display: grid; place-items: center; min-height: 72px; padding: 16px 8px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 20px;
  transition: background-color var(--dur), color var(--dur);
}
.profile__cta a + a { border-inline-start: 1px solid var(--line-4); }
.profile__cta a:hover, .profile__cta a:focus-visible { background: var(--gold); color: var(--on-gold); }
.profile__legal { border-top: 1px solid var(--line-4); padding: 18px 12px 22px; }
.profile__legal ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 15px; list-style: none; padding: 0; margin: 0; }
.profile__legal a { color: var(--muted-2); text-decoration: none; font-size: 14px; line-height: 24px; text-transform: capitalize; transition: color var(--dur); }
.profile__legal a:hover { color: var(--text); }

/* ---------- content column ---------- */
.content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.content > .card:first-child { border-start-end-radius: var(--r-lg); }
.content > .card:last-child { border-end-end-radius: var(--r-lg); }
.content .card { display: flex; flex-direction: column; gap: 20px; }

/* hero */
.hero { gap: 22px !important; }
.rotator { font-size: 20px; line-height: 30px; font-weight: 500; }
.rotator__words { position: relative; display: inline-grid; vertical-align: bottom; overflow: hidden; color: var(--gold); }
.rotator__word { grid-area: 1 / 1; white-space: nowrap; }
.rotator__word:not(:first-child) { display: none; }            /* no-JS: first word only */
.js .rotator__word:not(:first-child) { display: block; }
.js .rotator__word { opacity: 0; transform: translateY(-100%); }
.js .rotator__word.is-in { opacity: 1; transform: none; transition: transform 500ms var(--ease-out), opacity 500ms; }
.js .rotator__word.is-out { opacity: 0; transform: translateY(100%); transition: transform 400ms ease-in, opacity 400ms; }
.card .hero__title { font-size: 40px; line-height: 56px; font-weight: 500; letter-spacing: -.01em; }
.hero__title mark { padding: 0 10px; border-radius: 40px; background: var(--gold); color: var(--on-gold); white-space: nowrap; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero__lead { color: var(--text-3); font-weight: 400 !important; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 12px 10px 0; list-style: none; margin: 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__num { font-size: 38px; line-height: 44px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: 20px; line-height: 26px; font-weight: 300; }

/* about */
.about__img { width: 100%; height: auto; aspect-ratio: 2048 / 1151; object-fit: cover; }

/* services */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.service {
  display: flex; flex-direction: column; gap: 14px;
  padding: 26px 22px 26px 26px; border: 1px solid var(--line-3); border-radius: var(--r-md);
}
.service__head { display: flex; align-items: center; gap: 15px; }
.service__icon { width: 50px; height: 50px; color: var(--gold); fill: currentColor; flex: none; }
.service h3 { font-size: 20px; line-height: 26px; font-weight: 500; transition: color var(--dur); }
.service:hover h3 { color: var(--gold); }
.service p { color: var(--text-2); }

/* portfolio (video cards) */
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.vcard-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 8px 18px; border: 1px solid var(--line-3); border-radius: var(--r-md);
}
.vcard-item h3 { margin-top: 6px; font-size: 15px; line-height: 26px; font-weight: 500; text-align: center; }
.vcard-item h3 a { color: var(--text); text-decoration: none; }
.vcard-item h3 a:hover { color: var(--gold); }
.btn-watch {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 20px; border-radius: var(--r);
  background: var(--home-chip); color: var(--text-2); text-decoration: none;
  font-size: 13px; line-height: 22px; font-weight: 500; transition: background-color var(--dur), color var(--dur);
}
.btn-watch:hover { background: var(--gold); color: var(--on-gold); }
.btn-watch .icon { width: 14px; height: 14px; }
.testimonial-video { border-radius: 0; }

/* partners */
.partners { display: flex; flex-direction: column; gap: 32px; margin: 8px 0 24px; list-style: none; padding: 0; }
.partner { display: grid; grid-template-columns: 48% 1fr; gap: 20px; align-items: center; }
.partner img { width: 100%; height: auto; aspect-ratio: 1200 / 1176; object-fit: cover; border-radius: var(--r); background: var(--home-chip); }
.partner h3 { margin-bottom: 7px; color: var(--gold); font-size: 25px; line-height: 32px; font-weight: 600; transition: color var(--dur); }
.partner:hover h3 { color: var(--text); }
.partner p { color: var(--text-2); font-size: 18px; line-height: 27px; font-weight: 400 !important; }

/* contact */
.contact-link {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.contact-link .icon { width: 28px; height: 28px; color: var(--gold); }
.contact-link:hover span { color: var(--gold); }

/* entrance animation (JS adds .reveal; respects reduced motion via base.css) */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-visible { opacity: 1; transform: none; transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
@media print {
  .js .reveal { opacity: 1; transform: none; }
  .rail, .mnav, .skip-link { display: none; }
  .vcard { display: block; }
  .profile { position: static; max-height: none; }
}

/* ---------- mobile floating menu (hidden on desktop) ---------- */
.mnav { display: none; }

/* ==========================================================================
   Below 1100px — single column (the original's mobile layout)
   ========================================================================== */
@media (max-width: 1099.98px) {
  .vcard { display: block; max-width: 760px; padding: 16px 16px 40px; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .rail { display: none; }
  .profile { position: static; max-height: none; overflow: visible; margin-bottom: 20px; border-radius: var(--r-lg); }
  [dir="rtl"] .profile { border-radius: var(--r-lg); }
  .profile__photo { padding: 12px 12px 0; }
  .profile__photo img { width: 100%; max-width: 520px; }
  .content > .card { border-radius: 0; }
  .content > .card:first-child { border-start-end-radius: var(--r-lg); }
  .card { text-align: center; }
  .card .badge, .contact-link { align-self: center; }
  .card .hero__title { font-size: 25px; line-height: 38px; }
  .stats { padding: 6px 0 0; }
  .stat__num { font-size: 26px; line-height: 32px; }
  .stat__label { font-size: 15px; line-height: 20px; }
  .card h2 { font-size: 25px; line-height: 32px; }
  .services, .videos { grid-template-columns: 1fr; }
  .service { align-items: center; padding: 26px 20px; }
  .service__head { flex-direction: column; gap: 10px; }
  .partner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .partner img { max-width: 230px; }
  .partner p { font-size: 16px; line-height: 26px; }

  .mnav {
    display: flex; position: fixed; z-index: var(--z-nav);
    top: max(12px, env(safe-area-inset-top)); inset-inline-start: max(12px, env(safe-area-inset-left));
    flex-direction: column; align-items: center; gap: 8px; padding: 8px;
    border: 1px solid var(--gold); border-radius: var(--r-lg);
    background: var(--home-card); box-shadow: 0 6px 24px rgb(0 0 0 / 45%);
  }
  .mnav__toggle {
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; color: var(--text);
  }
  .mnav__toggle .icon { width: 22px; height: 22px; }
  .mnav__toggle .icon-close { display: none; }
  .mnav__toggle[aria-expanded="true"] .icon-menu { display: none; }
  .mnav__toggle[aria-expanded="true"] .icon-close { display: block; }
  .mnav .lang { gap: 8px; }
  .mnav__menu {
    display: flex; flex-direction: column; gap: 6px; list-style: none; padding: 4px 0 2px; margin: 0;
    /* never taller than the screen (phones in landscape): scroll inside the menu if needed */
    max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto; overscroll-behavior: contain;
  }
  .mnav__menu a {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 18px;
    border-radius: 50px; background: rgb(0 0 0 / 72%); color: var(--text); text-decoration: none;
    font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap;
  }
  .mnav__menu a:hover, .mnav__menu a[aria-current="true"] { color: var(--gold); }
  .mnav__menu .icon { width: 17px; height: 17px; }
}

/* short screens (phone in landscape): two-column menu so all 8 sections fit without scrolling */
@media (max-width: 1099.98px) and (max-height: 560px) {
  .mnav__menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
}

@media (max-width: 420px) {
  .card .hero__title { font-size: 23px; line-height: 36px; }
  .hero__title mark { white-space: normal; }
  .stat__num { font-size: 22px; }
  .stat__label { font-size: 13px; }
  .social { padding-inline: 6%; gap: 9px; }
}

/* short desktop screens: keep the sticky profile card fully visible */
@media (min-width: 1100px) and (max-height: 820px) {
  .profile__cta a { min-height: 58px; }
  .rail { gap: 22px; padding: 24px 0; }
  .rail__list { gap: 4px; }
}
