/*
 * Trainiq snippets (snippets.js): the course cards, the next dates and the
 * dates of one course on a school's own website. Everything sits under
 * .tiq-s, so the sheet can be loaded on that website without touching it.
 * The look is the booking flow's (booking.css), which every link leads to.
 *
 * A host page can set, on .tiq-s or above it:
 *   --tiq-primary     the school's colour (snippets.js sets it from the API)
 *   --tiq-font-head   the font of titles and buttons (default: the page's)
 *   --tiq-font-body   the font of the text (default: the page's)
 */
.tiq-s {
    --tiq-primary: #c43f31;
    --tiq-s-primary-dark: color-mix(in srgb, var(--tiq-primary) 86%, #000);
    --tiq-s-primary-text: color-mix(in srgb, var(--tiq-primary) 92%, #000);
    --tiq-s-tint: color-mix(in srgb, var(--tiq-primary) 10%, #fff);
    --tiq-s-ink: #0f1c2e;
    --tiq-s-gray: #666776;
    --tiq-s-line: #e5e7eb;
    --tiq-s-green: #2a7230;
    --tiq-s-green-tint: #e8f3e9;
    --tiq-s-radius: 12px;
    --tiq-s-head: var(--tiq-font-head, inherit);
    color: var(--tiq-s-ink);
    font-family: var(--tiq-font-body, inherit);
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}
.tiq-s *, .tiq-s *::before, .tiq-s *::after { box-sizing: border-box; }
/* A theme underlines and colours its links; a card or a date row is a link as a whole and keeps its own text. */
.tiq-s a, .tiq-s a:hover, .tiq-s a:focus { color: inherit; text-decoration: none; }
/* :where() keeps this reset weaker than every class below. */
:where(.tiq-s) button { font: inherit; color: inherit; cursor: pointer; }
.tiq-s[aria-busy="true"] { min-height: 96px; }
.tiq-s svg { flex-shrink: 0; }

.tiq-s-muted { display: block; color: var(--tiq-s-gray); font-size: 14px; margin: 0; }
.tiq-s-error { margin: 0; padding: 12px 14px; border-radius: 8px; background: var(--tiq-s-tint); color: var(--tiq-s-primary-text); font-size: 14px; font-weight: 700; }
.tiq-s-link { border: 0; background: none; padding: 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
.tiq-s-input { display: block; width: 100%; max-width: 420px; margin: 0 0 24px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; padding: 13px 14px; font: inherit; color: var(--tiq-s-ink); }
.tiq-s-input:focus { outline: none; border-color: var(--tiq-s-ink); box-shadow: 0 0 0 1px var(--tiq-s-ink); }

.tiq-s-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 8px; border: 2px solid transparent; padding: 12px 22px; background: var(--tiq-primary); color: #fff !important; font-family: var(--tiq-s-head); font-weight: 600; font-size: 16px; line-height: 1.3; white-space: nowrap; transition: background-color .15s, color .15s; }
.tiq-s-btn--small { padding: 8px 14px; font-size: 14px; }
.tiq-s-btn--outline { background: #fff; border-color: var(--tiq-s-ink); color: var(--tiq-s-ink) !important; margin-top: 16px; }
.tiq-s-btn--outline:hover { background: var(--tiq-s-ink); color: #fff !important; }
a.tiq-s-btn:hover, a:hover > .tiq-s-row-side .tiq-s-btn { background: var(--tiq-s-primary-dark); }

.tiq-s-pill { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tiq-s-pill--available { background: var(--tiq-s-green-tint); color: var(--tiq-s-green); }
.tiq-s-pill--few { background: var(--tiq-s-tint); color: var(--tiq-s-primary-text); }
.tiq-s-pill--full { background: #f3f4f6; color: var(--tiq-s-gray); }
.tiq-s-price { font-family: var(--tiq-s-head); font-weight: 700; font-size: 18px; white-space: nowrap; }
.tiq-s-price small { font-family: var(--tiq-font-body, inherit); font-weight: 400; font-size: 12px; color: var(--tiq-s-gray); }
.tiq-s-price--text { font-size: 15px; }

/* ── Course cards ── */
.tiq-s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 24px; }
.tiq-s-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--tiq-s-line); border-radius: var(--tiq-s-radius); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tiq-s-card:hover, .tiq-s-card:focus-visible { border-color: var(--tiq-s-ink); box-shadow: 0 10px 24px rgba(15, 28, 46, .08); transform: translateY(-2px); }
.tiq-s-card-img { display: block; aspect-ratio: 16 / 9; background: var(--tiq-s-tint); }
.tiq-s-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tiq-s-card-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: 24px; }
.tiq-s-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--tiq-s-gray); }
.tiq-s-eyebrow b { color: var(--tiq-s-primary-text); }
.tiq-s-card-title { font-family: var(--tiq-s-head); font-weight: 700; font-size: 20px; line-height: 1.25; }
.tiq-s-card-text { color: var(--tiq-s-gray); font-size: 15px; }
.tiq-s-meta { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.tiq-s-meta li { display: flex; align-items: center; gap: 8px; margin: 0; }
.tiq-s-meta svg { color: var(--tiq-s-gray); }
.tiq-s-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--tiq-s-line); }
.tiq-s-more { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-family: var(--tiq-s-head); font-weight: 600; font-size: 14px; color: var(--tiq-s-primary-text); }
.tiq-s-card:hover .tiq-s-more svg { transform: translateX(3px); }
.tiq-s-more svg { transition: transform .15s; }

/* ── Dates ── */
.tiq-s-rows { display: flex; flex-direction: column; gap: 10px; }
.tiq-s-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; background: #fff; border: 1px solid var(--tiq-s-line); border-radius: var(--tiq-s-radius); padding: 14px; transition: border-color .15s; }
a.tiq-s-row:hover, a.tiq-s-row:focus-visible { border-color: var(--tiq-s-ink); }
.tiq-s-row.is-full { background: #fafafa; color: var(--tiq-s-gray); }
.tiq-s-day { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 10px; background: var(--tiq-s-tint); color: var(--tiq-s-primary-text); font-size: 12px; font-weight: 700; text-transform: uppercase; line-height: 1.1; flex-shrink: 0; }
.tiq-s-day b { font-family: var(--tiq-s-head); font-size: 20px; }
.tiq-s-row.is-full .tiq-s-day { background: #f3f4f6; color: var(--tiq-s-gray); }
.tiq-s-row-main { flex: 1 1 200px; min-width: 0; }
.tiq-s-row-title { display: block; font-family: var(--tiq-s-head); font-weight: 600; }
.tiq-s-row-title::first-letter { text-transform: uppercase; }
.tiq-s-row-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
    .tiq-s-card, .tiq-s-more svg, .tiq-s-btn, .tiq-s-row { transition: none; }
    .tiq-s-card:hover { transform: none; }
}
