/* Native article fragments clear the full/sticky header and subnav.
   This affects only anchor landings, not default article typography/layout. */
#content .postcontent [id] {
  scroll-margin-top: 280px;
}
@media (max-width: 991.98px) {
  /* Canvas may retain desktop offsets in inline and injected styles after
     resizing. Kahlo's mobile header is not sticky; the subnav sits at zero. */
  #page-menu.sticky-page-menu:not(.dots-menu) #page-menu-wrap {
    top: 0 !important;
  }
  #content .postcontent [id] {
    scroll-margin-top: 120px;
  }
  /* Desktop sticky classes and inline heights can outlive the breakpoint.
     Keep the intended non-sticky mobile flow independent of that cleanup,
     so native anchors do not land against a disappearing desktop spacer. */
  #header #header-wrap {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    height: auto !important;
    border-bottom: 0 !important;
  }
  #header .header-wrap-clone {
    display: none !important;
  }
}
/* Preserve Canvas clipping/formatting without a hidden mobile scroll box.
   Keyboard focus can otherwise scroll this full-article wrapper internally
   and leave the opening byline behind the subnav after returning to the top.
   Frozen CSS and shared header/footer/article markup remain untouched. */
@supports (overflow: clip) {
  @media (max-width: 991.98px) {
    #content > .content-wrap {
      overflow: clip;
      display: flow-root;
    }
  }
}

/* Reserve only audited dimensionless contextual figures before loading.
 * Literal English sources and actual frozen dimensions; loaded intrinsic
 * ratios remain authoritative. No article, alt or image bytes change. */
@supports (aspect-ratio: auto 1 / 1) {
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-g05-guillermo-kahlo-self-portrait-1920-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1322;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i01-casa-azul-exterior-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 498;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i02-san-angel-house-and-studio-rear-view-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 685;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i05-kahlo-rivera-van-vechten-1932-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1297;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i06-kahlo-seated-beside-an-agave-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1010;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i07-kahlo-standing-beside-an-agave-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1064;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i11-kahlo-family-sisters-1916-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1073;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i22-casa-azul-at-allende-and-londres-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 768;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i23-san-ildefonso-facade-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 768;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i24-museo-arte-moderno-facade-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 769;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i26-palacio-bellas-artes-night-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 727;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i29-san-francisco-powell-street-c1920-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 824;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i30-leon-trotsky-bain-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1410;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i33-chasseriau-two-sisters-1843-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1429;
  }
  .postcontent figure img:not([width]):not([height])[src="/frida-kahlo/assets/kah-i38-woman-in-tehuantepec-tina-modotti-1024.jpg"] {
    width: 1024px;
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 1365;
  }
}

/* Reserve the verified, height-capped Mantegna portrait before lazy loading.
 * Explicit HTML dimensions alone are defeated by the frozen width:auto rule.
 * Keep the original 640px cap, actual ratio, responsive limit and image bytes. */
@supports (aspect-ratio: auto 1 / 1) {
  #content .postcontent figure.kahlo-context-portrait img[src="/frida-kahlo/assets/kahm-i004-mantegnas-saint-sebastian.jpg"][width="1024"][height="2388"] {
    width: calc(640px * 1024 / 2388);
    max-width: 100%;
    height: auto;
    aspect-ratio: auto 1024 / 2388;
  }
}
