/* Phone and tablet refinements, shared by every page. Desktop (>1020px) is unchanged. */

@media (max-width:1020px){
  /* Solid header bar on phones and tablets, never see-through */
  header[data-sticky],
  .aerostrat-scrolled header[data-sticky]{
    background:#001538 !important;
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    animation:none !important;
    border-bottom:1px solid rgba(180,180,180,0.26) !important;
  }

  /* Solid, scrollable menu panel */
  header .aerostrat-mobile-panel{
    height:auto !important;
    background:#001538 !important;
    max-height:calc(100vh - 104px);
    max-height:calc(100dvh - 104px);
    overflow-y:auto;
    overscroll-behavior:contain;
    box-shadow:0 24px 48px rgba(0,0,0,0.5);
  }
  header .aerostrat-mobile-panel a{min-height:48px}
  .aerostrat-menu-btn{width:48px !important;height:48px !important}

  /* Homepage hero: full screen with the content centred, no empty band */
  .aerostrat-hero .aerostrat-hero-inner{
    min-height:100vh !important;
    min-height:100svh !important;
    justify-content:center !important;
    padding-top:128px !important;
    padding-bottom:72px !important;
  }

  /* Comfortable tap targets (44px+) */
  footer a{min-height:44px;display:inline-flex !important;align-items:center}
  button[aria-label*=" grade "]{width:40px !important;height:40px !important}

  /* Readable small labels */
  [style*=" 9.5px/"],[style*=" 10px/"],[style*=" 9.5px /"],[style*=" 10px /"]{font-size:11px !important}
}

@media (max-width:640px){
  header .aerostrat-mobile-panel{
    max-height:calc(100vh - 88px);
    max-height:calc(100dvh - 88px);
    padding:14px 20px 28px !important;
  }
  .aerostrat-hero .aerostrat-hero-inner{padding-top:112px !important;padding-bottom:56px !important}
  /* Text spans the full width here, so even out the video overlay to keep it readable */
  .aerostrat-hero > video + div{background:linear-gradient(180deg,rgba(0,21,56,0.55) 0%,rgba(0,21,56,0.5) 60%,#001538 100%) !important}
}

/* Any touchscreen, including tablets in landscape that get the desktop layout */
@media (pointer:coarse){
  footer a{min-height:44px;display:inline-flex !important;align-items:center}
  button[aria-label*=" grade "]{width:40px !important;height:40px !important}
  [style*=" 9.5px/"],[style*=" 10px/"],[style*=" 9.5px /"],[style*=" 10px /"]{font-size:11px !important}
}

/* Page heroes on phones: text spans the full width, so even out the photo overlay */
@media (max-width:640px){
  .aerostrat-hero-alt > img + div{background:linear-gradient(180deg,rgba(0,21,56,0.6) 0%,rgba(0,21,56,0.55) 60%,#001538 100%) !important}
}

/* ---- Mobile spacing scale ----
   Section rhythm: 40px on a 390px phone, growing with the screen to 56px on tablets.
   Selectors are more specific than the per-page rules so this file sets the scale. */
@media (max-width:1020px){
  main > section:not(.aerostrat-hero):not(.aerostrat-hero-alt){
    padding-top:clamp(40px,8vw,56px) !important;
    padding-bottom:clamp(40px,8vw,56px) !important;
  }
  /* No trailing margin on the last block of a section, so gaps stay even */
  main > section > .aerostrat-reveal > :last-child{margin-bottom:0 !important}

  /* Content is always visible on phones and tablets. The scroll-in effect hid each
     section until it was well on screen, which showed as empty bands while scrolling. */
  .aerostrat-reveal[data-hidden],
  .aerostrat-reveal[data-hidden] .aerostrat-pop{opacity:1 !important;transform:none !important}
}
@media (pointer:coarse){
  .aerostrat-reveal[data-hidden],
  .aerostrat-reveal[data-hidden] .aerostrat-pop{opacity:1 !important;transform:none !important}
}

/* ---- Compact footer on phones ----
   One left edge, one row height (32px links), labels 8px above their links. */
@media (max-width:640px){
  html body footer{padding:28px 20px 16px !important}
  footer > div > div:first-child{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:20px 16px !important;
    padding-bottom:20px !important;
  }
  /* Brand spans the width; Company on the left, Solutions and Contact stacked on the right */
  footer > div > div:first-child > div:first-child{grid-column:1 / -1}
  footer > div > div:first-child > div:nth-child(2){grid-row:span 2}
  footer > div > div:first-child > div{gap:0 !important;align-items:flex-start}
  footer > div > div:first-child img{height:32px !important;margin:0 !important}
  /* The line under the logo repeats the logo's own tagline */
  footer > div > div:first-child > div:first-child > p{display:none}
  footer > div > div:first-child > div > div:first-child{margin:0 0 8px !important;font-size:11px !important;line-height:1 !important}
  footer > div > div:first-child a,
  footer > div > div:first-child span{
    display:inline-flex !important;align-items:center;
    min-height:32px !important;margin:0 !important;
    font-size:14px !important;line-height:1.3 !important;
  }
  footer > div > div:first-child > div:last-child svg{width:16px;height:16px}
  footer > div > div:last-child{padding-top:14px !important}
  footer > div > div:last-child span{font-size:12px !important}
}
@media (max-width:360px){
  footer > div > div:first-child a,
  footer > div > div:first-child span{font-size:13px !important}
}

/* FAQ accordion (home, Solutions, EBT/CBTA, TMS). Answers stay in the page
   source for search engines and AI crawlers; <details> opens without JS. */
.aerostrat-faq-list{display:flex;flex-direction:column;gap:1px}
.aerostrat-faq-item{background:#FFFFFF;outline:1px solid rgba(0,52,140,0.16)}
.aerostrat-faq-item > summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:24px;
  padding:24px clamp(20px,2.6vw,32px);min-height:48px;
}
.aerostrat-faq-item > summary::-webkit-details-marker{display:none}
.aerostrat-faq-item > summary::after{
  content:'';flex:none;width:14px;height:14px;
  background:linear-gradient(#00348C,#00348C) center/14px 2px no-repeat,linear-gradient(#00348C,#00348C) center/2px 14px no-repeat;
  transition:transform 0.25s ease;
}
.aerostrat-faq-item[open] > summary::after{transform:rotate(45deg)}
.aerostrat-faq-item > summary:hover{background:rgba(63,158,232,0.08)}
.aerostrat-faq-item > summary:hover h3{color:#00348C}
.aerostrat-faq-item > summary:focus-visible{outline:2px solid #3F9EE8;outline-offset:-2px}
.aerostrat-faq-item h3{margin:0;font:700 clamp(16px,1.6vw,19px)/1.35 'Open Sauce One',sans-serif;color:#000;text-wrap:pretty}
.aerostrat-faq-item[open] h3{color:#00348C}
.aerostrat-faq-item > p{margin:0;padding:0 clamp(20px,2.6vw,32px) 26px;max-width:860px;font:400 15.5px/1.8 'Open Sauce One',sans-serif;color:#4A5361;text-wrap:pretty}
.aerostrat-faq-item[open]{box-shadow:inset 3px 0 0 #3F9EE8}
@media (prefers-reduced-motion:reduce){.aerostrat-faq-item > summary::after{transition:none}}

/* Glossary page (/glossary): brand colours, light section like the FAQ */
.aerostrat-gloss-jump{display:flex;flex-wrap:wrap;gap:10px;margin-top:32px}
.aerostrat-gloss-jump a{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;border:1px solid rgba(180,180,180,0.45);border-radius:2px;font:600 13px/1 'Open Sauce One',sans-serif;color:#ECF0F3;text-decoration:none;transition:border-color .25s ease,color .25s ease,background .25s ease}
.aerostrat-gloss-jump a:hover{border-color:#3F9EE8;color:#fff;background:rgba(0,52,140,0.45);text-decoration:none}
.aerostrat-gloss-group{scroll-margin-top:130px}
.aerostrat-gloss-group + .aerostrat-gloss-group{margin-top:80px}
.aerostrat-gloss-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px}
.aerostrat-gloss-term{background:#FFFFFF;outline:1px solid rgba(0,52,140,0.16);padding:clamp(22px,2.6vw,32px);scroll-margin-top:130px;display:flex;flex-direction:column;gap:12px}
.aerostrat-gloss-term:target{box-shadow:inset 3px 0 0 #3F9EE8}
.aerostrat-gloss-wide{grid-column:1 / -1}
.aerostrat-gloss-term h3{margin:0;font:700 clamp(17px,1.7vw,20px)/1.3 'Open Sauce One',sans-serif;color:#000;text-wrap:pretty}
.aerostrat-gloss-abbr{display:inline-block;margin-left:8px;vertical-align:2px;font:700 10.5px/1 'Open Sauce One',sans-serif;letter-spacing:0.1em;color:#00348C;border:1px solid rgba(0,52,140,0.4);padding:5px 7px;border-radius:2px}
.aerostrat-gloss-term p{margin:0;max-width:760px;font:400 15.5px/1.8 'Open Sauce One',sans-serif;color:#4A5361;text-wrap:pretty}
.aerostrat-gloss-term p a,.aerostrat-gloss-rel a{color:#00348C;text-decoration:underline;text-underline-offset:3px}
.aerostrat-gloss-term p a:hover,.aerostrat-gloss-rel a:hover{color:#000}
.aerostrat-gloss-rel{margin-top:auto;padding-top:6px;font:500 13px/1.6 'Open Sauce One',sans-serif;color:#4A5361}
.aerostrat-gloss-comps{list-style:none;margin:6px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:10px 28px}
.aerostrat-gloss-comps li{display:flex;align-items:baseline;gap:12px;font:500 14.5px/1.5 'Open Sauce One',sans-serif;color:#000}
.aerostrat-gloss-comps li span{flex:none;width:42px;font:700 12px/1 'Open Sauce One',sans-serif;letter-spacing:0.06em;color:#00348C}
@media (max-width:760px){.aerostrat-gloss-list{grid-template-columns:minmax(0,1fr)}.aerostrat-gloss-group + .aerostrat-gloss-group{margin-top:56px}}

/* Pre-rendered pages (scripts/prerender.mjs): the copy fades in once; the live page that replaces it must not fade again */
html.dc-pre #dc-root .aerostrat-page-enter{animation:none}
/* Same fade as aerostrat-page-in, but from 1% opacity: Chrome ignores elements painted at 0%, so the copy would not count as the page being shown */
#dc-prerender .aerostrat-page-enter{animation-name:aerostrat-page-in-pre}
@keyframes aerostrat-page-in-pre{from{opacity:0.01;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
/* While the copy is on screen the live page stays out of layout; once the copy is removed it appears in place (no layout shift is recorded) */
#dc-prerender ~ #dc-root{display:none}
