/* Selectable course parts (used with js/course-parts.js).
   Without JavaScript every part stays visible and the fallback list is a plain table of contents. */
.course-parts-nav { margin: 0 0 40px; }
.course-parts-nav__intro {
    margin: 0 0 14px;
    color: #4c5a6e;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
}
.course-parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.course-part-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 14px 16px 16px;
    color: #1f2b3d;
    background: #f7f9fe;
    border: 1px solid #d2dcf0;
    border-top: 4px solid #9fb4d8;
    border-radius: 12px;
    font-family: "Open Sans", Arial, sans-serif;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.course-part-card:hover,
.course-part-card:focus-visible {
    color: #1f2b3d;
    text-decoration: none;
    border-top-color: #2b5fad;
    box-shadow: 0 6px 18px rgba(30, 60, 120, 0.12);
}
.course-part-card:focus-visible { outline: 3px solid #bd7416; outline-offset: 3px; }
.course-part-card[aria-current="true"] {
    background: #e8eefa;
    border-color: #2b5fad;
    border-top-color: #2b5fad;
    box-shadow: 0 6px 18px rgba(30, 60, 120, 0.14);
}
.course-part-card__number {
    color: #2a5394;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.course-part-card__title { font-size: 17px; font-weight: 700; line-height: 1.3; color: #1b3461; }
.course-part-card__summary { font-size: 13.5px; line-height: 1.45; color: #4c5a6e; }
.course-part-card__counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.course-part-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
    white-space: nowrap;
}
.course-part-chip--theorem { background: #e1f0f1; color: #00565d; }
.course-part-chip--example { background: #fbf0dd; color: #7a4a0d; }
.course-part-chip--exercise { background: #efebfa; color: #46377f; }
.course-parts-toolbar { display: flex; justify-content: flex-end; margin-top: 12px; }
.course-parts-toggle {
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid #2b5fad;
    border-radius: 8px;
    background: #fff;
    color: #2a5394;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.course-parts-toggle:hover { background: #e8eefa; }
.course-parts-toggle:focus-visible { outline: 3px solid #bd7416; outline-offset: 3px; }

/* One part at a time once the script is running. */
.course-parts-js .course-part { display: none; }
.course-parts-js .course-part.is-active,
.course-parts-js.course-parts-all .course-part { display: block; }
.course-part { scroll-margin-top: 80px; }
.course-part .euler-theorem-card { scroll-margin-top: 80px; }

/* Index of the frames of the selected part. */
.course-part-index {
    margin: 0 0 28px;
    padding: 12px 16px;
    background: #fbfcfe;
    border: 1px solid #d2dcf0;
    border-radius: 10px;
    font-family: "Open Sans", Arial, sans-serif;
}
.course-part-index > summary {
    cursor: pointer;
    color: #2a5394;
    font-size: 14px;
    font-weight: 700;
}
.course-part-index ol { margin: 10px 0 0; padding-left: 0; list-style: none; columns: 2 260px; column-gap: 24px; }
.course-part-index li { break-inside: avoid; margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.course-part-index a { color: #1f2b3d; text-decoration: none; }
.course-part-index a:hover { color: #2a5394; text-decoration: underline; }
.course-part-index__type {
    display: inline-block;
    min-width: 74px;
    margin-right: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.course-part-index__type--course { color: #2a5394; }
.course-part-index__type--theorem { color: #00636a; }
.course-part-index__type--example { color: #8a530f; }
.course-part-index__type--exercise { color: #51408f; }

/* Previous / next navigation at the bottom of each part. */
.course-part-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin: 40px 0 10px;
    padding-top: 18px;
    border-top: 1px solid #d2dcf0;
    font-family: "Open Sans", Arial, sans-serif;
}
.course-part-pager a {
    padding: 9px 14px;
    border: 1px solid #d2dcf0;
    border-radius: 8px;
    background: #f7f9fe;
    color: #2a5394;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.course-part-pager a:hover { border-color: #2b5fad; text-decoration: none; }
.course-part-pager__next { margin-left: auto; }
.course-parts-all .course-part-pager { display: none; }

@media print {
    .course-parts-nav, .course-part-index, .course-part-pager { display: none !important; }
    .course-parts-js .course-part { display: block !important; }
}
