/* ============================================================================
   Graduation Portal — design system (MOBILE-FIRST)
   "Stormy Morning" (Figma color combinations): monochromatic blue-gray —
   #384959 slate, #6A89A7 steel, #88BDF2 soft blue, #BDDDFC light sky — on
   misty light neutrals. Inter throughout.
   Base styles target phones; `min-width` media queries enhance for larger
   screens. Everything is token-driven: rebrand via the :root variables.
   ========================================================================== */
:root {
    /* Brand — Stormy Morning */
    --primary: #384959;       /* dark slate blue-gray */
    --primary-dark: #2A3744;
    --primary-50: #EDF3F9;
    --accent: #47637C;        /* deepened steel — emphasis text on light bg */
    --accent-soft: #E4EEF8;
    --steel: #6A89A7;         /* mid steel blue — rules, seals, accents */
    --steel-bright: #88BDF2;  /* soft blue — pops on the dark slate hero */
    --steel-soft: #DCEBFA;    /* light sky tint (from #BDDDFC) */

    /* Neutrals — cool misty light */
    --bg: #EEF3F8;
    --fg: #232D38;
    --card: #FFFFFF;
    --muted: #E3EBF2;
    --muted-fg: #5C6B79;
    --border: #D9E2EB;
    --border-strong: #B7C6D3;

    /* Status */
    --success: #166534;
    --success-soft: #EDF6EC;
    --danger: #B91C1C;
    --danger-soft: #FBEEEA;
    --warning: #92610E;
    --warning-soft: #F9F0DB;

    /* Shape & depth — cool-tinted shadows */
    --radius: 12px;
    --radius-sm: 8px;
    --ring: 0 0 0 3px rgba(106, 137, 167, .45);
    --shadow-sm: 0 1px 2px rgba(35, 52, 68, .08);
    --shadow: 0 8px 24px -12px rgba(35, 52, 68, .20);
    --shadow-lg: 0 24px 48px -24px rgba(24, 37, 50, .35);

    /* Touch */
    --touch: 48px;            /* minimum comfortable tap target */

    /* Type */
    --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body {
    font-family: var(--font-ui);
    background-color: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: rgba(106, 137, 167, .22);
}

a, .btn-link { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ------------------------------------------------------------ gold ornament */
/* Centered hairline rule with a diamond "seal" — the signature flourish under
   display headings on navy surfaces. */
.grad-rule { position: relative; width: 104px; height: 11px; margin: .4rem auto .8rem; }
.grad-rule::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--steel-bright) 18%, var(--steel-bright) 82%, transparent);
}
.grad-rule::after {
    content: ""; position: absolute; left: 50%; top: 50%;
    width: 7px; height: 7px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--steel-bright);
}

/* ----------------------------------------------------------------- buttons */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    min-height: var(--touch);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus, .btn:active:focus { box-shadow: var(--ring); }
.btn-sm { min-height: 40px; }

.btn-primary { color: #fff; background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:disabled { background-color: var(--primary); border-color: var(--primary); opacity: .55; }

.btn-outline-primary { color: var(--primary); border-color: var(--border-strong); background: var(--card); }
.btn-outline-primary:hover { color: #fff; background-color: var(--primary); border-color: var(--primary); }

/* ----------------------------------------------------------------- top bar */
.grad-topbar {
    background: var(--card);
    border-top: 3px solid var(--steel);       /* classic academic gold strip */
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 20;
}
.grad-topbar-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.grad-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--fg); }
.grad-brand:hover { color: var(--fg); }
.grad-brand-mark {
    width: 36px; height: 36px; flex: none;
    border-radius: 9px;
    object-fit: contain;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.grad-brand-name { font-weight: 700; letter-spacing: -.01em; line-height: 1.15; font-size: .98rem; }
.grad-brand-name small { font-family: var(--font-ui); display: block; font-weight: 600; color: var(--accent); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; margin-top: .1rem; }

/* desktop primary nav — hidden on mobile (bottom nav takes over) */
.grad-nav { display: none; margin-left: auto; align-items: center; gap: .15rem; }
.grad-nav-link {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .5rem .85rem; border-radius: 999px;
    font-weight: 600; font-size: .9rem; color: var(--muted-fg);
    text-decoration: none; white-space: nowrap;
    transition: color .15s ease, background-color .15s ease;
}
.grad-nav-link i { font-size: .85rem; opacity: .85; }
.grad-nav-link:hover { color: var(--primary); background: var(--primary-50); }
.grad-nav-link.active { color: var(--primary); background: var(--primary-50); box-shadow: inset 0 -2px 0 var(--steel); }

/* mobile bottom nav — fixed, safe-area aware, hidden on desktop.
   Solid background + own compositor layer (translateZ) instead of backdrop-filter:
   blur on a fixed element is expensive on phones and makes the bar lag/jitter
   while scrolling. */
.grad-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(35, 52, 68, .10);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.grad-bottomnav-link {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
    min-height: 58px; padding: .4rem 0;
    color: var(--muted-fg); text-decoration: none;
    font-size: .68rem; font-weight: 600;
}
.grad-bottomnav-link i { font-size: 1.15rem; }
.grad-bottomnav-link.active { color: var(--primary); box-shadow: inset 0 3px 0 var(--steel); }
.grad-bottomnav-link:active { background: var(--primary-50); }

/* reserve space so fixed bottom nav never covers content (mobile only) */
.grad-app { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0)); }

/* ----------------------------------------------------------------------- hero */
/* Mobile-first: full-bleed autoplay video sits behind a navy scrim so the
   white headline always meets contrast. The gradient is the base layer and
   shows instantly while the 13MB video buffers (and is the reduced-motion
   fallback below). */
.grad-hero {
    position: relative;
    isolation: isolate;
    min-height: 46vh;
    min-height: 46dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Content first: the base hero is a pure gradient (paints instantly, zero bytes).
       The photo layer below is added via .has-photo only after the page data has
       rendered — the browser doesn't fetch a background image until its rule applies. */
    background:
        radial-gradient(900px 320px at 80% -10%, rgba(136, 189, 242, .22), transparent 60%),
        linear-gradient(155deg, var(--primary-dark) 0%, var(--primary) 55%, #4A617A 100%);
    color: #fff;
    padding: 3rem 1rem 4.75rem;
    text-align: center;
    overflow: hidden;
}

/* Applied by the home page once its data has rendered: photo behind the tint. */
.grad-hero.has-photo {
    background-color: var(--primary-dark);
    background-image:
        radial-gradient(900px 320px at 80% -10%, rgba(136, 189, 242, .22), transparent 60%),
        url('a.jpg');
    background-size: auto, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}

/* Background video — sits above the CSS background, plays on top of a.jpg. */
.grad-hero-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}

/* Scrim: dark vignette + brand tint for legibility over any frame. */
.grad-hero-scrim {
    position: absolute; inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(24, 33, 45, .40) 0%, rgba(24, 33, 45, .22) 40%, rgba(24, 33, 45, .82) 100%),
        radial-gradient(120% 90% at 50% 30%, transparent 35%, rgba(13, 19, 26, .58) 100%);
}

.grad-hero-content { position: relative; z-index: 1; max-width: 60ch; }

.grad-hero-eyebrow {
    display: inline-block;
    font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--steel-soft);
    background: rgba(136, 189, 242, .14);
    border: 1px solid rgba(136, 189, 242, .5);
    padding: .35rem .8rem; border-radius: 999px;
    margin-bottom: 1rem;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.grad-hero h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 7.5vw, 3.25rem);
    line-height: 1.12;
    letter-spacing: -.015em;
    margin: 0 auto .35rem;
    max-width: 18ch;
    text-shadow: 0 2px 18px rgba(13, 19, 26, .5);
}
.grad-hero-sub { font-size: 1.02rem; opacity: .96; max-width: 46ch; margin: 0 auto; text-shadow: 0 1px 10px rgba(13, 19, 26, .55); }

.grad-hero-meta {
    margin-top: 1.4rem;
    display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
}

/* Hero skeleton — shown while the congregation header is being fetched, so the
   fallback copy never flashes before the real title arrives. */
.grad-hero-skel { display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: .5rem 0 .3rem; }
.grad-hero-skel span {
    display: block; height: 2.4rem; width: min(420px, 72vw);
    border-radius: 10px; background: rgba(255, 255, 255, .16);
    animation: skel-pulse 1.3s ease-in-out infinite;
}
.grad-hero-skel span:last-child { height: 1rem; width: min(300px, 54vw); }
@keyframes skel-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}

/* Light-surface skeleton bars — placeholders for the checker card and setup grid
   while the home page data loads. */
.skel {
    display: block;
    border-radius: 8px;
    background: var(--muted);
    animation: skel-pulse 1.3s ease-in-out infinite;
}
.skel + .skel { margin-top: .65rem; }
.skel-title { height: 1.1rem; width: 45%; max-width: 260px; }
.skel-line { height: .85rem; width: 70%; max-width: 420px; }
.skel-input { height: var(--touch); width: 100%; border-radius: var(--radius-sm); margin-top: .35rem; }
.skel-block { height: 148px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

@media (prefers-reduced-motion: reduce) {
    .grad-hero-skel span, .skel { animation: none; }
}

/* Honour reduced-motion: drop the looping video, keep the gradient hero. */
@media (prefers-reduced-motion: reduce) {
    .grad-hero-video { display: none; }
}
.grad-hero-meta .chip {
    display: inline-flex; align-items: center; gap: .4rem;
    background: rgba(13, 19, 26, .42);
    border: 1px solid rgba(136, 189, 242, .38);
    padding: .45rem .85rem; border-radius: 999px;
    font-size: .85rem; font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.grad-hero-meta .chip i { color: var(--steel-bright); }

/* home: pull the status-check card up so it overlaps the hero and is fully visible */
.grad-shell--hero { margin-top: -3.5rem; }

/* --------------------------------------------------------------------- shell */
.grad-shell {
    /* The hero is a stacking context (isolation: isolate), so the shell must be
       lifted above it or the pulled-up card tops get painted behind it. */
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: -2.75rem auto 2.5rem;
    padding: 0 1rem;
}

.grad-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.grad-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.grad-card-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: .55rem; }
.grad-card-title .ico {
    width: 32px; height: 32px; flex: none;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--steel-soft); color: var(--accent);
    font-size: .9rem;
}
.grad-card-subtitle { color: var(--muted-fg); margin: -.15rem 0 1.1rem; font-size: .92rem; }

/* lead card gets a ceremonial gold top border and more presence */
.grad-card.is-lead { box-shadow: var(--shadow-lg); border-color: var(--border-strong); border-top: 3px solid var(--steel); }

/* ------------------------------------------------------------------- search */
/* Mobile: input full width, button full width beneath it (easy thumb reach). */
.grad-search { display: flex; flex-direction: column; gap: .6rem; }
.grad-search .form-control {
    width: 100%;
    height: var(--touch);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff;
    padding: 0 1rem;
    font-size: 16px; /* prevents iOS zoom-on-focus */
}
.grad-search .form-control:focus { border-color: var(--steel); box-shadow: var(--ring); }
.grad-search .btn { width: 100%; height: var(--touch); padding: 0 1.5rem; }

/* result panels */
.grad-result { margin-top: 1.1rem; border-radius: var(--radius-sm); padding: 1rem 1.1rem; border: 1px solid var(--border); }
.grad-result h6 { font-weight: 700; display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.grad-result.is-found { background: var(--success-soft); border-color: #C4DFC6; border-left: 4px solid var(--success); }
.grad-result.is-found h6 { color: var(--success); }
.grad-result.is-warn { background: var(--warning-soft); border-color: #E8D9AE; border-left: 4px solid var(--warning); }
.grad-result.is-warn h6 { color: var(--warning); }
.grad-result.is-missing { background: var(--danger-soft); border-color: #EFCDC4; border-left: 4px solid var(--danger); }
.grad-result.is-missing h6 { color: var(--danger); }

.grad-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .9rem; }
.grad-result-grid .lbl { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-fg); margin-bottom: .15rem; }
.grad-result-grid .val { font-weight: 600; word-break: break-word; }

/* ------------------------------------------------------------------- badges */
/* Seal-like: small caps, letterspaced, hairline border. */
.grad-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    padding: .3rem .65rem; border-radius: 999px; line-height: 1; white-space: nowrap;
    border: 1px solid transparent;
}
.grad-badge.is-ok { color: var(--success); background: var(--success-soft); border-color: #C4DFC6; }
.grad-badge.is-pending { color: var(--warning); background: var(--warning-soft); border-color: #E8D9AE; }
.grad-badge.is-danger { color: var(--danger); background: var(--danger-soft); border-color: #EFCDC4; }

/* --------------------------------------------------------------- info panel */
.grad-info-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }

.grad-info-item {
    display: flex; gap: .8rem; align-items: flex-start;
    padding: .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
}
.grad-info-item .ico {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 10px;
    background: var(--steel-soft); color: var(--accent); font-size: 1rem;
}
.grad-info-item .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 600; margin-bottom: .15rem; }
.grad-info-item .val { font-weight: 600; line-height: 1.35; word-break: break-word; }
.grad-info-item .val .sub { display: block; font-weight: 500; color: var(--muted-fg); font-size: .85rem; }

/* ------------------------------------------------------------- rich content */
/* Base rules live in quill-content.css, lifted from Quill's own editor stylesheet so the
   published text matches what the administrator typed. These are the portal's overrides:
   the editor is a padded white box, the portal is a card. */
.grad-rich { word-break: break-word; }
.grad-rich > :first-child { margin-top: 0; }
.grad-rich > :last-child { margin-bottom: 0; }

.grad-rich a { color: var(--primary); }
.grad-rich img { height: auto; border-radius: var(--radius-sm); }

/* Content that predates the editor — the fee/rehearsal text folded in by the
   CeremonyInformation migration, or anything pasted from elsewhere — uses plain <ul>/<ol>
   markup with no data-list attribute, so Quill's marker span is absent. Give those lists
   their native markers back instead of leaving them bulletless. */
.grad-rich li:not([data-list]) { list-style-type: revert; padding-left: 0; }
.grad-rich ul { padding-left: 1.5em; }

/* --------------------------------------------------------------------- list */
/* Mobile-first: graduands render as compact profile tiles, two per row —
   avatar on top, then name / reg number / programme / status. Field labels
   and the Doc column are dropped here for compactness (desktop table has them). */
.grad-table-wrap { border: 0; }
.grad-table { width: 100%; margin: 0; }
.grad-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* visually hidden, kept for a11y */
.grad-table tbody {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
}
.grad-table tbody tr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .12rem;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    padding: .85rem .5rem .8rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
}
.grad-table tbody td {
    display: block;
    padding: 0;
    border: 0;
    max-width: 100%;
    font-size: .78rem;
    text-align: center;
    word-break: break-word;
}
.grad-table tbody td::before { content: none; }
.grad-table td.col-idx { display: none; }
.grad-table td.col-photo { order: -2; margin-bottom: .4rem; }
.grad-table tbody td[data-label="Name"] { order: -1; font-weight: 700; font-size: .84rem; line-height: 1.25; }
.grad-table .col-reg { font-weight: 600; font-size: .74rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.grad-table tbody td[data-label="Programme"] { font-size: .72rem; color: var(--muted-fg); }
.grad-table tbody td[data-label="Doc"] { display: none; }
.grad-table tbody td[data-label="Status"] { margin-top: .45rem; }
.grad-table tbody td[data-label="Status"] .grad-badge { font-size: .6rem; padding: .26rem .5rem; }

.grad-scroll { max-height: none; overflow: visible; }

/* -------------------------------------------------- programme filter select */
.grad-prog-select-wrap {
    display: flex; flex-direction: column; gap: .3rem;
    margin-bottom: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--border);
}
.grad-prog-label {
    font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted-fg);
}
.grad-prog-select-inner { position: relative; }
.grad-prog-select {
    width: 100%; height: var(--touch);
    padding: 0 2.5rem 0 .85rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: #fff; color: var(--fg);
    font-family: var(--font-ui); font-size: .95rem; font-weight: 600;
    cursor: pointer; appearance: none; -webkit-appearance: none;
}
.grad-prog-select:focus { outline: none; border-color: var(--steel); box-shadow: var(--ring); }
.grad-prog-select-icon {
    position: absolute; right: .85rem; top: 50%; transform: translateY(-50%);
    font-size: .75rem; color: var(--muted-fg); pointer-events: none;
}

/* ------------------------------------------------------- student avatar */
.grad-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--avatar-size, 40px); height: var(--avatar-size, 40px);
    border-radius: 50%; object-fit: cover; flex: none;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: calc(var(--avatar-size, 40px) * .38);
    font-weight: 700; color: var(--accent);
    background: var(--steel-soft);
    vertical-align: middle;
}
.grad-avatar--placeholder {
    background: var(--muted);
    animation: avatar-pulse 1.4s ease-in-out infinite;
}
@keyframes avatar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
    .grad-avatar--placeholder { animation: none; }
}

/* ----------------------------------------- result card header with avatar */
.grad-result-header {
    display: flex; align-items: center; gap: .9rem;
    margin-bottom: .75rem;
}
.grad-result-header h6 { margin-bottom: .2rem; }

/* -------------------------------------------- payment instructions box */
.grad-payment-box {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(136, 189, 242, .10);
    border: 1px solid rgba(136, 189, 242, .40);
}
.grad-payment-box-title {
    font-weight: 700; font-size: .92rem; color: var(--primary);
    display: flex; align-items: center; gap: .45rem;
    margin-bottom: .35rem;
}
.grad-payment-box-sub { color: var(--muted-fg); font-size: .85rem; margin-bottom: .75rem; }
.grad-payment-steps { display: flex; flex-direction: column; gap: .5rem; }
.grad-payment-step {
    display: flex; align-items: flex-start; gap: .6rem;
    font-size: .9rem;
}
.grad-payment-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex: none;
    border-radius: 50%; font-size: .72rem; font-weight: 800;
    background: var(--primary); color: #fff;
}
.grad-ussd {
    font-family: var(--font-ui); font-weight: 800; font-size: 1.02rem;
    color: var(--primary); letter-spacing: .02em;
    background: rgba(56, 73, 89, .08); padding: .1rem .45rem;
    border-radius: 5px;
}

/* filter input */
.grad-filter { height: var(--touch); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: #fff; padding: 0 1rem; font-size: 16px; }
.grad-filter:focus { border-color: var(--steel); box-shadow: var(--ring); }

.grad-count { color: var(--muted-fg); font-size: .9rem; scroll-margin-top: 76px; } /* clears the sticky topbar when pagination scrolls here */

/* ---------------------------------------------------------------- pagination */
.grad-pagination {
    display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: .35rem;
    margin-top: 1rem; padding-top: .85rem;
    border-top: 1px solid var(--border);
}
.grad-page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 .5rem;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
    background: #fff; color: var(--muted-fg);
    font-size: .88rem; font-weight: 600; cursor: pointer;
    transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.grad-page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.grad-page-btn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.grad-page-btn:disabled { opacity: .38; cursor: default; }
.grad-page-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; color: var(--muted-fg); font-size: .88rem; }

/* ------------------------------------------------------ interior page banner */
.grad-banner {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(700px 240px at 85% -20%, rgba(136, 189, 242, .20), transparent 60%),
        linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 60%, #4A617A 100%);
    color: #fff;
    padding: 1.75rem 1rem 3rem;
    text-align: center;
}

/* Optional ceremony photo behind the banner text (decorative). */
.grad-banner-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
    pointer-events: none;
}
/* Slate scrim keeps the white text at contrast over any photo. */
.grad-banner-scrim {
    position: absolute; inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(42, 55, 68, .72) 0%, rgba(42, 55, 68, .62) 45%, rgba(24, 33, 45, .88) 100%);
}
.grad-banner.has-image { padding: 2.5rem 1rem 3.5rem; }
.grad-banner.has-image h1 { text-shadow: 0 2px 14px rgba(13, 19, 26, .5); }
.grad-banner-inner { max-width: 1040px; margin: 0 auto; }
.grad-banner-eyebrow {
    display: inline-block; margin-bottom: .6rem;
    font-size: .66rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
    color: var(--steel-soft); background: rgba(136, 189, 242, .14); border: 1px solid rgba(136, 189, 242, .5);
    padding: .3rem .75rem; border-radius: 999px;
}
.grad-banner h1 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.5rem, 6vw, 2.4rem); line-height: 1.15; letter-spacing: -.015em;
    margin: 0 auto .2rem; max-width: 24ch;
}
.grad-banner .grad-rule { margin: .3rem auto .6rem; }
.grad-banner-sub { opacity: .94; max-width: 52ch; margin: 0 auto; font-size: .98rem; }
.grad-banner-extra { margin-top: 1rem; }
.grad-banner-back {
    display: inline-flex; align-items: center; gap: .45rem;
    color: #fff; text-decoration: none; font-weight: 600; font-size: .88rem;
    background: rgba(255,255,255,.10); border: 1px solid rgba(136, 189, 242, .45);
    padding: .4rem .85rem; border-radius: 999px;
}
.grad-banner-back:hover { color: #fff; background: rgba(136, 189, 242, .22); }

/* shell variant: interior pages pull cards up under the (shorter) banner */
.grad-shell--banner { margin-top: -1.75rem; }

/* ---------------------------------------------------------------- section head */
.grad-section { margin-bottom: 1.25rem; }
.grad-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.grad-section-title { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; margin: 0; }
.grad-section-sub { color: var(--muted-fg); margin: .2rem 0 0; font-size: .92rem; }

/* ------------------------------------------------------------- setup card grid */
.grad-setup-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }

.grad-setup-card {
    display: flex; flex-direction: column; gap: .6rem;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    text-decoration: none; color: var(--fg);
    transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.grad-setup-card:hover { color: var(--fg); border-color: var(--steel); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.grad-setup-card:focus-visible { outline: none; box-shadow: var(--ring); }

.grad-setup-card-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.grad-setup-card-date {
    font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--accent);
}
.grad-setup-card-title { font-weight: 700; font-size: 1.1rem; line-height: 1.3; letter-spacing: -.01em; word-break: break-word; }
.grad-setup-card-sem { color: var(--muted-fg); font-size: .85rem; margin-top: -.15rem; }

.grad-setup-card-foot {
    display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem;
    margin-top: .35rem; padding-top: .85rem; border-top: 1px dashed var(--border-strong);
}
.grad-setup-card-fee { display: flex; flex-direction: column; gap: .1rem; }
.grad-setup-card-fee .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-fg); }
.grad-setup-card-fee .amt { font-weight: 800; font-size: 1.05rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.grad-setup-card-cta { display: inline-flex; align-items: center; font-weight: 700; font-size: .9rem; color: var(--primary); white-space: nowrap; }
.grad-setup-card-cta::after { content: "→"; margin-left: .4rem; color: var(--steel); transition: margin-left .15s ease; }
.grad-setup-card:hover .grad-setup-card-cta::after { margin-left: .7rem; }

/* --------------------------------------------------------------- photo gallery */
/* Mosaic of ceremony photos. aspect-ratio reserves space (no layout shift);
   images are lazy-loaded and cropped with object-fit. */
.grad-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.grad-gallery-item {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4 / 3;
    background: var(--muted);
}
.grad-gallery-item.is-wide { grid-column: span 2; aspect-ratio: 16 / 8; }
.grad-gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .3s ease;
}
.grad-gallery-item:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) {
    .grad-gallery-item img { transition: none; }
    .grad-gallery-item:hover img { transform: none; }
}

/* ------------------------------------------------------------- highlight strip */
.grad-highlight {
    display: flex; align-items: center; gap: .9rem;
    padding: 1rem 1.1rem; margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--steel);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
    text-decoration: none; color: var(--fg);
    transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.grad-highlight:hover { color: var(--fg); border-color: var(--steel); box-shadow: var(--shadow); transform: translateY(-1px); }
.grad-highlight:focus-visible { outline: none; box-shadow: var(--ring); }
.grad-highlight-ico {
    width: 44px; height: 44px; flex: none;
    display: grid; place-items: center; border-radius: 12px;
    background: var(--steel-soft); color: var(--accent); font-size: 1.1rem;
}
.grad-highlight-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; flex: 1 1 auto; }
.grad-highlight-title { font-weight: 700; }
.grad-highlight-sub { color: var(--muted-fg); font-size: .88rem; word-break: break-word; }
.grad-highlight-arrow { color: var(--border-strong); flex: none; }
.grad-highlight:hover .grad-highlight-arrow { color: var(--steel); }

/* ----------------------------------------------------------------- notices */
.grad-note { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font-weight: 500; border: 1px solid var(--steel-soft); }

/* --------------------------------------------------------------------- footer */
.grad-footer { position: relative; text-align: center; color: var(--muted-fg); padding: 1.4rem 1rem 2.5rem; font-size: .85rem; }
.grad-footer::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 104px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);
}
.grad-footer .grad-footer-line { margin: .15rem 0; }

/* ----------------------------------------------------------- empty / spinner */
.grad-empty { text-align: center; color: var(--muted-fg); padding: 2rem 1rem; }
.grad-empty .ico { font-size: 1.8rem; color: var(--border-strong); margin-bottom: .6rem; }

/* error overlay (framework) */
.blazor-error-boundary { background: var(--danger); padding: 1rem; color: #fff; border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ============================================================================
   ENHANCEMENTS FOR LARGER SCREENS
   ========================================================================== */

/* Small tablets / large phones */
@media (min-width: 480px) {
    .grad-search { flex-direction: row; flex-wrap: wrap; }
    .grad-search .form-control { flex: 1 1 220px; width: auto; }
    .grad-search .btn { width: auto; flex: 0 0 auto; }
    .grad-result-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablets */
@media (min-width: 640px) {
    .grad-info-grid { grid-template-columns: repeat(2, 1fr); }
    .grad-setup-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Tablets / desktop: restore the real data table */
@media (min-width: 768px) {
    .grad-brand-name { font-size: 1rem; }
    .grad-brand-name small { font-size: .66rem; }

    /* desktop top nav replaces the mobile bottom nav */
    .grad-nav { display: flex; }
    .grad-bottomnav { display: none; }
    .grad-app { padding-bottom: 0; }

    .grad-banner { padding: 2.5rem 1.25rem 3.75rem; }
    .grad-shell--banner { margin-top: -2.25rem; }

    .grad-hero { min-height: 52vh; min-height: 52dvh; padding: 4rem 1.25rem 5.5rem; }
    .grad-hero-sub { font-size: 1.2rem; }
    .grad-hero-meta { margin-top: 1.5rem; }
    .grad-shell--hero { margin-top: -4rem; }

    .grad-shell { margin: -3.25rem auto 3rem; padding: 0 1.25rem; }
    .grad-card { padding: 1.75rem; margin-bottom: 1.5rem; }
    .grad-card-title { font-size: 1.15rem; }

    .grad-table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
    .grad-scroll { max-height: 540px; overflow: auto; }
    .grad-table { border-collapse: separate; border-spacing: 0; }
    .grad-table thead { position: static; width: auto; height: auto; clip: auto; }
    .grad-table thead tr { display: table-row; }
    .grad-table thead th {
        position: sticky; top: 0; z-index: 1;
        background: var(--primary); color: #fff;
        font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
        padding: .7rem .9rem; white-space: nowrap; border: 0;
        box-shadow: inset 0 -2px 0 var(--steel-bright);
    }
    .grad-table tbody { display: table-row-group; gap: 0; }
    .grad-table tbody tr { display: table-row; border: 0; border-radius: 0; background: transparent; padding: 0; margin: 0; box-shadow: none; }
    .grad-table tbody td {
        display: table-cell; text-align: left;
        padding: .7rem .9rem; border-top: 1px solid var(--border);
        vertical-align: middle; gap: 0;
        font-size: .95rem;
    }
    .grad-table tbody td::before { content: none; }
    .grad-table td.col-idx { display: table-cell; color: var(--muted-fg); width: 40px; }
    .grad-table td.col-photo {
        display: table-cell; width: 62px; text-align: center;
        padding: .45rem .6rem; margin-bottom: 0;
    }
    .grad-table thead th.col-photo { width: 62px; }
    .grad-table tbody td[data-label="Name"] { font-weight: 600; font-size: .95rem; }
    .grad-table tbody td[data-label="Doc"] { display: table-cell; }
    .grad-table tbody td[data-label="Programme"] { font-size: .95rem; color: var(--fg); }
    .grad-table tbody td[data-label="Status"] { margin-top: 0; }
    .grad-table tbody td[data-label="Status"] .grad-badge { font-size: .72rem; padding: .3rem .65rem; }
    .grad-table .col-reg { white-space: nowrap; font-weight: 700; font-size: .95rem; color: var(--fg); }
    .grad-table tbody tr:nth-child(odd) td { background: #F7FAFD; }
    .grad-table tbody tr:hover td { background: var(--primary-50); }
}

/* Desktop: three-up graduation cards; gallery becomes a 3-column mosaic */
@media (min-width: 992px) {
    .grad-setup-grid { grid-template-columns: repeat(3, 1fr); }

    .grad-gallery { grid-template-columns: repeat(3, 1fr); gap: .85rem; }
    .grad-gallery-item.is-wide { grid-column: span 2; grid-row: span 1; aspect-ratio: auto; }
}
