:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --primary-soft: #eff6ff;

    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;

    --background: #ffffff;
    --surface: #f8fafc;

    --border: #e2e8f0;

    --dark: #0f172a;

    --container-width: 1180px;
}


/* =================================================
   Base
================================================= */

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
}

.public-main {
    min-height: 70vh;
}


/* =================================================
   Header
================================================= */

.site-header {
    position: sticky;
    top: 0;

    z-index: 1030;

    background: rgba(255, 255, 255, 0.96);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(14px);
}

.site-header .navbar {
    min-height: 76px;
}


/* Brand */

.navbar-brand {
    display: inline-flex;

    align-items: center;

    gap: 0.8rem;

    color: var(--text);

    text-decoration: none;
}

.brand-mark {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 10px;

    background: var(--primary);

    color: #ffffff;

    font-size: 0.85rem;
    font-weight: 800;

    letter-spacing: 0.05em;
}

.brand-text {
    display: flex;

    flex-direction: column;

    line-height: 1.15;
}

.brand-text strong {
    color: var(--text);

    font-size: 1rem;
    font-weight: 700;
}

.brand-text small {
    margin-top: 0.18rem;

    color: var(--muted);

    font-size: 0.72rem;
}


/* Navigation */

.site-header .nav-link {
    margin-left: 0.15rem;

    padding:
        0.55rem
        0.75rem !important;

    border-radius: 8px;

    color: var(--text-secondary);

    font-size: 0.91rem;
    font-weight: 500;

    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.site-header .nav-link:hover {
    color: var(--primary);

    background: var(--primary-soft);
}


/* =================================================
   Page Hero
================================================= */

.page-hero {
    position: relative;

    overflow: hidden;

    padding:
        5.5rem
        0
        4.75rem;

    background:
        linear-gradient(
            180deg,
            #f8faff 0%,
            #ffffff 100%
        );

    border-bottom: 1px solid var(--border);
}

.page-hero::after {
    content: "";

    position: absolute;

    top: -180px;
    right: -150px;

    width: 500px;
    height: 500px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(29, 78, 216, 0.07),
            transparent 70%
        );

    pointer-events: none;
}

.page-eyebrow {
    margin-bottom: 0.9rem;

    color: var(--primary);

    font-size: 0.76rem;
    font-weight: 750;

    letter-spacing: 0.14em;

    text-transform: uppercase;
}

.page-title {
    max-width: 820px;

    margin: 0;

    color: var(--text);

    font-size:
        clamp(
            2.5rem,
            5vw,
            4rem
        );

    font-weight: 750;

    letter-spacing: -0.045em;

    line-height: 1.03;
}

.page-description {
    max-width: 760px;

    margin:
        1.4rem
        0
        0;

    color: var(--muted);

    font-size: 1.1rem;

    line-height: 1.75;
}


/* =================================================
   Sections
================================================= */

.content-section {
    padding:
        4.5rem
        0
        5.5rem;
}

.section-heading {
    margin-bottom: 2rem;
}

.section-title {
    margin: 0;

    color: var(--text);

    font-size: 1.55rem;
    font-weight: 700;

    letter-spacing: -0.02em;
}

.section-description {
    margin:
        0.5rem
        0
        0;

    color: var(--muted);

    line-height: 1.7;
}


/* =================================================
   Subject List
================================================= */

.subject-list {
    display: grid;

    gap: 1.25rem;
}


/* Subject Card */

.subject-card {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 2.5rem;

    padding:
        2rem
        2.2rem;

    background: #ffffff;

    border: 1px solid var(--border);

    border-radius: 16px;

    box-shadow:
        0 1px 2px
        rgba(15, 23, 42, 0.02);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.subject-card:hover {
    transform: translateY(-2px);

    border-color: #bfdbfe;

    box-shadow:
        0 18px 45px
        rgba(15, 23, 42, 0.07);
}


/* Subject label */

.subject-label {
    margin-bottom: 0.65rem;

    color: var(--primary);

    font-size: 0.72rem;
    font-weight: 750;

    letter-spacing: 0.11em;

    text-transform: uppercase;
}


/* Subject title */

.subject-title {
    margin:
        0
        0
        0.75rem;

    font-size: 1.4rem;

    font-weight: 700;

    letter-spacing: -0.02em;
}

.subject-title a {
    color: var(--text);

    text-decoration: none;
}

.subject-title a:hover {
    color: var(--primary);
}


/* Summary */

.subject-summary {
    max-width: 780px;

    margin: 0;

    color: var(--muted);

    line-height: 1.75;
}


/* Action */

.subject-action {
    white-space: nowrap;
}

.subject-link {
    display: inline-flex;

    align-items: center;

    gap: 0.5rem;

    padding:
        0.7rem
        1rem;

    border-radius: 9px;

    color: var(--primary);

    font-size: 0.92rem;
    font-weight: 650;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.subject-link:hover {
    color: var(--primary-dark);

    background: var(--primary-soft);
}


/* =================================================
   Detail Layout
================================================= */

.detail-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        280px;

    gap: 4rem;

    align-items: start;
}

.detail-content {
    min-width: 0;
}

.detail-body {
    color: #334155;

    font-size: 1.03rem;

    line-height: 1.9;
}

.detail-body h2,
.detail-body h3 {
    margin-top: 2.5rem;

    color: var(--text);

    font-weight: 700;
}


/* Sidebar */

.detail-sidebar {
    position: sticky;

    top: 105px;

    padding: 1.5rem;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 14px;
}


/* =================================================
   Empty State
================================================= */

.public-empty {
    padding:
        4.5rem
        2rem;

    background: var(--surface);

    border:
        1px dashed
        #cbd5e1;

    border-radius: 16px;

    text-align: center;

    color: var(--muted);
}


/* =================================================
   Footer
================================================= */

.site-footer {
    padding:
        4rem
        0
        1.5rem;

    background: var(--dark);

    color: #cbd5e1;
}

.footer-main {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 4rem;

    padding-bottom: 3rem;
}

.footer-brand {
    margin-bottom: 0.65rem;

    color: #ffffff;

    font-size: 1.15rem;
    font-weight: 700;
}

.footer-description {
    max-width: 430px;

    margin: 0;

    color: #94a3b8;

    line-height: 1.7;
}

.footer-links {
    display: flex;

    flex-wrap: wrap;

    gap:
        0.75rem
        1.5rem;
}

.footer-links a {
    color: #cbd5e1;

    font-size: 0.9rem;

    text-decoration: none;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 1rem;

    padding-top: 1.5rem;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.1);

    color: #94a3b8;

    font-size: 0.8rem;
}


/* =================================================
   Responsive
================================================= */

@media (max-width: 991.98px) {

    .site-header .navbar-collapse {
        padding:
            1rem
            0;
    }

    .site-header .nav-link {
        margin-left: 0;
    }

    .detail-layout {
        grid-template-columns: 1fr;

        gap: 2.5rem;
    }

    .detail-sidebar {
        position: static;

        order: -1;
    }

}


@media (max-width: 767.98px) {

    .page-hero {
        padding:
            4rem
            0
            3.5rem;
    }

    .content-section {
        padding:
            3.5rem
            0
            4rem;
    }

    .subject-card {
        grid-template-columns: 1fr;

        gap: 1.25rem;

        padding: 1.5rem;
    }

    .subject-action {
        white-space: normal;
    }

    .subject-link {
        padding-left: 0;
    }

    .footer-main {
        flex-direction: column;

        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;

        align-items: flex-start;
    }

}


@media (max-width: 575.98px) {

    .site-header .navbar {
        min-height: 68px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
    }

    .brand-text small {
        display: none;
    }

    .page-title {
        font-size: 2.35rem;
    }

    .page-description {
        font-size: 1rem;
    }

}

/* =================================================
   Teaching Subject Detail
================================================= */

.subject-detail-hero .page-title {
    max-width: 900px;
}

.page-hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
}

.hero-back-link:hover {
    color: var(--primary);
}

.section-kicker {
    margin-bottom: 0.55rem;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.sidebar-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-label {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.subject-meta-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.subject-meta-row dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.subject-meta-row dd {
    margin: 0;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: right;
}

.public-status-badge {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
}
.featured-media-section {
    padding: 0 0 2rem;
}

.featured-media-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}
