/* ==========================================================================
   QR Agri & Food Consulting — Responsive stylesheet
   Loaded after style.css. Desktop-first: breakpoints descend from large
   screens to small. Each breakpoint appears exactly once.

   Breakpoints
   -----------
   1440px  large desktop / laptop
   1280px  small laptop
   1180px  tablet landscape
   1080px  tablet — nav collapses, scroll-pinned sections unpin
    900px  small tablet
    760px  phone landscape / large phone
    560px  phone
    380px  small phone
   Plus a short-screen (max-height) query for the pinned about section and
   preference queries (reduced motion) at the end.
   ========================================================================== */

/* ==========================================================================
   1440px — large desktop
   ========================================================================== */
@media (max-width: 1440px) {
  .shell-flush,
  .hero-inner,
  .section,
  .section-md,
  .section-lg,
  .why-inner,
  .about-inner,
  .blog-overlap,
  .news-wrap,
  .signup-inner,
  .footer-inner,
  .footer-legal,
  .bar-inner {
    padding-left: 32px;
    padding-right: 32px;
  }

  .signup-ghost {
    font-size: 240px;
  }
}

/* ==========================================================================
   1280px — small laptop
   ========================================================================== */
@media (max-width: 1280px) {
  .hero-inner {
    gap: 40px;
    padding-top: 48px;
    padding-bottom: 72px;
  }
  .hero-media {
    min-height: 460px;
  }
  .hero-next {
    left: 0;
  }

  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }
  .section-lg {
    padding-top: 84px;
  }
  .blog {
    padding-top: 84px;
  }
  .signup {
    margin-top: 84px;
  }

  .why-inner {
    grid-template-columns: 48px 1.05fr 1fr;
    gap: 32px;
  }
  .testi {
    gap: 40px;
  }
  .faq {
    gap: 40px;
  }
  .signup-inner {
    gap: 40px;
    padding-top: 80px;
    padding-bottom: 84px;
  }
  .footer-inner {
    gap: 32px;
  }
}

/* ==========================================================================
   1180px — tablet landscape
   ========================================================================== */
@media (max-width: 1180px) {
  .r-util {
    display: none !important;
  }

  .nav {
    font-size: 14px;
  }
  .nav-link {
    padding: 9px 11px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile {
    height: 230px;
  }

  .course {
    grid-template-columns: auto;
    gap: 18px;
  }
  .signup-ghost {
    font-size: 180px;
  }
}

/* ==========================================================================
   1080px — tablet: nav collapses, scroll-pinned sections unpin
   ========================================================================== */
@media (max-width: 1080px) {
  /* Header: swap the desktop nav for the burger menu */
  .r-nav {
    display: none !important;
  }
  .r-burger {
    display: inline-flex !important;
  }

  /* Hero stacks */
  .r-hero,
  .r-founder,
  .r-form {
    grid-template-columns: 1fr !important;
  }
  .r-hero-media {
    min-height: 320px !important;
  }
  .hero-inner {
    gap: 36px;
  }
  .hero-next {
    position: static;
    max-width: none;
    margin-top: 14px;
  }
  .hero-badge {
    display: none;
  }

  .r-3,
  .r-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* "Why" section: unpin the scroll-driven layout */
  .r-why {
    grid-template-columns: 44px 1fr !important;
    gap: 24px !important;
  }
  .r-why {
    grid-template-areas:
      "rail media"
      "rail text" !important;
    align-content: center !important;
  }
  .r-why > div:first-child {
    grid-area: rail;
  }
  .r-why > div:nth-child(2) {
    grid-area: text;
  }
  .r-why-media {
    grid-area: media;
    height: 30vh !important;
    margin-bottom: 22px;
  }

  /* About / founder: release the sticky pin and the horizontal track */
  .r-about {
    height: auto !important;
  }
  .r-about-sticky {
    position: static !important;
    height: auto !important;
    padding: 72px 0 !important;
  }
  .r-about-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .r-portrait {
    height: 380px !important;
  }
  .r-track {
    transform: none !important;
    flex-direction: row !important;
    width: auto !important;
    flex-wrap: wrap;
  }
  .r-card {
    width: auto !important;
    flex: 0 0 auto !important;
  }
  .r-card.ab-card {
    width: 47.5% !important;
    flex: 0 0 47.5% !important;
    margin: 0;
  }
  .about-facts {
    justify-content: center;
    text-align: center;
  }
  .stack-14 {
    display: grid;
    gap: 14px;
    grid-template-columns: auto auto auto;
  }
  .ab-portrait {
    transform: none !important;
  }
  .section-lg,
  .blog {
    padding-top: 44px;
  }
  .r-testi,
  .r-news {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .r-founder > div:first-child {
    padding-bottom: 0 !important;
  }

  .testi-quote {
    min-height: 0;
  }
  .faq-aside {
    position: static;
  }
  .faq-a {
    padding-right: 20px;
  }

  .blog-media {
    height: 340px;
  }
  .blog-overlap {
    margin-top: -80px;
  }
  .blog-card {
    max-width: 100%;
    padding: 28px 28px 30px;
  }

  .signup-ghost {
    display: none;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .logo-strip .img-slot-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}

/* ==========================================================================
   900px — small tablet
   ========================================================================== */
@media (max-width: 900px) {
  .shell-flush,
  .hero-inner,
  .section,
  .section-md,
  .section-lg,
  .why-inner,
  .about-inner,
  .blog-overlap,
  .news-wrap,
  .signup-inner,
  .footer-inner,
  .footer-legal,
  .bar-inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero-inner {
    padding-top: 36px;
    padding-bottom: 56px;
  }
  .hero-media {
    min-height: 380px;
  }
  .hero-stats {
    gap: 18px;
  }

  .course {
    grid-template-columns: auto;
  }
  .course > :last-child {
    grid-column: 1 / -1;
  }

  .form-card {
    padding: 24px;
  }
  .signup-inner {
    padding-top: 64px;
    padding-bottom: 72px;
  }

  .about-facts {
    gap: 22px;
  }
  .rule-left {
    padding-left: 22px;
  }
}

/* ==========================================================================
   760px — phone landscape / large phone
   ========================================================================== */
@media (max-width: 760px) {
  .r-sec {
    padding-top: 60px !important;
  }
  .stack-14 {
    display: grid;
    gap: 14px;
    grid-template-columns: 50% 50%;
  }
  .r-pad {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .r-h1 {
    font-size: 40px !important;
  }

  .r-3,
  .r-4,
  .r-footer {
    grid-template-columns: auto auto !important;
  }
  .r-course {
    grid-template-columns: 1fr !important;
  }

  /* Header */
  .site-header {
    padding: 10px 0 6px;
  }
  .nav-bar {
    padding: 8px 8px 8px 14px;
    gap: 10px;
  }
  .brand-logo {
    height: 28px;
  }

  /* Hero */
  .hero-inner {
    padding-top: 28px;
    padding-bottom: 48px;
    gap: 28px;
  }
  .hero-lede {
    font-size: 15.5px;
    margin-bottom: 24px;
  }
  .hero-cta {
    gap: 10px;
  }
  .btn-primary-lg,
  .btn-ghost-lg {
    padding: 13px 20px;
  }
  .hero-media {
    min-height: 300px;
  }
  .hero-stat-num {
    font-size: 27px;
  }

  /* Sections */
  .section {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .section-md {
    padding-top: 52px;
  }
  .section-lg {
    padding-top: 64px;
  }
  .section-head {
    gap: 18px;
    margin-bottom: 28px;
  }
  .section-link {
    margin-left: 0;
  }

  .card-media {
    height: 200px;
  }
  .card-body {
    padding: 22px 22px 24px;
  }
  .tile {
    height: 200px;
  }

  .filters {
    gap: 20px;
  }
  .course {
    padding: 18px;
    gap: 16px;
  }
  .course > :last-child {
    grid-column: auto;
  }
  .course-date {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    justify-self: start;
    padding: 8px 14px;
  }
  .btn-register {
    width: 100%;
  }

  /* Why */
  .r-why {
    grid-template-columns: 1fr !important;
  }
  .r-why {
    grid-template-areas:
      "media"
      "text" !important;
  }
  .why-rail {
    display: none;
  }
  .r-why-media {
    height: 34vh !important;
  }
  .why-body {
    font-size: 16.5px;
  }

  /* About */
  .r-about-sticky {
    padding: 0 0 !important;
  }
  .r-portrait {
    height: 300px !important;
  }
  .quote {
    font-size: 18px;
  }

  /* Testimonials */
  .testi-person {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* FAQ */
  .faq-a {
    padding: 0 8px 22px 16px;
  }

  /* Blog */
  .blog {
    padding-top: 64px;
  }
  .blog-media {
    height: 260px;
  }
  .blog-overlap {
    margin-top: -56px;
  }
  .blog-card {
    padding: 24px 20px 26px;
  }

  /* Newsletter */
  .news-wrap {
    margin-top: 52px;
  }
  .news-form {
    flex-direction: column;
    align-items: stretch;
  }
  .news-input {
    min-width: 0;
  }
  .btn-subscribe {
    width: 100%;
  }

  /* Signup form */
  .signup {
    margin-top: 64px;
  }
  .signup-inner {
    padding-top: 0px;
    padding-bottom: 0px;
  }
  .form-card {
    padding: 20px;
    border-radius: var(--r);
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .steps {
    flex-wrap: wrap;
  }

  /* Footer */
  .footer-inner {
    padding-top: 48px;
    gap: 28px;
  }
  .footer-legal {
    padding-bottom: 150px;
    gap: 12px;
  }
  .footer-legal .grow {
    display: none;
  }

  /* Sticky bar */
  .bar-inner {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 18px;
  }
  .bar-actions {
    margin-left: 0;
    width: 100%;
  }
  .bar-actions > * {
    flex: 1;
    text-align: center;
  }
  .h-founder {
    font-size: 18px;
  }
  .signup-title {
    font-size: clamp(24px, 3vw, 42px);
  }
  .shell-flush,
  .hero-inner,
  .section,
  .section-md,
  .section-lg,
  .why-inner,
  .about-inner,
  .blog-overlap,
  .news-wrap,
  .signup-inner,
  .footer-inner,
  .footer-legal,
  .bar-inner {
    padding-left: 0px;
    padding-right: 0px;
  }
  .about-facts {
    margin-bottom: 26px !important;
  }
}

/* ==========================================================================
   560px — phone
   ========================================================================== */
@media (max-width: 560px) {
  .site-footer,
  .footer-legal {
    text-align: center;
  }
  .r-h1 {
    font-size: 28px !important;
  }
  .r-3,
  .r-4,
  .r-footer {
    grid-template-columns: 1fr !important;
  }
  .footer-legal {
    padding-bottom: 165px;
    gap: 12px;
    line-height: 1;
    display: inline-block;
  }
  .bar-inner {
    justify-content: center;
    text-align: center;
  }
  .stack-14 {
    display: grid;
    gap: 14px;
    grid-template-columns: 100%;
  }
  .r-card.ab-card {
    width: 100% !important;
    flex: 0 0 100% !important;
    margin: 0;
  }
  .nav-actions {
    gap: 6px;
  }
  .btn-nav-cta {
    padding: 10px 14px;
    font-size: 14px;
  }

  .hero-stats {
    gap: 14px 22px;
  }
  .hero-stat {
    min-width: 96px;
  }
  .hero-media {
    min-height: 260px;
  }

  .section-title,
  .section-title-tight {
    font-size: 25px;
  }

  .card-media {
    height: 180px;
  }
  .tile {
    height: 170px;
  }

  .about-facts {
    flex-direction: column;
    gap: 16px;
  }
  .rule-left {
    border-left: 0;
    padding-left: 0;
  }

  .testi-quote {
    font-size: 20px;
  }
  .empty-state {
    padding: 26px;
  }
  .r-why-media {
    height: 28vh !important;
  }

  /* .bar-actions {
    flex-direction: column;
  } */
}

/* ==========================================================================
   380px — small phone
   ========================================================================== */
@media (max-width: 380px) {
  .r-h1 {
    font-size: 29px !important;
  }
  .r-pad {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .brand-logo {
    height: 24px;
  }
  .btn-nav-cta {
    display: none;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary-lg,
  .btn-ghost-lg {
    text-align: center;
  }

  .card-body {
    padding: 18px;
  }
  .course {
    padding: 15px;
  }
  .form-card {
    padding: 16px;
  }
  .blog-card {
    padding: 20px 16px 22px;
  }
}

/* ==========================================================================
   Short desktop screens — laptops. The about section is pinned for its whole
   scroll, so everything in it has to fit one viewport.
   ========================================================================== */
@media (min-width: 1081px) and (max-height: 860px) {
  .about-sticky {
    padding: 76px 0 20px;
  }
  .portrait {
    height: 56vh;
    min-height: 300px;
  }
  .about-head {
    margin-bottom: 12px;
  }
  .quote {
    margin-bottom: 20px;
  }
  .quote.is-long {
    font-size: clamp(17px, 1.3vw, 20px);
    line-height: 1.45;
  }
  .ab-card {
    padding: 20px 22px;
  }
  .card-thumb {
    height: 130px;
  }
  .about-facts {
    margin-top: 16px;
    padding-top: 14px;
  }
  .stat-num-lg {
    font-size: 26px;
  }
}

/* ==========================================================================
   Preference queries
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .why-slide,
  .ab-portrait,
  .ab-track,
  .sticky-bar {
    transition: none;
  }

  .btn-circle:hover,
  .btn-circle-solid:hover,
  .btn-circle:active,
  .btn-circle-solid:active {
    transform: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
  .marquee {
    animation: none;
  }
  .sweep::after {
    animation: none;
    transform: scaleX(1);
  }
}
