/* ==========================================================================
   Study — design system
   No build step by design (ADR-0007). Plain CSS, custom properties, no framework.
   ========================================================================== */

:root {
    /* The site has one palette. "only light" also stops the browser applying its
       own dark treatment to native controls — selects, inputs, scrollbars — which
       would otherwise stay dark on a dark-mode OS against a light page. */
    color-scheme: only light;

    /* Brand. Deep indigo reads as institutional and trustworthy; amber gives a
       single warm accent so the page is not a wall of blue. */
    --brand-900: #131a3d;
    --brand-800: #1c2554;
    --brand-700: #263073;
    --brand-600: #33409b;
    --brand-500: #4553c4;
    --brand-400: #7684e0;
    --brand-300: #a3ade8;
    --brand-200: #c8cef2;
    --brand-100: #e8ebfb;
    --brand-050: #f4f6fd;

    --accent-600: #b4690e;
    --accent-500: #e08a1e;
    --accent-100: #fdf0dc;

    --green-600: #0f7a4d;
    --green-100: #e3f5ec;

    /* Neutrals */
    --ink: #12151f;
    --ink-2: #414a5e;
    --muted: #6b7488;
    --line: #e4e7ef;
    --line-2: #eef0f6;
    --bg: #ffffff;
    --bg-soft: #f7f8fc;

    /* Scale */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-full: 999px;

    --shadow-sm: 0 1px 2px rgba(18, 21, 31, .06), 0 1px 3px rgba(18, 21, 31, .04);
    --shadow-md: 0 4px 12px rgba(18, 21, 31, .07), 0 2px 4px rgba(18, 21, 31, .04);
    --shadow-lg: 0 18px 40px rgba(18, 21, 31, .12), 0 4px 12px rgba(18, 21, 31, .06);

    --measure: 66ch;
    --ease: cubic-bezier(.32, .72, 0, 1);
}


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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 2px; }

img, svg { max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: 1120px;
    margin-inline: auto;
    padding-inline: 22px;
}

.section { padding-block: 56px; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(10px);
    border-bottom: 1px solid var(--line-2);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding-block: 14px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--ink);
    text-decoration: none;
}

.logo-mark {
    display: block;
    flex: none;
    /* Slight lift so the mark's optical centre aligns with the wordmark's x-height. */
    transform: translateY(-.5px);
    transition: transform .2s var(--ease);
}

.logo:hover .logo-mark { transform: translateY(-.5px) scale(1.05); }

.logo-word {
    font-size: 1.24rem;
    font-weight: 800;
    letter-spacing: -.035em;
}

/* On the dark hero and footer the wordmark must not inherit body ink. */
.hero .logo-word, .site-footer .logo-word { color: inherit; }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0; padding: 0;
    list-style: none;
    font-size: .93rem;
}

.nav a, .nav-disabled {
    display: block;
    padding: 7px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    transition: background .15s var(--ease), color .15s var(--ease);
}

.nav a:hover { background: var(--brand-050); color: var(--brand-700); }

.nav-disabled { color: var(--muted); opacity: .5; cursor: not-allowed; }

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

.hero {
    position: relative;
    isolation: isolate;
    padding-block: clamp(56px, 9vw, 104px);
    overflow: hidden;
    color: #fff;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(1000px 460px at 12% -10%, rgba(118, 132, 224, .5), transparent 62%),
        radial-gradient(760px 380px at 92% 8%, rgba(224, 138, 30, .28), transparent 58%),
        linear-gradient(155deg, var(--brand-800), var(--brand-900) 62%);
}

/* Subtle grid so the gradient is not a flat wash. */
.hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 0%, #000 55%, transparent 100%);
}

.hero-title {
    margin: 0 0 14px;
    font-size: clamp(2.1rem, 5.4vw, 3.6rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.035em;
}

.hero-accent {
    background: linear-gradient(100deg, var(--accent-500), #ffd79a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead {
    margin: 0 0 30px;
    max-width: 46ch;
    font-size: clamp(1rem, 2vw, 1.16rem);
    color: rgba(255, 255, 255, .8);
}

/* The primary action, sized accordingly. */
.searchbar {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 620px;
    padding: 7px 7px 7px 14px;
    border-radius: var(--r-full);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
}

.searchbar-icon {
    flex: none;
    width: 20px; height: 20px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
}

.searchbar input {
    flex: 1;
    min-width: 0;
    padding: 11px 4px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
}

.searchbar input::placeholder { color: var(--muted); }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { box-shadow: var(--shadow-lg), 0 0 0 3px rgba(118, 132, 224, .45); }

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 18px;
}

.chips-label { font-size: .87rem; color: rgba(255, 255, 255, .62); }

.chip {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-size: .87rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s var(--ease), border-color .15s var(--ease);
}

.chip:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
    margin: 38px 0 0;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

.stat { display: flex; flex-direction: column; }

.stat dt {
    order: 2;
    font-size: .82rem;
    color: rgba(255, 255, 255, .6);
    text-transform: uppercase;
    letter-spacing: .07em;
}

.stat dd {
    order: 1;
    margin: 0 0 2px;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -.03em;
}

/* ---------------------------------------------------------------- sections */

.section-head { margin-bottom: 26px; }

.section-head-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    justify-content: space-between;
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -.025em;
}

.section-sub { margin: 6px 0 0; color: var(--muted); font-size: .96rem; }

.section-link { font-size: .93rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link:hover { text-decoration: underline; }

.band { background: var(--bg-soft); border-block: 1px solid var(--line-2); }

/* ------------------------------------------------------------ level cards */

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 14px;
}

.level-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 18px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
    color: var(--ink);
    text-decoration: none;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.level-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand-400);
    box-shadow: var(--shadow-md);
}

.level-icon {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: var(--r-md);
    background: var(--brand-100);
    color: var(--brand-600);
}


.level-icon svg {
    width: 22px; height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.level-name { font-weight: 600; font-size: .96rem; line-height: 1.3; }

/* ---------------------------------------------------------- program cards */

.program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
    gap: 18px;
}

.pcard {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.pcard:hover {
    transform: translateY(-3px);
    border-color: var(--brand-400);
    box-shadow: var(--shadow-md);
}

/* Whole card clickable without nesting interactive elements. */
.stretched::after { content: ""; position: absolute; inset: 0; }

.pcard-level {
    align-self: start;
    margin-bottom: 12px;
    padding: 4px 11px;
    border-radius: var(--r-full);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}


.level-postgraduate, .level-doctorate { background: var(--accent-100); color: var(--accent-600); }

.pcard-title { margin: 0 0 5px; font-size: 1.04rem; font-weight: 700; line-height: 1.32; letter-spacing: -.015em; }
.pcard-title a { color: var(--ink); text-decoration: none; }
.pcard:hover .pcard-title a { color: var(--brand-600); }

.pcard-provider { margin: 0 0 14px; font-size: .89rem; color: var(--muted); }

.pcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    font-size: .84rem;
    color: var(--ink-2);
}

.pcard-meta li { display: inline-flex; align-items: center; gap: 5px; }

.pcard-meta svg {
    width: 14px; height: 14px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pcard-price {
    margin: auto 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--line-2);
    font-size: .93rem;
}

.pcard-price strong { font-size: 1.1rem; letter-spacing: -.02em; }
.free { color: var(--green-600); font-weight: 700; }

/* ---------------------------------------------------------- article cards */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
    gap: 18px;
}

.acard {
    position: relative;
    padding: 22px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent-500);
    border-radius: var(--r-md);
    background: var(--bg);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}

.acard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.acard-title { margin: 0 0 8px; font-size: 1.02rem; font-weight: 700; line-height: 1.35; }
.acard-title a { color: var(--ink); text-decoration: none; }
.acard-summary { margin: 0 0 12px; font-size: .91rem; color: var(--muted); line-height: 1.55; }
.acard-meta { margin: 0; font-size: .82rem; color: var(--muted); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-full);
    background: var(--brand-600);
    color: #fff;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--ease);
}

.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-danger { background: #b3261e; }
.btn-danger:hover { background: #971f18; }
.btn-small { padding: 6px 14px; font-size: .85rem; }

/* -------------------------------------------------------------------- cta */

.cta {
    margin-block: 20px 64px;
    padding: clamp(32px, 6vw, 56px);
    border-radius: var(--r-lg);
    background: linear-gradient(140deg, var(--brand-050), var(--brand-100));
    border: 1px solid var(--line);
    text-align: center;
}

.cta h2 { margin: 0 0 8px; font-size: clamp(1.3rem, 3vw, 1.7rem); letter-spacing: -.025em; }
.cta p { margin: 0 auto 22px; color: var(--ink-2); max-width: 52ch; }

/* ----------------------------------------------------------- chips (band) */

.chips-wrap { margin-top: 0; }

.chip-lg {
    padding: 9px 18px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink-2);
    font-size: .92rem;
}

.chip-lg:hover { background: var(--brand-050); border-color: var(--brand-400); color: var(--brand-700); }

/* ----------------------------------------------------- catalogue & search */

.filters {
    margin-block: 24px 30px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-soft);
}

.filter-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.filter-row .field { margin-bottom: 0; flex: 0 1 172px; }
.filter-row .grow { flex: 2 1 240px; }
.filter-row .field-actions { flex: 0 0 auto; }

.filters select, .filters input, .field input, .field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: .95rem;
}

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; }
.field input:focus-visible { border-color: var(--brand-500); }

.result-count { margin-block: 18px; font-size: .93rem; }

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

.program-item { padding: 22px 0; border-bottom: 1px solid var(--line-2); }
.program-item h2, .program-item h3 { margin: 0 0 4px; font-size: 1.1rem; letter-spacing: -.015em; }
.program-item h2 a, .program-item h3 a { color: var(--ink); text-decoration: none; }
.program-item h2 a:hover, .program-item h3 a:hover { color: var(--brand-600); text-decoration: underline; }

.program-provider { margin: 0 0 9px; font-size: .9rem; }
.program-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: var(--bg-soft);
    font-size: .77rem;
    font-weight: 600;
    color: var(--ink-2);
}

.status { display: inline-block; margin: 0; padding: 3px 10px; border-radius: var(--r-full); font-size: .75rem; font-weight: 700; }
.status-pending { background: var(--accent-100); color: var(--accent-600); }

.empty {
    margin-block: 32px;
    padding: 44px 32px;
    border: 1px dashed var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-soft);
    text-align: center;
}

.empty h1 { margin-top: 0; }
.empty .muted { margin-inline: auto; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: center;
    padding-block: 32px;
}

.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-size: .87rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

.narrow { max-width: 460px; }
.narrow-article { max-width: 760px; padding-block: 44px; }
.narrow-article h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.03em; line-height: 1.15; }

.prose { margin-block: 22px; max-width: var(--measure); font-size: 1.03rem; line-height: 1.75; color: var(--ink-2); }

/* ===== structured programme description ===== */
.program-desc p { margin: 0 0 16px; }
.program-desc h3 {
    margin: 32px 0 12px;
    padding: 10px 16px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--brand-800);
    background: var(--brand-050);
    border-left: 3px solid var(--brand-500);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.program-desc h3:first-child { margin-top: 0; }
.program-desc ul {
    margin: 0 0 20px;
    padding-left: 24px;
    list-style: none;
}
.program-desc ul li {
    position: relative;
    padding: 6px 0 6px 12px;
    border-bottom: 1px solid var(--line-2);
}
.program-desc ul li:last-child { border-bottom: none; }
.program-desc ul li::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-400);
}
/* short list items: slightly smaller text */
.program-desc ul li { font-size: .97rem; }

/* ===== description expand/collapse ===== */
.program-desc-clamp {
    position: relative;
    max-height: 520px;
    overflow: hidden;
}
.program-desc-clamp::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}
.program-desc-clamp.is-expanded { max-height: none; }
.program-desc-clamp.is-expanded::after { display: none; }
.program-desc-clamp.is-short { max-height: none; }
.program-desc-clamp.is-short::after { display: none; }
.btn-expand[hidden] { display: none; }
.btn-expand {
    display: block;
    margin: -8px auto 24px;
    padding: 8px 20px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--brand-600);
    background: none;
    border: 1px solid var(--brand-300);
    border-radius: var(--r-full);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-expand:hover { background: var(--brand-050); }

/* ===== programme hero image ===== */
.program-hero {
    margin: 0 0 28px;
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 9;
    background: var(--brand-050);
}
.program-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lead { margin: 0 0 18px; max-width: var(--measure); font-size: 1.12rem; color: var(--muted); }

.detail-list {
    display: grid;
    grid-template-columns: minmax(150px, auto) 1fr;
    gap: 12px 22px;
    margin-block: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-soft);
    font-size: .95rem;
}

.detail-list dt { font-weight: 600; color: var(--muted); }
.detail-list dd { margin: 0; }

.muted { color: var(--muted); max-width: var(--measure); }
.small { font-size: .86rem; }
.mt { margin-top: 22px; }

/* ------------------------------------------------------------------ forms */

.form { margin-block: 26px; }

.alert {
    margin-block: 16px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: var(--r-sm);
    font-size: .93rem;
}

.alert-error { border-color: #f0b4b0; background: #fdeceb; color: #8c1d18; }
.alert-success { border-color: #a8ddc0; background: var(--green-100); color: var(--green-600); }


/* ------------------------------------------------------------------ admin */

.admin-bar { border-bottom: 1px solid var(--line); background: var(--bg-soft); font-size: .92rem; }

.admin-bar-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding-block: 12px;
}

.admin-bar nav { display: flex; gap: 6px; }
.admin-bar nav a { padding: 6px 12px; border-radius: var(--r-sm); text-decoration: none; }
.admin-bar nav a:hover { background: var(--brand-100); }
.admin-user { display: flex; gap: 14px; align-items: center; color: var(--muted); }

.metric { margin: 0 0 6px; font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; }

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

.card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
}

.card h3 { margin: 0 0 8px; font-size: 1.03rem; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .94rem; }

.table-wrap { overflow-x: auto; margin-block: 22px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }

.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid var(--line-2);
    text-align: start;
    vertical-align: middle;
}

.table th {
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.table .actions { text-align: end; }

code { padding: 2px 6px; border-radius: 5px; background: var(--bg-soft); font-size: .88em; }

/* ----------------------------------------------------------------- footer */

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line-2);
    background: var(--bg-soft);
    padding-block: 42px;
    font-size: .9rem;
    color: var(--muted);
}

.site-footer p { margin: 0 0 4px; }

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 48px;
    align-items: start;
}

.footer-brand {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: var(--ink);
}

.footer-tagline { flex-basis: 100%; font-size: .88rem; }

.footer-nav {
    display: flex;
    gap: 48px;
    margin-left: auto;
}

.footer-col h3 {
    margin: 0 0 10px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; }

@media (max-width: 640px) {
    .footer-inner { flex-direction: column; gap: 24px; }
    .footer-nav { margin-left: 0; gap: 32px; }
}

/* ================================================================ page heads */

.page-head {
    padding-block: 40px 30px;
    border-bottom: 1px solid var(--line-2);
    background: var(--bg-soft);
}

.page-head h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.032em;
    line-height: 1.14;
}

.page-sub { margin: 8px 0 0; color: var(--muted); font-size: 1.02rem; }

/* Dark variant for detail pages, so the hero treatment carries through. */
.page-head-dark {
    position: relative;
    isolation: isolate;
    border-bottom: 0;
    color: #fff;
    background:
        radial-gradient(800px 400px at 5% -30%, rgba(118, 132, 224, .5), transparent 55%),
        radial-gradient(400px 300px at 95% 120%, rgba(224, 138, 30, .12), transparent 60%),
        linear-gradient(160deg, var(--brand-700) 0%, var(--brand-900) 60%);
    padding-block: 38px 48px;
}

.page-head-dark h1 { margin: 10px 0 0; }
.page-head-dark .page-sub { color: rgba(255, 255, 255, .74); }
.page-head-dark .breadcrumb, .page-head-dark .breadcrumb a { color: rgba(255, 255, 255, .62); }
.page-head-dark .breadcrumb a:hover { color: #fff; }
.pcard-level.on-dark { background: rgba(255, 255, 255, .16); color: #fff; }
.provider-link { color: rgba(255, 255, 255, .92); text-decoration: none; }
.provider-link:hover { color: #fff; }

.page-sub-provider { display: flex; align-items: center; }
.page-sub-provider a { display: inline-flex; align-items: center; gap: 10px; }
.page-sub-provider .provider-logo-sm { width: 28px; height: 28px; border-radius: 6px; }
.page-sub-provider .provider-avatar { width: 28px; height: 28px; font-size: .75rem; margin: 0; border-radius: 6px; }
.page-sub-provider .provider-mark svg { width: 28px; height: 28px; }

/* ================================================================== filters */

.result-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.result-count { margin: 0; color: var(--muted); }
.result-count strong { color: var(--ink); font-size: 1.05rem; }

.clear-filters { font-size: .88rem; font-weight: 600; text-decoration: none; }
.clear-filters:hover { text-decoration: underline; }

.field-actions .btn { margin-top: 0; }

.program-grid-tight { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* =========================================================== detail layout */

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 860px) {
    .detail-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .detail-aside { order: -1; }
}

.detail-main h2 {
    margin: 40px 0 18px;
    padding-bottom: 12px;
    font-size: 1.3rem;
    letter-spacing: -.02em;
    border-bottom: 2px solid var(--line-2);
}
.detail-main h2:first-child { margin-top: 0; }

.detail-aside { position: sticky; top: 84px; }

.fact-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand-500);
    border-radius: var(--r-lg);
    background: var(--bg-soft);
    box-shadow: var(--shadow-sm);
}

.fact-title {
    margin: 0 0 14px !important;
    font-size: .78rem !important;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.fact-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 18px;
    margin: 0 0 18px;
    font-size: .94rem;
}

.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; font-weight: 600; text-align: end; }
.price { font-size: 1.12rem; letter-spacing: -.02em; }

.aside-note { margin-top: 14px; }

.provider-box {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg-soft);
    box-shadow: var(--shadow-sm);
}

.provider-box h3 { margin: 0 0 4px; font-size: 1.05rem; }
.provider-box h3 a { color: var(--ink); text-decoration: none; }
.provider-box h3 a:hover { text-decoration: underline; }
.provider-box p { margin: 0 0 12px; }
.provider-box-city { margin: 0 !important; }
.see-all-link { margin-top: 18px; text-align: center; }

/* Initial-letter avatar: providers have no logos (no media storage yet). */
.provider-avatar {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    margin-bottom: 14px;
    border-radius: var(--r-md);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 1.15rem;
    font-weight: 800;
}


.provider-avatar-lg {
    width: 62px; height: 62px;
    margin: 0;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 1.7rem;
}

.provider-head { display: flex; gap: 18px; align-items: center; margin-top: 12px; }
.provider-head h1 { margin: 0; }

/* ================================================================= articles */

.article-page { max-width: 720px; padding-block: 44px 60px; }
.article-title { margin: 12px 0 14px; font-size: clamp(1.8rem, 4.4vw, 2.6rem); letter-spacing: -.033em; line-height: 1.14; }
.article-meta { margin: 0 0 26px; display: flex; gap: 8px; color: var(--muted); font-size: .9rem; }

.article-summary {
    margin: 0 0 28px;
    padding-left: 18px;
    border-left: 3px solid var(--accent-500);
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--ink-2);
}

.article-body { font-size: 1.06rem; line-height: 1.8; }

.rule { margin: 40px 0 26px; border: 0; border-top: 1px solid var(--line-2); }

/* ==================================================================== auth */

.auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 210px);
    padding: 40px 22px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth-brand { margin-bottom: 18px; display: flex; justify-content: center; }
.auth-card h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.025em; }
.auth-sub { margin: 4px 0 22px; }
.auth-card .form { text-align: start; }
.auth-note { margin: 20px 0 0; }
.auth-back { margin-top: 22px; font-size: .9rem; }
.auth-back a { color: var(--muted); text-decoration: none; }
.auth-back a:hover { text-decoration: underline; }

/* ================================================================== errors */

.error-page { max-width: 520px; margin-inline: auto; padding-block: 56px; text-align: center; }

.error-code {
    margin: 0 0 8px;
    font-size: 4.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.05em;
    color: var(--brand-100);
}


.error-page h1 { margin: 0 0 10px; font-size: 1.6rem; letter-spacing: -.025em; }
.error-page .muted { margin-inline: auto; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }

/* ============================================================ button extras */

.btn-block { display: flex; width: 100%; }

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-2);
}

.btn-ghost:hover { background: var(--bg-soft); border-color: var(--brand-400); color: var(--brand-700); }

.empty-title { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; }

/* ============================================================= admin extras */

.admin-head {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.admin-head h1 { margin: 0; font-size: 1.55rem; letter-spacing: -.028em; }
.admin-head p { margin: 4px 0 0; }
.admin-head-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.count-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: var(--r-full);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .8rem;
    font-weight: 700;
    vertical-align: middle;
}


.stat-card .metric { color: var(--brand-600); }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.alert-info {
    border-color: var(--brand-100);
    background: var(--brand-050);
    color: var(--ink-2);
}

.pill {
    display: inline-block;
    padding: 3px 11px;
    border-radius: var(--r-full);
    font-size: .76rem;
    font-weight: 700;
}

.pill-live { background: var(--green-100); color: var(--green-600); }
.pill-draft { background: var(--accent-100); color: var(--accent-600); }

.slug { font-size: .8rem; color: var(--muted); }

/* Keeps delete buttons on the same row as the other actions. */
.inline-form { display: inline-block; margin: 0; }
.table .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ================================================================== forms */

.form-panel {
    max-width: 720px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--bg);
}

.form-panel textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    font-size: .95rem;
    line-height: 1.6;
    resize: vertical;
}

.form-panel input, .form-panel select { margin-bottom: 0; }

.field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0 18px;
}

.field-static {
    margin: 0;
    padding: 9px 0;
    font-weight: 600;
}

.field-help { margin: 6px 0 0; font-size: .84rem; color: var(--muted); }

/* Symfony renders help text and errors with these classes. */
.form-panel .help-text, .form-panel small { display: block; margin-top: 6px; font-size: .84rem; color: var(--muted); }

.form-panel ul {
    margin: 6px 0 0;
    padding-left: 18px;
    color: #b3261e;
    font-size: .86rem;
}


.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line-2);
}

/* ============================================================ provider logos */

/* object-fit: contain so a wide wordmark and a square crest both sit correctly
   without being distorted. */
.provider-logo {
    display: block;
    flex: none;
    object-fit: contain;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
}

.provider-logo-sm { width: 34px; height: 34px; padding: 3px; }
.provider-logo-lg { width: 68px; height: 68px; padding: 7px; border-radius: var(--r-md); }

/* Small marks sit inline with the provider name on cards. */
.pcard-provider {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 34px;
}

.pcard-provider .provider-avatar { width: 34px; height: 34px; margin: 0; font-size: .95rem; }
.pcard-provider .provider-logo-sm { width: 34px; height: 34px; }

.provider-box-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.provider-box-head h3 { margin: 0; }
.provider-box-head .provider-avatar { margin: 0; width: 38px; height: 38px; font-size: 1rem; }

.admin-cell { display: inline-flex; align-items: center; gap: 10px; }
.admin-cell .provider-avatar { margin: 0; width: 30px; height: 30px; font-size: .85rem; }
.admin-cell .provider-logo-sm { width: 30px; height: 30px; }

.logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-soft);
}

.logo-preview img {
    width: 72px; height: 72px;
    object-fit: contain;
    background: var(--bg);
    border-radius: var(--r-sm);
    padding: 6px;
}

/* File input needs explicit styling; it inherits nothing useful. */
.form-panel input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: var(--r-sm);
    background: var(--bg-soft);
    font-size: .9rem;
}

.form-panel input[type="checkbox"] { width: auto; margin-right: 6px; }

/* ============================================================== type tabs */

.type-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line-2);
}

.type-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 15px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    color: var(--ink-2);
    font-size: .91rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}

.type-tab:hover { border-color: var(--brand-400); background: var(--brand-050); }

.type-tab.is-active {
    background: var(--brand-600);
    border-color: var(--brand-600);
    color: #fff;
}

/* Categories with nothing in them stay visible but recede — the gap is
   information, not something to hide. */
.type-tab.is-empty { opacity: .5; }

.type-count {
    padding: 1px 8px;
    border-radius: var(--r-full);
    background: var(--bg-soft);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.type-tab.is-active .type-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* Generated identity marks (AvatarExtension). Sized to match uploaded logos so
   the two never disagree in a grid. */
.provider-mark { display: block; flex: none; line-height: 0; }
.provider-mark svg { display: block; border-radius: inherit; }
.pcard-provider .provider-mark svg { width: 34px; height: 34px; }
.admin-cell .provider-mark svg { width: 30px; height: 30px; }
.provider-box-head .provider-mark svg { width: 38px; height: 38px; }

/* ================================================= field-of-study cards */

.field-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.field-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--brand-500);
    border-radius: var(--r-lg);
    background: var(--bg);
    color: inherit;
    text-decoration: none;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.field-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-400); }
.field-card h2 { margin: 0 0 8px; font-size: 1.08rem; letter-spacing: -.02em; }
.field-card p { margin: 0 0 16px; font-size: .9rem; color: var(--muted); line-height: 1.55; }

.field-card-count {
    margin-top: auto;
    font-size: .84rem;
    font-weight: 700;
    color: var(--brand-600);
}


/* A field with nothing in it yet stays visible but does not invite a click. */
.field-card.is-empty { opacity: .55; border-top-color: var(--line); }
.field-card.is-empty .field-card-count { color: var(--muted); }

.related-head {
    margin: 48px 0 16px;
    padding-bottom: 12px;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    border-bottom: 2px solid var(--line-2);
}

.pcard-field {
    display: inline-block;
    margin-top: 10px;
    font-size: .82rem;
    font-weight: 600;
}

.chip-count {
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: var(--r-full);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: .78rem;
    font-weight: 700;
}


/* A verified date is a trust signal; a stale one is a warning, and both are shown. */
.verified { font-weight: 600; color: var(--green-600); }
.verified.is-stale { color: var(--accent-600); }

