/* ==========================================================================
   Training Station — Global styles
   Shared tokens, layout helpers and components used on every page.
   Page-specific styles live in their own file (e.g. home.css).
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  --ts-dark: #23333e;
  --ts-dark-2: #22333d;
  --ts-black: #000;
  --ts-white: #fff;
  --ts-orange: #e66d24;
  --ts-amber: #f6aa29;
  --ts-cream: #fff8ef;
  --ts-cream-2: #fdf3ea;
  --ts-cream-menu: #f8ead6;
  --ts-gradient: linear-gradient(90deg, #e66b23 0%, #f7b02b 100%);

  --ts-font-head: "Poppins", sans-serif;
  --ts-font-body: "Montserrat", sans-serif;

  --ts-leaf-lg: 50px;
  --ts-leaf-md: 36px;
  --ts-leaf-sm: 20px;

  --ts-shadow: 8px 10px 18px rgba(0, 0, 0, 0.18);
  --ts-container: 1162px;
}

/* ---------- 2. Base ---------- */
body {
  font-family: var(--ts-font-body);
  color: var(--ts-dark);
  background: var(--ts-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--ts-orange);
}

/* Content width taken from the 1440px artboard (139px → 1301px). */
.ts-container {
  width: 100%;
  max-width: calc(var(--ts-container) + 32px);
  margin-inline: auto;
  padding-inline: 16px;
}

.ts-section-title {
  font-family: var(--ts-font-head);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.2;
  color: var(--ts-dark);
  text-align: center;
  margin: 0;
}

/* Repeating chevron pattern used behind heroes / promos */
.ts-chevron-bg {
  background-image: url("../img/ui/bg-chevron.svg");
  background-repeat: repeat-x;
  background-size: 324px 325px;
  background-position: calc(50% - 368px) center;
}

/* Leaf shape: top-left + bottom-right rounded */
.ts-leaf {
  border-radius: var(--ts-leaf-lg) 0 var(--ts-leaf-lg) 0;
}

/* Gradient border helper — set --ts-fill to the inner colour */
.ts-gradient-border {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--ts-fill, #fff), var(--ts-fill, #fff)) padding-box,
    var(--ts-gradient) border-box;
}

/* ---------- 3. Buttons ---------- */
.ts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ts-font-body);
  font-size: 14px;
  line-height: 1;
  color: var(--ts-dark);
  border: 0;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.ts-btn:hover {
  color: var(--ts-dark);
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.ts-btn--gradient {
  background: var(--ts-gradient);
}

.ts-btn--outline {
  --ts-fill: #fff;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--ts-fill), var(--ts-fill)) padding-box,
    var(--ts-gradient) border-box;
  border-radius: 0 0 var(--ts-leaf-sm) 0;
}

.ts-btn--outline:hover {
  --ts-fill: var(--ts-cream);
}

/* Big call-to-action (Get Certificate / View All Blogs) */
.ts-btn--cta {
  background: var(--ts-gradient);
  color: var(--ts-white);
  font-family: var(--ts-font-head);
  font-size: 21px;
  height: 43px;
  padding: 0 40px;
  border-radius: 0 0 var(--ts-leaf-sm) 0;
}

.ts-btn--cta:hover {
  color: var(--ts-white);
}

/* ---------- 4. Search bar ---------- */
.ts-search {
  position: relative;
  display: flex;
  align-items: center;
  height: 31px;
  border: 1.5px solid var(--ts-dark);
  border-radius: 20px 0 20px 0;
  background: var(--ts-white);
}

.ts-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px 0 18px;
  font-size: 14px;
  color: var(--ts-dark);
}

.ts-search__btn {
  flex: 0 0 68px;
  height: calc(100% - 6px);
  margin-right: 3px;
  border: 0;
  border-radius: 14px 0 14px 0;
  background: var(--ts-dark);
  color: var(--ts-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* Orange variant (hero) */
.ts-search--orange {
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--ts-gradient) border-box;
}

.ts-search--orange .ts-search__btn {
  background: var(--ts-gradient);
}

/* ---------- 5. Header ---------- */
.site-header {
  position: relative;
  z-index: 50;
  background: var(--ts-white);
}

.site-header__inner {
  max-width: 1440px;
  margin-inline: auto;
  height: 107px;
  padding: 0 75px 0 45px;
  display: flex;
  align-items: center;
}

.site-header__logo img {
  width: 182px;
  display: block;
}

.site-header__search {
  width: 335px;
  margin-left: auto;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 0 66px;
  padding: 0;
  list-style: none;
}

.site-header__link {
  position: relative;
  display: block;
  font-family: var(--ts-font-head);
  font-weight: 500;
  font-size: 16px;
  color: var(--ts-dark);
  padding: 6px 0;
}

.site-header__link.is-active {
  color: var(--ts-black);
  margin-right: 14px;
}

.site-header__link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  background: var(--ts-gradient);
}

.site-header__cart {
  margin-left: 38px;
}

.ts-icon-btn {
  width: 37px;
  height: 33px;
  border-radius: 5px;
  border: 0;
  background: var(--ts-dark-2);
  color: var(--ts-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.ts-icon-btn:hover {
  color: var(--ts-amber);
}

.site-header__mobile-actions {
  display: none;
  gap: 10px;
  margin-left: auto;
}

/* Mobile menu panel */
.site-header__panel {
  background: var(--ts-cream-menu);
  padding: 22px 30px 18px;
}

.site-header__panel .ts-search {
  max-width: 270px;
  margin: 0 0 14px auto;
}

.site-header__panel-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: right;
}

.site-header__panel-nav a {
  display: inline-block;
  font-family: var(--ts-font-head);
  font-weight: 500;
  font-size: 15px;
  padding: 7px 0;
}

.site-header__panel-nav a.is-active {
  position: relative;
  color: var(--ts-black);
  font-weight: 600;
}

.site-header__panel-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3px;
  background: var(--ts-gradient);
}

/* ---------- 6. Course card (shared) ---------- */
.ts-course-card {
  --ts-fill: var(--ts-cream);
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--ts-fill), var(--ts-fill)) padding-box,
    var(--ts-gradient) border-box;
  border-radius: var(--ts-leaf-md) 0 var(--ts-leaf-md) 0;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ts-course-card:hover {
  box-shadow: 0 12px 24px rgba(230, 109, 36, 0.18);
  transform: translateY(-3px);
}

.ts-course-card__media {
  display: block;
  aspect-ratio: 270 / 182;
  overflow: hidden;
}

.ts-course-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ts-course-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 13px 9px 10px;
}

.ts-course-card__title {
  font-family: var(--ts-font-body);
  font-weight: 500;
  font-size: 15px;
  line-height: 18px;
  margin: 0 0 4px;
  padding-inline: 1px;
  flex: 1;
}

.ts-course-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 0 6px 0 1px;
}

.ts-course-card__meta .bi {
  color: #f19a27;
  font-size: 12px;
  margin-right: 3px;
}

.ts-course-card__price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 19px 0 13px;
  padding-left: 1px;
}

.ts-course-card__price del {
  font-weight: 600;
  font-size: 16px;
  color: var(--ts-dark);
}

.ts-course-card__price strong {
  font-weight: 600;
  font-size: 27px;
  line-height: 1;
  color: var(--ts-dark);
}

.ts-card-divider {
  height: 3px;
  background: var(--ts-gradient);
  margin-bottom: 8px;
}

.ts-course-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.ts-course-card__actions .ts-btn {
  height: 42px;
  font-weight: 500;
}

/* ---------- 7. Blog card (shared) ---------- */
.ts-blog-card {
  --ts-fill: var(--ts-cream);
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--ts-fill), var(--ts-fill)) padding-box,
    var(--ts-gradient) border-box;
  border-radius: var(--ts-leaf-md) 0 var(--ts-leaf-md) 0;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ts-blog-card:hover {
  box-shadow: 0 12px 24px rgba(230, 109, 36, 0.18);
  transform: translateY(-3px);
}

.ts-blog-card__media {
  display: block;
  aspect-ratio: 270 / 182;
  overflow: hidden;
}

.ts-blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ts-blog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 13px 9px 13px;
}

.ts-blog-card__title {
  font-family: var(--ts-font-body);
  font-weight: 400;
  font-size: 15px;
  line-height: 18px;
  margin: 0 0 13px;
  padding-inline: 1px;
  flex: 1;
}

.ts-blog-card__excerpt {
  font-weight: 300;
  font-size: 10px;
  line-height: 15px;
  margin: 0 0 12px;
  padding-inline: 2px;
}

.ts-blog-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.ts-blog-card__brand {
  height: 42px;
  border: 2px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--ts-gradient) border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

.ts-blog-card__brand img {
  max-height: 30px;
}

.ts-blog-card__actions .ts-btn {
  height: 42px;
}

/* ---------- 8. Logo box (accreditation / organisations) ---------- */
.ts-logo-box {
  border: 3px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--ts-gradient) border-box;
  border-radius: 28px 0 28px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ts-logo-box img {
  max-height: 100%;
  object-fit: contain;
}

/* ---------- 9. Slider dots ---------- */
.ts-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.ts-dots button {
  width: 8px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 2px 0 2px 0;
  background: #b5b5b5;
  transition: width 0.25s ease, background 0.25s ease;
}

.ts-dots button.is-active {
  width: 16px;
  background: var(--ts-gradient);
}

/* ---------- 10. Footer ---------- */
.site-footer {
  background: var(--ts-dark-2);
  color: var(--ts-white);
  padding: 68px 0 100px;
}

.site-footer__inner {
  max-width: 1244px;
}

.site-footer__logo img {
  width: 182px;
}

.site-footer__address {
  font-weight: 300;
  font-size: 16px;
  line-height: 22px;
  margin: 50px 0 34px 8px;
}

.site-footer__address a:hover {
  color: var(--ts-amber);
}

.site-footer__social {
  display: flex;
  gap: 31px;
  list-style: none;
  padding: 0;
  margin: 0 0 0 7px;
}

.site-footer__social a {
  display: block;
  width: 49px;
  height: 49px;
  border-radius: 50%;
  background: var(--ts-white);
  padding: 5px;
  transition: transform 0.2s ease;
}

.site-footer__social a:hover {
  transform: translateY(-3px);
}

.site-footer__social img {
  width: 100%;
  height: 100%;
  display: block;
}

.site-footer__heading {
  font-family: var(--ts-font-body);
  font-weight: 500;
  font-size: 18px;
  margin: 0 0 6px;
  padding-bottom: 16px;
  position: relative;
  display: inline-block;
  min-width: 202px;
}

/* Underline: 8 white leaf-shaped dots (same shape as the slider dots, .ts-dots) */
.site-footer__heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 126px; /* 8 dots x 14px + 7 gaps x 2px */
  height: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='4' viewBox='0 0 16 4'%3E%3Cpath fill='%23fff' d='M2 0H14V2a2 2 0 0 1-2 2H0V2a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") repeat-x left center / 16px 4px;
}

.site-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__links li + li {
  margin-top: 10px;
}

.site-footer__links a {
  font-weight: 300;
  font-size: 18px;
  line-height: 24px;
}

.site-footer__links a:hover {
  color: var(--ts-amber);
}

/* Footer column positions (desktop artboard: 113 / 674 / 1059) */
@media (min-width: 992px) {
  .site-footer__brand { flex: 0 0 45.4%; max-width: 45.4%; }
  .site-footer__col { flex: 0 0 32.6%; max-width: 32.6%; }
  .site-footer__col + .site-footer__col { flex: 0 0 22%; max-width: 22%; }
}

/* ---------- 11. Responsive (shared) ---------- */
@media (max-width: 1299.98px) {
  .site-header__inner {
    padding: 0 30px;
  }

  .site-header__search {
    width: 260px;
  }

  .site-header__nav {
    margin-left: 32px;
    gap: 18px;
  }
}

@media (max-width: 1099.98px) {
  .site-header__inner {
    height: 100px;
    padding: 0 16px;
  }

  .site-header__logo img {
    width: 172px;
  }

  .site-header__search,
  .site-header__nav,
  .site-header__cart {
    display: none;
  }

  .site-header__mobile-actions {
    display: flex;
  }

  .ts-icon-btn {
    width: 43px;
    height: 34px;
    font-size: 20px;
  }

  .site-header__mobile-actions .bi-list {
    font-size: 28px;
  }
}

@media (max-width: 767.98px) {
  /* Chevron pattern: two stacked rows on phones (same image, second row 325px lower).
     'body' raises specificity above page rules that set their own position. */
  body .ts-chevron-bg {
    background-image: url("../img/ui/bg-chevron.svg"), url("../img/ui/bg-chevron.svg");
    background-repeat: repeat-x, repeat-x;
    background-size: 324px 325px, 324px 325px;
    background-position: calc(50% - 368px) var(--chevron-y, 0px), calc(50% - 368px) calc(var(--chevron-y, 0px) + 325px + var(--chevron-gap, 60px));
  }

  .ts-section-title {
    font-size: 24px;
  }

  .site-footer {
    padding: 36px 0 60px;
  }

  .site-footer__logo img {
    width: 172px;
  }

  .site-footer__address {
    font-size: 16px;
    line-height: 22px;
    max-width: 235px;
    margin: 42px 0 26px 4px;
  }

  .site-footer__social {
    gap: 30px;
    margin: 0 0 84px 2px;
  }

  .site-footer__social a {
    width: 48px;
    height: 48px;
  }

  .site-footer__col + .site-footer__col {
    margin-top: 34px;
  }

  .site-footer__heading {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .site-footer__links a {
    font-size: 17px;
  }

  .site-footer__links li + li {
    margin-top: 8px;
  }

  .ts-course-card__title,
  .ts-blog-card__title {
    font-size: 10px;
    line-height: 12px;
  }

  .ts-course-card__meta,
  .ts-course-card__meta .bi {
    font-size: 8px;
  }

  .ts-course-card__price {
    margin: 12px 0 10px;
    gap: 6px;
  }

  .ts-course-card__price del {
    font-size: 10px;
  }

  .ts-course-card__price strong {
    font-size: 18px;
  }

  .ts-card-divider {
    height: 2px;
    margin-bottom: 7px;
  }

  .ts-course-card__body,
  .ts-blog-card__body {
    padding: 9px 7px;
  }

  .ts-course-card__actions,
  .ts-blog-card__actions {
    gap: 6px;
  }

  .ts-course-card__actions .ts-btn,
  .ts-blog-card__actions .ts-btn,
  .ts-blog-card__brand {
    height: 28px;
    font-size: 9px;
  }

  .ts-blog-card__brand img {
    max-height: 19px;
  }

  .ts-blog-card__title {
    margin-bottom: 8px;
  }

  .ts-blog-card__excerpt {
    font-size: 7px;
    line-height: 10px;
    margin-bottom: 10px;
  }

  .ts-btn--outline {
    border-width: 1.5px;
    border-radius: 0 0 12px 0;
  }

  .ts-course-card,
  .ts-blog-card {
    border-radius: 24px 0 24px 0;
  }
}
