/* ==========================================================================
   Subject / course catalogue — site/subjects, site/courses, site/logic.
   Everything is scoped to .subjects-page so no other view is affected.
   NOTE: site.css is registered by the layout *after* this file, so keep the
   selectors here specific enough (.subjects-page prefix) to survive it.
   ========================================================================== */

.subjects-page {
    max-width: 980px;
    margin: 0 auto;
    padding-bottom: 50px;
    text-align: left;
}

/* ---------- page head ---------- */
.subjects-page .subj-head {
    text-align: center;
    margin-bottom: 30px;
}

.subjects-page .subj-head h1 {
    margin: 0 0 8px;
    font-size: 1.9em;
    font-weight: 700;
    color: #0a3a9a;
}

.subjects-page .subj-head p {
    margin: 0;
    color: #5b6472;
    font-size: 1.05em;
    line-height: 1.6;
}

/* ---------- one exam / bonus block ---------- */
.subjects-page .subj-block {
    background: #fff;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(20,25,40,0.05);
    padding: 24px 26px 28px;
    margin-bottom: 22px;
}

.subjects-page .subj-block h2 {
    margin: 0;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.4;
    color: #1f2430;
}

.subjects-page .subj-block-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eef1f6;
    margin-bottom: 18px;
}

/* pill, not a fixed square: the label is a translation ("БИЛ(ҚТЛ)", "НИШ", "★") */
.subjects-page .subj-badge {
    flex: none;
    padding: 0 12px;
    height: 30px;
    border-radius: 999px;
    background: rgba(10,58,154,0.08);
    color: #0a3a9a;
    font-size: 0.82em;
    font-weight: 800;
    line-height: 30px;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* stage label: I-тур / II-тур */
.subjects-page .subj-stage {
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a93a3;
    margin: 0 0 14px;
}

.subjects-page .subj-stage + .subj-grid {
    margin-bottom: 24px;
}

.subjects-page .subj-grid:last-child {
    margin-bottom: 0;
}

/* ---------- cards ---------- */
.subjects-page .subj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.subjects-page a.subj-card {
    display: block;
    border: 1px solid #e4e8ef;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.subjects-page a.subj-card:hover,
.subjects-page a.subj-card:focus {
    border-color: #0a3a9a;
    box-shadow: 0 6px 18px rgba(10,58,154,0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.subjects-page .subj-thumb {
    display: block;
    width: 100%;
    height: 118px;
    /* the artwork is square (1080x1080) on a solid #0d399a plate, so "contain"
       on the same colour crops nothing and still fills the tile edge to edge */
    object-fit: contain;
    background: #0d399a;
}

.subjects-page .subj-card-body {
    padding: 12px 14px 14px;
    text-align: center;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.subjects-page .subj-card-title {
    font-size: 0.98em;
    font-weight: 700;
    line-height: 1.35;
    color: #1f2430;
}

.subjects-page .subj-card-note {
    margin-top: 4px;
    font-size: 0.85em;
    color: #5b6472;
}

/* ---------- compact block (catalogue with a single entry) ---------- */
.subjects-page .subj-block-compact {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
}

.subjects-page .subj-block-compact .subj-grid {
    grid-template-columns: 1fr;
}

.subjects-page .subj-block-compact .subj-thumb {
    height: 165px;
}

/* ---------- tablet ---------- */
@media (max-width: 900px) {
    .subjects-page .subj-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .subjects-page .subj-block {
        padding: 20px 20px 24px;
    }
}

/* ---------- phone: two columns keeps the list scannable ---------- */
@media (max-width: 600px) {
    .subjects-page .subj-head h1 { font-size: 1.5em; }
    .subjects-page .subj-head p  { font-size: 1em; }

    .subjects-page .subj-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .subjects-page .subj-thumb { height: 92px; }

    .subjects-page .subj-card-body { padding: 10px 10px 12px; }
    .subjects-page .subj-card-title { font-size: 0.92em; }

    .subjects-page .subj-block {
        padding: 18px 16px 20px;
        border-radius: 12px;
    }

    .subjects-page .subj-block h2 { font-size: 1.1em; }

    .subjects-page .subj-block-compact {
        max-width: none;
    }

    .subjects-page .subj-block-compact .subj-thumb { height: 150px; }

    .subjects-page .subj-badge {
        padding: 0 10px;
        height: 26px;
        line-height: 26px;
        font-size: 0.75em;
    }
}
