/* Shared page geometry. Tables and controls keep their own internal layouts. */
:root {
    scrollbar-gutter: stable;
    --campus-frame-width: min(clamp(1480px, 70vw, 1760px), calc(100% - clamp(40px, 5vw, 96px)));
    --campus-frame-gap: 20px;
    --campus-hero-min: 208px;
    --campus-hero-pad-start: 40px;
    --campus-hero-pad-end: 26px;
    --campus-title-size: clamp(32px, 3.5vw, 44px);
    --campus-card-padding: 24px;
    --campus-card-radius: 16px;
}

@media (max-width: 767px) {
    :root {
        scrollbar-gutter: auto;
        --campus-frame-width: calc(100% - clamp(24px, 8vw, 32px));
        --campus-frame-gap: 12px;
        --campus-hero-min: 0px;
        --campus-hero-pad-start: 16px;
        --campus-hero-pad-end: 16px;
        --campus-title-size: 28px;
        --campus-card-padding: clamp(12px, 3.8vw, 16px);
        --campus-card-radius: 14px;
    }
}

body .campus-page-frame,
body.portal-lobby .start-wrap.campus-page-frame,
body.portal-inner > #wrap > #info.campus-page-frame,
body.portal-login > :is(#wrap, #info).campus-page-frame,
body:not(.sugang-main) > main.campus-page-frame,
body.sugang-main #info .info_sectionz.campus-page-frame {
    box-sizing: border-box;
    width: var(--campus-frame-width) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: auto !important;
}

body.portal-lobby .start-wrap.campus-page-frame,
body.portal-inner > #wrap > #info.campus-page-frame,
body:not(.sugang-main) > main.campus-page-frame {
    margin-block-start: var(--campus-frame-gap) !important;
}

body > header.campus-page-hero,
body > header.campus-page-hero:is(.calendar-hero, .flow-hero, .room-header, .recommendation-brand, .results-brand),
body:not(.sugang-main) > #wrap > #header.campus-page-hero,
body.unified-inner-hero > #wrap > #header.campus-page-hero,
body.legal-page.portal-inner > #wrap > #header.public-info-header.campus-page-hero {
    box-sizing: border-box;
    display: block !important;
    min-height: var(--campus-hero-min) !important;
    padding: var(--campus-hero-pad-start) 0 var(--campus-hero-pad-end) !important;
    background: linear-gradient(130deg, #112238, #244863) !important;
    color: #fff;
}

body > .campus-page-hero > .campus-hero-copy,
body > #wrap > #header.campus-page-hero > .campus-hero-copy {
    box-sizing: border-box;
    width: var(--campus-frame-width) !important;
    height: auto;
    max-width: none !important;
    min-width: 0;
    margin: 0 auto !important;
    padding: 0 !important;
}

body > .campus-page-hero > .campus-hero-copy > h1,
body:has(> .room-header) > .campus-page-hero > .campus-hero-copy > h1,
body > #wrap > #header.campus-page-hero > .campus-hero-copy > :is(h1, .campus-login-heading) {
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff;
    font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif !important;
    font-size: var(--campus-title-size) !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}

.campus-page-hero > .campus-hero-copy > :is(.logout_ment, .login-hero-copy, h1 + p),
body.unified-inner-hero > #wrap > #header.campus-page-hero > .campus-hero-copy > .logout_ment {
    max-width: 720px;
    margin-block: 8px 0 !important;
    color: #dce9f1 !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
    overflow-wrap: anywhere;
}

.campus-page-frame > :is(.flow-controls, .calendar-section, .panel, .readiness-result, .info_sectionz, .home-overview):first-child,
body.results-page-body > .campus-page-frame > .results {
    margin-block-start: 0 !important;
}

body:not(.sugang-main) .campus-page-frame > :is(.home-overview, .info_sectionz, .calendar-section, .flow-controls, .panel, .results),
body:not(.sugang-main) .campus-page-frame > .readiness-result > :is(.readiness-score, .readiness-checks) {
    box-sizing: border-box;
    padding: var(--campus-card-padding) !important;
    border-radius: var(--campus-card-radius) !important;
}

body.portal-login {
    --campus-frame-width: min(1080px, calc(100% - clamp(32px, 5vw, 80px)));
}
body.portal-login > #wrap.campus-page-frame {
    row-gap: var(--campus-frame-gap) !important;
}
@media (min-width: 851px) {
    body.portal-login > #wrap.campus-page-frame { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.portal-login > #wrap.campus-page-frame #Contents .login_box,
    body.portal-login > #wrap.campus-page-frame #Contents .login_default {
        height: 100% !important;
    }
}

body.portal-login #header.campus-page-hero > .campus-hero-copy {
    text-align: start;
}

body.portal-login .campus-hero-copy > .campus-tool-brand { display: none; }

body.portal-login .login_default > #loginTermLabel {
    margin-block: 0 12px;
    color: #40576a;
    font-size: 14px;
    font-weight: 600;
}
.portal-login .login-card-title {
    margin: 0 0 8px;
    color: #173b5e;
    font-size: 24px;
    line-height: 1.25;
}

.campus-page-frame .room-toolbar { max-inline-size: 880px; }

body.sugang-main { --campus-frame-width: min(clamp(1140px, 56vw, 1440px), calc(100% - clamp(24px, 5vw, 80px))); }
.not-found-card.campus-compact-frame { box-sizing: border-box; width: min(520px, 100%); }

@media (min-width: 768px) {
    .campus-page-hero .standalone-brand,
    .campus-page-hero .public-info-brand { display: none; }
    body.portal-lobby .campus-page-hero {
        --campus-hero-pad-start: clamp(40px, 3vw, 62px);
        --campus-hero-pad-end: clamp(38px, 2.8vw, 56px);
        --campus-title-size: clamp(46px, 4.8vw, 76px);
    }

    body.portal-lobby .campus-page-hero > .campus-hero-copy > .logout_ment {
        margin-block-start: 14px !important;
        font-size: clamp(15px, 1.05vw, 17px) !important;
    }

}

@media (max-width: 767px) {
    .campus-page-hero .campus-tool-header > .campus-tool-brand { min-height: 50px; }

    body.portal-inner.unified-inner-hero:not(.legal-page) > #wrap > #header.campus-page-hero {
        padding-block: var(--campus-hero-pad-start) var(--campus-hero-pad-end) !important;
    }

    body .campus-page-hero > .campus-hero-copy > :is(.logout_ment, .login-hero-copy, h1 + p) {
        margin-block: 0 !important;
    }

    body.portal-lobby #header.campus-page-hero > .campus-hero-copy {
        row-gap: 8px !important;
    }

    body.legal-page #header.public-info-header > .campus-hero-copy {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) fit-content(52%);
        align-items: center;
        gap: 8px 12px;
    }

    .public-info-header .campus-hero-copy > .public-info-brand { grid-area: 1 / 1; }
    .public-info-header .campus-hero-copy > .language-toolbar { grid-area: 1 / 2; }
    .public-info-header .campus-hero-copy > h1 { grid-column: 1 / -1; }
    body.portal-login.has-mobile-app-nav > .login-home-back { display: none !important; }
    body.portal-login #header.campus-page-hero > .campus-hero-copy {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) fit-content(52%);
        align-items: center;
        gap: 8px 12px;
    }

    body.portal-login .campus-hero-copy > .campus-tool-brand {
        display: flex;
        grid-area: 1 / 1;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        min-width: 0;
        color: #fff;
        font-size: 12px;
        font-weight: 750;
        line-height: 1.25;
    }

    body.portal-login .campus-hero-copy > .campus-tool-brand img {
        box-sizing: border-box;
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        padding: 3px;
        border: 1px solid rgb(255 255 255 / 72%);
        border-radius: 10px;
        background: #fffaf4;
    }

    body.portal-login .campus-hero-copy > .campus-tool-brand span { min-width: 0; overflow-wrap: anywhere; }

    body.portal-login #header.campus-page-hero .campus-hero-copy > .language-toolbar {
        grid-area: 1 / 2;
        margin-block: 0;
        align-self: start;
    }
    body.portal-login .campus-hero-copy > :is(h1,p) { grid-column: 1 / -1; }
    body.portal-login #header.campus-page-hero > .campus-hero-copy > .login-hero-copy { margin-block: 0 !important; }

    body.portal-login #wrap.campus-page-frame :is(.login_default, .main_notice) {
        padding: clamp(14px, 4.6vw, 20px) !important;
    }
}

@media (max-width: 480px) {
    body .site-footer .footer-links:has(> a:nth-child(5):last-child) {
        display: grid;
        grid-template-columns: repeat(6,minmax(0,1fr));
        width: min(100%,360px);
        gap: 4px 8px;
    }
    .site-footer .footer-links:has(> a:nth-child(5):last-child) > a {
        grid-column: span 2;
        justify-content: center;
        text-align: center;
        overflow-wrap: anywhere;
    }
    .site-footer .footer-links:has(> a:nth-child(5):last-child) > a:nth-last-child(-n+2) { grid-column: span 3; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --campus-hero-min: 152px;
        --campus-hero-pad-start: 24px;
        --campus-hero-pad-end: 24px;
        --campus-frame-gap: 16px;
    }
}

@media (min-width: 768px) and (max-height: 700px) {
    :root {
        --campus-hero-min: 156px;
        --campus-hero-pad-start: 28px;
        --campus-hero-pad-end: 28px;
        --campus-frame-gap: 16px;
    }
    body.portal-lobby .campus-page-hero {
        --campus-hero-pad-start: 30px;
        --campus-hero-pad-end: 30px;
        --campus-title-size: clamp(38px, 4.3vw, 60px);
    }
}
