.semester-syllabi-page{
    position:relative;
    padding:clamp(42px,6vw,78px) 0 clamp(60px,8vw,100px);
    overflow:hidden;
    background:
        radial-gradient(circle at 100% 0,rgba(98,102,234,.12),transparent 30%),
        linear-gradient(145deg,var(--wash),#fff 48%,#f4f3fb);
}

.semester-syllabi-back{
    display:inline-flex;
    align-items:center;
    gap:9px;
    margin-bottom:clamp(24px,4vw,38px);
    color:var(--plum);
    font-size:clamp(.9rem,1.1vw,1rem);
    font-weight:800;
    text-decoration:none;
    transition:color .2s ease,transform .2s ease;
}

.semester-syllabi-back:hover{
    color:var(--rose);
    transform:translateX(-3px);
}

.semester-syllabi-heading{
    max-width:900px;
    margin:0 auto clamp(16px,2.5vw,25px);
    text-align:center;
}

.semester-syllabi-heading .kicker{
    justify-content:center;
    font-size:clamp(.82rem,1vw,.94rem);
}

.semester-syllabi-heading h1{
    margin:12px 0;
    color:var(--plum);
    font-size:clamp(2.1rem,4vw,3.35rem);
    font-weight:850;
    line-height:1.12;
}

.semester-syllabi-heading>p{
    max-width:760px;
    margin:0 auto;
    color:var(--muted);
    font-size:clamp(1.02rem,1.4vw,1.15rem);
    line-height:1.8;
}

.semester-syllabi-summary{
    display:flex;
    align-items:stretch;
    justify-content:center;
    gap:12px;
    margin-top:clamp(16px,2.2vw,22px);
}

.semester-syllabi-summary div{
    min-width:130px;
    padding:13px 18px;
    border:1px solid rgba(98,102,234,.16);
    border-radius:12px;
    background:rgba(255,255,255,.78);
    box-shadow:0 8px 22px rgba(33,34,84,.06);
}

.semester-syllabi-summary strong{
    display:block;
    color:var(--plum);
    font-size:clamp(1.35rem,2.1vw,1.75rem);
    font-weight:850;
    line-height:1.1;
}

.semester-syllabi-summary span{
    display:block;
    margin-top:4px;
    color:var(--muted);
    font-size:clamp(.78rem,.95vw,.88rem);
    font-weight:750;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.semester-syllabi-toolbar{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:18px;
    margin-bottom:30px;
    padding:clamp(18px,3vw,26px);
    border:1px solid var(--line);
    border-radius:16px;
    background:#fff;
    box-shadow:0 13px 35px rgba(33,34,84,.08);
}

.semester-filter-group{
    min-width:0;
}

.semester-filter-group label{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:8px;
    color:var(--plum);
    font-size:clamp(.88rem,1.05vw,.98rem);
    font-weight:800;
}

.semester-filter-group label i{
    color:var(--coral);
}

.semester-select-control,
.semester-search-control{
    position:relative;
}

.semester-select-control select,
.semester-search-control input{
    box-sizing:border-box;
    width:100%;
    min-height:48px;
    border:1px solid #d7d9e5;
    border-radius:10px;
    outline:none;
    background:#fafbff;
    color:var(--ink);
    font-size:clamp(.95rem,1.15vw,1.05rem);
    transition:border-color .2s ease,box-shadow .2s ease;
}

.semester-select-control select{
    padding:10px 42px 10px 14px;
    appearance:none;
    cursor:pointer;
}

.semester-search-control input{
    padding:10px 14px 10px 43px;
}

.semester-select-control select:focus,
.semester-search-control input:focus{
    border-color:#6266ea;
    box-shadow:0 0 0 3px rgba(98,102,234,.12);
}

.semester-select-control>i,
.semester-search-control>i{
    position:absolute;
    top:50%;
    color:#6b7280;
    pointer-events:none;
    transform:translateY(-50%);
}

.semester-select-control>i{
    right:15px;
}

.semester-search-control>i{
    left:16px;
}

.semester-branch-list{
    display:grid;
    gap:22px;
}

.semester-branch-section{
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:17px;
    background:#fff;
    box-shadow:0 12px 32px rgba(33,34,84,.07);
}

.semester-branch-heading{
    display:grid;
    grid-template-columns:48px minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
    padding:18px 22px;
    border-bottom:1px solid rgba(98,102,234,.13);
    background:
        linear-gradient(135deg,rgba(98,102,234,.11),rgba(238,118,71,.06));
}

.semester-branch-icon{
    display:grid;
    width:44px;
    height:44px;
    place-items:center;
    border-radius:11px;
    background:linear-gradient(135deg,var(--plum),#6266ea);
    color:#fff;
    font-size:clamp(1.05rem,1.25vw,1.15rem);
    box-shadow:0 7px 16px rgba(33,34,84,.18);
}

.semester-branch-heading span{
    color:var(--coral);
    font-size:clamp(.77rem,.95vw,.87rem);
    font-weight:850;
    letter-spacing:.08em;
}

.semester-branch-heading h2{
    margin:2px 0 0;
    color:var(--plum);
    font-size:clamp(1.1rem,1.8vw,1.35rem);
    font-weight:850;
    line-height:1.35;
    overflow-wrap:anywhere;
}

.semester-branch-heading>strong{
    padding:7px 12px;
    border-radius:999px;
    background:#e8f7ee;
    color:#08783f;
    font-size:clamp(.8rem,.95vw,.9rem);
    font-weight:800;
    white-space:nowrap;
}

.semester-subject-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
    padding:18px;
}

.semester-subject-card{
    position:relative;
    display:grid;
    grid-template-columns:38px 42px minmax(0,1fr);
    align-items:center;
    gap:11px;
    min-width:0;
    padding:14px;
    border:1px solid #e4e6ef;
    border-radius:12px;
    background:#fff;
    transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease;
}

.semester-subject-card:hover{
    border-color:rgba(98,102,234,.35);
    box-shadow:0 10px 24px rgba(33,34,84,.09);
    transform:translateY(-2px);
}

.semester-subject-number{
    display:grid;
    width:34px;
    height:34px;
    place-items:center;
    border:1px solid rgba(98,102,234,.22);
    border-radius:50%;
    background:rgba(98,102,234,.08);
    color:#6266ea;
    font-size:clamp(.78rem,.95vw,.88rem);
    font-weight:850;
}

.semester-subject-icon{
    display:grid;
    width:40px;
    height:40px;
    place-items:center;
    border-radius:9px;
    background:#fff3e9;
    color:var(--coral);
    font-size:clamp(.96rem,1.15vw,1.08rem);
}

.semester-subject-content{
    min-width:0;
}

.semester-subject-content>span{
    display:block;
    margin-bottom:3px;
    color:var(--muted);
    font-size:clamp(.74rem,.9vw,.84rem);
    font-weight:750;
    text-transform:uppercase;
    letter-spacing:.05em;
}

.semester-subject-content h3{
    margin:0;
    color:var(--ink);
    font-size:clamp(.96rem,1.2vw,1.08rem);
    font-weight:800;
    line-height:1.45;
    overflow-wrap:anywhere;
}

/* Buttons appear together below the subject title. */
.semester-subject-actions{
    grid-column:1 / -1;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-wrap:wrap;
    gap:8px;
    min-width:0;
    margin-top:3px;
}

.semester-subject-link{
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:39px;
    padding:8px 11px;
    border-radius:8px;
    background:#08783f;
    color:#fff;
    font-size:clamp(.8rem,.95vw,.91rem);
    font-weight:800;
    line-height:1.35;
    text-decoration:none;
    white-space:nowrap;
    box-shadow:0 6px 15px rgba(8,120,63,.18);
    transition:
        background .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.semester-subject-link:visited{
    color:#fff;
}

.semester-subject-link:hover,
.semester-subject-link:focus{
    background:#056534;
    color:#fff;
    transform:translateY(-1px);
    box-shadow:0 8px 19px rgba(8,120,63,.26);
}

.semester-subject-link:focus-visible{
    outline:3px solid var(--coral,#ee7647);
    outline-offset:3px;
}

/* Lecture Schedule: theme plum/purple. */
.semester-subject-link-schedule{
    background:var(--plum,#35254f);
    color:#fff;
    box-shadow:0 6px 15px rgba(53,37,79,.18);
}

.semester-subject-link-schedule:visited{
    color:#fff;
}

.semester-subject-link-schedule:hover,
.semester-subject-link-schedule:focus{
    background:#6266ea;
    color:#fff;
    box-shadow:0 8px 19px rgba(98,102,234,.26);
}

.semester-subject-link-pending{
    background:#f1f2f6;
    color:#74798a;
    box-shadow:none;
    cursor:not-allowed;
}

.semester-subject-link-pending:visited{
    color:#74798a;
}

.semester-subject-link-pending:hover,
.semester-subject-link-pending:focus{
    background:#f1f2f6;
    color:#74798a;
    box-shadow:none;
    transform:none;
}

.semester-empty-state{
    padding:45px 24px;
    border:1px dashed #cfd2df;
    border-radius:15px;
    background:rgba(255,255,255,.88);
    text-align:center;
}

.semester-empty-state i{
    margin-bottom:13px;
    color:#6266ea;
    font-size:clamp(1.9rem,2.5vw,2.1rem);
}

.semester-empty-state h2{
    margin:0 0 6px;
    color:var(--plum);
    font-size:clamp(1.22rem,1.6vw,1.38rem);
    font-weight:850;
}

.semester-empty-state p{
    margin:0;
    color:var(--muted);
    font-size:clamp(.94rem,1.15vw,1.04rem);
}

.semester-syllabi-page [hidden]{
    display:none!important;
}

@media(max-width:900px){

    .semester-subject-grid{
        grid-template-columns:1fr;
    }

}

@media(max-width:700px){

    .semester-syllabi-heading{
        margin-bottom:clamp(14px,4vw,20px);
    }

    .semester-syllabi-heading h1{
        font-size:clamp(1.9rem,7vw,2.35rem);
    }

    .semester-syllabi-heading>p{
        font-size:clamp(1rem,4vw,1.1rem);
    }

    .semester-syllabi-toolbar{
        grid-template-columns:1fr;
    }

    .semester-syllabi-summary{
        display:grid;
        grid-template-columns:repeat(3,minmax(0,1fr));
        margin-top:clamp(14px,4vw,18px);
    }

    .semester-syllabi-summary div{
        min-width:0;
        padding:11px 8px;
    }

    .semester-syllabi-summary strong{
        font-size:clamp(1.3rem,5vw,1.55rem);
    }

    .semester-syllabi-summary span{
        font-size:clamp(.76rem,3vw,.84rem);
    }

    .semester-filter-group label{
        font-size:clamp(.9rem,3.6vw,.99rem);
    }

    .semester-select-control select,
    .semester-search-control input{
        font-size:clamp(.96rem,3.8vw,1.05rem);
    }

    .semester-branch-heading{
        grid-template-columns:44px minmax(0,1fr);
    }

    .semester-branch-heading>strong{
        grid-column:1 / -1;
        justify-self:start;
        font-size:clamp(.8rem,3.2vw,.9rem);
    }

    .semester-branch-heading h2{
        font-size:clamp(1.08rem,4.5vw,1.28rem);
    }

    .semester-branch-heading span{
        font-size:clamp(.76rem,3vw,.84rem);
    }

    .semester-subject-card{
        grid-template-columns:34px 38px minmax(0,1fr);
    }

    .semester-subject-content>span{
        font-size:clamp(.73rem,3vw,.82rem);
    }

    .semester-subject-content h3{
        font-size:clamp(.97rem,4vw,1.08rem);
    }

    .semester-subject-actions{
        justify-content:flex-start;
    }

    .semester-subject-link{
        min-height:43px;
        font-size:clamp(.86rem,3.5vw,.96rem);
    }

}

@media(max-width:430px){

    .semester-syllabi-summary{
        grid-template-columns:1fr;
    }

    .semester-branch-heading,
    .semester-subject-grid{
        padding:14px;
    }

    .semester-subject-card{
        grid-template-columns:32px minmax(0,1fr);
    }

    .semester-subject-icon{
        display:none;
    }

    .semester-subject-number{
        font-size:clamp(.78rem,3.4vw,.87rem);
    }

    .semester-subject-content h3{
        font-size:clamp(.98rem,4.25vw,1.07rem);
    }

    .semester-subject-actions{
        gap:7px;
    }

    .semester-subject-link{
        gap:5px;
        padding:8px 9px;
        font-size:.82rem;
    }

    .semester-subject-link .fa-arrow-up-right-from-square{
        display:none;
    }

}

@media(prefers-reduced-motion:reduce){

    .semester-syllabi-back,
    .semester-subject-card,
    .semester-subject-link{
        transition:none;
    }

    .semester-syllabi-back:hover,
    .semester-subject-card:hover,
    .semester-subject-link:hover{
        transform:none;
    }

}

/* Keep the subject details and buttons in the same card row. */
.semester-subject-card{
    grid-template-columns:38px 42px minmax(0,1fr) auto;
}

.semester-subject-actions{
    grid-column:4;
    grid-row:1;
    flex-direction:column;
    align-items:stretch;
    justify-content:center;
    flex-wrap:nowrap;
    gap:8px;
    margin-top:0;
}

@media(max-width:700px){
    .semester-subject-card{
        grid-template-columns:34px 38px minmax(0,1fr);
    }

    .semester-subject-actions{
        grid-column:3;
        grid-row:2;
        justify-self:start;
    }
}

@media(max-width:430px){
    .semester-subject-card{
        grid-template-columns:32px minmax(0,1fr);
    }

    .semester-subject-actions{
        grid-column:2;
    }
}