/* Integrity Training Services
   Values come from design_handoff_its_website (README "Design Tokens"). */

:root {
    --blue: #1B75BB;
    --blue-hover: #135A91;
    --blue-light-hover: #2585CF;
    --blue-on-dark: #7FB6E3;
    --blue-tint: #E3F0FA;

    --ink: #1E2326;
    --footer: #171B1D;

    --text-2: #4A5256;
    --muted: #5D666B;
    --on-dark: #C4CACE;
    --footer-text: #8A9398;

    --page: #F4F5F6;
    --white: #FFFFFF;

    --border: #E3E6E8;
    --border-soft: #EDEFF0;
    --border-grid: #DDE1E3;
    --border-input: #D5DADD;
    --border-pill: #C9CFD2;

    --warn-bg: #FFF1D6;
    --warn-fg: #8A5A00;
    --error-bg: #FDECEC;
    --error-fg: #A12626;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-pill: 40px;

    --font-body: 'Barlow', system-ui, sans-serif;
    --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;

    --header-h: 81px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

img { max-width: 100%; display: block; }

h1, h2, h3 { margin: 0; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Blazor moves focus to the page's h1 after navigation, for screen readers. No ring needed. */
h1:focus { outline: none; }

code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.9em;
    background: var(--border-soft);
    padding: 1px 5px;
    border-radius: 3px;
}

[id] { scroll-margin-top: var(--header-h); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
}
.skip-link:focus { left: 16px; color: #fff; }

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding-left: 32px;
    padding-right: 32px;
}

.stack { display: flex; flex-direction: column; }
.stack--14 { gap: 14px; }
.stack--16 { gap: 16px; }
.stack--20 { gap: 20px; }
.stack--22 { gap: 22px; }
.stack--28 { gap: 28px; }
.stack--40 { gap: 40px; }

/* ---------- Type ---------- */

.eyebrow {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
}
.eyebrow--on-dark { color: var(--blue-on-dark); }
.eyebrow--bar { display: flex; align-items: center; gap: 12px; }
.eyebrow--bar::before {
    content: "";
    width: 28px;
    height: 3px;
    background: var(--blue);
    flex-shrink: 0;
}

.h2 {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(38px, 4.4vw, 56px);
    line-height: 1;
    text-transform: uppercase;
    text-wrap: balance;
}

.lead {
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-2);
    text-wrap: pretty;
}
.lead--on-dark { color: var(--on-dark); }

.hint { display: block; font-size: 14px; color: var(--muted); font-weight: 400; }

.prose { max-width: 760px; font-size: 17px; line-height: 1.6; color: var(--text-2); }
.prose p + p { margin-top: 16px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    font: 600 16px/1.2 var(--font-body);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn--sm { padding: 11px 20px; font-size: 15px; }
.btn--block { width: 100%; padding: 16px; }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); color: #fff; }
.btn--light-hover:hover { background: var(--blue-light-hover); }

.btn--outline { border-color: var(--border-pill); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }

.btn--outline-dark { border-color: var(--text-2); color: #fff; }
.btn--outline-dark:hover { border-color: #fff; color: #fff; }

.button-row { display: flex; gap: 14px; flex-wrap: wrap; }

.text-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--blue);
    font: 600 15px var(--font-body);
    cursor: pointer;
}
.text-button:hover { color: var(--blue-hover); }
.text-button--danger { color: var(--error-fg); }
.text-button--danger:hover { color: #7A1B1B; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    padding-top: 14px;
    padding-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.site-header__logo img { height: 52px; width: auto; }

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px 28px;
    font-weight: 500;
    font-size: 15px;
}
.site-nav a:not(.btn) { color: var(--ink); white-space: nowrap; }
.site-nav a:not(.btn):hover { color: var(--blue); }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(90deg, rgba(24, 28, 30, .94) 0%, rgba(24, 28, 30, .82) 45%, rgba(24, 28, 30, .35) 100%),
        url('../images/hero-bg.jpg') center / cover no-repeat #1E2326;
}
.hero__inner {
    position: relative;
    z-index: 1;
    padding-top: 96px;
    padding-bottom: 120px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: 56px;
    align-items: center;
}
.hero__spacer { min-height: 360px; }
.hero__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(48px, 6.4vw, 84px);
    line-height: 0.95;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-wrap: balance;
}
.hero__lead {
    font-size: 19px;
    line-height: 1.55;
    color: var(--on-dark);
    max-width: 520px;
    text-wrap: pretty;
}

/* Road markings, echoing the logo */
.hero__road {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 44px;
    display: flex;
    gap: 40px;
    padding-left: 32px;
    opacity: 0.9;
}
.hero__road span {
    flex: 0 0 72px;
    height: 6px;
    background: #fff;
    border-radius: 1px;
}

/* ---------- Trust strip ---------- */

.trust-strip { background: var(--blue); color: #fff; }
.trust-strip__inner {
    padding-top: 22px;
    padding-bottom: 22px;
    display: flex;
    justify-content: space-between;
    gap: 12px 24px;
    flex-wrap: wrap;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- Sections ---------- */

.section { padding-top: 96px; padding-bottom: 96px; }
.section--courses { padding-top: 112px; }
.section--tight { padding-top: 64px; padding-bottom: 80px; }
.section--white {
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.section--dark { background: var(--ink); color: #fff; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
}
.section-head__text { max-width: 620px; }
.section--courses .section-head { margin-bottom: 40px; }

/* ---------- Courses ---------- */

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
    font: 600 15px var(--font-body);
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border-pill);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 20px;
}
.course-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: border-color .15s, transform .15s;
}
.course-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.course-card[hidden] { display: none; }
.course-card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.course-card__category {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue);
}
.course-card__duration { font-size: 14px; color: var(--muted); white-space: nowrap; }
.course-card__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.05;
    text-transform: uppercase;
}
.course-card__desc { flex: 1; font-size: 16px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }

/* ---------- Course dates iframe ---------- */

.dates-frame {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}
.dates-frame iframe {
    display: block;
    width: 100%;
    height: 900px;
    border: 0;
}
.dates-frame--compact iframe { height: 620px; }
.dates-frame__fallback { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- About ---------- */

.about-us {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 32px 64px;
    align-items: start;
}

.about-grid {
    padding-top: 112px;
    padding-bottom: 112px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 64px;
    align-items: center;
}
.about-grid__photo {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 4;
    object-fit: cover;
    border-radius: var(--radius);
}
.pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border-grid);
    border: 1px solid var(--border-grid);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 8px;
}
.pillar {
    background: var(--page);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-2);
}
.pillar__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--ink);
}

/* ---------- Contact ---------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 64px;
}
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    font-size: 17px;
}
.contact-details a { color: var(--blue-on-dark); }
.contact-details a:hover { color: #fff; }
.contact-details__phone { color: #fff !important; }

.form-card {
    background: var(--white);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 32px;
}
.form-card__state {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    color: var(--text-2);
}
.form-card__state form { margin-top: 12px; }
.form-card__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 32px;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--ink);
}

/* ---------- Forms ---------- */

.enquiry-form,
.admin-form { display: flex; flex-direction: column; gap: 16px; }

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}
.field-row--wide-first { grid-template-columns: repeat(auto-fit, minmax(180px, 2fr)) minmax(110px, 1fr); }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    min-width: 0;
}
.input {
    width: 100%;
    font: 16px var(--font-body);
    color: var(--ink);
    padding: 12px 14px;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}
.input:focus { border-color: var(--blue); }
textarea.input { resize: vertical; }
.input.invalid { border-color: var(--error-fg); }
.field__error, .validation-message { font-size: 14px; font-weight: 500; color: var(--error-fg); }

/* ---------- Alerts & badges ---------- */

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--blue-tint);
    color: var(--blue-hover);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.alert--ok { background: #E4F4E8; color: #1E6B35; }
.alert--error { background: var(--error-bg); color: var(--error-fg); }
.alert a { color: inherit; text-decoration: underline; }

.badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--border-soft);
    color: var(--muted);
    white-space: nowrap;
}
.badge--ok { background: var(--blue-tint); color: var(--blue-hover); }
.badge--warn { background: var(--warn-bg); color: var(--warn-fg); }

/* ---------- Inner page header ---------- */

.page-header { background: var(--ink); color: #fff; }
.page-header__inner {
    padding-top: 72px;
    padding-bottom: 72px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.page-header__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(42px, 5.2vw, 68px);
    line-height: 0.95;
    text-transform: uppercase;
    text-wrap: balance;
}
.page-header__lead { font-size: 18px; line-height: 1.55; color: var(--on-dark); max-width: 640px; }

/* ---------- Admin ---------- */

.admin { max-width: 880px; }
.admin--narrow { max-width: 520px; }
.admin-intro { font-size: 17px; color: var(--text-2); }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.admin > .admin-intro { margin-bottom: 24px; }

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}
.admin-card > p { color: var(--text-2); margin-bottom: 18px; }
.admin-card__title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.admin-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; }
.admin-actions--tight { gap: 8px 16px; }
.admin-inline-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.admin-inline-form .field { flex: 1 1 260px; }
.admin-disabled {
    font-size: 15px;
    color: var(--muted);
    border: 1.5px dashed var(--border-pill);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    cursor: help;
}

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th {
    text-align: left;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 12px 10px 0;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 12px 14px 0;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}
.data-table td .badge + .badge { margin-left: 6px; }
.data-table td .hint { margin-top: 4px; font-size: 13px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--footer); color: var(--footer-text); font-size: 14px; }
.site-footer__inner {
    padding-top: 28px;
    padding-bottom: 28px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.site-footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: #fff; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
    .container { padding-left: 16px; padding-right: 16px; }

    /* A wrapped nav makes a tall header; don't pin it over the content on phones. */
    .site-header { position: static; }
    [id] { scroll-margin-top: 0; }
    .site-header__inner { gap: 12px; }
    .site-header__logo img { height: 44px; }
    .site-nav { justify-content: flex-start; gap: 10px 20px; }

    .hero__inner { padding-top: 64px; padding-bottom: 104px; }
    .hero__spacer { display: none; }
    .hero__road { padding-left: 16px; }

    .section { padding-top: 72px; padding-bottom: 72px; }
    .section--courses, .about-grid { padding-top: 72px; padding-bottom: 72px; }
    .contact-grid, .about-grid { gap: 40px; }

    .course-card, .form-card, .admin-card { padding: 22px; }
    .dates-frame iframe { height: 760px; }
    .dates-frame--compact iframe { height: 560px; }

    .page-header__inner { padding-top: 48px; padding-bottom: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .course-card, .btn, .pill { transition: none; }
    .course-card:hover { transform: none; }
}
