/* ==========================================================================
   QR Agri & Food Consulting — Listing page (BRCGS training courses)

   Loaded after style.css and responsive.css. Uses the same tokens, type
   scale and shapes as the Home, About and Category pages; only the
   Listing-specific compositions live here. Class prefix: .lst-

   1. Page banner
   2. Courses — the BRCGS course cards
   3. Pagination
   4. Responsive
   ========================================================================== */


/* ==========================================================================
   1. Page banner
   ========================================================================== */

.lst-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--g-800);
}

.lst-hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.lst-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.04);
}

.lst-hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(78% 120% at 12% 100%, rgba(34, 31, 25, .74), transparent 68%),
    linear-gradient(180deg, rgba(34, 31, 25, .62) 0%, rgba(34, 31, 25, .40) 42%, rgba(34, 31, 25, .78) 100%);
}

.lst-hero-inner {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 188px 40px 78px;
}

.lst-crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(253, 251, 245, .78);
  margin-bottom: 22px;
}

.lst-crumb a {
  color: rgba(253, 251, 245, .78);
}

.lst-crumb a:hover {
  color: var(--white);
}

.lst-crumb-sep {
  width: 18px;
  height: 1px;
  background: var(--g-300);
  opacity: .7;
}

.lst-crumb-here {
  color: var(--g-300);
}

.lst-hero-title {
  font-size: clamp(40px, 5vw, 70px);
  color: var(--white);
  max-width: 14em;
}

.lst-hero-rule {
  width: 84px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
  margin-top: 26px;
}


/* ==========================================================================
   2. Courses — the BRCGS course cards
   ========================================================================== */

.lst-courses {
  max-width: 1320px;
  margin: 0 auto;
  padding: 88px 40px;
}

.lst-courses-head {
  margin-bottom: 44px;
}

.lst-courses-head .section-title {
  max-width: 16em;
}
.lst-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

/* The card is a column: a tall photo, then the copy, with the footer
   pinned to the bottom so a row of cards keeps its buttons on one line. */
.lst-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 400ms cubic-bezier(.2, .7, .2, 1),
    box-shadow 400ms cubic-bezier(.2, .7, .2, 1),
    border-color 400ms;
}

.lst-card:hover {
  transform: translateY(-6px);
  border-color: var(--g-300);
  box-shadow: var(--shadow-lift);
}


/* ---------- Media ---------- */

.lst-card-media {
  position: relative;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 3 / 2;
}

.lst-card-media img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 800ms cubic-bezier(.2, .7, .2, 1);
}

.lst-card:hover .lst-card-media img {
  transform: scale(1.06);
}

/* Scrim keeps the tag legible over a busy photograph and settles the
   crop into the card instead of leaving a hard edge. */
.lst-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(34, 31, 25, .34) 0%,
      rgba(34, 31, 25, .04) 38%,
      rgba(34, 31, 25, 0) 62%);
  pointer-events: none;
}

.lst-card-tag {
  position: absolute;
  z-index: 1;
  left: 16px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(253, 251, 245, .95);
  backdrop-filter: blur(6px);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2f3d1f;
  box-shadow: 0 6px 18px -8px rgba(31, 61, 25, .5);
}

.lst-card-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--g-600);
}

/* Accreditation sits opposite the tag, over the photo, so the body
   below is left to the course itself. */
.lst-card-note {
  position: absolute;
  z-index: 1;
  right: 16px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(34, 31, 25, .62);
  backdrop-filter: blur(6px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--white);
}


/* ---------- Body ---------- */

.lst-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 26px 26px 28px;
}

.lst-card-title {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

/* Short brand rule under the heading — the same accent the page banner
   and section heads use. */
.lst-card-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  border-radius: 999px;
  background: var(--red);
  margin: 14px 0 0;
  transition: width 400ms cubic-bezier(.2, .7, .2, 1);
}

.lst-card:hover .lst-card-title::after {
  width: 64px;
}

.lst-card-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-top: 14px;
}


/* ---------- Meta chips ---------- */

.lst-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 24px;
}

/* Rows are free text from the course's Details panel, so a chip may hold a
   whole sentence: it wraps inside the card instead of running off the edge.
   The 16px radius is still a full pill on one line and a soft box on two. */
.lst-card-meta-item {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 100%;
  padding: 7px 13px;
  border-radius: 16px;
  background: var(--tint);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #4c4638;
  overflow-wrap: anywhere;
}

/* Centres the icon on the first line of text. */
.lst-card-meta-item svg {
  flex: none;
  margin-top: 1.5px;
  color: var(--g-600);
}


/* ---------- Footer ---------- */

.lst-card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.lst-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--b-600);
  color: var(--white);
  font-weight: 600;
  font-size: 14.5px;
  box-shadow: 0 12px 26px -14px rgba(53, 148, 76, .55);
  transition: box-shadow 260ms, transform 260ms;
}

.lst-card-btn:hover {
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -14px rgba(53, 148, 76, .7);
}

.lst-card-btn svg {
  transition: transform 300ms cubic-bezier(.2, .7, .2, 1);
}

.lst-card:hover .lst-card-btn svg {
  transform: translateX(4px);
}

/* Price/'·' slot at the end of the footer row. */
.lst-card-foot-note {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* ==========================================================================
   3. Pagination
   ========================================================================== */

.lst-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.lst-page {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 220ms, color 220ms, border-color 220ms, box-shadow 220ms;
}

.lst-page:hover {
  background: var(--tint);
  color: var(--ink);
  border-color: var(--g-300);
}

.lst-page.is-current {
  background: var(--g-800);
  border-color: var(--g-800);
  color: var(--white);
  box-shadow: 0 12px 24px -14px rgba(31, 61, 25, .6);
}

.lst-page.is-current:hover {
  background: var(--g-800);
  color: var(--white);
}

.lst-page.is-disabled {
  opacity: .45;
  pointer-events: none;
}

.lst-page-gap {
  min-width: 24px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.lst-page-next {
  margin-left: auto;
}


/* ==========================================================================
   4. Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .lst-hero-inner {
    padding: 164px 32px 66px;
  }

  .lst-courses {
    padding: 74px 32px;
  }

  .lst-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .lst-card-body {
    padding: 26px 26px 28px;
  }
}

/* Two columns get too narrow for the title below this, so go single file. */
@media (max-width: 860px) {
  .lst-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
}

@media (max-width: 760px) {
  .lst-hero-inner {
    padding: 132px 18px 52px;
  }

  .lst-courses {
    padding: 56px 18px;
  }

  .lst-courses-head {
    margin-bottom: 32px;
  }

  .lst-grid {
    gap: 22px;
  }

  .lst-card-media {
    aspect-ratio: 16 / 10;
  }

  .lst-card-body {
    padding: 24px 22px 26px;
  }

  .lst-card-title {
    font-size: 20px;
  }

  .lst-card-foot {
    padding-top: 22px;
  }

  .lst-card-btn {
    flex: 1;
    justify-content: center;
  }

  .lst-page-label {
    display: none;
  }

  .lst-page-next {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {

  .lst-card,
  .lst-card-media img,
  .lst-card-title::after,
  .lst-card-btn,
  .lst-card-btn svg {
    transition: none !important;
  }

  .lst-card:hover {
    transform: none;
  }
}


/* ----- per-course register CTA + section intro (added with the training rebuild) ----- */

.lst-card-register {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--b-600);
  color: var(--b-600);
  font-weight: 700;
  font-size: 14.5px;
  transition: background 240ms, color 240ms, transform 240ms;
}

.lst-card-register:hover {
  background: var(--b-600);
  color: var(--white);
  transform: translateY(-1px);
}

.lst-courses-lede {
  max-width: 70ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

@media (max-width: 560px) {
  .lst-card-foot {
    flex-wrap: wrap;
  }

  .lst-card-register {
    margin-left: 0;
    width: 100%;
  }
}
