/* Document page shell */
.document-page {
    min-width: 0;
}

.document-page > .document-content,
.document-page > .site-container > .document-content {
    width: 100%;
    max-width: 53.75rem;
}

.documents-page > .site-container > .document-content,
.projects-page > .site-container > .document-content,
.textbooks-page > .site-container > .document-content {
    max-width: none;
}

.documents-page .table-scroll,
.projects-page .table-scroll,
.textbooks-page .table-scroll,
.documents-page .data-table,
.projects-page .data-table,
.textbooks-page .data-table {
    width: 100%;
}

/* Document heading */
.document-page__header {
    min-width: 0;
}

.document-page__eyebrow {
    color: var(--site-link);
    font-weight: 800;
}

.document-page__title {
    margin-top: 0;
    color: var(--site-primary-dark);
}

.document-page__meta {
    color: var(--site-text-muted);
    font-size: calc(var(--page-helper-size) * var(--a11y-text-scale));
    line-height: var(--page-helper-line-height);
}

/* Document content */
.document-page__layout {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.document-page__content {
    min-width: 0;
}

.document-page__section {
    scroll-margin-top: 1rem;
}

.document-content > .page-intro + * {
    margin-top: 2rem;
}

.document-body {
    max-width: 52rem;
}

.document-lead {
    margin-bottom: var(--section-gap);
}

.document-lead > :first-child,
.document-section > :first-child {
    margin-top: 0;
}

.document-lead > :last-child,
.document-section > :last-child {
    margin-bottom: 0;
}

.document-section {
    scroll-margin-top: 1rem;
}

.document-section + .document-section {
    margin-top: var(--section-gap);
}

/* Document actions */
.document-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Document attachments */
.document-attachment {
    padding-block: 1.5rem;
}

.document-attachment + .document-attachment {
    border-top: 1px solid var(--site-border);
}

.document-download-link {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    margin-block: 0.25rem 0.75rem;
    color: var(--site-link);
    font-weight: 700;
}

.document-download-link svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.document-download-link:focus-visible,
.document-details > summary:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: 3px;
}

.document-details {
    margin-top: 0.75rem;
    border-block: 1px solid var(--site-border);
}

.document-details > summary {
    padding-block: 0.75rem;
    color: var(--site-text);
    cursor: pointer;
    font-weight: 700;
}

.document-details__content {
    padding-block: 0.25rem 1rem;
}

.document-details__content > :first-child {
    margin-top: 0;
}

.document-details__content > :last-child {
    margin-bottom: 0;
}

/* Documents directory */
.documents-page .page-hero--documents,
.textbooks-page .page-hero--documents {
    --page-hero-background: #2a3440;

    background: var(--page-hero-background);
}

.documents-page__hero-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: max(2rem, calc((100vw - 74rem) / 2));
    width: clamp(15rem, 24vw, 22rem);
    height: auto;
    opacity: 0.1;
    pointer-events: none;
    transform: translateY(-50%);
}

.documents-page__hero-icon--directory {
    opacity: 0.13;
}

.documents-table {
    --data-table-min-width: 58rem;

    table-layout: fixed;
}

.documents-table th:nth-child(2),
.documents-table__format {
    width: 12rem;
}

.documents-table th:nth-child(3),
.documents-table__date {
    width: 9rem;
}

.documents-table th:nth-child(4),
.documents-table__action {
    width: 8rem;
}

.documents-table__description {
    max-width: none;
    margin: 0.35rem 0 0;
}

.documents-table__format,
.documents-table__date,
.documents-table__action {
    white-space: nowrap;
}

.documents-table a:focus-visible,
.documents-related a:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: 3px;
}

@media (max-width: 47.999rem) {
    #site-shell :is(.documents-page, .association-page, .projects-page)
        .documents-table[data-responsive-table]
        tbody
        :where(th, td):not(:last-child) {
        border-bottom: 1px solid color-mix(in srgb, var(--site-primary-dark) 22%, white);
    }
}

.documents-related__list {
    border-top: 1px solid var(--site-border);
    border-bottom: 1px solid var(--site-border);
}

.documents-related__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    min-width: 0;
    padding-block: 1.25rem;
}

.documents-related__row + .documents-related__row {
    border-top: 1px solid var(--site-border);
}

.documents-related__row > div {
    min-width: 0;
}

.documents-related__row h3 {
    margin: 0 0 0.25rem;
    font-weight: 700;
}

.documents-related__action {
    white-space: nowrap;
}

/* Existing compact document results used by public search */
.document-search-results .document-list {
    min-width: 0;
    border-top: 1px solid var(--site-border);
    border-bottom: 1px solid var(--site-border);
}

.document-search-results .document-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    min-width: 0;
    padding-block: 1.25rem;
}

.document-search-results .document-row + .document-row {
    border-top: 1px solid var(--site-border);
}

.document-search-results .document-row__icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.15rem;
    color: var(--site-primary-accent);
}

.document-search-results .document-row__content {
    min-width: 0;
}

.document-search-results .document-row__title,
.document-search-results .document-row__description,
.document-search-results .document-row__meta {
    margin: 0;
}

.document-search-results .document-row__description,
.document-search-results .document-row__meta {
    margin-top: 0.55rem;
}

.document-search-results .document-row__meta {
    color: var(--site-text-muted);
}

.document-search-results .document-row__action {
    white-space: nowrap;
}

.document-search-results .document-row a:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: 3px;
}

.document-search-results {
    margin-top: var(--section-gap);
}

@media (max-width: 42rem) {
    .documents-page__hero-icon {
        display: none;
    }

    .documents-related__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .documents-related__action {
        justify-self: start;
        white-space: normal;
    }

    .document-search-results .document-row {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.75rem;
    }

    .document-search-results .document-row__action {
        grid-column: 2;
        justify-self: start;
        white-space: normal;
    }
}

@media print {
    .document-attachment {
        break-before: page;
        page-break-before: always;
    }

    .document-download-link,
    .document-details > summary {
        display: none;
    }

    .document-details {
        border: 0;
    }

    .document-details > :not(summary) {
        display: block !important;
    }
}
.documents-accessibility {
    margin-bottom: clamp(2rem, 5vw, 3.5rem);
    padding: clamp(1.35rem, 3vw, 2rem);
    border-left: 0.3rem solid var(--site-primary-accent);
    background: var(--site-primary-light-accent);
}

.documents-accessibility > :first-child {
    margin-top: 0;
}

.documents-accessibility > :last-child {
    margin-bottom: 0;
}
