/* ============================================================
   TUC Education — reps.tuced.org.uk index page
   Brand colours and fonts match the Evolve course content.
   ============================================================ */

/* ── Design tokens ───────────────────────────────────────────────────────── */

:root {
    --teal:          #457178;
    --dark-teal:     #35585E;
    --darker-teal:   #1e4649;
    --light-teal:    #68B7BD;
    --pale-teal:     #D8ECEE;
    --very-pale:     #F0F7F8;
    --bg:            #FDFEFE;
    --text:          #1C2B2D;
    --text-body:     #3D3D3D;
    --text-muted:    #5f6f71;
    --card-border:   #DDE8EA;
    --shadow-sm:     0 1px 3px rgba(30, 70, 73, 0.10), 0 1px 2px rgba(30, 70, 73, 0.06);
    --shadow-md:     0 6px 20px rgba(30, 70, 73, 0.14), 0 2px 6px rgba(30, 70, 73, 0.08);
    --radius:        10px;
    --container:     1100px;
    --font-heading:  'Zilla Slab', Georgia, serif;
    --font-body:     'Red Hat Text', system-ui, sans-serif;
}


/* ── Reset ───────────────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text-body);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--teal);
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}


/* ── Layout container ────────────────────────────────────────────────────── */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 600px) {
    .container {
        padding: 0 16px;
    }
}


/* ── Site header ─────────────────────────────────────────────────────────── */

.site-header {
    background: #ffffff;
    border-bottom: 3px solid var(--light-teal);
    padding: 14px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-link {
    flex-shrink: 0;
    display: block;
    line-height: 0;
    border-radius: 4px;
    outline-offset: 4px;
}

.logo-link img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.site-name {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.site-name-org {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.site-name-sub {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ── Hero section ────────────────────────────────────────────────────────── */

.hero {
    background: var(--very-pale);
    border-bottom: 1px solid var(--pale-teal);
    color: var(--text);
    padding: 56px 0 68px;
    text-align: center;
}

.hero-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--dark-teal);
    background: var(--pale-teal);
    padding: 3px 11px;
    border-radius: 100px;
    margin: 0 0 14px;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-weight: 600;
    margin: 0 0 20px;
    line-height: 1.15;
    color: var(--darker-teal);
}

.hero p {
    font-size: 1.15rem;
    font-weight: 500;
    margin: 0 auto 0.85em;
    max-width: 600px;
    color: var(--text);
    line-height: 1.6;
}

.hero p + p {
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-body);
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.93rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-btn--primary {
    background: var(--dark-teal);
    color: #ffffff;
}

.hero-btn--primary:hover {
    background: var(--darker-teal);
    color: #ffffff;
}

.hero-btn--secondary {
    background: transparent;
    color: var(--dark-teal);
    border: 2px solid var(--teal);
}

.hero-btn--secondary:hover {
    background: var(--pale-teal);
    border-color: var(--dark-teal);
}

@media (max-width: 600px) {
    .hero {
        padding: 40px 0 52px;
    }
    .hero p br {
        display: none;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
}


/* ── Course grid ─────────────────────────────────────────────────────────── */

main {
    padding-bottom: 72px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
    padding-top: 52px;
}

@media (max-width: 480px) {
    .course-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 36px;
    }
}


/* ── Course card ─────────────────────────────────────────────────────────── */

/* Cards without a preview image get a teal top accent instead */
.course-card--no-image {
    border-top: 4px solid var(--light-teal);
}

.course-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Lift on hover — using :has() with a fallback via JS-free approach */
.course-card:has(.card-link:hover),
.course-card:has(.card-link:focus-visible) {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(30, 70, 73, 0.16), 0 3px 8px rgba(30, 70, 73, 0.08);
    border-color: var(--light-teal);
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(a)) {
    .course-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 28px rgba(30, 70, 73, 0.16), 0 3px 8px rgba(30, 70, 73, 0.08);
        border-color: var(--light-teal);
    }
}

.card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    outline: none;
}

.card-link:focus-visible {
    outline: 3px solid var(--light-teal);
    outline-offset: 2px;
    border-radius: var(--radius);
}


/* Card image */

.card-image {
    aspect-ratio: 2 / 1;
    overflow: hidden;
    background: var(--pale-teal);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:has(.card-link:hover) .card-image img {
    transform: scale(1.03);
}


/* Card body */

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-tag {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dark-teal);
    margin: 0;
    padding: 3px 10px;
    background: var(--pale-teal);
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--darker-teal);
    margin: 0;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.93rem;
    line-height: 1.5;
    color: var(--text-body);
    margin: 0;
    flex: 1;
}

.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--teal);
    transition: gap 0.15s ease;
}

.course-card:has(.card-link:hover) .card-cta {
    gap: 10px;
}

.card-cta svg {
    flex-shrink: 0;
}


/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
    background: var(--darker-teal);
    color: rgba(255, 255, 255, 0.8);
    padding: 28px 0;
    font-size: 0.88rem;
}

.footer-copy {
    margin: 0;
}

.site-footer a {
    color: var(--light-teal);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    opacity: 1;
}


/* ── Accessibility ───────────────────────────────────────────────────────── */

:focus-visible {
    outline: 3px solid var(--light-teal);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
