/* Small, page-level integrations kept outside the main single-file layout. */
/* Give desktop listings room while keeping long prose comfortable to read.
 * These selectors intentionally outrank the original inline stylesheet.
 * Phone/tablet and print layouts retain their existing rules.
 */
@media screen and (min-width: 901px) {
    html:root {
        --sidebar-width: 352px;
    }

    .page-wrapper > .sidebar {
        padding-inline: 24px;
    }

    .sidebar .nav-menu .nav-link {
        font-size: 1.22rem;
        line-height: 1.4;
    }

    .page-wrapper > .main-content {
        --desktop-prose-measure: 84ch;
        padding-inline: clamp(2.5rem, 4vw, 4.5rem);
    }

    .main-content .page-section {
        max-width: 1160px;
    }

    .page-section .entry-content {
        width: 100%;
        max-width: none;
    }

    .main-content .page-section > section > p {
        max-width: var(--desktop-prose-measure);
    }

    .page-section .entry-content > .abstract-content {
        max-width: 80ch;
    }
}

@media screen and (min-width: 901px) and (max-width: 1180px) {
    html:root {
        --sidebar-width: 336px;
    }

    .page-wrapper > .sidebar {
        padding-inline: 16px;
    }
}

.entry-desc.thesis-origin-note {
    font-weight: 600;
}

.sidebar .copyright {
    width: 100%;
    text-align: center;
}

/* Academic profiles share the existing footer icons' exact theme colours.
 * Keep the complete footer in one row, with Erdős Number first.
 */
.sidebar .academic-profiles {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 112px;
    gap: 2px;
    margin: 0;
}

.sidebar .academic-profile-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 var(--footer-icon-size);
    width: var(--footer-icon-size);
    min-width: 36px;
    height: 44px;
    padding: 0;
    color: var(--text-color);
    text-decoration: none;
    border: 0;
    background: none;
    transition: color 0.2s ease;
}

.sidebar .academic-profile-link:hover,
.sidebar .academic-profile-link:focus-visible {
    color: var(--link-color);
    text-decoration: none;
}

.sidebar .academic-profile-link svg,
.sidebar .academic-profile-link img {
    display: block;
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar .bottom-controls {
    --footer-icon-size: 44px;
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 0;
    gap: 2px;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.sidebar .bottom-controls .toggle-btn {
    flex: 0 1 var(--footer-icon-size);
    width: var(--footer-icon-size);
    min-width: 36px;
    min-height: 44px;
}

.sidebar .bottom-controls .erdos-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 0.5rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .sidebar .sidebar-bottom {
        row-gap: 0.35rem;
    }

    .sidebar .bottom-controls {
        margin-top: 0;
    }
}

@media (max-width: 360px) {
    .sidebar .bottom-controls {
        --footer-icon-size: 36px;
    }

    .sidebar .bottom-controls .erdos-btn {
        padding-inline: 0.45rem;
        font-size: 0.88rem;
    }
}

@media print {
    .sidebar .academic-profiles {
        display: none;
    }
}

.thesis-html-link {
    display: inline-block;
    margin-left: 0.18em;
    padding: 0.02em 0.08em;
    color: var(--link-color);
    font-size: 0.84em;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1;
    white-space: nowrap;
    vertical-align: 0.08em;
}

.thesis-html-link,
.thesis-html-link:hover,
.thesis-html-link:focus {
    text-decoration: none;
}

.thesis-html-link:hover {
    color: var(--link-hover);
}

/* Match the bold monospace wordmark at https://pretextbook.org/. */
.thesis-html-link .pretext-wordmark {
    font-family: monospace, sans-serif;
    font-weight: 700;
    letter-spacing: normal;
}
