/*
   Phone & tablet layout.
   Every rule below sits inside a max-width media query, so the site looks
   exactly as before on computers. Same colours, fonts and illustrations —
   just rearranged to fit narrow screens.
*/

.hdr-burger{display:none;}
.gtc-table-scroll{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;}

/* The footer's copyright line no longer forces the page wider than the screen */
@media (max-width:1180px){
  .footer-copy{white-space:normal;}
}

/* Phones and tablets: ☰ menu */
@media (max-width:960px){
  .site-header{padding:0 1rem;gap:1rem;}
  .site-logo{font-size:20px;}
  .hdr-burger{display:flex;flex-direction:column;justify-content:center;gap:5px;width:44px;height:44px;margin-right:-8px;
    padding:0 10px;background:none;border:none;border-radius:6px;cursor:pointer;flex-shrink:0;}
  .hdr-burger span{display:block;height:2px;width:100%;background:#fff;border-radius:2px;transition:transform .2s,opacity .2s;}
  .hdr-burger:focus-visible{outline:2px solid var(--gold);outline-offset:2px;}
  .site-header.menu-open .hdr-burger span:nth-child(1){transform:translateY(7px) rotate(45deg);}
  .site-header.menu-open .hdr-burger span:nth-child(2){opacity:0;}
  .site-header.menu-open .hdr-burger span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

  /* The links drop down beneath the header */
  .hdr-right{display:none;position:absolute;top:100%;left:0;right:0;flex-direction:column;align-items:stretch;gap:0;
    background:var(--accent);border-bottom:3px solid var(--gold);box-shadow:0 14px 28px rgba(15,26,40,.28);
    padding:.4rem 1rem 1.1rem;max-height:calc(100vh - 62px);overflow-y:auto;}
  .site-header.menu-open .hdr-right{display:flex;}
  .site-nav{flex-direction:column;align-items:stretch;gap:0;flex-wrap:nowrap;}
  .site-nav .nav-link{display:block;font-size:16px;padding:14px 10px;border-radius:0;border-bottom:1px solid rgba(255,255,255,.12);white-space:normal;}
  .site-nav .nav-link.active{border-radius:4px;border-bottom-color:transparent;margin:4px 0;}
  .hdr-account{padding-top:14px;}
  .hdr-login{width:100%;font-size:15px;padding:12px 14px;}
  .hdr-user{width:100%;flex-wrap:wrap;gap:10px;}
  .hdr-user .nav-link{flex:1;font-size:16px;padding:10px;border:1px solid rgba(255,255,255,.25);border-radius:4px;text-align:center;}
  .hdr-logout{font-size:14px;padding:10px 6px;}
}

/* Phones */
@media (max-width:760px){
  /* Stop anything from pushing the page sideways */
  html,body{overflow-x:clip;}
  .card{overflow-wrap:break-word;}

  /* Avoid iPhone zooming in when a box is tapped (text below 16px triggers it) */
  input,select,textarea{font-size:16px !important;}

  /* Home: headline and the check box come first; illustration smaller, after the text */
  .hero2{padding:1.75rem 1rem 2.25rem;}
  .hero2-top{gap:1rem;margin-bottom:1.5rem;}
  .hero2-copy{order:0;}
  .hero2-art{order:1;}
  .hero-illus{max-width:250px;}
  .hero2-title{font-size:clamp(1.75rem,8vw,2.2rem);line-height:1.18;}
  .hero2-sub{font-size:15px;line-height:1.6;}

  /* Wizard */
  .shell{padding:1.25rem .85rem 3rem;}
  .card{padding:1.35rem 1.1rem;}
  .progress-rail{margin-bottom:1.6rem;}
  .prog-label{display:none;}
  .prog-step.active .prog-label{display:block;font-size:11px;max-width:96px;line-height:1.3;}
  .btn-row{gap:8px;}
  .btn-row .btn{flex:1 1 auto;justify-content:center;min-height:44px;}
  .shell{min-width:0;width:100%;}
  .prog-step{min-width:0;}
  .two-col > *,.three-col > *,.four-col > *{min-width:0;}
  select,input{max-width:100%;}
  /* Trip date rows: arrival + departure side by side, day count and remove button beneath */
  #primaryStaysContainer > div,[id$="_trips"] > div{grid-template-columns:1fr 1fr !important;}
  #primaryStaysContainer > div > *,[id$="_trips"] > div > *{min-width:0;}
  #primaryStaysContainer > div > button,[id$="_trips"] > div > button{justify-self:start;min-width:44px;min-height:40px;}
  #primaryStaysContainer input[type="date"],[id$="_trips"] input[type="date"]{width:100%;min-width:0;}
  .date-range-row{grid-template-columns:1fr;}
  .date-range-row .days-computed{grid-column:auto;}

  /* Tables scroll inside their own box */
  .gtc-table-scroll{margin:0 -2px;}
  .gtc-table-scroll > table{min-width:560px;}
  .gtc-table-scroll th,.gtc-table-scroll td{overflow-wrap:normal;word-break:normal;}

  /* Results headers: title full width, "Download Report" button beneath it */
  div:has(> #downloadStep5Btn),div:has(> #downloadReportBtn){flex-wrap:wrap;}
  div:has(> #downloadStep5Btn) > div,div:has(> #downloadReportBtn) > div{flex:1 1 100% !important;min-width:0;}
  #downloadStep5Btn,#downloadReportBtn{margin-top:0 !important;min-height:44px;}

  /* Expandable sections: heading on its own line, the note beneath */
  .detail-toggle summary{flex-wrap:wrap;row-gap:4px;}
  .dt-summary-label{flex:1 1 auto;min-width:0;}
  .dt-summary-time{flex:1 1 100%;white-space:normal;}

  /* Log-in window opens as a sheet from the bottom of the screen */
  .auth-overlay{align-items:flex-end;padding:0;}
  .auth-modal{width:100%;max-width:none !important;margin:0;border-radius:14px 14px 0 0;max-height:94vh;overflow-y:auto;
    padding:1.6rem 1.25rem 1.4rem;}

  /* My reports */
  .report-actions{width:100%;}
  .report-actions .btn{flex:1 1 auto;justify-content:center;min-height:40px;}

  /* Footer */
  .footer-bottom{flex-direction:column;align-items:flex-start;}
  .footer-links a,.footer-legal a{padding:4px 0;}
}

/* Small phones */
@media (max-width:380px){
  .site-logo{font-size:18px;}
  .card{padding:1.2rem .9rem;}
}
