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

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

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

.pe-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* =====================================================================
   Page header
   ===================================================================== */
.pi-head {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(28px, 3.5vw, 48px) clamp(32px, 4vw, 56px);
    background: var(--pi-forest);
    color: #cfdac9;
}
.pi-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;
}
.pi-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;
}
.pi-crumbs { margin-bottom: clamp(14px, 2vw, 22px); font-size: .875rem; }
.pi-crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; }
.pi-crumbs li + li::before { content: "/"; margin-right: 8px; color: rgba(255, 255, 255, .4); }
.pi-crumbs a { color: #cfdac9; text-decoration: none; }
.pi-crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.pi-crumbs li[aria-current] { color: var(--pi-mustard); font-weight: 600; }
.pi-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;
}
.pi-head__lead {
    max-width: 48rem;
    margin: 0;
    font-size: clamp(1rem, .95rem + .3vw, 1.125rem);
    line-height: 1.65;
}

/* =====================================================================
   Institute cards
   ===================================================================== */
.pi-cards { padding-block: clamp(32px, 4.5vw, 56px) clamp(20px, 3vw, 32px); }
.pi-cards__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.pi-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1.5px solid var(--pi-line);
    border-radius: 18px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.pi-card:hover {
    border-color: var(--pi-sage);
    box-shadow: 0 22px 38px -30px rgba(23, 57, 44, .6);
}
.pi-card__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.pi-card__logo {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    flex: none;
    place-items: center;
    width: 84px;
    height: 84px;
    padding: 8px;
    border: 1.5px solid var(--pi-line);
    border-radius: 16px;
    background: #fff;
}
.pi-card__initials,
.pi-card__logo img { grid-area: 1 / 1; }
.pi-card__initials {
    display: grid;
    place-items: center;
    width: 54px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--pi-sage), var(--pi-forest));
    color: rgba(255, 255, 255, .92);
    font-family: var(--pe-font-display, Georgia, serif);
    font-size: 1.3rem;
}
.pi-card__logo img {
    width: auto;
    height: auto;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.pi-card__name {
    margin: 0 0 6px;
    color: var(--pi-forest);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
}
.pi-card__place {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--pi-muted);
    font-size: .9375rem;
    line-height: 1.45;
}
.pi-card__place i { margin-top: 2px; color: var(--pi-forest); }
.pi-card__text {
    margin: 0 0 14px;
    color: var(--pi-muted);
    font-size: .9688rem;
    line-height: 1.6;
}
.pi-card__approvals {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--pi-forest);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.45;
}
.pi-card__approvals i { margin-top: 2px; color: var(--pi-mustard); }
.pi-card__courses {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 18px !important;
}
.pi-card__courses li {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pi-sage-100);
    color: var(--pi-forest);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.35;
}
.pi-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--pi-line);
}
.pi-card__apply { min-height: 44px; padding: 0 20px; font-size: .9375rem; }
.pi-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pi-forest);
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.pi-card__link:hover { color: var(--pi-green); text-decoration: underline; text-underline-offset: 4px; }
.pi-card__link i { color: var(--pi-mustard); }

/* =====================================================================
   Comparison table
   ===================================================================== */
.pi-table { padding-block: clamp(20px, 3vw, 32px) clamp(32px, 4.5vw, 56px); }
.pi-table__title {
    margin: 0 0 8px;
    color: var(--pi-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;
}
.pi-table__hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--pi-muted);
    font-size: .9375rem;
}
.pi-table__hint i { color: var(--pi-mustard); }

.pi-table__scroll {
    overflow-x: auto;
    border: 1.5px solid var(--pi-line);
    border-radius: 18px;
    background: #fff;
}
.pi-table table {
    width: 100%;
    border-collapse: separate;      /* keeps the sticky column's edges tidy */
    border-spacing: 0;
    font-size: .9375rem;
}
.pi-table th,
.pi-table td {
    padding: 14px 18px;
    text-align: left;
    vertical-align: top;
    line-height: 1.5;
}
.pi-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--pi-forest);
    color: #fff;
    font-size: .9375rem;
    font-weight: 600;
    white-space: normal;
    min-width: 200px;
}
/* first column stays put while the rest scrolls */
.pi-table th[scope="row"],
.pi-table__corner {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 128px;
    color: var(--pi-forest);
    font-weight: 700;
    background: var(--pi-sage-50);
    box-shadow: 1px 0 0 var(--pi-line);
}
.pi-table__corner { z-index: 4; background: var(--pi-forest); color: #fff; }
.pi-table tbody tr + tr th,
.pi-table tbody tr + tr td { border-top: 1px solid var(--pi-line); }
.pi-table tbody td { color: var(--pi-muted); }
.pi-table tbody a { color: var(--pi-green); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pi-table tbody a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* =====================================================================
   Closing call-to-action
   ===================================================================== */
.pi-cta { padding-block: 0 clamp(32px, 4.5vw, 56px); }
.pi-cta__inner {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 22px 40px;
    overflow: hidden;
    padding: clamp(24px, 3.2vw, 40px);
    border-radius: 22px;
    background: var(--pi-forest);
    color: #cfdac9;
}
.pi-cta__inner::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;
}
.pi-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;
}
.pi-cta p { max-width: 48ch; margin: 0; font-size: 1rem; line-height: 1.6; }
.pi-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 991.98px) {
    .pi-cards__list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575.98px) {
    .pi-card { padding: 18px; }
    .pi-card__head { gap: 12px; }
    .pi-card__logo { width: 66px; height: 66px; border-radius: 14px; }
    .pi-card__apply { width: 100%; }
    .pi-table th, .pi-table td { padding: 12px 14px; font-size: .875rem; }
    .pi-table thead th { min-width: 170px; }
    .pi-table th[scope="row"], .pi-table__corner { min-width: 104px; }
    .pi-cta__actions, .pi-cta__actions .pe-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .pi-card { transition-duration: .01ms !important; }
}
