/* =====================================================================
   PE Group of Institutions: PROGRAMMES PAGE ONLY styles (/programme)
   Reuses the colour tokens from pe-header.css, with fallbacks.
   ===================================================================== */

.pr-head, .pr-list {
    --pr-forest: var(--pe-forest, #17392c);
    --pr-green: var(--pe-green, #2f6b4f);
    --pr-sage: var(--pe-sage, #7c8c6b);
    --pr-sage-50: var(--pe-sage-50, #f3f6f0);
    --pr-sage-100: var(--pe-sage-100, #e5ebe0);
    --pr-mustard: var(--pe-mustard, #d9a036);
    --pr-ink: var(--pe-ink, #1c2521);
    --pr-muted: var(--pe-muted, #5b675f);
    --pr-line: #dfe4dd;

    color: var(--pr-ink);
    font-family: var(--pe-font-ui, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}
.pr-head *, .pr-list *,
.pr-head *::before, .pr-list *::before { box-sizing: border-box; }
.pr-head ol, .pr-head ul, .pr-list ul { margin: 0; padding: 0; list-style: none; }
.pr-list :focus-visible { outline: 2px solid var(--pr-forest); outline-offset: 3px; }
.pr-head :focus-visible { outline: 2px solid var(--pr-mustard); outline-offset: 3px; }

/* =====================================================================
   Page header
   ===================================================================== */
.pr-head {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(28px, 3.5vw, 48px) clamp(28px, 3.5vw, 44px);
    background: var(--pr-forest);
    color: #cfdac9;
}
.pr-head::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(46% 70% at 82% 18%, rgba(124, 140, 107, .4), transparent 70%),
        radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.5px) 0 0 / 22px 22px;
}
.pr-head::after {
    content: "";
    position: absolute;
    right: -3%;
    bottom: -58%;
    z-index: -1;
    width: min(28%, 300px);
    aspect-ratio: 4 / 5;
    border: 26px solid rgba(255, 255, 255, .07);
    border-radius: 50% 50% 0 0 / 40% 40% 0 0;
    pointer-events: none;
}
.pr-crumbs { margin-bottom: clamp(14px, 2vw, 22px); font-size: .875rem; }
.pr-crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; }
.pr-crumbs li + li::before { content: "/"; margin-right: 8px; color: rgba(255, 255, 255, .4); }
.pr-crumbs a { color: #cfdac9; text-decoration: none; }
.pr-crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pr-crumbs li[aria-current] { color: var(--pr-mustard); font-weight: 600; }
.pr-head__title {
    margin: 0 0 12px;
    color: #fff;
    font-family: var(--pe-font-display, Georgia, "Times New Roman", serif);
    font-size: clamp(1.875rem, 1.2rem + 2.4vw, 3rem);
    font-weight: 400;
    line-height: 1.1;
}
.pr-head__lead {
    max-width: 46rem;
    margin: 0;
    font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
    line-height: 1.65;
}

/* jump links */
.pr-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: clamp(20px, 3vw, 28px);
}
.pr-jump a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, color .2s;
}
.pr-jump a:hover {
    border-color: var(--pr-mustard);
    background: var(--pr-mustard);
    color: var(--pr-forest);
}
.pr-jump span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .75rem;
}
.pr-jump a:hover span { background: rgba(23, 57, 44, .18); }

/* =====================================================================
   Levels and cards
   ===================================================================== */
.pr-list { padding-block: clamp(32px, 4.5vw, 60px); }
.pr-level { scroll-margin-top: 110px; }      /* clears the sticky header */
.pr-level + .pr-level { margin-top: clamp(32px, 4.5vw, 56px); }
.pr-level__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 16px;
    margin-bottom: clamp(16px, 2.5vw, 24px);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pr-line);
}
.pr-level__title {
    margin: 0;
    color: var(--pr-forest);
    font-family: var(--pe-font-display, Georgia, "Times New Roman", serif);
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
    font-weight: 400;
    line-height: 1.15;
}
.pr-level__count {
    color: var(--pr-muted);
    font-size: .9375rem;
}

.pr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.pr-card {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 24px;
    border: 1.5px solid var(--pr-line);
    border-radius: 18px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.pr-card:hover {
    border-color: var(--pr-sage);
    box-shadow: 0 22px 38px -28px rgba(23, 57, 44, .6);
    transform: translateY(-3px);
}
.pr-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.pr-card__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--pr-sage-100);
    color: var(--pr-forest);
    font-size: 1.3rem;
}
.pr-card__tag {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--pr-forest);
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
}
.pr-card__name {
    min-height: calc(1.25rem * 1.3 * 2);      /* keeps short and long names aligned */
    margin: 0 0 10px;
    color: var(--pr-forest);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}
.pr-card__name a { color: inherit; text-decoration: none; }
.pr-card__name a:hover { text-decoration: underline; text-decoration-color: var(--pr-mustard); text-underline-offset: 4px; }
.pr-card__college {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0 0 16px;
    color: var(--pr-muted);
    font-size: .9375rem;
    line-height: 1.45;
}
.pr-card__college i { margin-top: 2px; color: var(--pr-forest); }

.pr-card__meta {
    display: grid;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid var(--pr-line);
    border-bottom: 1px solid var(--pr-line);
}
.pr-card__meta li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pr-ink);
    font-size: .9375rem;
    font-weight: 600;
}
.pr-card__meta i { color: var(--pr-mustard); font-size: 1rem; }

.pr-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0 !important;
}
.pr-card__badges li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--pr-sage-50);
    color: var(--pr-forest);
    font-size: .8125rem;
    font-weight: 600;
}
.pr-card__badges i { color: var(--pr-mustard); font-size: .85rem; }

.pr-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: auto;
    padding-top: 20px;
}
.pr-card__apply { min-height: 44px; padding: 0 20px; font-size: .9375rem; }
.pr-card__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pr-forest);
    font-size: .9375rem;
    font-weight: 700;
    text-decoration: none;
}
.pr-card__more i { transition: transform .2s; }
.pr-card__more:hover { color: var(--pr-green); }
.pr-card__more:hover i { transform: translateX(3px); }

/* =====================================================================
   Closing call-to-action
   ===================================================================== */
.pr-cta {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 22px 40px;
    overflow: hidden;
    margin-top: clamp(36px, 5vw, 64px);
    padding: clamp(24px, 3.2vw, 40px);
    border-radius: 22px;
    background: var(--pr-forest);
    color: #cfdac9;
}
.pr-cta::before {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -60%;
    z-index: -1;
    width: min(30%, 260px);
    aspect-ratio: 4 / 5;
    border: 26px solid rgba(255, 255, 255, .07);
    border-radius: 50% 50% 0 0 / 40% 40% 0 0;
    pointer-events: none;
}
.pr-cta__title {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--pe-font-display, Georgia, "Times New Roman", serif);
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: 400;
    line-height: 1.15;
}
.pr-cta p { max-width: 48ch; margin: 0; font-size: 1rem; line-height: 1.6; }
.pr-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1199.98px) {
    .pr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .pr-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .pr-card { padding: 18px 18px 20px; }
    .pr-card__name { font-size: 1.125rem; min-height: 0; }
    .pr-card__actions { gap: 12px; }
    .pr-card__apply { width: 100%; }
    .pr-cta__actions, .pr-cta__actions .pe-btn { width: 100%; }
    .pr-jump a { min-height: 40px; padding: 0 14px; font-size: .875rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pr-card, .pr-card__more i, .pr-jump a { transition-duration: .01ms !important; }
    .pr-card:hover { transform: none; }
}
