/* ============================================================
   Curriculum listing v4
   ไม่มี Hero / แถบกลุ่มสาขา · แบนเนอร์ 2048×768 เหนือลิงก์สาขา
   ============================================================ */

:root {
    --ink: #1a1c20;
    --ink-2: #3d424c;
    --muted: #767b86;
    --gold: #8f6f22;
    --gold-bright: #c39429;
    --gold-line: #e2cf9d;
    --gold-tint: #fffceb;
    --y-brand: #e8c65a;
    --paper: #ffffff;
    --canvas: #f5f6f8;
    --line: #e2e5ea;
    --sans: 'Noto Sans Thai', -apple-system, 'Segoe UI', sans-serif;
    --r-md: 10px;
    --r-sm: 8px;
    --lift: 0 8px 18px -14px rgba(26, 28, 32, .4);
    --banner-shadow: 0 14px 36px -12px rgba(26, 28, 32, .35), 0 4px 12px rgba(26, 28, 32, .08);
}

body {
    font-family: var(--sans);
    background-color: var(--canvas);
    color: var(--ink-2);
    line-height: 1.7;
}

.page-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    background: rgba(245, 246, 248, .92);
    backdrop-filter: blur(2px);
    transition: opacity .35s ease, visibility .35s ease;
}

.page-loader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--gold-line);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: page-loader-spin .75s linear infinite;
}

.page-loader-text {
    margin: 0;
    font-size: .92rem;
    font-weight: 500;
    color: var(--muted);
}

@keyframes page-loader-spin {
    to { transform: rotate(360deg); }
}

.page-container {
    max-width: 1120px;
    padding-top: 1.35rem;
    padding-bottom: 4rem;
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0 0 1.15rem;
    font-size: .88rem;
    color: var(--muted);
}

.crumbs li + li::before {
    content: '/';
    margin: 0 .6rem;
    color: #c3c0b8;
}

.crumbs a {
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.crumbs a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold-line);
}

/* ---------- ตัวกรองระดับปริญญา — เด่นและใหญ่ ---------- */
.degree-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: .65rem;
    margin: 0 0 1.35rem;
}

.degree-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    min-height: 3.15rem;
    padding: .7rem 1.45rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink-2);
    font-family: var(--sans);
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px -8px rgba(26, 28, 32, .28);
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.degree-tab i {
    font-size: 1.05rem;
    color: var(--gold);
}

.degree-tab:hover {
    color: var(--ink);
    border-color: var(--gold-line);
    background: var(--gold-tint);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -10px rgba(26, 28, 32, .35);
}

.degree-tab.is-active {
    color: var(--ink);
    background: var(--y-brand);
    border-color: var(--y-brand);
    box-shadow: 0 10px 22px -10px rgba(143, 111, 34, .55);
}

.degree-tab.is-active i {
    color: var(--ink);
}

.degree-tab--side {
    font-weight: 600;
    color: var(--muted);
    background: #fff;
}

.degree-tab--side:hover {
    color: var(--gold);
}

.curr-banner {
    margin: 0 0 1.45rem;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #eceef2;
    box-shadow: var(--banner-shadow);
}

.curr-banner img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2048 / 768;
    object-fit: cover;
    object-position: center;
}

.curr-banner-placeholder {
    aspect-ratio: 2048 / 768;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55;
    padding: 1rem;
    background: linear-gradient(180deg, #f0f2f5 0%, #e6e9ee 100%);
}

.curr-banner-placeholder code {
    font-size: .8rem;
    color: var(--ink-2);
}

.degree-pane {
    display: none;
}

.degree-pane.is-active {
    display: block;
    animation: pane-fade .22s ease;
}

@keyframes pane-fade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.major-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    gap: 1.15rem;
}

.major-card {
    display: block;
    width: 100%;
    margin: 0;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.major-card:hover,
.major-card:focus {
    transform: translateY(-2px);
    border-color: var(--gold-line);
    box-shadow: var(--lift);
    text-decoration: none;
    color: inherit;
    outline: none;
}

.major-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 450 / 300;
    overflow: hidden;
    background: #edeae4;
}

.major-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

html[data-major-label="off"] .major-card-bar,
html[data-major-label="off"] .major-card-name {
    display: none;
}

.major-card-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28%;
    min-height: 1.55rem;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.major-card-bar-bg {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 400%;
    object-fit: cover;
    object-position: center;
    filter: blur(14px) brightness(.62) saturate(1.05);
    transform: scale(1.25);
    transform-origin: center bottom;
    display: block;
}

.major-card-bar--solid {
    background: rgba(26, 28, 32, .58);
}

.major-card-name {
    position: absolute;
    left: .4rem;
    right: .4rem;
    bottom: 0;
    z-index: 2;
    height: 28%;
    min-height: 1.55rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 6px rgba(0, 0, 0, .7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.major-card-media--empty {
    background: linear-gradient(145deg, #3a3d44 0%, #1a1c20 70%);
}

.major-card-media--empty.tone-0 { background: linear-gradient(145deg, #3d424c 0%, #1a1c20 75%); }
.major-card-media--empty.tone-1 { background: linear-gradient(145deg, #4a4538 0%, #1f1c16 75%); }
.major-card-media--empty.tone-2 { background: linear-gradient(145deg, #38424a 0%, #161a1f 75%); }
.major-card-media--empty.tone-3 { background: linear-gradient(145deg, #3a4038 0%, #181c16 75%); }

.curr-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}

.curr-empty i {
    display: block;
    font-size: 1.5rem;
    color: #c5cad3;
    margin-bottom: .5rem;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold-bright);
    outline-offset: 3px;
}

@media (max-width: 991.98px) {
    .major-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .85rem;
    }

    .degree-tab {
        font-size: 1.02rem;
        min-height: 2.85rem;
        padding: .6rem 1.15rem;
    }
}

@media (max-width: 575.98px) {
    .degree-tabs {
        gap: .45rem;
    }

    .degree-tab {
        flex: 1 1 calc(50% - .45rem);
        font-size: .95rem;
        padding: .55rem .85rem;
        min-height: 2.65rem;
    }

    .degree-tab--side {
        flex: 1 1 100%;
    }

    .major-grid {
        grid-template-columns: 1fr;
        gap: .7rem;
    }

    .major-card-name {
        font-size: .68rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .major-card,
    .degree-tab,
    .degree-pane.is-active { transition: none; animation: none; }
    .page-loader-spinner {
        animation: none;
        border-top-color: var(--gold-line);
        opacity: .7;
    }
}
