.sources-page {
    max-width: 1120px;
    margin: 0 auto;
}

.sources-intro {
    max-width: 860px;
    margin: 0 auto 2rem;
    color: #49566a;
    font-size: 1.05rem;
    line-height: 1.75;
    text-align: center;
}

.sources-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 2.25rem 0 3rem;
}

.sources-categories a {
    position: relative;
    display: flex;
    min-height: 165px;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.35rem;
    overflow: hidden;
    border: 1px solid #c7ae75;
    background: linear-gradient(145deg, #12496f, #082944 72%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 9px 24px rgba(10, 38, 67, .12);
}

.sources-categories a::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(222, 195, 126, .38);
    pointer-events: none;
}

.sources-categories__number {
    position: absolute;
    top: 1.1rem;
    right: 1.25rem;
    color: rgba(231, 211, 156, .42);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.4rem;
}

.sources-categories strong,
.sources-categories small {
    position: relative;
    z-index: 1;
}

.sources-categories strong {
    color: #f2dfac;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    line-height: 1.15;
}

.sources-categories small {
    margin-top: .45rem;
    color: #d9e3ec;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sources-section {
    margin: 0 0 3rem;
    scroll-margin-top: 80px;
}

.sources-section > header {
    display: grid;
    grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
    gap: 2rem;
    align-items: end;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #d3c39f;
}

.sources-section__number {
    margin: 0 0 .25rem;
    color: #997129;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sources-section h2 {
    margin: 0;
    color: #671d26;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
}

.sources-section > header > p {
    margin: 0;
    color: #556172;
    line-height: 1.55;
}

.sources-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid #ddd2b9;
    border-left: 1px solid #ddd2b9;
}

.source-item {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    border-right: 1px solid #ddd2b9;
    border-bottom: 1px solid #ddd2b9;
    background: #fbf7ed;
    color: #344354;
}

.source-item span {
    font-weight: 700;
    line-height: 1.3;
}

.source-item em {
    flex: none;
    color: #9a8053;
    font-size: .68rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

a.source-item {
    text-decoration: none;
}

.source-item--available {
    box-shadow: inset 4px 0 #6a2028;
}

.source-item--available span {
    color: #671d26;
}

.source-item--available em {
    color: #6a2028;
}

.sources-back-top {
    margin: .85rem 0 0;
    text-align: right;
}

.sources-back-top a {
    color: #671d26;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-decoration: none;
    text-transform: uppercase;
}

.sources-back-top a:hover,
.sources-back-top a:focus {
    text-decoration: underline;
}

.source-detail {
    max-width: 1060px;
    margin: 0 auto;
}

.source-detail__title {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
}

.source-detail__record {
    display: grid;
    grid-template-columns: .8fr .75fr 1.45fr;
    max-width: 920px;
    margin: 2rem auto;
    border-top: 1px solid #d2c19b;
    border-left: 1px solid #d2c19b;
    background: #f8f2e5;
}

.source-detail__record div {
    padding: 1rem 1.1rem;
    border-right: 1px solid #d2c19b;
    border-bottom: 1px solid #d2c19b;
}

.source-detail__record span {
    display: block;
    margin-bottom: .3rem;
    color: #987128;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.source-detail__record strong {
    color: #314255;
    font-size: .9rem;
    line-height: 1.4;
}

.source-document {
    max-width: 920px;
    margin: 2.25rem auto;
    padding: clamp(1.25rem, 4vw, 3.25rem);
    border: 1px solid #d6c7a6;
    background: #fffdf7;
    box-shadow: 0 12px 30px rgba(10, 38, 67, .08);
}

.source-document__transcription {
    margin: 0 0 .55rem !important;
    color: #987128 !important;
    font-family: Arial, sans-serif;
    font-size: .7rem !important;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.source-document h2 {
    margin: 0 0 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #d9caaa;
    color: #671d26;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.2;
}

.source-document__body > p:not(.source-document__transcription) {
    margin: 0 0 1.15rem;
    color: #273747;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.03rem;
    line-height: 1.82;
    text-align: justify;
}

.source-document__scans {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
}

.source-document__scans figure {
    margin: 0;
    padding: .75rem;
    border: 1px solid #d6c7a6;
    background: #f6f0e3;
    text-align: center;
}

.source-document__scans img {
    display: block;
    width: 100%;
    height: 260px;
    object-fit: contain;
    background: #fff;
}

.source-document__scans figcaption {
    margin-top: .6rem;
    color: #596576;
    font-size: .78rem;
}

.technical-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 0 0 2.25rem;
}

.technical-gallery figure {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: .75rem;
    border: 1px solid #d6c7a6;
    background: #f6f0e3;
}

.technical-gallery a {
    display: flex;
    min-height: 250px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.technical-gallery img {
    display: block;
    width: 100%;
    height: 250px;
    object-fit: contain;
}

.technical-gallery figcaption {
    margin-top: .65rem;
    color: #596576;
    font-size: .78rem;
    line-height: 1.4;
    text-align: center;
}

.technical-gallery + p {
    padding: 1rem 1.1rem;
    border-left: 4px solid #b69045;
    background: #f7f0df;
}

.formation-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.formation-gallery figure,
.formation-diagram {
    margin: 0;
    padding: .8rem;
    border: 1px solid #d6c7a6;
    background: #f6f0e3;
    text-align: center;
}

.formation-gallery a,
.formation-diagram a {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

.formation-gallery a {
    min-height: 230px;
}

.formation-gallery img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
}

.formation-diagram {
    max-width: 680px;
    margin-right: auto;
    margin-left: auto;
}

.formation-diagram img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

.formation-diagram--wide {
    max-width: 820px;
}

.formation-gallery figcaption,
.formation-diagram figcaption {
    margin-top: .7rem;
    color: #596576;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.source-detail__top,
.source-detail__back-wrap {
    max-width: 920px;
    margin: 1rem auto;
}

.source-detail__top {
    text-align: right;
}

.source-detail__top a,
.source-detail__back {
    color: #671d26;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-decoration: none;
    text-transform: uppercase;
}

.source-detail__sequence {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 920px;
    margin: 2.5rem auto 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid #d2c19b;
}

.source-detail__sequence a {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .7rem;
    padding: .9rem 1rem;
    border: 1px solid #d6c7a6;
    background: #faf5e9;
    color: #671d26;
    text-decoration: none;
}

.source-detail__sequence a > span {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 1.2rem;
}

.source-detail__sequence small {
    color: #987128;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.source-detail__sequence strong {
    line-height: 1.25;
}

.source-detail__next {
    text-align: right;
}

.source-detail__next > span {
    grid-column: 2;
}

.source-detail__next small,
.source-detail__next strong {
    grid-column: 1;
    grid-row: auto;
}

@media (max-width: 780px) {
    .sources-categories,
    .sources-list {
        grid-template-columns: 1fr;
    }

    .sources-section > header {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .source-detail__record,
    .source-detail__sequence,
    .source-document__scans,
    .technical-gallery,
    .formation-gallery {
        grid-template-columns: 1fr;
    }

    .technical-gallery a,
    .technical-gallery img {
        min-height: 0;
        height: auto;
        max-height: 70vh;
    }

    .formation-gallery a {
        min-height: 0;
    }

    .formation-gallery img {
        height: auto;
        max-height: 60vh;
    }

    .source-document__body > p:not(.source-document__transcription) {
        text-align: left;
    }
}
