/* ==========================================================================
   QR Agri & Food Consulting — Course detail page

   Loaded after style.css, responsive.css and category.css. Uses the same
   tokens, type scale and section rhythm as the home, About and Category
   pages; only the detail-specific compositions live here. Class prefix: .cd-

   1. Layout        course content beside the related-categories rail
   2. Content       title, lede, blocks, lists, exam figures
   3. Rail          related categories, contact card
   4. Responsive
   ========================================================================== */


/* ==========================================================================
   1. Layout
   ========================================================================== */

.cd-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 88px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 64px;
  align-items: start;
}

.cd-rail {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 22px;
}


/* ==========================================================================
   2. Content
   ========================================================================== */

.cd-title {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.18;
  margin-bottom: 22px;
}

.cd-lede {
  font-size: 18.5px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 16px;
}

.cd-content p {
  color: var(--muted);
  line-height: 1.78;
  margin-bottom: 14px;
}

/* Key facts, same rhythm as .about-facts on the home page. */
.cd-facts {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 30px 0 0;
  padding: 22px 0;
}

.cd-fact-val {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -.014em;
  line-height: 1.3;
}

.cd-fact-key {
  font-size: 13.5px;
  color: var(--muted);
}

.cd-block {
  margin-top: 44px;
}

.cd-block-head {
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
}

.cd-h2 {
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.3;
  margin-bottom: 16px;
}

/* Numbered objectives */
.cd-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: cd-step;
  display: grid;
  gap: 14px;
}

.cd-steps li {
  counter-increment: cd-step;
  position: relative;
  padding: 22px 26px 24px 74px;
  border-radius: var(--r);
  background: var(--white);
  box-shadow: var(--shadow);
  line-height: 1.7;
}

.cd-steps li::before {
  content: counter(cd-step, decimal-leading-zero);
  position: absolute;
  left: 26px;
  top: 20px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.2;
  color: var(--g-600);
}

/* Checked list */
.cd-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}

.cd-list li {
  position: relative;
  padding-left: 32px;
  line-height: 1.7;
  color: var(--ink);
}

.cd-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--g-100);
  border: 1px solid var(--g-300);
}

.cd-list li::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: .68em;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--g-700);
  border-bottom: 2px solid var(--g-700);
  transform: rotate(-45deg);
}

/* Assessment figures */
.cd-exam {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 30px 34px 32px;
  border-radius: var(--r-lg);
  background: var(--tint);
  border: 1px solid var(--line);
}

.cd-exam-num {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--ink);
}

.cd-exam-label {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.cd-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 40px;
}


/* ==========================================================================
   3. Rail — related categories
   ========================================================================== */

.cd-rail-head {
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 16px;
}

.cd-related {
  display: grid;
  gap: 14px;
}

/* Compact card: thumbnail beside title, in the .cat-card family. */
.cd-rel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.cd-rel-thumb {
  flex: 0 0 92px;
  width: 92px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
}

.cd-rel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms cubic-bezier(.2, .7, .2, 1);
}

.cd-rel:hover .cd-rel-thumb img {
  transform: scale(1.06);
}

.cd-rel-tag {
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 5px;
}

.cd-rel-title {
  font-size: 16px;
  line-height: 1.35;
  margin: 0;
}

.cd-rail-all {
  margin-top: 18px;
  font-weight: 600;
}

/* Contact card */
.cd-help {
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--tint);
  border: 1px solid var(--line);
}

.cd-help-title {
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.cd-help p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 18px;
}

.cd-help-links {
  display: grid;
  gap: 9px;
  font-size: 15.5px;
}

.cd-help-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 20px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--b-600);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 14px 30px -12px rgba(53, 148, 76, .45);
}


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

@media (max-width: 1440px) {
  .cd-wrap {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-width: 1180px) {
  .cd-wrap {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 44px;
  }
}

@media (max-width: 1000px) {
  .cd-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 52px;
  }

  .cd-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
  }
}

@media (max-width: 900px) {
  .cd-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 760px) {
  .cd-wrap {
    padding: 56px 20px;
  }

  .cd-rail,
  .cd-exam {
    grid-template-columns: minmax(0, 1fr);
  }

  .cd-exam {
    gap: 22px;
    padding: 26px 24px 28px;
  }

  .cd-block {
    margin-top: 36px;
  }

  .cd-steps li {
    padding: 20px 22px 22px 64px;
  }

  .cd-steps li::before {
    left: 22px;
  }
}


/* ==========================================================================
   5. Training info panel + register CTAs
   Replaces the former sidebar contact box on course pages. Uses the existing
   tokens and the same pill/ radius language as .cd-help it supersedes.
   ========================================================================== */

.cd-cta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 22px 0 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.cd-register-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 999px;
  background: var(--b-600);
  color: var(--white);
  font-weight: 700;
  font-size: 15.5px;
  box-shadow: 0 14px 30px -12px rgba(53, 148, 76, .45);
  transition: box-shadow 260ms, transform 260ms;
}

.cd-register-btn:hover {
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 20px 36px -12px rgba(53, 148, 76, .6);
}

.cd-cta-date {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
}

.cd-cta-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 36px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--tint);
  border: 1px solid var(--line);
}

.cd-cta-foot-title {
  font-size: 19px;
  line-height: 1.35;
  margin-bottom: 6px;
}

.cd-cta-foot-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ----- sidebar panel ----- */

.cd-info {
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--tint);
  border: 1px solid var(--line);
  margin-bottom: 32px;
}

.cd-info-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--b-600);
  margin-bottom: 18px;
}

.cd-info-rows {
  display: grid;
  gap: 16px;
}

.cd-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cd-info-row svg {
  flex: none;
  margin-top: 2px;
  color: var(--b-600);
}

.cd-info-key {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.cd-info-val {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.cd-info-cta {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 22px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--b-600);
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 14px 30px -12px rgba(53, 148, 76, .45);
  transition: box-shadow 260ms, transform 260ms;
}

.cd-info-cta:hover {
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 20px 36px -12px rgba(53, 148, 76, .6);
}

.cd-info-all {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .cd-cta-foot {
    padding: 22px;
  }

  .cd-cta-foot .cd-register-btn,
  .cd-cta-top .cd-register-btn {
    width: 100%;
  }

  .cd-info {
    padding: 22px;
  }
}
