/* =========================================================================
   Jumbo – responsive.css: every screen-size override, largest screens
   first. Loaded after common.css, which holds the base styles and has no
   media queries of its own.

   Breakpoints used
     1399px  large desktop        1281px / 1280px  fixed header on / off
     1024px  / 1023px  tablet landscape          992px / 991px  desktop / mobile layout
     768px   cards (wider) / footer logos (narrower)
     599px   phone     575px  small phone     414px  narrow phone
     Also: reduced motion (lightbox spinner) at the end.
   ========================================================================= */


/* ---- 1281px and wider: fixed header that shrinks on scroll --------------- */

@media (min-width: 1281px) {
  #page-header {position: fixed; top: 0; left: 0; width: 100%; z-index: 5;}
  .white-back {padding-top: 289px; transition: padding-top 0.2s ease;}
  body.header-not-at-top .white-back {padding-top: 197px;}
  .header-not-at-top .logo a {display: inline-block; width: 150px; min-width: 150px; height: 90px; overflow: hidden;}
  .header-not-at-top .logo a img {display: block; width: 100%; height: auto; transition: width 0.2s ease;}

  /* Skip link */
  #main {scroll-margin-top: 289px;}
}

/* ---- 1399px and wider ---------------------------------------------------- */

@media (min-width: 1399px) {
  /* Contact form links (/contact/#…) land below the fixed header */
  .jumplink {padding-top: 270px; margin-top: -270px;}
}

/* ---- 1280px and narrower: header scrolls away ---------------------------- */

@media (max-width: 1280px) {
  .logo a {width: 150px; min-width: 150px;}
  .jumplink {padding-top: 200px; margin-top: -200px;}
  body.header-not-at-top .white-back {padding-top: 50px; transition: padding-top 0.2s ease;}
  body.header-not-at-top #page-header .topbar {background-color: #FFF; color: #000; padding: 10px 0; line-height: 2rem; margin: 0 0 -50px 0; position: fixed; z-index: 10; width: 100%; top: 0; left: 0;}
}

/* ---- 1024px and wider ---------------------------------------------------- */

@media (min-width: 1024px) {
  .page-template-page-template-tour .sidebar {position: relative; z-index: 2; margin: 0 50px -300% 50px;}
  .background-tint {background-color: rgba(239,236,234,0.5);}
}

/* ---- 1023px and narrower ------------------------------------------------- */

@media (max-width: 1023px) {
  .page-template-page-template-tour .sidebar {padding: 50px;}
  .page-template-page-template-contact .grey-back a {overflow-wrap: break-word; word-wrap: break-word;}
  .our-focus .content-block .col-12.col-lg-8 {padding: 0 0 30px 0;}
}

/* ---- 992px and wider: desktop layout ------------------------------------- */

@media (min-width: 992px) {
  .single .mobile-sidebar {display: none;}

  /* Title blocks: a square beside the hero image */
  h1.title-block,
  p.title-block {
    padding: 50px;
    aspect-ratio: 1 / 1;
  }
  .page-template-page-template-tour h1.title-block {
    margin-bottom: 30px;
  }

  /* Home */
  .page-template-page-template-home .history .row > [class*="col-"] > .content-block,
  .page-template-page-template-home .next-events .row > [class*="col-"] > .content-block,
  .page-template-page-template-home .donate .row > [class*="col-"] > .content-block,
  .page-template-page-template-home .home-ctas .get-involved,
  .page-template-page-template-home .home-ctas .keep-updated {
    height: 100%;
  }
}

/* ---- 991px and narrower: mobile layout ----------------------------------- */

@media (max-width: 991px) {
  .desktop-image {display: none;}
  .mobile-image {display: block;}

  .sidebar.hide-mobile {display: none;}
  .sidebar.hide-desktop {display: block;}

  .single-post .sidebar {display: none;}
  .single-post .mobile-sidebar {display: block; position: relative; z-index: 2; margin: 0; padding: 0 50px 50px 50px;}
  .single-post .mobile-sidebar .news-article-link {background-color: transparent; display: block; font-weight: 300;}

  .page-template-page-template-standard a {overflow-wrap: break-word; word-wrap: break-word;}

  /* Title blocks: a bar above the image */
  h1.title-block,
  p.title-block {
    padding: 20px 50px;
    aspect-ratio: auto;
    margin: 0 0 30px 0;
  }
}

/* ---- 768px and wider: cards --------------------------------------------- */

@media (min-width: 768px) {
  /* Cards */
  article > .event-article-link .image-panel .overlay h3,
  article > .news-article-link .image-panel .overlay h3 {
    min-height: 8rem;   /* two lines of the 4rem title line height */
  }
  /* The whole band is at least a date line plus two title lines, so cards
     without a date (pages in search results) match the ones with one */
  article > .event-article-link .image-panel .overlay,
  article > .news-article-link .image-panel .overlay {
    min-height: calc(2.5rem + 8rem + 40px);   /* date + title + 20px padding top and bottom */
  }
}

/* ---- 768px and narrower: footer logos two to a row ----------------------- */

@media (max-width: 768px) {
  #page-footer .sponsors {padding-top: 20px;}
  #page-footer .sponsors a {display: inline-block; width: 45%; margin: 0 0 20px 0;}
  #page-footer .sponsors a:nth-of-type(2) {margin: 0 0 20px 5%;}
  #page-footer .sponsors img {display: block; height: auto; width: 100%;}
}

/* ---- 599px and narrower: phones ------------------------------------------ */

@media (max-width: 599px) {
  section {padding: 0 0 30px 0;}

  .hero-text {position: static;}
  .home .hero-text {padding: 30px;}
  .home .content-block {padding: 30px !important;}
  .get-involved,
  .keep-updated,
  .grey-back {padding: 30px;}
  .get-involved a {overflow-wrap: break-word; word-wrap: break-word;}
  .testimonial .content-block blockquote {font-size: 3rem; line-height: 3.5rem;}

  .page-template-page-template-tour .sidebar {padding: 30px;}
  .single-post .mobile-sidebar {padding: 0 40px 50px 40px;}
  p.no-events {padding: 0 40px;}

  #page-footer {padding: 50px 12.5px;}
  #page-footer .col-12 {padding-bottom: 30px;}
  #page-footer .sponsors a {margin: 0 0 20px 0;}

  /* Title blocks */
  h1.title-block,
  p.title-block {
    padding: 20px 30px;
  }

  /* Events */
  .page-template-page-template-events .next-events .content-block,
  .page-template-page-template-events .past-events .content-block {
    padding: 20px 30px;
  }

  /* News pager: arrows only for Previous/Next and slightly smaller buttons,
     so "« 1 2 3 4 »" fits on one line down to 320px wide */
  .pager ul.page-numbers {
    gap: 6px;
  }
  .pager a.page-numbers,
  .pager span.page-numbers {
    min-width: 40px;
    padding: 8px 10px;
  }
  .pager .pager-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* Not found */
  .search-again {
    padding: 30px;
  }
}

/* ---- 575px and narrower -------------------------------------------------- */

@media (max-width: 575px) {
  #page-footer {padding: 50px 30px;}
}

/* ---- 414px and narrower -------------------------------------------------- */

@media (max-width: 414px) {
  section {padding: 0 10px 30px 10px;}
  .menu-open {position: relative; margin-right: 10px;}
  #page-header .blackbar .col-12 div {padding: 0 10px;}
  h1 {font-size: 4rem; line-height: 5rem;}
  .page-template-page-template-about .intro,
  .page-template-page-template-projects .intro,
  .page-template-page-template-donate .intro,
  .page-template-page-template-contact .intro,
  .page-template-page-template-standard .intro {font-size: 2.3rem; line-height: 2.9rem;}
}

/* ---- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  /* Lightbox */
  dialog.lightbox.is-loading::after { animation-duration: 3s; }
}
