/* ------------------------------------------------------------------
   Scottish training fund pages - /funding/scotland/

   Loaded from HeadContent, which the master renders BEFORE bootstrap, so
   every rule here is scoped under .sf-page. A bare element selector would
   lose to bootstrap's own base styles no matter what we wrote; scoped it
   wins on specificity instead of on order.

   Palette is the course page's (courses/product.aspx), so a reader moving
   between a course and its funding page stays in the same site.
   ------------------------------------------------------------------ */

.sf-page {
    --sf-blue: #0060b1;
    --sf-blue-dark: #004a89;
    --sf-teal: #083643;
    --sf-green: #28a745;
    --sf-bg: #f1f6f9;
    --sf-border: #e6ebee;
    --sf-muted: #5a6b72;
    --sf-ink: #33474e;
    --sf-warn-bg: #fdf5e6;
    --sf-warn-border: #e4cf9e;
    --sf-warn-ink: #7d5106;

    color: var(--sf-ink);
    width: 100%;
    box-sizing: border-box;
    padding-left: 16px;
    padding-right: 16px;
    font-size: 16px;
    line-height: 1.62;
}

/* Match the course page: break out of the master's ~1140px container on wide
   screens so the course lists aren't squeezed into a narrow column. */
@media (min-width: 1200px) {
    .sf-page {
        --sf-w: min(1400px, calc(100vw - 32px));
        width: var(--sf-w);
        position: relative;
        left: 50%;
        margin-left: calc(var(--sf-w) / -2);
    }
}

.sf-page * {
    box-sizing: border-box;
}

.sf-page h1,
.sf-page h2,
.sf-page h3 {
    color: var(--sf-teal);
    margin-top: 0;
}

.sf-page h1 {
    font-size: 34px;
    line-height: 1.16;
    font-weight: 500;
    margin-bottom: 10px;
}

.sf-page h2 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 500;
    margin-bottom: 8px;
}

.sf-page h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.sf-page p {
    margin: 0 0 16px;
    max-width: 68ch;
}

.sf-page a {
    color: var(--sf-blue);
}

.sf-page a:hover {
    color: var(--sf-blue-dark);
}

.sf-lede {
    font-size: 18px;
    color: var(--sf-muted);
    max-width: 66ch;
}

.sf-section {
    padding: 26px 0;
    border-top: 1px solid var(--sf-border);
}

.sf-section:first-of-type {
    border-top: 0;
}

/* ---------- hero ---------- */

.sf-hero {
    display: flex;
    align-items: flex-start;
    gap: 26px;
    background: var(--sf-bg);
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    padding: 28px 30px;
    margin: 16px 0 8px;
}

.sf-hero-badge {
    flex: 0 0 auto;
    width: 108px;
    height: 108px;
    object-fit: contain;
}

.sf-hero-body {
    min-width: 0;
}

.sf-hero .sf-lede {
    margin-bottom: 12px;
}

.sf-hero-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

.sf-hero-meta li {
    font-size: 14px;
    color: var(--sf-muted);
}

.sf-hero-meta b {
    display: block;
    font-size: 16px;
    color: var(--sf-teal);
    font-weight: 600;
}

@media (max-width: 700px) {
    .sf-hero {
        flex-direction: column;
        gap: 18px;
        padding: 22px;
    }

    .sf-hero-badge {
        width: 84px;
        height: 84px;
    }

    .sf-page h1 {
        font-size: 27px;
    }
}

/* ---------- the pre-approval warning ---------- */

.sf-alert {
    background: var(--sf-warn-bg);
    border: 1px solid var(--sf-warn-border);
    border-radius: 8px;
    padding: 20px 24px;
    margin: 20px 0;
}

.sf-alert h2 {
    font-size: 19px;
    color: var(--sf-warn-ink);
    margin-bottom: 6px;
}

.sf-alert p {
    margin-bottom: 0;
    max-width: 76ch;
}

.sf-alert p + p {
    margin-top: 10px;
}

/* ---------- fund cards ---------- */

.sf-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 18px 0 0;
}

.sf-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    padding: 22px;
    background: #fff;
}

.sf-card-badge {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.sf-card h3 {
    font-size: 17px;
    margin-bottom: 4px;
}

.sf-card-who {
    font-size: 14.5px;
    color: var(--sf-muted);
    margin: 0 0 12px;
    flex: 1 1 auto;
}

.sf-card-value {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sf-teal);
    margin: 0 0 14px;
}

.sf-card-count {
    font-size: 13.5px;
    color: var(--sf-muted);
    margin: 10px 0 0;
}

/* ---------- buttons ---------- */

/* One treatment for every button on these pages: white ground, blue rule, blue label,
   filling in on hover.

   It reads as something to click rather than as a banner, which is what these pages need -
   they inform first and sell second, and a row of solid blue blocks made them look like an
   advert. It also sits correctly on all three grounds these buttons land on: the white page,
   the tinted hero, and the white fund cards. */
.sf-btn {
    display: inline-block;
    background: #fff;
    color: var(--sf-blue);
    border: 1px solid var(--sf-blue);
    border-radius: 6px;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}

.sf-btn:hover,
.sf-btn:focus {
    background: var(--sf-blue);
    border-color: var(--sf-blue);
    color: #fff;
    text-decoration: none;
}

.sf-btn:focus-visible {
    outline: 2px solid var(--sf-blue-dark);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .sf-btn {
        transition: none;
    }
}

.sf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0 0;
}

/* ---------- checklists ---------- */

.sf-criteria {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 76ch;
}

.sf-criteria li {
    position: relative;
    padding: 9px 0 9px 30px;
    border-bottom: 1px solid var(--sf-border);
}

.sf-criteria li:last-child {
    border-bottom: 0;
}

.sf-criteria li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 17px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sf-blue);
}

.sf-notes {
    margin: 16px 0 0;
    padding: 16px 20px;
    background: var(--sf-bg);
    border-radius: 6px;
    max-width: 76ch;
}

.sf-notes ul {
    margin: 0;
    padding-left: 18px;
}

.sf-notes li {
    margin-bottom: 6px;
    font-size: 15px;
}

.sf-notes li:last-child {
    margin-bottom: 0;
}

/* ---------- steps ---------- */

.sf-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin: 18px 0 0;
    list-style: none;
    padding: 0;
}

.sf-steps li {
    border-top: 3px solid var(--sf-blue);
    padding-top: 14px;
}

.sf-step-n {
    display: block;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sf-muted);
    margin-bottom: 4px;
}

.sf-steps b {
    display: block;
    font-size: 16px;
    color: var(--sf-teal);
    margin-bottom: 4px;
}

.sf-steps p {
    font-size: 14.5px;
    margin: 0;
}

/* ---------- fund comparison ---------- */

/* Wide by nature, so it scrolls inside its own box rather than making the page
   scroll sideways on a phone. */
.sf-compare {
    overflow-x: auto;
    margin: 18px 0 0;
    border: 1px solid var(--sf-border);
    border-radius: 8px;
    background: #fff;
}

.sf-compare table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    min-width: 720px;
}

.sf-compare caption {
    caption-side: top;
    text-align: left;
    padding: 14px 18px 0;
    font-size: 13px;
    color: var(--sf-muted);
}

.sf-compare th,
.sf-compare td {
    text-align: left;
    padding: 12px 18px;
    border-bottom: 1px solid var(--sf-border);
    vertical-align: top;
}

.sf-compare thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--sf-muted);
    background: var(--sf-bg);
    white-space: nowrap;
}

.sf-compare tbody th {
    font-weight: 600;
    color: var(--sf-teal);
    max-width: 22ch;
}

.sf-compare tbody tr:last-child th,
.sf-compare tbody tr:last-child td {
    border-bottom: 0;
}

.sf-compare .sf-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- course lists ---------- */

.sf-group {
    margin: 22px 0 0;
}

.sf-group h3 {
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sf-muted);
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--sf-border);
}

.sf-courses {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 0 26px;
}

.sf-courses li {
    padding: 11px 0;
    border-bottom: 1px solid var(--sf-border);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sf-course-code {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--sf-muted);
    background: var(--sf-bg);
    border-radius: 3px;
    padding: 2px 6px;
    min-width: 62px;
    text-align: center;
}

.sf-course-name {
    flex: 1 1 auto;
    font-size: 15px;
}

.sf-course-funds {
    display: block;
    font-size: 12.5px;
    color: var(--sf-muted);
    margin-top: 2px;
}

.sf-course-out {
    font-size: 13px;
    white-space: nowrap;
}

/* ---------- FAQ ---------- */

.sf-faq {
    max-width: 76ch;
    margin: 14px 0 0;
    border-top: 1px solid var(--sf-border);
}

.sf-faq details {
    border-bottom: 1px solid var(--sf-border);
}

.sf-faq summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 600;
    color: var(--sf-teal);
    font-size: 16px;
}

.sf-faq summary:hover {
    color: var(--sf-blue);
}

.sf-faq .sf-answer {
    padding: 0 0 16px;
}

.sf-faq .sf-answer p {
    margin-bottom: 0;
    color: var(--sf-muted);
}

/* ---------- footnote ---------- */

.sf-source {
    font-size: 13.5px;
    color: var(--sf-muted);
    border-top: 1px solid var(--sf-border);
    padding-top: 16px;
    margin-top: 30px;
    max-width: 80ch;
}

.sf-source img {
    height: 26px;
    width: auto;
    vertical-align: middle;
    margin-right: 10px;
}

/* ------------------------------------------------------------------
   The notice on a course page (courses/product.aspx).

   Deliberately quieter than anything above: it is an interruption on a page
   somebody opened to read about a course, so it uses the same muted panel as
   .cp-note rather than anything that reads as an offer.
   ------------------------------------------------------------------ */

.cp-funding {
    border: 1px solid #e6ebee;
    border-left: 3px solid #0060b1;
    border-radius: 6px;
    background: #f7fafb;
    padding: 18px 22px;
    margin: 0 0 18px;
}

.cp-funding h3 {
    font-size: 17px;
    color: #083643;
    margin: 0 0 8px;
}

.cp-funding p {
    font-size: 14.5px;
    line-height: 1.6;
    color: #33474e;
    margin: 0 0 10px;
    max-width: 74ch;
}

.cp-funding p:last-child {
    margin-bottom: 0;
}

.cp-funding-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
}

.cp-funding-badges img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

/* The line above the enrol button - one sentence, no decoration at all. */
.cp-funding-inline {
    font-size: 13px;
    line-height: 1.5;
    color: #5a6b72;
    margin: 0 0 12px;
}
