/* Shared public type and interaction rules. */
:root {
    --oreilly-type-hero: clamp(42px, 4.3vw, 60px);
    --oreilly-type-section: clamp(42px, 3.8vw, 46px);
    --oreilly-type-h1: var(--oreilly-type-hero);
    --oreilly-type-h2: var(--oreilly-type-section);
    --oreilly-type-h3: clamp(24px, 2.2vw, 32px);
    --oreilly-type-h4: clamp(20px, 1.8vw, 26px);
    --oreilly-type-h5: clamp(18px, 1.5vw, 22px);
    --oreilly-type-h6: clamp(16px, 1.25vw, 18px);
}

@media (min-width: 992px) {
    :root .container {
        width: min(var(--oreilly-container-width), calc(100% - var(--oreilly-page-gutter-desktop)));
        max-width: var(--oreilly-container-width);
    }
}

/* One responsive scale for semantic headings across the public site. */
body.oreilly-public :is(h1, .h1, .--h1),
body.oreilly-public h2,
body.oreilly-public h3,
body.oreilly-public h4,
body.oreilly-public :is(h5, .h5, .--h5),
body.oreilly-public :is(h6, .h6, .--h6) {
    font-family: var(--oreilly-font-display) !important;
    font-weight: 400 !important;
}
body.oreilly-public :is(h1, .h1, .--h1) {
    font-size: var(--oreilly-type-h1) !important;
    line-height: 1.02 !important;
    letter-spacing: -.045em;
    text-wrap: balance;
}

body.oreilly-public .school-home__hero h1,
body.oreilly-public .foundation-story__hero h1 {
    --oreilly-type-h1: clamp(40px, 4vw, 56px);
}
body.oreilly-public h2 {
    font-size: var(--oreilly-type-h2) !important;
    line-height: 1.1 !important;
    letter-spacing: -.04em;
    text-wrap: balance;
}
body.oreilly-public h3 {
    font-size: var(--oreilly-type-h3) !important;
    line-height: 1.15 !important;
    letter-spacing: -.025em;
}
body.oreilly-public h4 {
    font-size: var(--oreilly-type-h4) !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em;
}
body.oreilly-public :is(h5, .h5, .--h5) {
    font-size: var(--oreilly-type-h5) !important;
    line-height: 1.2 !important;
}
body.oreilly-public :is(h6, .h6, .--h6) {
    font-size: var(--oreilly-type-h6) !important;
    line-height: 1.25 !important;
}
body.oreilly-public main .oreilly-contact__contact-row p.oreilly-contact__contact-value {
    margin: 0 !important;
    color: var(--oc-ink);
    font-family: var(--oreilly-font-display);
    font-size: clamp(15.5px, 2.2vw, 23.5px);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.15;
    text-transform: none;
}
body.oreilly-public main .oreilly-contact__contact-row p.oreilly-contact__contact-value a {
    color: inherit;
}
body.oreilly-public main .oreilly-contact__contact-row p.oreilly-contact__contact-value a:hover {
    color: var(--oc-purple);
}
@media (max-width: 767px) {
    body.oreilly-public main .oreilly-contact__contact-row p.oreilly-contact__contact-value {
        font-size: 13px;
    }
}

.school-home__hero .banner__slides--content--description,
.oreilly-page-hero .oreilly-page-hero__description,
.oreilly-academics__hero-copy > p:not(.oreilly-academics__eyebrow),
.oreilly-admissions__hero-copy > p:not(.oreilly-admissions__eyebrow),
.oreilly-contact__hero-copy > p:not(.oreilly-contact__eyebrow),
.foundation-story__hero-description,
.foundation-about-story__hero-copy > p:not(.foundation-about-story__eyebrow),
.foundation-projects-story__hero-copy > p:not(.foundation-projects-story__eyebrow),
.foundation-involved-story__hero-copy > p:not(.foundation-involved-story__eyebrow),
.foundation-donate-story__hero-copy > p:not(.foundation-donate-story__eyebrow) {
    font-size: clamp(16px, 1.25vw, 19px) !important;
    line-height: 1.6;
}


/* The leadership description belongs directly beneath its heading. */
.oreilly-leadership__heading {
    display: block;
    max-width: 820px;
}
.oreilly-leadership__heading h1 { max-width: 820px; margin-bottom: 18px; }
.oreilly-leadership__heading > p:last-child {
    max-width: 650px;
    margin: 0;
    font-size: clamp(16px, 1.2vw, 18px);
    line-height: 1.65;
}
.oreilly-leadership__featured-grid--text-only { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.oreilly-leadership__featured--without-photo {
    min-height: 240px;
    grid-template-columns: 1fr;
}
.oreilly-leadership__featured--without-photo .oreilly-leadership__featured-copy {
    padding: clamp(30px, 4vw, 52px);
    align-items: flex-start;
}

/* The Academics call to action keeps its heading and actions in separate tracks. */
.oreilly-academics__cta-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
}
.oreilly-academics__cta-actions { min-width: 0; }
.oreilly-academics__cta-panel .oreilly-academics__text-link:is(:hover, :focus-visible) {
    color: #fff !important;
}
.oreilly-academics__hero .oreilly-academics__text-link:is(:hover, :focus-visible) { color: #fff !important; }

/* Light buttons remain light on hover so their text never crosses a low-contrast color. */
.foundation-story .foundation-story__button--light:is(:hover, :focus-visible),
.foundation-donate-story .foundation-donate-story__button--light:is(:hover, :focus-visible),
.oreilly-news-story .oreilly-news-story__button--light:is(:hover, :focus-visible) {
    border-color: #e7dfff;
    background: #e7dfff;
    color: #211441 !important;
}
.school-home .school-home__offering-card .rts-nbg-btn:is(:hover, :focus-visible) { color: #fff !important; }
.school-home .school-home__offering-link:is(:hover, :focus-visible) { color: #fff !important; }

/* Switch label color immediately when the animated dark panel enters or leaves.
   A delayed color transition leaves white text on the button's white base after mouse-out. */
.rts-theme-btn {
    transition-property: background-color, border-color, transform !important;
}
.rts-theme-btn:is(:hover, :focus-visible):not(:disabled) {
    color: #fff !important;
}
.rts-theme-btn:is(:hover, :focus-visible):not(:disabled) :is(span, i) { color: inherit !important; }
.rts-theme-btn:focus-visible::before { left: 0; opacity: 1; }

.foundation-giving-form__submit:disabled { background: #5b506c; color: #fff; }
main :is(a, button)[class*="button"]:focus-visible,
main :is(a, button)[class*="btn"]:focus-visible,
main :is(a, button)[class*="link"]:focus-visible {
    outline: 3px solid #ad92ff;
    outline-offset: 4px;
}

@media (max-width: 1199px) {
    .oreilly-academics__cta-panel { grid-template-columns: 1fr; }
    .oreilly-academics__cta-actions { justify-content: flex-start; }
}

@media (max-width: 767px) {
    :root {
        --oreilly-type-hero: clamp(40px, 11.3vw, 48px);
        --oreilly-type-section: clamp(34px, 9vw, 42px);
    }
    .oreilly-academics__cta-panel { gap: 24px; }
    .oreilly-academics__cta-actions { align-items: stretch; }
    .oreilly-leadership__featured-grid--text-only { grid-template-columns: 1fr; }
    .oreilly-leadership__featured--without-photo { min-height: 180px; }
}

/* Public heroes stay within one viewport, including short landscape screens. */
.school-home__hero { --oreilly-hero-height: 700px; }
.rts-breadcrumb.breadcrumb-height.oreilly-page-hero { --oreilly-hero-height: clamp(520px, 42vw, 620px); }
.rts-breadcrumb.breadcrumb-height.oreilly-page-hero--detail { --oreilly-hero-height: clamp(560px, 45vw, 650px); }
.oreilly-academics__hero { --oreilly-hero-height: clamp(650px, 78vh, 820px); }
.oreilly-admissions__hero { --oreilly-hero-height: clamp(650px, 76vh, 800px); }
.oreilly-contact__hero { --oreilly-hero-height: 700px; }
.foundation-story__hero { --oreilly-hero-height: 700px; }
.foundation-about-story__hero { --oreilly-hero-height: clamp(620px, 75vh, 820px); }
.foundation-projects-story__hero,
.foundation-involved-story__hero { --oreilly-hero-height: clamp(580px, 69vh, 740px); }
.foundation-donate-story__hero { --oreilly-hero-height: clamp(680px, 78vh, 860px); }
.foundation-project-hero { --oreilly-hero-height: clamp(580px, 67vh, 720px); }

:is(.school-home__hero, .oreilly-page-hero, .oreilly-academics__hero,
    .oreilly-admissions__hero, .oreilly-contact__hero, .foundation-story__hero,
    .foundation-about-story__hero, .foundation-projects-story__hero,
    .foundation-involved-story__hero, .foundation-donate-story__hero,
    .foundation-project-hero) {
    height: min(var(--oreilly-hero-height), 100svh) !important;
    min-height: 0 !important;
    max-height: 100svh;
}

.school-home__hero :is(.banner__wrapper, .banner__wrapper--bg, .banner__height, .swiper, .swiper-wrapper, .swiper-slide),
:is(.oreilly-page-hero__inner, .oreilly-academics__hero-inner,
    .oreilly-admissions__hero-inner, .oreilly-contact__hero-inner,
    .foundation-story__hero-container, .foundation-about-story__hero-inner,
    .foundation-projects-story__hero-inner, .foundation-involved-story__hero-inner,
    .foundation-donate-story__hero-inner, .foundation-project-hero__inner) {
    height: 100% !important;
    min-height: 0 !important;
}

@media (max-width: 1199px) {
    .foundation-story__hero { --oreilly-hero-height: 620px; }
    .foundation-about-story__hero { --oreilly-hero-height: 660px; }
    .foundation-donate-story__hero { --oreilly-hero-height: 680px; }
}

@media (max-width: 1024px) {
    .rts-breadcrumb.breadcrumb-height.oreilly-page-hero { --oreilly-hero-height: 520px; }
    .oreilly-contact__hero { --oreilly-hero-height: 620px; }
}

@media (max-width: 991px) {
    .foundation-project-hero { --oreilly-hero-height: 620px; }
    .foundation-projects-story__hero { --oreilly-hero-height: 620px; }
    .foundation-involved-story__hero { --oreilly-hero-height: 650px; }
}

@media (max-width: 767px) {
    .school-home__hero { --oreilly-hero-height: 580px; }
    .rts-breadcrumb.breadcrumb-height.oreilly-page-hero { --oreilly-hero-height: clamp(410px, 118vw, 490px); }
    .oreilly-academics__hero { --oreilly-hero-height: 620px; }
    .oreilly-admissions__hero { --oreilly-hero-height: 640px; }
    .oreilly-contact__hero { --oreilly-hero-height: 580px; }
    .foundation-story__hero { --oreilly-hero-height: 580px; }
    .foundation-about-story__hero { --oreilly-hero-height: 680px; }
    .foundation-projects-story__hero { --oreilly-hero-height: 650px; }
    .foundation-involved-story__hero { --oreilly-hero-height: 630px; }
    .foundation-donate-story__hero { --oreilly-hero-height: 620px; }
    .foundation-project-hero { --oreilly-hero-height: 580px; }
}

/* News has two stacked panels on phones; the image uses the remaining space. */
@media (max-height: 700px) {
    .oreilly-news-story__hero { height: 100svh; max-height: 100svh; }
    .oreilly-news-story__hero-grid {
        height: calc(100% - 34px);
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
    }
    .oreilly-news-story__hero-copy,
    .oreilly-news-story__hero-media { min-height: 0; }
}
@media (max-width: 991px) and (max-height: 700px) {
    .oreilly-news-story__hero-grid { grid-template-rows: auto minmax(0, 1fr); }
}
@media (max-width: 767px) and (max-height: 700px) {
    .oreilly-news-story__hero-grid { height: calc(100% - 12px); }
    .oreilly-news-story__hero-copy { padding-block: 32px; }
    .oreilly-news-story__hero-media { height: 100%; }
}
@media (max-width: 360px) and (max-height: 600px) {
    .foundation-about-story__hero-inner,
    .oreilly-page-hero .oreilly-page-hero__inner { padding-bottom: 28px; }
}

.blog__thumb--empty,
.blog__thumb--empty a {
    display: block;
    min-height: 220px;
    background: var(--oreilly-color-primary, #2a1676);
}

/* Filled public CTAs share the School hero button shape and size. */
:is(
    .oreilly-academics__button,
    .oreilly-admissions__button,
    .oreilly-news-story__button,
    .foundation-story__button,
    .foundation-about-story__button,
    .foundation-projects-story__button,
    .foundation-involved-story__button,
    .foundation-donate-story__button,
    .foundation-project-button
) {
    min-height: 54px;
    padding: 14px 22px;
    border-radius: 6px;
}

/* Keep school crests in the site header; omit duplicate crests inside first-fold hero banners. */
:is(.rts-hero-slider, .banner.v__3, .oreilly-page-hero, .rts-breadcrumb) :is(.rts-university-icon, .banner__slides--content--icon, .oreilly-page-hero__crest, .rts-breadcrumb__crest){display:none!important}

body.oreilly-public * {
    text-transform: none !important;
}

/* Preserve contrast for dark-panel headings after they moved to H2. */
body.oreilly-public main :is(
    .school-home__student-life-copy,
    .school-home__foundation-copy,
    .oreilly-about__statement,
    .oreilly-academics__purpose,
    .oreilly-academics__cta-panel,
    .oreilly-admissions__section-heading,
    .oreilly-admissions__process,
    .oreilly-admissions__record-panel,
    .oreilly-admissions__help-panel,
    .oreilly-contact__form-intro,
    .oreilly-contact__community,
    .oreilly-leadership__section-heading--light,
    .foundation-about-story__impact,
    .foundation-about-story__cta,
    .foundation-projects-story__impact,
    .foundation-projects-story__donate,
    .foundation-involved-story__impact-copy,
    .foundation-involved-story__volunteer-intro,
    .oreilly-programme-detail__section-heading,
    .oreilly-programme-detail__pathway-copy,
    .foundation-project-progress__panel,
    .foundation-project-donation__intro
) h2 {
    color: #fff;
}

body.oreilly-public .oreilly-footer__trust-heading h4 {
    color: #fff;
}

@media (max-width: 767px) {
    .rts-breadcrumb.breadcrumb-height.oreilly-page-hero,
    main.school-home > .school-home__hero,
    main.foundation-story > .foundation-story__hero {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    main.school-home > .school-home__hero :is(.banner__wrapper, .swiper, .swiper-wrapper, .swiper-slide, .banner__wrapper--bg, .school-home__hero-inner, .banner__height),
    main.foundation-story > .foundation-story__hero .foundation-story__hero-container {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    main.school-home > .school-home__hero .school-home__hero-layout,
    main.foundation-story > .foundation-story__hero .foundation-story__hero-container {
        padding-block: 52px;
    }
}
