/* English site navigation: dropdown menus ("Common Shoulder Problems", "Surgery").
   Shared by /en (en.html) and every /en/* page. Loaded after the page's own header CSS. */
.main-nav .nav-list { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.main-nav .nav-list > li { position: relative; }
.main-nav .nav-list > li > a { text-decoration: none; color: var(--text); font-weight: 500; font-size: 0.97rem; padding: 0.4rem 0; border-bottom: 1.5px solid transparent; white-space: nowrap; }
.main-nav .nav-list > li > a:hover, .main-nav .nav-list > li > a[aria-current="page"] { color: var(--ink); border-color: var(--sky); }

.sub-toggle {
    display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 500; font-size: 0.97rem; color: var(--text); padding: 0.4rem 0; white-space: nowrap;
    border-bottom: 1.5px solid transparent;
}
.sub-toggle:hover, .has-sub.is-current > .sub-toggle { color: var(--ink); border-color: var(--sky); }
.sub-toggle svg { width: 14px; height: 14px; transition: transform 0.2s ease; flex: none; }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.main-nav ul.sub {
    display: block; list-style: none; position: absolute; top: calc(100% + 0.6rem); left: -1rem; z-index: 1100;
    min-width: 17.5rem; padding: 0.55rem; margin: 0; background: var(--white);
    border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(23, 41, 58, 0.12);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.main-nav ul.sub::before { content: ""; position: absolute; left: 0; right: 0; top: -0.7rem; height: 0.7rem; } /* hover bridge */
.has-sub.open > ul.sub {
    opacity: 1; visibility: visible; transform: none; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
@media (hover: hover) and (min-width: 901px) {
    .has-sub:hover > ul.sub { opacity: 1; visibility: visible; transform: none; transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s; }
    .has-sub:hover > .sub-toggle svg { transform: rotate(180deg); }
}
.main-nav ul.sub li { display: block; }
.main-nav ul.sub a {
    display: block; padding: 0.6rem 0.8rem; border-radius: 8px; border: 0; text-decoration: none;
    color: var(--ink); font-weight: 500; font-size: 0.95rem; line-height: 1.35; white-space: normal;
}
.main-nav ul.sub a small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); margin-top: 0.1rem; }
.main-nav ul.sub a:hover, .main-nav ul.sub a:focus-visible { background: var(--tint); color: var(--brand-ink); }
.main-nav ul.sub a[aria-current="page"] { background: var(--tint); color: var(--brand-ink); }
.main-nav ul.sub .sub-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0.7rem 0.8rem 0.25rem; border-top: 1px solid var(--line); margin-top: 0.35rem; }

/* "Contact" lives in the phone button on desktop; it is shown inside the mobile menu */
@media (min-width: 901px) { .main-nav .nav-hide-md { display: none; } }
@media (max-width: 1440px) {
    .main-nav .nav-list { gap: 1.25rem; }
}
@media (max-width: 1359px) {
    .site-header .brand small { display: none; }
}
@media (min-width: 1360px) {
    .site-header .container { max-width: 1300px; }
}
@media (max-width: 1100px) {
    .main-nav .nav-list { gap: 0.95rem; }
    .site-header .header-phone .phone-num { display: none; }
    .site-header .header-phone { padding: 0.6rem 0.8rem; }
}
@media (max-width: 900px) {
    .main-nav .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 0.4rem 0 0.8rem; }
    .main-nav .nav-hide-md { display: block; }
    .main-nav .nav-list > li > a, .sub-toggle {
        display: flex; width: 100%; justify-content: space-between; padding: 0.85rem 1.5rem; font-size: 1.05rem; border: 0;
    }
    .main-nav .nav-list > li + li { border-top: 1px solid var(--line); }
    .main-nav ul.sub {
        position: static; display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none;
        border: 0; border-radius: 0; background: var(--tint); min-width: 0; padding: 0.3rem 0.9rem 0.6rem; transition: none;
    }
    .main-nav ul.sub::before { display: none; }
    .has-sub.open > ul.sub { display: block; }
    .main-nav { max-height: calc(100vh - 72px); overflow-y: auto; }
    .main-nav .nav-hide-md { display: block; }
}
@media (prefers-reduced-motion: reduce) {
    .main-nav ul.sub, .sub-toggle svg { transition: none; }
}
@media (min-width: 901px) and (max-width: 1180px) {
    .nav-x { display: none; }
    .main-nav .nav-list { gap: 0.8rem; }
    .site-header .header-inner { gap: 1rem; }
    .sub-toggle { font-size: 0.93rem; }
}
/* Dropdowns near the right edge open towards the left so they never overflow the viewport */
@media (min-width: 901px) { .main-nav .nav-list > .has-sub:nth-last-child(-n+2) > ul.sub { left: auto; right: -1rem; } }

/* ---------- Touch: comfortable tap targets on phones and tablets (≥ 40px tall where links stand alone) ---------- */
@media (max-width: 900px) {
  .brand { padding: 0.45rem 0; margin: -0.45rem 0; }
  .footer-bottom-links { gap: 0 1.1rem; }
  .footer-bottom-links a { display: inline-block; padding: 0.65rem 0.15rem; }
  .footer-contact-item a { display: inline-block; padding: 0.4rem 0; margin: -0.4rem 0; }
  .site-footer ul a, .footer-more a { display: inline-block; padding: 0.45rem 0; }
  .byline a, .he-link a { display: inline-block; padding: 0.5rem 0; margin: -0.5rem 0; }
  p.links a, .tx-links a { display: inline-block; padding: 0.5rem 0; }
  .ac-year .lk { gap: 0 0.9rem; }
  .ac-year .lk a, .ac-year .lk button { display: inline-block; padding: 0.55rem 0.1rem; margin: -0.2rem 0; }
  .media-list figcaption a { display: inline-block; padding: 0.45rem 0; }
  .affil ul a { display: inline-flex; align-items: center; min-height: 44px; }
  .form-legal { font-size: 0.85rem; }
  .feature-body > a:not(.btn) { display: inline-block; padding: 0.5rem 0; }
}

/* Brand name always on one line; slightly smaller on narrow phones */
.brand b { white-space: nowrap; }
@media (max-width: 400px) { .brand b { font-size: 1.18rem; } }
@media (max-width: 340px) { .brand b { font-size: 1.06rem; } }

/* Reserve room at the end of the page for the floating contact bar (phones), like the Hebrew home page */
@media (max-width: 768px) {
  body { padding-bottom: 0 !important; }
  .site-footer { padding-bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)) !important; }
}
