/* Homepage composition. Shared shell, controls and reading styles stay in styles.css. */
/* Each section uses the same twelve tracks; editorial columns split that full span symmetrically. */
.portal-home .hero-grid,
.portal-home .home-section-grid,
.portal-home .home-editorial-layout {
 display: grid;
 grid-template-columns: repeat(12, minmax(0, 1fr));
 column-gap: 24px;
}
.portal-home .home-section-grid>.section-heading,
.portal-home .home-admission-grid,
.portal-home .materials-grid { grid-column: 1 / -1; }
.portal-home .section:not(:where(.pn-map-home)) { padding-block: 48px; }
.portal-home .section:not(:where(.pn-map-home)) .section-heading { align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.portal-home .section:not(:where(.pn-map-home)) .section-heading h2 { font-size: 1.75rem; line-height: 36px; }
.portal-home .section-heading .heading-description { margin-top: 12px; font-size: 1rem; line-height: 24px; }
.home-open-days-preview { scroll-margin-block-start: 24px; }
@media (max-width: 639px) {
 .home-open-days-preview .section-heading { flex-wrap: wrap; }
}
.portal-home {
 --pn-home-section-primary: var(--pn-surface);
 --pn-home-section-alternate: #F2F7FA;
}

[data-pn-display] .portal-home { --pn-home-section-alternate: var(--pn-surface-sage); }

.portal-home > [data-home-surface="primary"] { background-color: var(--pn-home-section-primary); }
.portal-home > [data-home-surface="alternate"] { background-color: var(--pn-home-section-alternate); }
.portal-home > .materials-section[data-home-surface] { border-block-start: 0; }

.portal-home .hero-grid { align-items: center; row-gap: 48px; min-height: 0; padding-block: 48px; }
.hero-copy { grid-column: 1 / span 6; min-width: 0; }
.portal-home .hero h1 { max-width: 640px; font-size: clamp(3rem, 4vw, 3.5rem); line-height: 1.08; letter-spacing: -.048em; }
.portal-home .hero h1>span { display: block; color: var(--primary); }
.portal-home .hero h1>.hero-title-start { color: var(--pn-brand); }
.portal-home .hero-description { max-width: 565px; margin-top: 24px; font-size: 1.25rem; line-height: 1.65; }
.hero-location-phrase { hyphens: none; }
.hero-actions { margin-top: 32px; }
.hero-interest-action { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; max-width: 100%; padding: var(--pn-space-3) var(--pn-space-6); font-size: 1.0625rem; line-height: 1.5; text-align: left; }
.hero-career {
 grid-column: 7 / span 6;
 position: relative;
 display: grid;
 grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
 grid-template-rows: repeat(16, minmax(0, 1fr));
 isolation: isolate;
 inline-size: 100%;
 max-inline-size: 560px;
 min-inline-size: 0;
 aspect-ratio: 560 / 531;
 justify-self: end;
 background: radial-gradient(ellipse at center, var(--pn-home-section-alternate), transparent 68%);
}
.hero-career-student {
 grid-column: 2;
 grid-row: 1 / -1;
 display: grid;
 inline-size: 100%;
 block-size: 100%;
 min-block-size: 0;
 padding-block: 8%;
}
.hero-career-student > :is(img, canvas) {
 grid-area: 1 / 1;
 inline-size: 100%;
 block-size: 100%;
 min-block-size: 0;
 object-fit: contain;
}
.hero-career-student > [hidden] { display: none; }
.hero-career-link {
 position: relative;
 isolation: isolate;
 display: grid;
 grid-template-rows: minmax(0, 1fr) auto;
 align-items: center;
 justify-items: center;
 min-inline-size: 0;
 padding: 8px 2px;
 gap: 4px;
 border: 1px solid transparent;
 border-radius: 12px;
 color: var(--pn-brand);
 text-align: center;
 text-decoration: none;
}
.hero-career-link::before {
 position: absolute;
 z-index: -1;
 inset: 0;
 border-radius: inherit;
 background: radial-gradient(ellipse at center, var(--pn-home-section-alternate), transparent 75%);
 opacity: 0;
 pointer-events: none;
 content: '';
}
.hero-career-link:focus-visible { border-color: var(--focus); }
.hero-career-link:focus-visible .hero-career-label { text-decoration: underline; text-underline-offset: .2em; }
.hero-career-link:focus-visible::before { opacity: 1; }
.hero-career-label { font-size: clamp(.75rem, 1.05vw, .9375rem); font-weight: 650; line-height: 1.2; }
.hero-career-object { inline-size: min(94%, 140px); block-size: 100%; min-block-size: 0; object-fit: contain; }
.hero-career-laptop { grid-area: 2 / 1 / 6 / 2; }
.hero-career-microscope { grid-area: 7 / 1 / 11 / 2; }
.hero-career-camera { grid-area: 1 / 3 / 5 / 4; }
.hero-career-documents { grid-area: 5 / 3 / 9 / 4; }
.hero-career-globe { grid-area: 9 / 3 / 13 / 4; }
@media (max-width: 620px) {
 .hero-career-link { padding-block: 4px; }
}
@media (hover: hover) and (pointer: fine) {
 .hero-career-link:hover::before { opacity: 1; }
 .hero-career-link:hover .hero-career-label { color: var(--primary); }
}
html.bvi-active .hero-contours,
html.bvi-active .hero-career :is(.hero-career-student, .hero-career-object) { display: none; }
html.bvi-active .hero-career { display: flex; flex-wrap: wrap; gap: 8px; aspect-ratio: auto; background: none; }
html.bvi-active .hero-career-link { display: block; min-block-size: 44px; padding-inline: 8px; }

.home-admission .heading-description { max-width: 56ch; }
.home-admission-grid { display: grid; grid-template-columns: subgrid; gap: 24px; }
@supports not (grid-template-columns: subgrid) {
 .home-admission-grid, .portal-home .materials-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.home-admission-card { grid-column: span 6; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 24px; border: 1px solid var(--border); border-top: 3px solid var(--primary); border-radius: 12px; background: var(--surface); }
.home-admission-card-heading { display: flex; align-items: center; gap: 16px; }
.home-admission-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 12px; color: var(--primary); background: var(--soft); }
.home-admission-icon .icon { width: 30px; height: 30px; }
.home-admission-card h3 { font-size: 1.25rem; line-height: 28px; letter-spacing: -.025em; }
.home-admission-card>p { font-size: 1rem; line-height: 24px; color: var(--muted); max-width: 49ch; }
.home-admission-card-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 12px; margin-top: auto; }
.home-admission-card-footer>span { color: var(--muted); font-size: .875rem; line-height: 20px; }
.home-admission-card .button { min-height: 48px; padding: 12px 18px; line-height: 1.5; text-align: center; }

/* The one-pixel centre track shares the admission gutter's axis without offsets. */
.portal-home .home-editorial-columns { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); grid-template-rows: auto; column-gap: 32px; align-items: start; }
.portal-home .home-news { grid-column: 1; grid-row: 1; min-width: 0; }
.portal-home .home-announcements { grid-column: 3; grid-row: 1; min-width: 0; padding: 0; border: 0; }
.portal-home .home-editorial-divider { grid-column: 2; grid-row: 1 / -1; align-self: stretch; background: var(--border); }
.portal-home .home-editorial .section-heading { display: flex; align-items: baseline; gap: 16px; margin: 0 0 24px; }
.portal-home .home-editorial .section-heading .text-link { margin: 0; }
.portal-home .home-news-grid,
.portal-home .announcement-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.portal-home .home-news-grid .editorial-card,
.portal-home .announcement-list .announcement-item { min-width: 0; padding: 24px 0; border: 0; border-bottom: 1px solid var(--border); align-content: start; }
.portal-home .home-news-grid .editorial-card:first-child,
.portal-home .announcement-list .announcement-item:first-child { padding-top: 0; }
.portal-home .home-news-grid .editorial-card-copy:has(.publication-date),
.portal-home .announcement-list .announcement-item:has(.publication-date) { grid-template-columns: 48px minmax(0, 1fr); column-gap: 16px; align-content: start; }
.portal-home .home-news-grid .editorial-card-copy { align-content: start; }
.portal-home .home-news-grid .editorial-card-copy>.publication-date { grid-row: 1 / span 2; }
.portal-home .home-news-grid .editorial-card h3,
.portal-home .announcement-list .announcement-item h3 { font-size: 1.25rem; line-height: 28px; font-weight: 650; }
.portal-home .home-news-grid .editorial-card p,
.portal-home .announcement-list .announcement-item p { margin-top: 12px; font-size: 1rem; line-height: 24px; }
.portal-home .home-calendar-link { padding-top: 24px; margin: 0; }

/* Synchronize complete publication rows; each title and summary keep their natural 12px gap. */
@supports (grid-template-rows: subgrid) {
 .portal-home .home-editorial-columns { grid-template-rows: auto repeat(3, auto) auto; }
 .portal-home .home-news,
 .portal-home .home-announcements { display: grid; grid-template-rows: subgrid; grid-row: 1 / -1; align-self: stretch; }
 .portal-home .home-editorial .section-heading { grid-row: 1; }
 .portal-home .home-news-grid,
 .portal-home .announcement-list { grid-template-rows: subgrid; grid-row: 2 / span 3; }
 .portal-home .home-calendar-link { grid-row: 5; }
}

.portal-home .materials-grid { display: grid; grid-template-columns: subgrid; column-gap: 24px; }
.portal-home .materials-grid>.material-card,
.portal-home .materials-grid>.material-card:last-child:nth-child(3) { grid-column: span 4; }
.portal-home .materials-grid>.material-card:last-child:nth-child(3) .card-media { aspect-ratio: 1.85; height: auto; }
.portal-home .materials-grid .material-card-heading { gap: 12px; }
.portal-home .materials-grid .material-card h3 { font-size: 1.25rem; line-height: 28px; }
.portal-home .materials-grid .material-summary { margin-top: 12px; font-size: 1rem; line-height: 24px; }
@media (min-width: 761px) and (max-width: 1023px) {
 .portal-home .materials-grid .material-card-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
 .portal-home .materials-grid .material-card-heading { display: contents; }
 .portal-home .materials-grid .material-card h3 { grid-column: 1 / -1; }
}
/* Share image and body rows only, leaving heading/summary spacing intrinsic. */
@supports (grid-template-rows: subgrid) {
 .portal-home .materials-grid { row-gap: 0; }
 .portal-home .materials-grid>.material-card,
 .portal-home .materials-grid>.material-card:last-child:nth-child(3) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; grid-row: span 2; row-gap: 0; }
 .portal-home .materials-grid .card-body { display: flex; padding-top: 24px; }
 .portal-home .materials-grid .card-more { padding-top: 24px; }
}

/* Footer joins the same twelve-track composition on this page only. */
body[data-page="home"] .site-footer .footer-main { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-block: 48px; }
body[data-page="home"] .site-footer .footer-main>* { grid-column: span 3; min-width: 0; }

@media (max-width: 1000px) {
 .portal-home .hero h1 { font-size: 3rem; }
 .portal-home .hero-description { font-size: 1.125rem; }
 .hero-interest-action { font-size: 1rem; padding-inline: calc(var(--pn-space-4) + var(--pn-space-1)); }
}
@media (min-width: 761px) and (max-height: 700px) {
 .portal-home .hero-grid { padding-block: 32px; row-gap: 28px; }
 .portal-home .hero h1 { font-size: clamp(2.75rem, 4vw, 3.5rem); }
 .portal-home .hero-description { margin-top: 20px; }
 .hero-actions { margin-top: 24px; }
}
@media (max-width: 900px) {
 .portal-home .home-editorial .section-heading { flex-wrap: wrap; gap: 4px 16px; }
}
@media (max-width: 1050px) {
 body[data-page="home"] .site-footer .footer-main > :is(.footer-brand, .footer-group) { grid-column: span 6; }
}
@media (760px < width <= 860px) {
 .portal-home .hero-grid { row-gap: 32px; }
 .hero-copy { grid-column: 1 / -1; }
 .hero-career { grid-column: 1 / -1; justify-self: center; max-inline-size: 440px; }
}
@media (max-width: 760px) {
 .portal-home .hero-grid { row-gap: 28px; }
 .hero-copy { grid-column: 1 / -1; }
 .hero-career { grid-column: 1 / -1; justify-self: center; }
 .portal-home .hero h1 { font-size: clamp(2.25rem, 7vw, 3rem); }
 .portal-home .hero-description { font-size: 1.125rem; max-width: 600px; }
 .hero-actions { margin-top: 24px; }
 .home-admission-grid { grid-auto-rows: 1fr; }
 .home-admission-card { grid-column: 1 / -1; }
 .portal-home .home-editorial-columns { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; row-gap: 48px; }
 .portal-home .home-news,
 .portal-home .home-announcements { grid-column: 1; grid-row: auto; display: block; }
 .portal-home .home-editorial-divider { display: none; }
 .portal-home .home-news-grid,
 .portal-home .announcement-list { grid-template-rows: none; }
 .portal-home .home-editorial .section-heading { flex-wrap: nowrap; }
 .portal-home .materials-grid { row-gap: 24px; }
 .portal-home .materials-grid>.material-card,
 .portal-home .materials-grid>.material-card:last-child:nth-child(3) { grid-column: 1 / -1; grid-row: auto; display: flex; }
 .portal-home .materials-grid>.material-card:last-child:nth-child(3) .card-media { aspect-ratio: 1.85; height: auto; }
}
@media (max-width: 450px) {
 body[data-page="home"] .site-footer .footer-main > :is(.footer-brand, .footer-group) { grid-column: 1 / -1; }
 .portal-home .section:not(:where(.pn-map-home)) .section-heading { flex-wrap: wrap; gap: 12px; }
 .portal-home .home-editorial .section-heading { flex-wrap: wrap; gap: 4px 16px; }
}
@media (max-width: 400px) {
 .portal-home .hero h1 { font-size: 2.125rem; }
 .portal-home .hero-description { margin-top: 20px; font-size: 1.0625rem; }
 .hero-interest-action { width: 100%; padding-inline: var(--pn-space-4); font-size: 1rem; }
 .home-admission-card-heading { gap: 12px; }
 .home-admission-icon { width: 44px; height: 44px; flex-basis: 44px; }
 .home-admission-icon .icon { width: 28px; height: 28px; }
 .home-admission-card .button { width: 100%; }
 .home-admission-card-footer { align-items: stretch; }
}
html.large-text .portal-home .hero-grid { min-height: 0; }
@media (forced-colors: active) {
 .hero-career-link:focus-visible { border-color: Highlight; }
 .home-admission-card, .home-admission-icon { border: 1px solid CanvasText; }
}
