/* Shared persistent masthead on desktop - 2026-11-09.
   Reuse the six mobile shortcut links and the original single logo. */
@media screen {
  :root { --site-header-height: var(--mobile-header-height,98px); }
  body .masthead { position:sticky; top:0; z-index:1100; box-shadow:0 5px 18px #00000025; }
  html { scroll-padding-top:calc(var(--site-header-height) + 12px); }
  html:has(.guide-shell) { scroll-padding-top:20px; }
  body .guide-navigation { top:var(--site-header-height); }
  .skip { position:fixed; z-index:1101; }
}

/* Desktop, including large touch screens. Rotated phones retain the mobile row. */
@media screen and (min-width:701px) and (hover:hover), screen and (min-width:1025px) {
  .masthead { height:var(--site-header-height); }
  .masthead .nav { position:relative; height:var(--site-header-height); gap:18px; flex-wrap:nowrap; }
  .masthead .nav>.pill { display:none; }
  .masthead .navlinks { flex-shrink:0; gap:24px; }
  .masthead .mobile-revenue-links { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); align-items:center; flex:0 1 440px; min-width:0; gap:6px; direction:rtl; }
  .masthead .mobile-revenue-links a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-width:0; min-height:60px; border-radius:10px; color:#efc57e; text-decoration:none; font:700 12px/1.35 Arial,'Noto Sans Hebrew',sans-serif; }
  .masthead .mobile-revenue-links svg { width:22px; height:22px; flex-shrink:0; }
  .masthead .mobile-revenue-links span { white-space:nowrap; }
  .masthead .mobile-revenue-links a[aria-current=page] { background:#efc57e18; box-shadow:inset 0 -2px #efc57e; color:#ffe4b4; }
  .masthead :focus-visible { outline:2px solid #ffe4b4; outline-offset:-2px; }

  /* Primary anchors clear both the masthead and chapter navigation. */
  body .guide-shell .guide-panel,
  body .guide-shell .guide-panel>.flagship-section,
  body .guide-shell .destination-section,
  body .guide-shell .guide-anchor-alias,
  body .guide-shell .guide-source-list li,
  body .guide-shell .guide-subchapter,
  body .guide-shell .guide-place,
  body .guide-shell .source-register li { scroll-margin-top:var(--guide-experience-top,calc(var(--site-header-height) + 110px)); }
  body .guide-shell [data-experience-panel],
  body .guide-shell [data-experience-panel] .flagship-section,
  body .destination-tabs [data-experience-panel] .destination-section,
  body .destination-tabs [data-experience-panel] .guide-subchapter,
  body .destination-tabs [data-experience-panel] .guide-place,
  body .guide-shell .anchor-alias { scroll-margin-top:var(--guide-experience-offset,calc(var(--site-header-height) + 215px)); }
}

/* Compact browser windows keep all six shortcuts; main navigation moves to the menu. */
@media screen and (min-width:701px) and (max-width:1100px) and (hover:hover), screen and (min-width:1025px) and (max-width:1100px) {
  :root { --site-header-height:88px; }
  .masthead .nav { width:auto; margin-inline:16px; gap:12px; }
  .masthead .logo { flex:0 0 120px; width:120px; height:68px; }
  .masthead .logo img { transform:none; }
  .masthead .navlinks { display:none; }
  .masthead .mobile-revenue-links { flex:1; }
  .masthead .mobile-menu { display:block; flex:0 0 44px; color:#fff0d5; }
  .masthead .mobile-menu summary { display:flex; align-items:center; justify-content:center; min-height:48px; list-style:none; border-radius:8px; cursor:pointer; }
  .masthead .mobile-menu summary::-webkit-details-marker { display:none; }
  .masthead .mobile-menu[open] summary { background:#efc57e18; }
  .masthead .mobile-menu-links { position:absolute; top:100%; inset-inline-end:0; width:min(300px,100%); max-height:calc(100dvh - var(--site-header-height) - 16px); overflow:auto; overscroll-behavior:contain; background:#03182b; border-radius:0 0 16px 16px; padding:8px 16px 12px; box-shadow:0 12px 25px #0005; }
  .masthead .mobile-menu-links a { display:block; min-height:48px; padding:10px 8px; text-decoration:none; font-size:16px; }
}

/* Reading sidebars must also remain below the shared masthead. */
@media screen and (min-width:761px) {
  body .mag-sidebar { top:calc(var(--site-header-height) + 24px); }
}
@media screen and (min-width:901px) {
  body .guide-side { top:calc(var(--site-header-height) + 20px); max-height:calc(100dvh - var(--site-header-height) - 40px); }
}
@media screen and (min-width:1001px) {
  body .flagship-menu,
  body .flagship-toc { top:calc(var(--site-header-height) + 18px); }
  body .flagship-menu .flagship-toc { max-height:calc(100dvh - var(--site-header-height) - 36px); }
}

/* Wide desktop: restore the original insurance button in the left-hand slot. */
@media screen and (min-width:1101px) {
  .masthead .navlinks { display:none; }
  .masthead .nav>.pill.gold { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; min-height:48px; white-space:nowrap; }
  .masthead .mobile-revenue-links { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .masthead .mobile-revenue-links a[href="insurance.html"] { display:none; }
}

/* Mobile and compact browsers: use the same left-hand insurance button. */
@media screen and (max-width:1100px) {
  .masthead .navlinks,
  .masthead .mobile-menu { display:none; }
  .masthead .mobile-revenue-links { grid-template-columns:repeat(5,minmax(0,1fr)); flex:1; gap:2px; }
  .masthead .mobile-revenue-links a[href="insurance.html"] { display:none; }
  .masthead .nav>.pill.gold { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; min-width:92px; min-height:44px; padding:8px; white-space:nowrap; font-size:11px; line-height:1.3; }
}
@media screen and (min-width:701px) and (max-width:1100px) {
  .masthead .nav>.pill.gold { min-width:124px; min-height:48px; padding:9px 16px; font-size:13px; }
}
