/* Mobile & Safari polish (Oct 2026) — loaded last by base.html, after site.css, motion.css and nav-gold.css.
   Bump the ?v= number on its <link> in base.html when this file changes (assets are cached for a year). */

/* Taps: a soft brass flash instead of iOS's default grey box */
html{-webkit-tap-highlight-color:rgba(176,141,62,.18)}
img,video{max-width:100%;height:auto}

/* Forms. A <select> sizes itself to its longest option, which pushed the contact and resource
   forms ~80px past the edge of a phone screen. Grid tracks of minmax(0,1fr) let it shrink.
   Every field stays at 16px or larger so iOS Safari doesn't zoom in when a field is tapped. */
form.contact,form.contact label,.contact-grid>*{min-width:0}
form.contact label{grid-template-columns:minmax(0,1fr)}
form.contact select{width:100%;overflow:hidden}
.contact-grid{overflow-x:clip}     /* WebKit counts the hidden option text as page width; clip it at the gutter so focus rings still show */
form.contact select{min-width:0;max-width:100%;text-overflow:ellipsis}
input,select,textarea{font-size:max(16px,1em)}
.subscribe input[type=email]{font-size:16px;min-width:0}

/* Phone menu */
@media (max-width:980px){
  /* 100vh on iOS includes the area behind Safari's toolbar, so the bottom of the menu could not be reached */
  nav.primary.open{max-height:calc(100vh - var(--hdr-h,90px));max-height:calc(100dvh - var(--hdr-h,90px));
    overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))}
  html.nav-open,html.nav-open body{overflow:hidden}      /* the page behind the open menu no longer scrolls */
  .menu-toggle{min-height:44px;min-width:44px}
}

/* Tap targets of at least 44px (Apple's guideline) and no text smaller than 12px on phones */
@media (max-width:760px){
  footer.site ul{gap:0}
  footer.site li a,footer.site address a,footer.site .top p a{display:inline-block;padding-block:10px}
  footer.site address{margin-bottom:10px}
  footer.site .social-links.dark a{padding:11px}
  .crumbs a{display:inline-block;padding-block:10px}
  /* mono eyebrow labels were 10.5-11.5px: legible on a monitor, squinty on a phone */
  footer.site h4,.post-card .kicker,.kicker,.pr-tag,.om-kicker,.t-elite span,blockquote cite,dl dt,.vm-timeline .tl-when,.toc>b,a>small{font-size:12px!important}
  a.fn,a[href="#assets-note"]{display:inline-block;min-width:24px;padding:6px 4px;margin:-6px -2px;text-align:center}   /* footnote asterisks */
}

/* iPhones held sideways: keep content clear of the notch / Dynamic Island and the home indicator.
   env() values are 0 unless the viewport meta has viewport-fit=cover (set in base.html). */
.wrap{padding-left:max(var(--gutter),env(safe-area-inset-left,0px));padding-right:max(var(--gutter),env(safe-area-inset-right,0px))}
header.site .wrap{padding-left:max(var(--hdr-pad,var(--gutter)),env(safe-area-inset-left,0px));padding-right:max(var(--hdr-pad,var(--gutter)),env(safe-area-inset-right,0px))}
footer.site{padding-bottom:env(safe-area-inset-bottom,0px)}
