/* Mobile fixes shared by every page on the site.

   Page CSS is inlined per template, so a phone bug in the nav, footer or
   forms otherwise has to be patched in ~3,600 files. This sheet is linked
   as the LAST stylesheet in <head> (scripts/add-mobile-fixes-css.py), so it
   wins over the inline rules at equal specificity. Everything except the
   footer signup block is inside a max-width media query: desktop layout is
   not touched.

   Found by rendering the site at 390px and 320px (2026-11-18 audit). */

/* ---- Footer signup form -------------------------------------------------
   Business pages (and some discover/guide pages) carry the form markup but
   never got its CSS, so it rendered as a bare browser-default input and
   button. Same values as the styled templates. */
.footer-sub-row{display:flex;gap:8px;flex-wrap:wrap;}
.footer-sub-row input{flex:1;min-width:0;padding:9px 12px;border-radius:8px;border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.08);color:#fff;font-size:13.5px;font-family:inherit;}
.footer-sub-row input::placeholder{color:rgba(255,255,255,.5);}
.footer-sub-row input:focus{outline:none;border-color:var(--blue,#3fa7de);}
.footer-sub-row button{padding:9px 16px;border-radius:8px;border:none;background:var(--blue,#3fa7de);color:#fff;
  font-weight:700;font-size:13.5px;cursor:pointer;font-family:inherit;white-space:nowrap;}
.footer-sub-row button:hover{background:var(--blue-dark,#2b7fb0);}
.footer-sub-msg{font-size:12px;margin:8px 0 0;color:rgba(255,255,255,.65);line-height:1.5;}
/* .footer-col a is display:block, which dropped "privacy policy" onto its
   own line mid-sentence. */
.site-footer .footer-sub-msg a{display:inline;padding:0;font-size:inherit;color:rgba(255,255,255,.85);text-decoration:underline;}

@media (max-width:600px){
  /* ---- iOS Safari zooms the whole page when a focused field is under
     16px, and does not zoom back out. Every search box, filter select and
     email field on the site was 13-15px. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]):not([type=button]):not([type=image]),
  select,textarea{font-size:16px !important;}
  input{text-overflow:ellipsis;}
  /* A select sizes to its longest option; at 16px that can exceed the screen. */
  select{max-width:100%;}

  /* ---- Mega menu: the overlay kept its 20px desktop padding, so the
     "full-screen" panel was inset, 20px taller than the space left for it
     (last links unreachable), and the header row was too narrow -- the
     close button was pushed off the panel on most templates. */
  .mega-menu-overlay{padding:0;}
  .mega-menu-panel{height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;margin-top:0;border-radius:0;
    padding:16px 20px calc(28px + env(safe-area-inset-bottom,0px));}
  .mega-menu-head{flex-wrap:wrap;gap:10px;position:sticky;top:-16px;background:#fff;z-index:2;
    margin:-16px -20px 18px;padding:14px 20px 12px;}
  .mega-menu-head .nav-logo{min-width:0;flex:0 1 auto;}
  .mega-menu-head .nav-logo img{height:30px;}
  .mega-menu-head .nav-logo b{font-size:15px;}
  .mega-menu-head-actions{flex:0 0 auto;gap:8px;margin-left:auto;flex-wrap:nowrap;}
  .mega-menu-head-actions .nav-auth-btn{white-space:nowrap;}
  .mega-menu-close{flex:0 0 auto;width:40px;height:40px;}
  /* Two columns instead of one 1,500px-long list. */
  .mega-menu-cols{grid-template-columns:1fr 1fr;gap:24px 16px;}
  .mega-menu-col a{padding:9px 0;}

  /* ---- Editorial bands: flex:1 1 300px is a 300px WIDTH basis on desktop,
     but the band turns into a column on phones, where the same basis is a
     300px HEIGHT -- a block of dead space above every button. */
  .editorial-band-inner .editorial-band-body{flex:0 1 auto;}

  /* ---- Tap targets ---- */
  .cs-accordion-head{min-height:44px;}
  .site-footer .footer-col a{padding:8px 0;}
  .site-footer .footer-social-row .footer-social-btn{padding:0;width:40px;height:40px;}
  .ev-back-link,.evd-back-link{display:inline-block;padding:10px 0;}
  .specials-mini-dots .dot{position:relative;}
  .specials-mini-dots .dot::after{content:"";position:absolute;inset:-14px -5px;}

  /* ---- Cuisine directory cards: slash-joined cuisine strings
     ("American/Southern/BBQ/Seafood") have no break point and pushed the
     card wider than a 320px screen. */
  .cd-name,.cd-meta,.cd-line{overflow-wrap:anywhere;}

  /* ---- Third-party embeds set their own min-width inline (Instagram:
     326px), which is wider than a 320px phone's content column. */
  .instagram-media{min-width:0 !important;max-width:100% !important;}
}

/* ---- Footer: 2 link columns on phones rather than one long single column
   (roughly halves the footer's height). Brand + signup stay full width. */
@media (max-width:480px){
  .site-footer .footer-inner{grid-template-columns:1fr 1fr;gap:26px 18px;}
  .site-footer .footer-inner > .footer-brand,
  .site-footer .footer-inner > .footer-subscribe{grid-column:1 / -1;min-width:0;}
  .site-footer .footer-inner > .footer-col{min-width:0;}
}

/* ---- Small phones (iPhone SE / mini, 320-375px): logo + search + menu
   button were 12px wider than the screen, so every page scrolled sideways
   and the menu button sat partly off-screen. */
@media (max-width:380px){
  .site-nav .nav-top{padding:10px 12px;gap:6px;}
  .site-nav .nav-top .nav-logo{gap:6px;min-width:0;flex:0 1 auto;}
  .site-nav .nav-top .nav-logo img{height:30px;}
  .site-nav .nav-top .nav-logo b{font-size:15px;}
  .site-nav .nav-pills-scroll{padding-left:12px;padding-right:12px;}
}
@media (max-width:340px){
  .site-nav .nav-top .nav-logo b{font-size:14px;letter-spacing:-.3px;}
}

/* ---- Sticky filter / tab bars sit directly under the sticky header. Its
   height comes from /mobile-nav.js (--cs-nav-h); these bars used to hard-code
   top:59px or top:0 and slid partly or wholly behind the header. */
body .cd-filters,body .board-filters,body .dir-filters,body .dg-tabs,body .best-tabs{top:var(--cs-nav-h,59px);}

/* ---- Business pages: when price is the only at-a-glance fact, the box was
   a full-width, nearly empty yellow card. Shrink it to fit its chips. */
.at-a-glance:not(:has(> :not(.glance-chips))){width:fit-content;padding:8px 10px;}
.at-a-glance:not(:has(> :not(.glance-chips))) .glance-chips{margin-bottom:0;}

@media (max-width:600px){
  /* ---- Header: /mobile-nav.js adds .nav-compact while scrolling down. */
  .site-nav.nav-compact .nav-pills-scroll{display:none;}

  /* ---- The Specials Board filter bar is ~240px tall on a phone; stuck under
     the header it covered a third of the screen. Let it scroll away. */
  body .board-filters{position:static;}
  /* Directory filters: search on its own row, the two selects side by side. */
  .dir-filters{padding:10px 16px;gap:8px;}
  .dir-filters input{flex:1 1 100%;min-width:0;}
  .dir-filters select{flex:1 1 0;min-width:0;}

  /* ---- Smallest labels (ad labels 9.5px, badges and photo credits
     10-10.5px) up to an 11px floor. !important because several are set in
     inline style attributes. */
  .cs-house-ad-label,.fact-ad-label,.biz-photo-credit,.ev-page-photo-credit,.gd-photo-credit,
  .badge,.lbl,.evd-card-cat,.mini-event-kicker,.giveaway-badge,.crawl-badge,.dg-badge,.b-tag,
  .cs-datecal-dow,.bb-spot-cat-chip,.cs-spotlight-tag,.chi-history-card-tag,.dir-card .cat,
  .nav-search-results .r-tag{font-size:11px !important;}
}

