*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}
@view-transition {
    navigation:auto;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    @view-transition {
        navigation: none;
    }
}

body {
    background-color: #fff;
    color: #353331;
    font-family: 'Open Sans', Helvetica, Arial, sans-serif;
    margin: 0;
}

a {
    color: #8c6d2c;
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: rgb(from #8c6d2c r g b /.3);
    text-underline-offset: .125em;
    &:hover {
        text-decoration-color: #8c6d2c;
    }
}

hr {
    display: none;
}

p, ul, ol, dl {
    line-height: 1.6;
    margin: 1rem 0;
}

ul > li {
    list-style-type: square;
}

/*.banner { background: #353331; color: #efeeed; position: relative; }
.banner:has(.header-sub) { padding: 1rem 2rem; }
.banner h1 { font-family: 'Open Sans', sans-serif; font-size: 1.2rem; font-weight: bold; margin: 0; }
.banner a { color: #fff; text-decoration: none; }
.banner .header-sub { color: #b0adac; font-size: .85rem; margin: 0 0 .15rem 0; }
.banner .back { color: #b0adac; display: inline-block; font-size: .9rem; margin-block-start: .4rem; text-decoration: none; }
.banner .back:hover { color: #fff; }*/

.legend {
    background-color: #755f3b;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: .5rem 1rem;
    text-align: center;
    .home {
        color: #fff;
        font-family: 'Cormorant Garamond';
        font-size: 1.5rem;
        font-style: italic;
        grid-column: 2;
        /*text-transform: uppercase;*/
    }
}
body:has(.hero) {
    .legend {
        height: 0;
        padding: 0;
    }
    .home {
        visibility: hidden;
    }
    button[popovertarget="panel"][popovertargetaction="show"] {
        position: absolute;
        bottom: -2.0625rem;
        right: 1rem;
        text-transform: uppercase;
        z-index: 2;
    }
}
button[popovertarget="panel"] {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: 1rem;
    line-height: 1;
}
button[popovertarget="panel"][popovertargetaction="show"] {
    grid-column: 3;
    justify-self: end;
    /*position: absolute;*/
    /*bottom: -2.5rem;*/
    /*right: 1rem;*/
    text-transform: uppercase;
    /*z-index: 2;*/
    &:hover {
        color: #fff;
    }
}
/*body:has(.content .container) {
    button[popovertarget="panel"][popovertargetaction="show"] {
        color: #353331;
        &:hover {
            color: #2f2e2d;
        }
    }
}
@media (width >= 960px) {
    button[popovertarget="panel"][popovertargetaction="show"] {
        right: 2rem;
    }
}*/

/* panel */
#panel[popover] {
    --size: clamp(33vw,30rem,100vw);
    border: none;
    display: block;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 0;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    block-size: 100dvh;
    inline-size: var(--size);
    transform: translateX(var(--size));
    transition: transform 150ms cubic-bezier(0.31,1.13,0.64,1);
    z-index: 10;

    /* &:not(:popover-open) {
        display: none;
    } */
    &::backdrop {
        background-color: rgb(72 69 66 /.71);
        transition: background-color 150ms ease;
    }
    &:popover-open {
        /*display: block;*/
        transform: translateX(0);
        &::backdrop {
            background-color: rgb(72 69 66 /.71);
        }
    }
}
/*@media (width >= 960px) {
    #panel[popover] {
        --w: 33vw;
    }
}*/
#panel {
    /*background-color: #fff;*/
    background-color: #755f3b;
    color: #fff;
    .panel-header {
        /*background-color: #755f3b;*/
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 2rem;
        h2 {
            color: #fff;
            display: flex;
            align-items: center;
            font-family: 'Cormorant Garamond', Palatino, Georgia, serif;
            font-size: 2rem;
            font-weight: 500;
            line-height: 1;
            margin: 0;
            text-transform: uppercase;
            span::before {
                color: #dfdedd;
                content: 'Special Collections & Archives';
                display: block;
                flex-basis: 100%;
                font-size: 1.1875rem;
                font-style: italic;
                text-transform: capitalize;
            }
            svg {
                height: 3rem;
                width: 3rem;
            }
        }
    }
    p {
        margin: 1rem 2rem;
    }
    ul {
        margin: 0 0 1rem 0;
        padding: 0 0 2rem 0;
        /*overflow-y: auto;*/
        /*max-block-size: 76dvh;*/
    }
    li {
        list-style: none;
    }
    a {
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: start;
        gap: 1rem;
        font-weight: bold;
        line-height: 1.3;
        overflow: hidden;
        padding: 1rem 2rem;
        text-decoration: none;
        text-overflow: ellipsis;
        white-space: nowrap;
        /*&:hover {
            background-color: #977a4c;
            background-color: rgb(151 122 76 /.3);
            color: #fff;
            text-decoration: none; 
        }*/
        i,svg {
            opacity: .5;
        }
    }
    .separator {
        border-block-start: 1px solid rgb(227 226 225 / .15);
        margin-block-start: 1rem;
        padding-block-start: 1rem;
        &:first-of-type {
            margin-block-start: 0;
        }
    }
    .browse.separator::before {
        color: #dfdedd;
        content: 'Browse';
        font-size: .875rem;
        margin-inline-start: 2rem;
        text-transform: uppercase;
    }
}
.bookmarks-count {
    font-style: normal;
    font-weight: normal;
}
@media (hover: hover) {
    #panel a:hover {
        background-color: #977a4c;
        background-color: rgb(151 122 76 /.3);
        color: #fff;
        text-decoration: none; 
    }
}

/* content */
.content {
    background-color: #efeeed;
    margin: 0 auto;
    padding: 0;
    position: relative;
    .container {
        margin: 0 auto;
        padding: 1rem;
        min-block-size: 80dvh;
        max-inline-size: 59rem;
    }
    h1 {
        font-family: 'Cormorant Garamond', Palatino, Georgia, serif;
        font-size: 2.5rem;
        font-style: italic;
        font-weight: 600;
        margin: 0;
    }
}
@media (width >= 960px) {
    .content {
        .container {
            padding: 2rem;
        }
    }
}

/* Index */
.search-bar {
    margin-block-end: 1.5rem;
}
.search-box {
    background-color: #fff;
    border: 3px solid #fff;
    border-radius: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    justify-content: space-between;
    overflow: hidden;
    padding: .25rem;
    transition: border-color 200ms ease;
    &:focus-within {
        border-color: #a27f33;
    }
    input[type=search] {
        background-color: #fff;
        /*border-color: #252321 #454341 #454341 #252321;*/
        border: none;
        flex: 1;
        font-size: 1rem;
        /*min-inline-size: 200px;*/
        padding: .5rem 1.5rem;
        &:focus {
            outline: none;
        }
    }
    button {
        background-color: #fff;
        border: none;
        color: #353331;
        cursor: pointer;
        font-size: 1rem;
        padding: .5rem 1.5rem;
    }
}
.content {
    .search-bar {
        margin-block-end: 2rem;
    }
}

.field-radios {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-block-start: .5rem;
    width: 100%;
    label {
        align-items: center;
        color: #cfcecd;
        cursor: pointer;
        display: flex;
        gap: .25rem;
    }
    input[type="radio"] {
        appearance: none;
        -webkit-appearance: none;
        background-color: rgb(255 255 255 /.2);
        /*border: 1px solid rgb(from #777675 r g b /.1);*/
        /*border-color: rgb(from #777675 r g b /.3) rgb(from #777675 r g b /.2) rgb(from #777675 r g b /.1) rgb(from #777675 r g b /.2);*/
        border-width: 1px 1px 0 1px;
        border-radius: 50%;
        cursor: pointer;
        height: 1em;
        margin: 0 0 0 5px;
        width: 1em;
        flex-shrink: 0;
        /*transition: background-color .15s ease, border-color .15s ease;*/
        transition: background-color .15s ease;
        &:checked {
            background-color: #b38c38;
            /*border-color: #8c6d2c;*/
        }
    }
}
.hero {
    .field-radios {
        justify-content: center;
        label {
            color: #cfcecd;
        }
    }
}
.content {
    .field-radios {
        margin-inline-start: 1rem;
        label {
            color: #353331;
        }
        input[type="radio"] {
            background-color: rgb(from #777675 r g b /.3);
            &:checked {
                background-color: #b38c38;
            }
        }
    }
}

.alpha-bar { display: flex; flex-wrap: wrap; gap: .2rem; margin-block-end: 1rem; }
.alpha-bar a {
    background: #fff;
    border: 1px solid #ecebea;
    border-radius: 4px;
    color: #8c6d2c;
    font-size: .9rem;
    padding: .3125rem .5625rem;
    text-decoration: none; }
.alpha-bar a:hover { background: #e2e0df; color: #353331; }
.alpha-bar a.active { background: #353331; color: #efeeed; }

.meta { align-items: center; color: #555; display: flex; font-size: .9rem; justify-content: space-between; margin: 0 1rem 1rem 0; }
.sort-bar { align-items: center; color: #555; display: flex; font-size: .9rem; gap: .35rem; }
.sort-note { color: #888; font-style: italic; }

.records { margin: 0; padding: 0; }
.records li {
    background: #fff;
    border: 1px solid #ecebea;
    border-radius: 6px;
    list-style: none;
    margin-block-end: .75rem;
    padding: 1rem 1.25rem;
}
.records li a { color: #8c6d2c; font-size: 1.05rem; font-weight: 600; text-decoration: none; }
.records li a:hover { text-decoration: underline; }
.record-meta { color: #666; font-size: .82rem; margin-block: .25rem .5rem; }
.records .abstract { color: #444; font-style: italic; }
mark { background: #ffe082; border-radius: 2px; padding: 0 1px; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    justify-content: center;
    margin-block-start: 1.5rem;
}
.pagination a, .pagination span {
    background: #fff;
    border: 1px solid #ecebea;
    border-radius: 4px;
    color: #8c6d2c;
    font-size: .9rem;
    padding: .35rem .7rem;
    text-decoration: none;
}
.pagination a:hover { background: #e2e0df; color: #353331; }
.pagination .current { background: #353331; border-color: #353331; color: #efeeed; }
.pagination .disabled { color: #aaa; pointer-events: none; }
.empty { color: #666; padding-block: 3rem; text-align: center; }

/* Login */
.login-box { background: #faf9f9; border: 1px solid #ddd; border-radius: 6px; margin-block: 2rem; margin-inline: auto; max-inline-size: 360px; padding: 2rem; }
.login-box h2 { color: #353331; font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; margin-block: 0 1.25rem; }
.login-box label { display: block; font-size: .88rem; font-weight: 600; margin-block-end: .3rem; }
.login-box input { border: 1px solid #ccc; border-radius: 4px; display: block; font-size: 1rem; inline-size: 100%; margin-block-end: 1rem; padding: .5rem .75rem; }
.login-box button { background: #353331; border: none; border-radius: 4px; color: #efeeed; cursor: pointer; font-size: 1rem; padding: .5rem 1.25rem; }
.login-box button:hover { background: #555150; }
.login-error { color: #b00; font-size: .9rem; margin-block-end: 1rem; }

/* Upload */
.upload-form, .upload-confirm { background: #faf9f9; border: 1px solid #ddd; border-radius: 6px; margin-block-end: 1rem; max-inline-size: 480px; padding: 1.5rem 2rem; }
.upload-form label { display: block; font-size: .88rem; font-weight: 600; margin-block-end: .5rem; }
.upload-form input[type=file] { display: block; font-size: .95rem; margin-block-end: 1rem; }
.upload-form button, .upload-confirm button { background: #353331; border: none; border-radius: 4px; color: #efeeed; cursor: pointer; font-size: 1rem; padding: .5rem 1.25rem; }
.upload-form button:hover, .upload-confirm button:hover { background: #555150; }
.upload-confirm p { margin-block: 0 .75rem; }
.btn-danger { background: #8b2020 !important; }
.btn-danger:hover { background: #a83030 !important; }
.btn-cancel { color: #555; display: inline-block; font-size: .9rem; margin-inline-start: .75rem; text-decoration: none; }
.btn-cancel:hover { text-decoration: underline; }
.upload-success { background: #e8f5eb; border: 1px solid #b8dfc0; border-radius: 4px; color: #1a6b2a; margin-block-end: 1rem; max-inline-size: 480px; padding: .6rem 1rem; }
.upload-error   { background: #fbeaea; border: 1px solid #e0b8b8; border-radius: 4px; color: #8b2020; margin-block-end: 1rem; max-inline-size: 480px; padding: .6rem 1rem; }
.upload-note { color: #666; font-size: .88rem; }
.upload-note a { color: #8c6d2c; }

.hero {
    background-attachment: fixed;
    background-color: rgb(from #3e3114 r g b);
    background-image: linear-gradient(rgb(62 49 20 /.83), rgb(62 49 20 /.83)), url('https://zsr.wfu.edu/theme/img/20150707library1059-2000x1333.jpg');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 1rem;
    position: relative;
    text-align: center;
    h1 {
        color: #efeeed;
        font-family: 'Cormorant Garamond', serif;
        font-size: clamp(2rem, 6vw, 4rem);
        font-style: italic;
        font-weight: 600;
        letter-spacing: .02em;
        margin-block: 0 .4rem;
    }
    .container {
        /*background-color: #353331;*/
        /*border-radius: 2rem;*/
        margin: 0 auto;
        padding: 2rem 0 1rem 0;
        max-inline-size: 43rem;
    }
    .count {
        color: #afaead;
        font-size: .95rem;
        letter-spacing: .03em;
        margin-block-end: 1.75rem;
    }
    .intro {
        color: #afaead;
        font-style: italic;
        line-height: 1.5;
        margin: 0 auto;
        /*max-inline-size: 33rem;*/
        text-align: left;
        text-wrap: balance;
    }
    a {
        color: #cfcecd;
        text-decoration-color: rgb(from #cfcecd r g b /.3);
        text-underline-offset: .125em;
        &:hover {
            color: #efeeed;
            text-decoration-color: rgb(from #cfcecd r g b /.5);
        }
    }
}

@media (width >= 960px) {
    .hero .container {
        padding: 3rem 0 1rem 0;
    }
}

/* Browse cards */
.browse-cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
    padding: 1rem;
}
@media (width >= 520px) {
    .browse-cards {
        grid-template-columns: repeat(2,1fr);
    }
}
/* @media (width >= 960px) {
    .browse-cards {
        padding: 2rem;
    }
} */
.browse-card {
    background: #fff;
    min-width: 0;
    border: 1px solid #ecebea;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 0;
    ul {
        flex: 1;
        list-style: none;
        margin: 0;
        padding: 0 1.5rem 1.25rem 1.5rem;
    }
    li {
        border-block-end: 1px solid #f5f4f3;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding-block: .5rem;
        &:last-child {
            border-block-end: none;
        }
    }
    a {
        color: #8c6d2c;
        flex: 1;
        overflow: hidden;
        /*min-inline-size: 0;*/
        text-decoration: none;
        /*text-overflow: ellipsis;*/
        /*white-space: nowrap;*/
        &:hover {
            text-decoration: underline;
        }
    }
}
.browse-card-header {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-block-end: .5rem;
    padding: 1.25rem 1.5rem 0 1.5rem;
    h2,h3 {
        color: #353331;
        font-family: 'Cormorant Garamond', serif;
        font-size: 1.5rem;
        margin: 0;
        span {
            color: #777675;
            display: block;
            font-family: 'Open Sans', sans-serif;
            font-size: .875rem;
            font-weight: normal;
            text-transform: uppercase;
        }
    }
}
.browse-card-count {
    color: #888;
    display: none;
    flex-shrink: 0;
}
.browse-card-term-count {
    color: #bbb;
    flex-shrink: 0;
    margin-inline-start: .5rem;
}
.browse-card-footer {
    border-block-start: 1px solid #ecebea;
    padding: 1rem 1.5rem;
    text-align: right;
}

.landing-all {
    color: #555351;
    margin: 0 auto;
    padding: 1rem 0 2rem 0;
    text-align: center;
    a {
        color: #8c6d2c;
    }
}

footer {
    color: #555351;
    text-align: center;
    a {
        color: #8c6d2c;
    }
}

/* Browse type bar */
.browse-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding-block: 0 1rem;
    a {
        background-color: #fff;
        border-radius: 4px;
        color: #353331;
        font-size: .85rem;
        padding: .3rem .75rem;
        text-decoration: none;
        &:hover {
            background-color: #e3e2e1;
        }
        &.active {
            background-color: #353331;
            color: #fff;
        }
    }
}

.sort-link { color: #8c6d2c; font-size: .9rem; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.sort-link-active { color: #353331; font-weight: 600; pointer-events: none; }
.sort-active { color: #353331 !important; font-weight: 600; pointer-events: none; text-decoration: none !important; }

.record-title-row { align-items: baseline; display: flex; gap: .5rem; justify-content: space-between; }
.record-title-row a { flex: 1; }

/* Browse pages */
.browse-heading { color: #353331; font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; margin-block: 0 .75rem; }

/* Subjects page */
.subjects-header { margin-block-end: .75rem; }
.subjects-header h2 { color: #353331; font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; margin-block: 0; }
.subjects-term-header { margin-block-end: 1.25rem; }
.subjects-term-header h2 { color: #353331; font-family: 'Cormorant Garamond', serif; font-size: 1.7rem; margin-block: .25rem .15rem; }
.subjects-count { color: #666; font-size: .88rem; margin-block: 0 1rem; }
.back-link { color: #8c6d2c; font-size: .88rem; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.type-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-end: 1rem; }
.type-tabs a { background: #fff; border: 1px solid #ecebea; border-radius: 4px; color: #555; font-size: .88rem; padding: .3rem .7rem; text-decoration: none; }
.type-tabs a:hover { background: #e2e0df; color: #353331; }
.type-tabs a.active { background: #353331; border-color: #353331; color: #efeeed; }

.term-list { list-style: none; margin: 0; padding: 0; }
.term-list li {
    background-color: #fff;
    border: 1px solid #ecebea;
    border-radius: 4px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: .92rem;
    margin-block-end: .25rem;
    padding: .5rem;
}
.term-list li a { color: #8c6d2c; flex: 1; min-inline-size: 0; overflow: hidden; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.term-list li a:hover { text-decoration: underline; }
.term-count { color: #aaa; flex-shrink: 0; font-size: .8rem; margin-inline-start: .5rem; }

.ead-bookmark {
    position: absolute;
    top: 5rem;
    right: 5rem;
}

.bookmarks-bar {
    p {
        margin-block: 0 1rem;
    }
}

.bookmarks-remove-btn,
.bookmarks-clear-btn {
    background: none;
    border: none;
    /*color: #777675;*/
    color: #dfdedd;
    cursor: pointer;
    font-size: 1rem;
    margin: 0;
    padding: .25rem;
    &:hover {
        color: #fff;
    }
}
.bookmarks-remove-btn {
    font-size: 1.25rem;
}
.bookmarks-clear-btn {
    float: right;
    margin: 1rem 2rem;
    padding: 0;
}

.bookmarks-btn {
    background: none;
    border: none;
    color: #cfcecd;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    padding: .2rem;
    transition: color .15s;
    &:hover svg {
        fill: #8c6d2c;
        stroke: #8c6d2c;
    }
}
.bookmarks-btn-saved {
    color: #8c6d2c;
    svg {
        fill: currentColor;
    }
}
.bookmarks-btn-small {
    padding: .125rem;
}
