/* Device fixes from the wave-4 device QA (docs/qa-devices.md). Kept in one file so block CSS stays a clean v141 port. */

/* iOS Safari zooms the page when a focused field is under 16px: phones and tablets get 16px fields. */
@media(max-width:960px),(pointer:coarse){body :is(.field,.quote-page .field) :is(input,select,textarea),body .guide-mobile-jump select{font-size:16px}}

/* Touch targets: at least 44px on phones and touch tablets. Where the visual must not change, a transparent
   ::before grows the hit area (flat links hide ::after, text links use ::after for their underline). */
@media(max-width:640px),(pointer:coarse){
	.topline a{position:relative}
	.topline a::before{content:"";position:absolute;inset:-13px -16px}
	.text-link,button.text-link,.office-link,.toggle-link,.map-credit,.office-map-caption>a,.footer-contact a{position:relative}
	:is(.text-link,button.text-link,.office-link,.map-credit,.office-map-caption>a,.footer-contact a)::before{content:"";position:absolute;inset:-14px -4px}
	.toggle-link::before{content:"";position:absolute;inset:-5px 0}
	body .round-btn{width:44px;height:44px}
	body .destination-dot,body .testimonial-dots .destination-dot{height:44px}
	body :is(.btn,.filter),body .episode .btn{min-height:44px}
}
/* Footer link lists: 44px rows on phones (the gap moves into the row height, so the rhythm barely changes). */
@media(max-width:640px){
	body .footer-links nav{gap:0}
	body .footer-links nav>strong{margin-bottom:4px}
	body .footer-link{display:inline-flex;align-items:center;min-height:44px}
	body .legal-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px}
}

/* JA headings in Safari/Firefox (no word-break:auto-phrase): inc/ja-phrases.php puts <wbr> between BudouX phrases;
   keep-all forbids every other break, overflow-wrap (base.css) still rescues a phrase wider than the line. */
:lang(ja) :is(h1,h2,h3,h4,h5,h6,.footer-link):has(wbr){word-break:keep-all;overflow-wrap:break-word}
/* motion.js wraps heading words in inline-blocks; cap them at the line so a long phrase wraps instead of overflowing. */
h1 .motion-word,h2 .motion-word{max-width:100%}
/* Fixed mobile quote bar: not on the quote page itself, and out of the way while a form field has focus
   (iOS keeps fixed bars above the on-screen keyboard, where it covered the field being typed in). */
@media(max-width:640px){
	body:has(.quote-page) .mobile-quote-action,
	body:has(form :is(input,select,textarea):focus) .mobile-quote-action{display:none}
}
