@config '../lib/tailwind.config.js';
@tailwind base;
@tailwind components;
@tailwind utilities;

/* =========================================================
   GLOBAL UTILITIES
========================================================= */

.muntinlupa-line {
    border: 0;
    background: linear-gradient(
        to right,
        #FFD166 0%,
        #FFD166 50%,
        #118AB2 50%,
        #118AB2 80%,
        #EF476F 80%,
        #EF476F 100%
    );
}

#intro-child {
    display: none;
}

.button-trans,
#feedback-parent div,
#team-parent div {
    transition: all 0.3s ease-in-out;
}

.header-title-shadow {
    text-shadow: 0 0 2px #2b2b2b;
}

.vignette-overlay {
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 1);
}

.neumorphic {
    box-shadow: 5px 5px 10px #9f9f9f, -5px -5px 10px #ffffff;
}

.research-neumorphic {
    box-shadow: 5px 5px 5px #b6b6b6, -10px -10px 10px #ffffff;
}

.reverse-animation {
    animation-direction: reverse;
}

.mask-image-gradient {
    mask-image: linear-gradient(to right, black 0%, black 90%, transparent 100%);
}

/* =========================================================
   SCROLLBARS
========================================================= */

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track,
#horizontal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
#horizontal-scroll::-webkit-scrollbar-thumb {
    background: #888;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
#horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#horizontal-scroll {
    overflow-x: scroll;
}

#horizontal-scroll::-webkit-scrollbar {
    height: 6px;
}

.facility-slider,
.slider {
    display: flex;
    overflow-x: scroll;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.facility-slider {
    box-shadow: 0 0 0.5rem black;
}

.facility-slider::-webkit-scrollbar,
.slider::-webkit-scrollbar {
    display: none;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes mvvFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes swap {
    50% {
        transform: translate(-50%, calc(var(--y) - 250px)) scale(0.85) rotate(-5deg);
        animation-timing-function: ease-in;
    }

    100% {
        transform: translate(-50%, calc(var(--y) - 15px)) scale(0.85);
        z-index: -1;
    }
}

/* =========================================================
   VIDEO MASK
========================================================= */

.video-mask {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;

    background-image:
        linear-gradient(45deg, #808080 5%, transparent 25%),
        linear-gradient(-45deg, #808080 5%, transparent 25%),
        linear-gradient(45deg, transparent 95%, #808080 45%),
        linear-gradient(-45deg, transparent 95%, #808080 45%);

    background-size: 3px 3px;
    background-position: 0 0, 10px 0, 10px -10px, 0 10px;
}

/* =========================================================
   STORY CARDS
========================================================= */

.card-story:nth-last-child(4) {
    --y: calc(-50% + -100px);
    transform: translate(-50%, var(--y)) scale(0.8);
}

.card-story:nth-last-child(3) {
    --y: calc(-50% + -50px);
    transform: translate(-50%, var(--y)) scale(0.9);
}

.card-story:nth-last-child(2) {
    --y: calc(-50%);
    transform: translate(-50%, var(--y)) scale(1);
}

.card-story:nth-last-child(1) {
    --y: calc(-50% + 50px);
    transform: translate(-50%, var(--y)) scale(1.1);
}

/* =========================================================
   HISTORY / OUR STORY — isolated editorial layout
   ========================================================= */
.history-section {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: clamp(3.25rem, 6vw, 6rem) clamp(1rem, 4vw, 3rem);
    scroll-margin-top: 6.5rem;
    color: #073b4c;
    background: #ffffff;
}
.history-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}
.history-heading {
    max-width: 920px;
    margin: 0 auto clamp(1.75rem, 3.5vw, 3.25rem);
    text-align: center;
}
.history-heading h2 {
    margin: 0;
    color: #073b4c;
    font-family: "Agatho", Georgia, serif;
    font-size: clamp(1.55rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1.25;
    text-wrap: balance;
}
.history-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(1.5rem, 4vw, 3.5rem);
}
.history-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    background: transparent;
    border-left: 4px solid #073b4c;
    border-radius: 0;
    aspect-ratio: 4 / 3;
}
.history-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 350px;
    object-fit: contain;
}
.history-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 1.75rem;
}
.history-text {
    color: #334155;
    font-size: clamp(1rem, 1.15vw, 1.125rem);
    font-weight: 400;
    line-height: 1.8;
}
.history-text p { margin: 0; }
.history-text p + p { margin-top: 1.35rem; }
.history-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.85rem 1.5rem;
    color: #ffffff;
    background: #073b4c;
    border: 1px solid #073b4c;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 240ms ease, color 240ms ease, transform 240ms ease;
}
.history-cta:hover {
    color: #073b4c;
    background: #ffd166;
    text-decoration: none;
    transform: translateY(-2px);
}
.history-cta:focus-visible {
    outline: 3px solid #d99a00;
    outline-offset: 4px;
}
@media (max-width: 1023px) {
    .history-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }
    .history-media {
        width: 100%;
        max-width: 630px;
        margin: 0 auto;
    }
    .history-content {
        width: 100%;
        max-width: 730px;
        margin: 0 auto;
    }
    .history-section { scroll-margin-top: 5.5rem; }
}
@media (max-width: 480px) {
    .history-section { padding: 3rem 1rem; }
    .history-media { padding: 1.1rem; }
    .history-heading h2 { font-size: 1.55rem; }
    .history-content { gap: 1.4rem; }
}
/* These activate only when the existing IntersectionObserver marks the
   section for reveal; content stays visible if JS is unavailable. */
.history-section.scroll-fade .history-media,
.history-section.scroll-fade .history-content {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 650ms ease, transform 700ms cubic-bezier(.22, 1, .36, 1);
}
.history-section.scroll-fade.is-visible .history-media,
.history-section.scroll-fade.is-visible .history-content {
    opacity: 1;
    transform: translateY(0);
}
.history-section.scroll-fade.is-visible .history-content {
    transition-delay: 110ms;
}
@media (prefers-reduced-motion: reduce) {
    .history-section.scroll-fade .history-media,
    .history-section.scroll-fade .history-content {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .history-cta { transition: none; }
    .history-cta:hover { transform: none; }
}

/* =========================================================
   MVV SECTION
========================================================= */

#missvissval {
    position: relative;

    width: 100%;
    overflow: hidden;

    background: #00222d;
}

.mvv-main {
    position: relative;
    z-index: 10;

    display: grid;
    grid-template-columns: 18% 36% 46% 15%;

    width: 80%;
    min-height: 430px;
    margin-top: 120px;

    background: #ffffff;
    border-top-right-radius: 48px;
}

.mvv-clip-svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.inverted {
    position: absolute;
    right: -99px;
    bottom: -1px;
    z-index: 20;

    width: 100px;
    height: 100px;

    margin: 0;
    padding: 0;

    background-color: #ffffff;
    clip-path: url(#clip);

    pointer-events: none;
}

.mvv-empty {
    display: block;
}

.mvv-left {
    padding: 48px 12px 0 0;
}

.mvv-right {
    display: flex;
    align-items: center;

    padding: 48px 32px 0 0;
}

.mvv-title {
    color: #333;
    font-size: 58px;
    font-weight: 700;
    line-height: 0.95;
}

.mvv-subtitle {
    margin-top: 16px;

    color: #333;
    font-size: 17px;
}

.mvv-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;

    margin-top: 56px;
    margin-left: 140px;
}

.mvv-tab {
    width: fit-content;

    color: #00222d;
    background: transparent;
    border: 0;

    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-align: left;

    cursor: pointer;
    padding: 0.55rem 0.75rem;
    margin-left: -0.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease;
}

.mvv-tab:hover,
.mvv-tab.active {
    color: #00222d;
    background-color: rgba(0, 34, 45, 0.07);
    transform: translateX(3px);
}

.mvv-tab.active {
    background-color: rgba(0, 34, 45, 0.12);
}

.mvv-tab:focus-visible {
    outline: 2px solid #00222d;
    outline-offset: 2px;
}

.mvv-panel {
    display: none;

    width: 100%;
    padding-inline: 5rem;
}

.mvv-panel.active {
    display: flex;
    flex-direction: column;
    justify-content: center;

    animation: mvvFadeIn 0.35s ease-out forwards;
}

.mvv-text,
.mvv-list {
    color: #222;
    font-size: 16px;
    line-height: 2;
}

.mvv-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mvv-core {
    display: flex;
    flex-direction: column;
    gap: 16px;

    color: #00222d;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.08em;
}

.mvv-image {
    position: absolute;
    top: 90px;
    right: 0;
    z-index: 2;

    width: 26%;
    height: 430px;
}

.mvv-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: left;
}

/* =========================================================
   CAMPUS CTA
========================================================= */

.campus-cta-section {
    position: relative;

    width: 100%;
    overflow: visible;

    line-height: 0;
}

.campus-cta-image,
.campus-cta-image img {
    width: 100%;
}

.campus-cta-image img {
    display: block;
    height: auto;
}

/* Desktop retains the original text-bearing panorama; mobile supplies real text. */
.campus-cta-image .campus-cta-mobile-image,
.campus-cta-mobile-heading {
    display: none;
}

.campus-cta-button {
    position: absolute;
    top: 50%;
    right: clamp(16px, 5vw, 80px);
    z-index: 20;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    padding:
        clamp(10px, 1.2vw, 16px)
        clamp(14px, 2vw, 24px);

    color: #ffffff;
    background: #cf123f;

    font-size: clamp(10px, 1vw, 14px);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);

    transform: translateY(-50%);
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.campus-cta-button:hover {
    color: #fff !important;
    background: #a90f34;

    transform: translateY(-50%) translateX(6px);
}

.campus-cta-button span {
    font-size: clamp(12px, 1vw, 16px);
}

/* =========================================================
   HERO
========================================================= */

.hero-actions {
    position: absolute;
    right: 3vw;
    bottom: 9vh;
    z-index: 20;
}

.hero-know-more,
.get-directions {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.75rem 1.25rem;

    color: #ffffff;

    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.hero-know-more {
    background: #00222d;
}

.get-directions {
    background: #195265;
}

.hero-know-more:hover,
.get-directions:hover {
    color: #ffffff;
    background: #00394a;

    transform: translateY(-3px);
}

.hero-apply-strip {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 62px;

    background: linear-gradient(to bottom, #db0707, #600000);
}

.hero-apply-btn {
    min-width: 180px;

    padding: 12px 36px;

    color: #ffffff;
    background: transparent;
    border: 4px solid #ffffff;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.hero-apply-btn:hover {
    color: #c90035;
    background: #ffffff;
}

/* =========================================================
   OTHER COMPONENTS
========================================================= */

.faq-accordion {
    transition-property: all;
    transition-duration: 500ms;
}

.facility-section:hover .facility-child {
    cursor: pointer;
    background-color: rgb(229 229 229 / var(--tw-bg-opacity));

    --tw-scale-x: 1.05;
    --tw-scale-y: 1.05;

    transform:
        translate(var(--tw-translate-x), var(--tw-translate-y))
        rotate(var(--tw-rotate))
        skewX(var(--tw-skew-x))
        skewY(var(--tw-skew-y))
        scaleX(var(--tw-scale-x))
        scaleY(var(--tw-scale-y));
}

/* =========================================================
   RESPONSIVE: TABLET
========================================================= */

@media (max-width: 1024px) {
    .inverted,
    .mvv-empty,
    .mvv-image {
        display: none;
    }

    #missvissval {
        min-height: auto;
        padding: 48px 16px;
    }

    .mvv-main {
        grid-template-columns: 1fr;

        width: 100%;
        min-height: auto;
        margin-top: 0;

        border-top-right-radius: 32px;
        border-bottom-left-radius: 32px;
    }

    .mvv-left {
        padding: 40px 28px 24px;
    }

    .mvv-right {
        padding: 16px 28px 40px;
    }

    .mvv-title {
        font-size: clamp(36px, 9vw, 52px);
        line-height: 1;
    }

    .mvv-subtitle {
        font-size: 15px;
        line-height: 1.6;
    }

    .mvv-nav {
        align-items: flex-start;
        gap: 18px;

        margin-top: 36px;
        margin-left: 0;
    }

    .mvv-tab {
        font-size: 1.05rem;
        letter-spacing: 0.14em;
    }

    .mvv-tab:hover,
    .mvv-tab.active {
        transform: translateX(6px);
    }

    .mvv-text,
    .mvv-list {
        font-size: 15px;
        line-height: 1.8;
    }

    .mvv-core {
        gap: 12px;
        font-size: 18px;
    }
}

/* =========================================================
   RESPONSIVE: MOBILE LANDSCAPE / SMALL TABLET
========================================================= */

/* =========================================================
   RESPONSIVE: MOBILE
========================================================= */

@media (max-width: 768px) {
    .mvv-panel {
        padding: 0;
    }

    /* The mobile photograph has no embedded text; the phrase is real HTML below. */
    .campus-cta-section {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        background: #00222d;
        line-height: normal;
    }

    .campus-cta-image .campus-cta-desktop-image {
        display: none;
    }

    .campus-cta-image .campus-cta-mobile-image {
        display: block;
        height: clamp(180px, 52vw, 300px);
        object-fit: cover;
        object-position: center;
    }

    .campus-cta-mobile-heading {
        display: block;
        margin: 0;
        padding: clamp(18px, 4vw, 30px) 20px 0;
        color: #ffffff;
        font-family: 'Agatho', Georgia, serif;
        font-size: clamp(1.55rem, 5.8vw, 2.25rem);
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        text-wrap: balance;
    }

    .campus-cta-button {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        align-self: center;
        margin: 16px 16px 28px;
        padding: 12px 18px;
        font-size: 11px;
        transform: none;
    }

    .campus-cta-button:hover {
        transform: translateY(-2px);
    }

    .hero-actions {
        right: 50%;
        bottom: 12vh;

        transform: translateX(50%);
    }

    .hero-know-more {
        padding: 14px 24px;
        font-size: 14px;
    }

    .hero-apply-strip {
        min-height: 58px;
    }

    .hero-apply-btn {
        min-width: 150px;

        padding: 10px 28px;

        font-size: 12px;
    }
}

/* =========================================================
   RESPONSIVE: SMALL MOBILE
========================================================= */

@media (max-width: 639px) {
    .thisdiv {
        height: 300px;
    }

    .thisscroll {
        overflow: scroll;
    }
}

@media (max-width: 480px) {
    #missvissval {
        padding: 32px 12px;
    }

    .mvv-main {
        border-top-right-radius: 24px;
        border-bottom-left-radius: 24px;
    }

    .mvv-left {
        padding: 32px 20px 20px;
    }

    .mvv-right {
        padding: 12px 20px 32px;
    }

    .mvv-title {
        font-size: clamp(30px, 11vw, 40px);
    }

    .mvv-nav {
        gap: 14px;
    }

    .mvv-tab {
        font-size: 0.95rem;
        letter-spacing: 0.12em;
    }
}

/* =========================================================
   PREMIUM PUBLIC CTA SYSTEM — homepage / shared footer only
   ========================================================= */
.cdm-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    box-sizing: border-box;
    min-height: 44px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.035em;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 7px 17px rgba(0,34,45,0.16);
    transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease,
                transform 250ms cubic-bezier(.22,1,.36,1), box-shadow 250ms ease;
}
.cdm-cta:hover {
    text-decoration: none;
}
.cdm-cta:focus-visible {
    outline: 3px solid #ffd166;
    outline-offset: 4px;
}
.cdm-cta:not(.campus-cta-button):hover {
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 12px 24px rgba(0,34,45,0.22);
}
.cdm-cta:not(.campus-cta-button):active {
    transform: translateY(0);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 3px 9px rgba(0,34,45,0.16);
}
.cdm-cta-icon {
    display: inline-block;
    flex: 0 0 auto;
    color: #ffd166;
    font-size: 1.15em;
    font-weight: 800;
    line-height: 1;
    transition: transform 250ms cubic-bezier(.22,1,.36,1);
}
.cdm-cta:hover .cdm-cta-icon {
    transform: translate(3px,-2px);
}
.hero-know-more.cdm-cta {
    min-height: 46px;
    padding: 0.75rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 800;
}
.cdm-cta--navy {
    background-color: #073b4c;
    border-color: #073b4c;
    color: #ffffff;
}
.cdm-cta--navy:hover {
    background-color: #145268;
    color: #ffffff;
}
.history-cta.cdm-cta:hover {
    background-color: #ffd166;
    border-color: #073b4c;
    color: #073b4c;
}
.history-cta.cdm-cta:hover .cdm-cta-icon {
    color: #073b4c;
}
.cdm-cta--crimson {
    background-color: #8f1635;
    border-color: #8f1635;
    color: #ffffff;
}
.cdm-cta--crimson:hover {
    background-color: #ad2045;
    color: #ffffff;
}
.cdm-cta--outlined.hero-apply-btn {
    border: 2px solid #ffffff;
    background-color: transparent;
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.cdm-cta--outlined.hero-apply-btn:hover {
    border-color: #ffffff;
    background-color: #ffffff;
    color: #8f1635;
}
.cdm-cta--outlined.hero-apply-btn:hover .cdm-cta-icon {
    color: #8f1635;
}
.cdm-cta--utility.get-directions {
    min-height: 44px;
    width: max-content;
    max-width: 100%;
    padding: 0.55rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.025em;
    background-color: #195265;
    border: 1px solid rgba(255,255,255,0.2);
    color: #ffffff;
}
.cdm-cta--utility.get-directions:hover {
    background-color: #0e4052;
    color: #ffffff;
}
.cdm-cta--utility.get-directions .fa-location-dot {
    color: #ffd166;
    font-size: 0.95em;
}
.cdm-about-cta.cdm-cta {
    min-height: 46px;
    padding: 0.75rem 1.1rem;
    background-color: #073b4c;
    border: 1px solid rgba(255,255,255,0.18);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 800;
}
.cdm-about-cta.cdm-cta:hover {
    background-color: #145268;
    color: #ffffff;
}
.join-apply-cta.cdm-cta {
    padding: 0.85rem 1.6rem;
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 0.95rem;
}
.campus-cta-button.cdm-cta {
    border: 1px solid rgba(255,255,255,0.14);
}
/* Preserve the existing centered, absolute CTA transforms on mobile and desktop. */
.campus-cta-button.cdm-cta:hover {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 14px 28px rgba(0,34,45,0.24);
}
#carousel-nav > button {
    min-height: 44px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 5px 12px rgba(0,34,45,0.15);
    transition: background-color 240ms ease, box-shadow 240ms ease;
}
#carousel-nav > button:hover {
    box-shadow: 0 8px 16px rgba(0,34,45,0.2);
}
#carousel-nav > button:focus-visible {
    outline: 3px solid #ffd166;
    outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
    .cdm-cta,
    .cdm-cta-icon,
    #carousel-nav > button {
        transition: none !important;
    }
    .cdm-cta:not(.campus-cta-button):hover,
    .cdm-cta:hover .cdm-cta-icon {
        transform: none !important;
    }
}

/* Keep content immediately legible when device/browser prefers reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .mvv-panel.active { animation: none; }
    .mvv-tab { transition: none; }
    .mvv-tab:hover, .mvv-tab.active { transform: none; }
    .facility-slider, .slider { scroll-behavior: auto; }
}

/* =========================================================
   HOMEPAGE PREMIUM FIRST PASS — scoped public components
   Preserve existing CDM brand colors and all content.
========================================================= */
#aboutus.cdm-audience-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
    width: 100%;
    height: auto;
    min-height: 0;
    background: #073b4c;
}

#aboutus .cdm-audience-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    min-height: clamp(21rem, 28vw, 27rem);
    padding: clamp(1.4rem, 2.4vw, 2.8rem) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    background: #073b4c;
    color: #ffffff;
}

#aboutus .cdm-audience-image,
#aboutus .cdm-audience-tint {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#aboutus .cdm-audience-image {
    z-index: -2;
}
#aboutus .cdm-audience-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.8) contrast(1.04);
}
#aboutus #AB1 .cdm-audience-image img { object-position: 25% center; }
#aboutus #academics-page .cdm-audience-image img { object-position: 54% center; }
#aboutus #life-at-cdm .cdm-audience-image img { object-position: 83% center; }
#aboutus .cdm-audience-tint {
    z-index: -1;
    opacity: 1;
}
#aboutus #AB1 .cdm-audience-tint {
    background: linear-gradient(120deg, rgba(2,34,46,.95), rgba(7,59,76,.82));
}
#aboutus #academics-page {
    background: #ffd166;
}
#aboutus #academics-page .cdm-audience-tint {
    background: linear-gradient(120deg, rgba(255,209,102,.96), rgba(240,187,70,.9));
}
#aboutus #academics-page .cdm-audience-title,
#aboutus #academics-page .cdm-audience-description {
    color: #00222d;
}
#aboutus #academics-page .animated-line {
    background: rgba(0,34,45,.78);
}
#aboutus #life-at-cdm {
    background: #08617f;
}
#aboutus #life-at-cdm .cdm-audience-tint {
    background: linear-gradient(120deg, rgba(1,61,84,.92), rgba(17,138,178,.72));
}

#aboutus .cdm-audience-title {
    margin: 0 0 0.8rem;
    max-width: 20ch;
    color: #ffffff;
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0.025em;
    line-height: 1.2;
    text-wrap: balance;
}
#aboutus .animated-line {
    height: 3px;
    max-width: 7rem;
    background: rgba(255,255,255,.85);
}
#aboutus .cdm-audience-description {
    margin: 1rem 0 1.75rem;
    padding: 0;
    max-width: 38ch;
    color: rgba(255,255,255,.96);
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.95rem, 1.06vw, 1.075rem);
    font-weight: 500;
    letter-spacing: 0.005em;
    line-height: 1.58;
    text-wrap: pretty;
}
#aboutus .cdm-audience-actions {
    position: relative;
    inset: auto;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
    height: auto;
    padding: 0;
    margin-top: auto;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
#aboutus .cdm-about-cta {
    min-height: 44px;
}
@media (max-width: 767px) {
    #aboutus.cdm-audience-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    #aboutus .cdm-audience-card {
        min-height: 17rem;
        padding: clamp(1.5rem, 6vw, 2.1rem) !important;
    }
    #aboutus .cdm-audience-description {
        max-width: 52ch;
        margin-bottom: 1.25rem;
    }
}

/* Shared homepage editorial rhythm, without changing global CMS headings. */
.hero-text h1 {
    line-height: 1.08;
    letter-spacing: -0.018em;
    text-wrap: balance;
}
.cdm-section-title {
    font-family: 'Agatho', Georgia, serif;
    line-height: 1.17;
    letter-spacing: -0.015em;
    text-wrap: balance;
}
.cdm-join-section {
    background: #00222d; /* image-loading fallback */
}
.cdm-join-panel {
    width: min(100%, clamp(20rem, 34vw, 27rem));
    padding: clamp(1.5rem, 3vw, 2.6rem) !important;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 34, 45, 0.22);
}
.cdm-join-panel h1 {
    line-height: 1.13;
}
@media (max-width: 640px) {
    .cdm-join-panel {
        width: 100%;
        max-width: 29rem;
        padding: 1.5rem !important;
    }
}

/* The existing MVV inverted corner remains unchanged. */
@media (min-width: 1025px) {
    #missvissval .mvv-main {
        grid-template-columns: 18% 36% minmax(0, 46%);
    }
    #missvissval .mvv-nav {
        margin-left: clamp(0px, 5vw, 72px);
    }
    #missvissval .mvv-panel {
        padding-inline: clamp(1rem, 2.5vw, 3rem);
    }
}

.cdm-life-section {
    padding: clamp(3.5rem, 6vw, 6rem) clamp(1rem, 4vw, 3rem) 0;
    scroll-margin-top: 6.5rem;
    background: #ffffff;
}
.cdm-life-section > div:first-child {
    width: 100%;
    max-width: 1200px;
}
.cdm-life-section .cdm-section-title {
    font-size: clamp(2rem, 4vw, 3rem);
}

#highlights.cdm-highlights {
    gap: clamp(1.5rem, 3vw, 2.5rem);
    padding: clamp(3.5rem, 6vw, 6rem) clamp(1rem, 4vw, 3rem);
    background: #ffffff;
}
#highlights .cdm-section-title {
    margin-bottom: 0.75rem;
    color: #073b4c;
    font-size: clamp(2rem, 3.4vw, 3rem);
}
#highlights .cdm-highlight-card {
    padding: clamp(1.2rem, 2vw, 1.8rem) 1rem;
    border: 1px solid #e1e7e9;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0,34,45,.055);
}
#highlights .cdm-highlight-card .counting-number,
#highlights .cdm-highlight-card .counting-number + span {
    color: #8f1635;
    font-variant-numeric: tabular-nums;
}
#highlights .cdm-highlight-card p {
    line-height: 1.5;
    letter-spacing: 0.01em;
}
@media (prefers-reduced-motion: reduce) {
    #aboutus .cdm-audience-card img { filter: none; }
}

/* Responsive Life@CDM gallery. Avoid Bootstrap's unrelated .carousel-item display rules. */
.cdm-life-gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(10px, 1.5vw, 18px);
    width: 100%;
    min-width: 0;
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.cdm-life-gallery-item {
    min-width: 0;
    height: clamp(210px, 25vw, 310px);
    border-radius: 12px;
    overflow: hidden;
    background: #f8f5ed;
}
.cdm-life-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cdm-life-gallery-nav { align-items: center; }
.cdm-life-gallery-nav button:disabled {
    opacity: .45;
    box-shadow: none;
    cursor: not-allowed;
}
.cdm-life-gallery:focus-visible {
    outline: 3px solid #d99a00;
    outline-offset: 3px;
}
@media (min-width: 640px) and (max-width: 1023px) {
    .cdm-life-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 640px) and (max-width: 767px) {
    .cdm-life-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .cdm-life-section .cdm-life-description {
        font-size: clamp(.9375rem, 3.8vw, 1rem);
        line-height: 1.7;
        font-weight: 400;
    }
    .cdm-life-gallery {
        display: flex;
        flex-wrap: nowrap;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 10px;
    }
    .cdm-life-gallery-item {
        flex: 0 0 min(82%, 340px);
        height: clamp(210px, 62vw, 285px);
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
    .cdm-life-gallery-item:last-child { scroll-snap-align: end; }
    .cdm-join-section {
        height: auto;
        min-height: min(100svh, 44rem);
        padding-block: clamp(4rem, 10vh, 6rem);
    }
    .cdm-join-panel { max-width: 29rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cdm-life-gallery { scroll-behavior: auto; }
}
