/*
 * RAL mobile fixes: header, logo, menu, footer and home page banner on phones and tablets.
 * SpikeDM, 2026-12-03. The phone and tablet fixes are inside one max-width media query, so desktop is unchanged.
 * The last part, for the home page video's poster, applies at every size.
 * See fragments/site-fixes/README.md for what each part fixes and how to add it.
 */
@media (max-width: 991px) {

  /* Footer: the theme pins it behind the page, but on phones it is taller than the screen,
     so it covered the three business tabs at the top (the big RAL logo seen there).
     Let it sit at the end of the page instead. */
  body { margin-bottom: 0 !important; }
  .site-wrp > footer { position: relative !important; top: auto !important; bottom: auto !important; }

  /* Three business tabs: one slim row instead of three 63px bars */
  .site-wide-btns-wrp .flex-row { flex-wrap: nowrap !important; }
  .site-wide-btns-wrp .flex-col { flex: 1 1 0 !important; max-width: none !important; width: auto !important; }
  .site-wide-btns-wrp .sw-btn { width: 100%; height: auto !important; } /* the theme's matchHeight script writes a fixed height here */
  .site-wide-btns-wrp .sw-btn p { margin: 0 !important; }
  .site-wide-btns-wrp .sw-btn a { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px !important; padding: 6px 4px !important; font-size: 12px !important; line-height: 1.2 !important; }
  .site-wide-btns-wrp .sw-btn a i { font-size: 15px !important; margin: 0 !important; }

  /* Phone number bar: the site's own font (it showed in Roboto Slab), smaller and centred */
  .mob-tel-wrp { padding: 7px 15px !important; text-align: center !important; }
  .mob-tel-wrp .telephone-number { display: block !important; }
  .mob-tel-wrp .tel-wrp p { margin: 0 !important; }
  .mob-tel-wrp .tel-wrp p,
  .mob-tel-wrp .tel-wrp span,
  .mob-tel-wrp .tel-wrp a { font-family: "Open Sans", sans-serif !important; font-size: 15px !important; line-height: 1.5 !important; font-weight: 600 !important; }

  /* Logo: keep its real shape (it was stretched from 508 x 100 to 240 x 89), and lose the
     empty space around it (line height under the image, and matchHeight's fixed column heights) */
  .logo-wrp, .logo-wrp a { height: auto !important; }
  .primary-header .flex-row, .primary-header .flex-col, .primary-header .component { height: auto !important; min-height: 0 !important; }
  .logo-wrp a { display: block !important; line-height: 0 !important; }
  .logo-wrp img.logo { display: block !important; width: auto !important; height: auto !important; max-width: 100% !important; max-height: 50px !important; }
  header.main .primary-header .container > .flex-row { padding: 10px 0 !important; }
  .primary-header .container > .flex-row .flex-row { padding: 0 !important; }

  /* Menu button: a little smaller to suit the slimmer header */
  .primary-header .hamburger-content-wrp { margin: 0 15px 0 0 !important; padding: 7px 12px !important; }
  .hamburger-content-wrp .closed-text { font-size: 12px !important; }

  /* Sticky header (appears when scrolling): logo and menu only. It was 147px tall. */
  header.sticky .mob-tel-wrp { display: none !important; }
  header.sticky .primary-header .container > .flex-row { padding: 6px 0 !important; }
  header.sticky .logo-wrp img.logo { max-height: 40px !important; }
  header.sticky .primary-header .hamburger-content-wrp { padding: 6px 10px !important; }
  header.sticky .hamburger-content-wrp .closed-text { display: none !important; }

  /* Menu panel: cover the whole screen (a strip of the page showed down the left) */
  .mobile-nav.window.full-screen { left: 0 !important; right: 0 !important; width: 100% !important; max-width: none !important; }

  /* Home page banner: fit its content (it was at least 1100px tall on phones, mostly empty) */
  .homepage-template .slide-wrp,
  .homepage-template .slide-wrp > .container { min-height: 0 !important; height: auto !important; }
  .homepage-template .slide-wrp > .container { padding: 50px 15px 90px !important; }
}

/*
 * Home page video, every screen size (SpikeDM, 2026-12-03).
 * The theme's video has no poster, so the banner showed only its purple overlay until the video loaded.
 * Now the video's first frame shows behind it until it starts. For visitors whose device asks for
 * less motion, that frame shows as a still picture instead of the video.
 * The picture is fragments/site-fixes/images/home-video-poster.jpg in the theme (full path below, so
 * this also works if pasted into Additional CSS).
 */
.homepage-template .bg-wrp.video video { background: #1C1D58 url(/wp-content/themes/Robinsons/fragments/site-fixes/images/home-video-poster.jpg) center / cover no-repeat; }
@media (prefers-reduced-motion: reduce) {
  .homepage-template .slide-wrp:has(.bg-wrp.video) { background: #1C1D58 url(/wp-content/themes/Robinsons/fragments/site-fixes/images/home-video-poster.jpg) center / cover no-repeat; }
  .homepage-template .slide-wrp:has(.bg-wrp.video) .bg-wrp.video video { display: none; }
}
