:root {
    --ink: #2e2924;
    --brown: #663c27;
    --copper: #96643f;
    --cream: #f6f2ea;
    --paper: #fffdfa;
    --line: #d9d0c4;
    --muted: #716b64
}

.pdf-reader {
    padding-top: 2rem;
    padding-bottom: 4rem
}

.pdf-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem
}

.pdf-reader iframe {
    display: block;
    width: 100%;
    height: min(78vh, 1000px);
    min-height: 620px;
    border: 1px solid #d9ddd8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(24, 46, 37, .12)
}

@media(max-width:700px) {
    .pdf-reader iframe {
        min-height: 70vh;
        border-radius: 10px
    }

    .pdf-actions {
        justify-content: stretch
    }

    .pdf-actions .button {
        width: 100%;
        text-align: center
    }
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    color: var(--ink);
    font: 16px/1.65 Arial, sans-serif;
    background: var(--paper)
}

a {
    color: inherit
}

.wrap {
    width: min(1180px, calc(100% - 40px));
    margin: auto
}

.narrow {
    width: min(900px, calc(100% - 40px));
    margin: auto
}

.skip {
    position: absolute;
    left: -9999px
}

.topbar {
    background: var(--brown);
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
    letter-spacing: .03em
}

.topbar span {
    margin: 0 14px;
    color: #d9bda7
}

header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: Georgia, serif
}

.brand-logo {
    display: block;
    width: 56px;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
    margin-right: 12px
}

.footer .brand-logo {
    width: 64px;
    height: auto
}

.brand strong {
    font-size: 30px
}

.brand small {
    font-size: 18px;
    color: var(--muted)
}

nav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    height: 82px
}

nav>a,
nav form button {
    display: flex;
    align-items: center;
    padding: 0 17px;
    border: 0;
    background: none;
    text-decoration: none;
    font-weight: 600;
    color: #48423c
}

nav>a:hover {
    background: var(--cream);
    box-shadow: inset 0 -3px var(--copper)
}

nav form {
    display: flex
}

.hero {
    background: var(--cream);
    padding: 90px 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.65fr .75fr;
    gap: 80px;
    align-items: center
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 800;
    color: #846044;
    font-size: 13px
}

.hero h1,
.page-hero h1,
.reader h1,
h2,
.auth-card h1,
.admin h1 {
    font-family: Georgia, serif;
    line-height: 1.05
}

.hero h1 {
    font-size: clamp(56px, 7vw, 92px);
    margin: 12px 0 25px;
    letter-spacing: -.04em
}

.hero h1 em {
    display: block;
    color: var(--copper);
    font-weight: 400
}

.lead {
    font-size: 21px;
    color: #5d5751;
    max-width: 730px
}

.search {
    display: flex;
    background: #fff;
    border: 1px solid #cfc6ba;
    border-radius: 12px;
    padding: 8px;
    margin-top: 36px;
    box-shadow: 0 10px 30px #55362212
}

.search input {
    flex: 1;
    border: 0;
    padding: 12px;
    font-size: 18px;
    outline: 0
}

.search button,
.button,
button {
    background: var(--brown);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 13px 24px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none
}

.popular {
    color: var(--muted)
}

.popular a {
    margin-left: 14px
}

.quote {
    background: #fffcf8;
    border: 1px solid #cdbdac;
    border-radius: 160px 160px 14px 14px;
    text-align: center;
    padding: 55px 35px 35px;
    min-height: 420px;
    box-shadow: 0 30px 50px #6a3f2515
}

.seal {
    display: grid;
    place-items: center;
    margin: auto;
    border: 1px solid var(--brown);
    border-radius: 50%;
    width: 76px;
    height: 76px;
    font: 45px Georgia
}

.quote blockquote {
    font: italic 25px/1.4 Georgia;
    margin: 32px 0
}

.quote strong {
    font: 34px Georgia;
    display: block
}

.quote small {
    color: var(--muted)
}

.intro,
.latest {
    padding: 90px 0
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 90px
}

.split h2,
.features h2,
.latest h2 {
    font-size: 35px;
    margin: 10px 0
}

.split p {
    font-size: 19px;
    color: var(--muted)
}

.features {
    background: var(--cream);
    padding: 50px 0
}

.cards,
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px
}

.feature {
    background: #fff;
    border: 1px solid var(--line);
    padding: 30px;
    text-decoration: none;
    min-height: 300px;
    transition: .2s
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px #55362214
}

.feature>span {
    color: var(--copper);
    font-weight: 800
}

.feature h3 {
    font: 32px Georgia;
    margin: 42px 0 10px
}

.feature p {
    color: var(--muted)
}

.feature b {
    display: block;
    margin-top: 30px
}

.about-hero .lead {
    margin-bottom: 0
}

.about-features {
    background: var(--paper)
}

.about-cards {
    margin-top: 15px
}

.about-card {
    display: flex;
    flex-direction: column
}

.about-card h3 {
    margin-top: 34px
}

.about-card p {
    flex: 1
}

.training-information {
    padding-top: 64px;
    padding-bottom: 28px
}

.page-copy.training-information>p {
    font-size: 20px
}

.page-copy.training-information>p:first-child {
    font-size: 20px
}

.training-paths {
    padding-top: 48px
}

.training-level-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    margin-top: 20px
}

.training-level-card {
    display: flex;
    flex-direction: column;
    min-height: 220px
}

.training-level-card h3 {
    margin-top: 20px
}

.training-level-card-wide {
    grid-column: 1 / -1
}

.training-specializations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px
}

.training-specialization {
    display: flex;
    flex-direction: column;
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--cream)
}

.training-specialization h4 {
    margin: 0 0 10px;
    font: 26px/1.2 Georgia, serif
}

.training-specialization p {
    flex: 1;
    margin-top: 0
}

.content-pending {
    display: inline-block;
    margin-top: auto;
    color: var(--muted);
    font-weight: 700
}

.instructor-section {
    padding-top: 70px;
    padding-bottom: 90px
}

.instructor-section>h2 {
    margin: 0 0 30px;
    font: 44px/1.15 Georgia, serif
}

.instructor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px
}

.instructor-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper)
}

.instructor-photo,
.instructor-profile-photo {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    text-decoration: none
}

.instructor-photo {
    width: 112.5px;
    height: 150px
}

.instructor-photo img,
.instructor-profile-photo img {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    transform: translate(-50%, -50%)
}

.instructor-photo span {
    font: 60px Georgia, serif
}

.instructor-card h3 {
    margin: 4px 0 6px;
    font: 28px/1.2 Georgia, serif
}

.instructor-card h3 a {
    color: var(--ink);
    text-decoration: none
}

.instructor-card p {
    color: var(--muted)
}

.instructor-card .more-link {
    margin-top: 10px
}

.instructor-title {
    font-weight: 800
}

.instructor-profile-head {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 42px;
    align-items: center
}

.instructor-profile-photo {
    width: 165px;
    height: 220px
}

.instructor-profile-photo span {
    font: 84px Georgia, serif
}

.instructor-profile-copy>h2:first-child {
    margin-top: 0
}

@media(max-width:900px) {
    .instructor-grid {
        grid-template-columns: 1fr
    }
}

@media(max-width:600px) {
    .instructor-card,
    .instructor-profile-head {
        grid-template-columns: 1fr
    }

    .instructor-profile-photo {
        width: 120px;
        height: 160px
    }
}

.more-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 30px;
    color: var(--brown);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid transparent
}

.more-link:hover,
.more-link:focus-visible {
    border-bottom-color: var(--brown)
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.admin-article-filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 14px;
    align-items: end;
    margin: 20px 0 26px;
    padding: 18px;
    border-radius: 10px;
    background: var(--cream)
}

.admin-article-filters label {
    display: grid;
    gap: 7px;
    font-weight: 700
}

.admin-article-filters input,
.admin-article-filters select {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font: inherit
}

.admin-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px
}

.admin-filter-actions a {
    white-space: nowrap;
    color: var(--brown);
    font-weight: 700
}

@media(max-width:900px) {
    .admin-article-filters {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:600px) {
    .admin-article-filters {
        grid-template-columns: 1fr
    }
}

.article-card {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    overflow: hidden
}

.article-card img,
.placeholder {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background: #eadfce;
    display: grid;
    place-items: center;
    font: 70px Georgia;
    color: var(--brown)
}

.card-body {
    padding: 22px
}

.meta,
.byline {
    font-size: 13px;
    color: var(--copper);
    font-weight: 700
}

.article-card h3 {
    font: 25px/1.2 Georgia;
    margin: 10px 0
}

.article-card h3 a {
    text-decoration: none
}

.article-card p {
    color: var(--muted)
}

footer {
    background: #2f2119;
    color: #eee;
    padding: 55px 0
}

.footer {
    display: flex;
    justify-content: space-between
}

.footer>div:last-child {
    display: flex;
    gap: 30px
}

.invert b {
    border-color: #eee
}

.page-hero {
    background: var(--cream);
    padding: 20px 0
}

.page-hero h1,
.reader h1 {
    font-size: 56px;
    margin: 12px 0
}

.library {
    padding: 55px 0 90px
}

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    margin-bottom: 35px
}

.filters input,
.filters select,
.stack input,
.stack select,
.stack textarea,
.editor input,
.editor select,
.editor textarea,
.auth-card input {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    font: inherit
}

.reader-head {
    background: var(--cream);
    padding: 15px 0
}

.back {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--copper)
}

.article-authors {
    font-size: 18px;
    font-weight: bold
}

.cover {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    margin: 25px 0;
    border-radius: 10px
}

.chips span,
.status {
    display: inline-block;
    background: #eadfce;
    padding: 5px 12px;
    border-radius: 20px;
    margin: 4px
}

.prose {
    padding-top: 35px;
    padding-bottom: 90px;
    font: 20px/1.8 Georgia, serif
}

.prose h2,
.prose h3,
.prose h4 {
    font-family: Georgia;
    font-size: 32px;
    margin-top: 2em;
    line-height: 1.2
}

.page-copy>p:first-child {
    font-size: 24px
}

.auth-card {
    width: min(470px, calc(100% - 40px));
    margin: 80px auto;
    padding: 45px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--cream)
}

.auth-card h1 {
    font-size: 48px
}

.auth-card label,
.editor>label {
    display: block;
    margin: 18px 0;
    font-weight: bold
}

.check {
    display: flex !important;
    align-items: center;
    gap: 8px
}

.check input {
    width: auto
}

.error {
    color: #9c2424;
    background: #ffe8e8;
    padding: 12px
}

.flash {
    background: #e4f4e9;
    padding: 12px;
    text-align: center
}

.admin {
    padding: 60px 0 100px
}

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: end
}

.admin h1 {
    font-size: 55px;
    margin: 5px 0
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 35px 0
}

.stats div,
.panel {
    border: 1px solid var(--line);
    background: #fff;
    padding: 24px;
    border-radius: 10px
}

.stats strong {
    display: block;
    font: 38px Georgia
}

.stats span {
    color: var(--muted)
}

.panel {
    margin-bottom: 24px
}

.panel h2 {
    font-size: 28px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    text-align: left;
    padding: 13px;
    border-bottom: 1px solid var(--line)
}

.actions {
    display: flex;
    gap: 12px
}

.actions form,
.actions button {
    display: inline;
    padding: 0;
    background: none;
    color: #9c2424
}

.author-bio-preview {
    max-width: 480px;
    color: var(--muted)
}

.author-editor textarea {
    min-height: 260px;
    resize: vertical
}

.author-photo-field {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1.25rem;
    align-items: center
}

.author-photo-frame {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 90px;
    height: 120px;
    border-radius: 8px;
    background: #eef1ed;
    border: 1px solid var(--line)
}

.author-photo-frame img,
.author-table-photo img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: auto;
    max-width: none;
    height: 100%;
    transform: translate(-50%, -50%)
}

.author-photo-field label {
    margin: 0
}

.author-photo-field small {
    display: block;
    margin-top: .5rem;
    color: var(--muted)
}

.author-table-photo {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    width: 36px;
    height: 48px;
    border-radius: 5px;
    background: #eef1ed
}

.author-photo-placeholder {
    display: grid;
    place-items: center;
    width: 36px;
    height: 48px;
    border-radius: 5px;
    background: #eef1ed;
    color: var(--muted)
}

@media(max-width:600px) {
    .author-photo-field {
        grid-template-columns: 1fr
    }
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #9c2424;
    font-weight: 600
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px
}

.stack {
    display: grid;
    gap: 12px
}

.narrow-wide {
    width: min(900px, calc(100% - 40px))
}

.editor {
    margin-top: 30px;
    border: 1px solid var(--line);
    padding: 32px;
    border-radius: 10px
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    gap: 15px
}

.upload-box {
    border: 2px dashed #cbb8a7;
    background: var(--cream);
    padding: 22px;
    margin: 18px 0
}

.upload-box p {
    color: var(--muted)
}

fieldset {
    border: 1px solid var(--line);
    margin: 18px 0
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.code-editor {
    font: 14px Consolas, monospace;
    min-height: 420px
}

.editor-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 25px;
    margin-top: 20px
}

@media(max-width:900px) {

    .hero-grid,
    .split {
        grid-template-columns: 1fr
    }

    .quote {
        display: none
    }

    .cards,
    .article-grid,
    .admin-grid {
        grid-template-columns: 1fr 1fr
    }

    .nav {
        align-items: flex-start;
        padding: 15px 0
    }

    .nav nav {
        height: auto;
        flex-wrap: wrap;
        justify-content: flex-end
    }

    .nav nav>a {
        padding: 9px
    }

    .brand strong {
        font-size: 23px
    }

    .brand-logo {
        width: 46px;
        height: auto;
        margin-right: 8px
    }

    .filters,
    .form-grid {
        grid-template-columns: 1fr
    }

    .stats {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:620px) {
    .topbar {
        display: none
    }

    .nav {
        display: block
    }

    .nav nav {
        margin-top: 12px;
        justify-content: flex-start
    }

    .hero {
        padding: 55px 0
    }

    .hero h1 {
        font-size: 50px
    }

    .search {
        display: block
    }

    .search button {
        width: 100%
    }

    .cards,
    .article-grid,
    .admin-grid {
        grid-template-columns: 1fr
    }

    .training-specializations {
        grid-template-columns: 1fr
    }

    .split {
        gap: 10px
    }

    .page-hero h1,
    .reader h1 {
        font-size: 44px
    }

    .footer,
    .admin-head {
        display: block
    }

    .footer>div:last-child {
        display: block
    }

    .stats {
        grid-template-columns: 1fr 1fr
    }
}

#paginator             { padding:0px;margin:0px; }
.pagination            { display: flex; justify-content: center; list-style-type: none; padding: 2px; margin: 2px; }
.pagination li a       { display: block;  padding: 2px 8px; text-decoration: none; border: 1px solid gray;  margin: 1px 2px; border-radius: 3px; }
.pagination li.active  { display: block;  padding: 2px 8px; background-color: #f4e8a4; font-weight:bold; margin: 1px 2px; border-radius: 3px; }
