/* components customization */
body{
    --pb-lang-input-color: black;
}

main {
    min-height: calc(100vh - var(--pb-menubar-height) - 100px);
    display: block;
    padding: var(--pb-menubar-height) 1em 1em 1em;
}

main.homepage {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto auto auto auto auto;
    gap: 10px 10px;
    justify-content: space-evenly;
    max-width: 980px;
    margin: 1rem auto 1rem auto;
}
strong{
    font-size: 1.2rem;
    font-weight: bold;
}
@media (max-width: 1023px) {
    
    main {
        padding: var(--pb-menubar-height) 1em 1em 1em;
    }
    
    main.homepage {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        gap: 4px;
        height: auto;
        margin: 32px 10px 0 10px;
    }
    .homepage a.facsimile, .homepage a.facsimile:link,
    .homepage a.quote, .homepage a.quote:link {
        display: none;
    }
    .doclist {
        margin-bottom: 20px;
    }
    .documents {
        padding-left: 10px;
    }
    .documents .label {
        display: none;
    }
    .toolbar pb-search {
        padding-left: 0;
    }
    #facets, #status {
        display: none;
    }
}

.toolbarPagePrev, .toolbarPageNext, .toolbarPageDisplay, .pageSyncSelector {
    user-select: none;
    cursor: pointer;
    height: 30px;
    font: var(--pb-base-font);
    line-height: 30px;
    text-align: center;
    background-color: var(--bernoulli-panel-grey);
    display: block;
    transition: 200ms;
}

.toolbarPagePrev:hover, .toolbarPageNext:hover, .toolbarPageDisplay:hover, .pageSyncSelector:hover {
    background-color: #e3e3e3;
}


.toolbarPagePrev {
    width: 20px;
    border-radius: 5px 0px 0px 5px;
}

.toolbarPageNext {
    width: 20px;
    border-radius: 0px 5px 5px 0
}

.toolbarPageDisplay {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 70px;
    padding: 0px;
    color: black;
    -webkit-text-fill-color: currentColor;
    text-align-last: center;
}

.pageSyncSelector {
    width: 30px;
    border-radius: 5px;
    margin: 0px 5px 0px 5px;
}

.pageSyncSelector.isActivated {
    background-color: var(--pb-menubar-background-color);
    color: var(--pb-menubar-color);
}

.pageSyncSelector.isActivated:hover {
    background-color: black;
}



@media (max-width: 500px) {
    main {
        padding: var(--pb-menubar-height) 5px 1em 5px;
    }
}

body {
    --pb-view-height: calc(100vh - 212px);
}

/* Search mask*/

.search-result-tag {
    color:white;
    padding: 3px;
    margin-right: 0.5em;
}

.search-result-tag.field-metadata { background-color:#777777; }
.search-result-tag.field-commentaries { background-color: var(--bernoulli-red); }
.search-result-tag.field-normalized { background-color:#35424b; }
.search-result-tag.field-diplomatic { background-color:teal; }


#scope ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

pb-search::part(input) {
    height: 30px;
    border-radius: 5px;
    font: inherit;
    background-color: #5d5d5d;
    color: white;
    padding: 5px;
    border: 2px solid #5d5d5d;
    transition: 100ms;
}

pb-search::part(input):hover {
    outline: none;
    border: 2px solid grey;
}

pb-search::part(input):focus-visible {
    outline: none;
    border: 2px solid #bebebe;
}

/* Edition */


pb-panel::part(select) {
    font: inherit;
    border: none;
    height: 30px;
    border-radius: 5px;
    background-color: var(--bernoulli-panel-grey);
    width: 100%;
    min-width: 10px;
    transition: background-color 200ms;
}


pb-panel::part(select):hover {
    background-color: #e3e3e3;
}

pb-panel::part(select):open {
    background-color: var(--bernoulli-panel-grey);
}

pb-panel::part(nav) {
    column-gap: 5px;
}

pb-panel::part(ul) {
    column-gap: 0px;
}

.edition pb-grid {
    width: 100%;
    --pb-content-theme: {
        font-family: var(--pb-serif-font-family);
        font-size: 14pt;
        line-height: 1.42857143;
        margin: 0 16px;
}

}

.content-body {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0;
}


.edition .content-body {
    width: calc(100% - 32px);
    position: relative;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.edition .breadcrumbs pb-popover{
    margin-left:1rem;
}

.edition ._pb_panel {
    height: calc(100% - var(--panel-navbar-height));
    background-color: var(--bernoulli-panel-grey);
    border-radius: 5px;
}

.edition .content-body pb-view {
    flex: 1 1;
    --pb-footnote-color: var(--pb-color-start)
}
.edition pb-panel {
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.edition .flex-for-add-panel-button {
    display: flex;
    flex-wrap: nowrap;
}

.edition .add-panel-button {
    border-radius: 5px;
    width: 2.5%;
    min-width: 20px;
    margin-bottom: 16px;
    margin-top: calc(16px + var(--panel-navbar-height));
    transition: 200ms;
    text-orientation: mixed;
    background-color: var(--bernoulli-panel-grey);
}


.edition .add-panel-button:hover {
    background-color: #e3e3e3;
}

.edition .add-panel-button .add-panel-label {
    writing-mode: vertical-rl;
    display: none;
    transition: 200ms;
}

.edition .add-panel-button:hover .add-panel-label{
    display: inline;
}

.edition .add-panel-button:hover iron-icon {
    display: none;
}


@media (max-width: 500px) {

    .edition pb-grid {
        display: block;
    }

    .edition pb-panel {
        margin-bottom: 20px;
    }

    .edition .flex-for-add-panel-button {
    display: block;
    }   

    .edition .add-panel-button {
    width: calc(100% - 32px);
    margin: 0px 16px 0px 16px;
    height: 50px;
    background-color: var(--bernoulli-panel-grey);
    writing-mode: horizontal-tb;
    }


    .edition .add-panel-button .add-panel-label {
        writing-mode: horizontal-tb;
    }
    
}

.content-body #facsimile {
    flex: 1 1;
    height: 100%;
}

#facsimile > div{
    height: 100%;
}

#facsimile > div h1{
    font-family: var(--bernoulli-base-font-family-bold)
}

@media (max-width: 300px) {
    #facsimile {
        display: none;
    }
}

.tify {
    background: transparent !important;
}

.tify-header {
    box-shadow: none !important;
}

.tify-header-column.-pagination {
    visibility: collapse;
}

/*overriding the tify styling because I always want the buttons to be at the bottom. If this is not desired, the "bottom" and "top" values can be removed and the buttons will jump to the middle if there is enough space. */
.tify .tify-scan-page-button.-next.-next,.tify .tify-scan-page-button.-previous.-previous{
    bottom: 0;
    top: auto;
    display: flex;
    height: 40px;
    width: 40px;
    padding: 0px;
    justify-content: center;
    transition: 100ms;
}

.tify .tify-scan-page-button.-next.-next {
    border-radius: 5px 0px 0px 0px;
}

.tify .tify-scan-page-button.-previous.-previous {
    border-radius: 0px 5px 0px 0px;
}

/* need to add the whole thing for .tify.-short as well otherwise the specificity of tify's native styling overrides bernoulli.css when the tify is .-short */
.tify.-short .tify-scan-page-button.-next.-next, .tify.-short .tify-scan-page-button.-previous.-previous{
    bottom: 0;
    top: auto;
    display: flex;
    height: 40px;
    width: 40px;
    padding: 0px;
    justify-content: center;
    transition: 100ms;
}

.tify.-short .tify-scan-page-button.-next.-next {
    border-radius: 5px 0px 0px 0px;
}

.tify.-short .tify-scan-page-button.-previous.-previous {
    border-radius: 0px 5px 0px 0px;
}



@media (min-width: 1024px) {
    
    .toolbar {
        display: none;
    }
    .panels {
        display: flex;
        flex-direction: row;
    }
    .indexpage .panels .doclist {
        flex: 2 auto;
        margin-right: 20px;
    }
}

.tp-title {
    font-family: "avenirblack", "Oswald", Verdana, "Helvetica", sans-serif;
    font-size: 36px;
    font-weight: 400;
    color: var(--bernoulli-red);
}

.tp-title span {
    color: #9e9e9e;
    font-size: 26px;
    margin-top: 12px;
}


.info-box {
    background-color: lightgrey;
    min-height: 10.5rem;
    margin: 0;
}

footer {
    font-size: smaller;
    background-color: var(--pb-menubar-background-color);
    color: #f0f0f0;
}

footer .footer-flex-container {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

footer .footer-logos {
    flex: 1 1 1000px;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-around;
}

footer .footer-logos a {
    transition: transform 0.2s ease;
    display: inline-flex;
    margin: 10px 1%;
    max-width: 100%;
}

footer .footer-logos img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
}

footer .footer-info {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 250px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

footer .footer-info a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;

}

.footer-logos a:hover {
    transform: scale(1.05);

}


.banner img {
    overflow: auto;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;

}



a {
    color: #ba1e1e;
}

figcaption {
    font-family: var(--paper-font-caption_-_font-family);
}

.homepage figcaption {
    font-family: "avenirblack";
    text-align: center;
    font-size: smaller;
}



.corresp-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4em;
    padding: 0 2em;
    
}

.corresp-nav a {
    text-decoration: none;
    font-weight: bold;
}

#prev {
    float: left;
}

#next {
    float: right;
}


/* Split lists */
pb-split-list::part(items) {
    margin-top: 1em;
    display:block !important;
    column-count: 2;
}

pb-split-list::part(items) span {
    display:block !important;
}

.split-list-item {
    display: block;
}

.ne {
    color: var(--bernoulli-red);
}

/* from homepage styles */
.row {
    grid-column: span 5;
    grid-row: 1;
}

.orte {
    background-color: #c3ac8e;
    max-height: 155px;
}

.personen {
    background-color:rgb(83, 175, 217);
    max-height: 155px;
}

.quote {
    background-color: #BA3B1A;
    grid-row: 2 / 5;
    grid-column: 1 / 4;
}

.quote a {
    color: white;
    text-decoration: none;
    font-size: 14pt;
}

.quote i {
    position: absolute;
    top: 10px;
}

.bottom {
    margin-top: 15px;
}

.quote .bottom {
    position: absolute;
    bottom: 18px;
}

.quote p {
    margin-bottom: 1.5em;
}

.facsimile {
    grid-row: 2 / 5;
    grid-column:  4 / 6;
    background-position: top left;
    background-repeat: no-repeat;
    background-attachment: 0 0;
    background-size: auto 100%;
    padding: 0 !important;
}

.facsimile img {
    height: 100%;
    width: 100%;
}

.box {
    display: block;
    position: relative;
    padding: 10px;
    margin: 0;
    padding-left: 1em;
}

.box i {
    display: block;
    font-size: 38px;
    opacity: .5;
    color: white;
}

.box h1 {
    font-size: 2em;
    margin-bottom: 0;
}

.box div {
    font-size: var(--pb-base-font-size);
}

.box .source {
    font-size: var(--pb-font-size-small);
}

.gallery {
    grid-column: span 5;
    grid-row: 6;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding-top: 1em;
    margin-bottom: 4em;
}

.gallery figure {
    margin: 0;
}

.gallery img {width: 7.5em;}

.teaser {
    line-height: 27px;
    text-align: justify;
}

@media (min-width: 1024px) {
    teaser {
        font-size: var(--pb-heading-h4-font-size);
    }
}

.homepage a, .homepage a:link {
    display: block;
    text-decoration: none;
    color: white;
} 

/* from index page */

.indexpage {
    
aside {
    max-width: 34rem;
}

pb-results {
    overflow: scroll;
    margin: 0 20px;
    height: calc(100vh - 128px);
}

.panels {
    margin-bottom: 40px;
}

.panels .doclist {
    margin: 0;
    --paper-tabs-selection-bar-color: #607D8B;
    --paper-tab-content: {
        font-family: "avenirbook", "Oswald", Verdana, "Helvetica", sans-serif;
        font-weight: 400;
    }
    ;
    --paper-card-header: {
        color: #393939;
    }
    ;
    --paper-card-header-text: {
        font-family: "avenirblack", "Oswald", Verdana, "Helvetica", sans-serif;
        font-size: 20px;
        font-weight: 400;
    }
    ;
}

.panels .doclist .card-content {
    padding: 0;
}

.panels .doclist .browse {
    display: flex;
    flex-direction: row;
    padding: 0;
}

#document-list {
    margin-left: 5em;
}


.parent-link iron-icon {
    padding-right: 4px;
}

.parent-link {
    display: block;
    margin-bottom: 10px;
    margin-top: 16px;
    padding: 6px 0;
    border-bottom: thin solid var(--paper-grey-300);
}

.documents ul {
    list-style: none;
}

.documents app-toolbar {
    @apply --layout-start-justified;
    font-size: 14px;
    margin-top: 10px;
    padding-left: 0;
}

.documents div {
    margin: 0;
}

.documents .error {
    color: #c02020;
}

.documents a,
.documents a:visited {
    color: #ba3b1a;
    text-decoration: none;
}

.documents li {
    display: flex;
    flex-direction: row;
    margin-bottom: 10px;
    padding: 6px 0;
    border-bottom: thin solid var(--paper-grey-300);
}

.documents li:last-child {
    border: none;
}

.documents .document-select {
    flex: 0 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "avenirblack", "Oswald", Verdana, "Helvetica", sans-serif;
    font-weight: 400 !important;
    line-height: 1.2;
}

h5 {
    font-size: 16px;
    margin: 0;
}

#facets, #status {
    flex: 0;
    margin: 0 2em 0 0;
    font-family: "avenirbook"
}

#facets h3, #scope h3, h3 {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 11.5pt;
}


#facets table, #status table {
    font-size: 14px;
}

#facets table table {
    padding-left: 16px;
    width: 100%;
}

#facets table td, #status table td {
    padding: 4px 0;
}

#facets table td:nth-child(2), #status table td:nth-child(2){
    color: #808080;
    text-align: right;
    padding-left: 1em;
    vertical-align: middle;
}

#status table {
    width: 100%;
    font-family: "avenirbook"
}

}

/* from errorpage. tag style with attribute include="pb-common-styles" */
body.errorpage {
    --pb-link-theme: {
        text-decoration: none;
        color: black;
    };

    --pb-content-theme: {
        margin-right: 32px;
    };

    --paper-card-header: {
        font-family: "Oswald",Verdana,"Helvetica",sans-serif;
        background-color: #607D8B;
    };

    --paper-card-header-color: #F0F0F0;
}

.errorpage .tp-title {
    font-family: "Oswald",Verdana,"Helvetica",sans-serif;
    font-size: 36px;
    font-weight: 400;
}

.errorpage pre {
    font-family: "Ubuntu Mono",Menlo,Consolas,Courier,monospace;
    font-size: 14px;
    width: 100%;
    overflow: auto;
    white-space: pre-wrap;
}

.errorpage section {
    margin: 0 20px;
}
.errorpage .content-body {
    position: relative;
    display: flex;
    justify-content: center;
}

/* Register pages*/


main.register-places {
    --pb-highlight-color: #ba1e1e;
    padding-left:0;
    padding-right:0;

    pb-leaflet-map {
        display: block;
        height: 40vh;
        width: 100vw;
        z-index: 10;
    }

    .list {
        height: 60%;
        max-width: 41.24rem;
        margin: 0 auto;
        overflow: auto;
        margin-top:40vh
    }

    [slot=controls] {
        display: flex;
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }

    pb-split-list::part(items) {
        margin-top: 1em;
    }

    .place iron-icon {
        margin-left: 1em;
        --iron-icon-height: 22px;
    }

    .place {
        margin-bottom: 0.5em;
    }

    @media (max-width: 767px) {
        .list {
            --pb-categorized-list-columns: 1;
            max-width: auto;
            margin-left: 10px;
            margin-right: 10px;
        }

        form {
            display: block;
        }
        form label {
            margin: 0;
            display: block;
        }
    }
}

main.register-people {

    -pb-highlight-color: #ba1e1e;
    width: 60%;
    margin: auto;


    .transcript {
        max-width: none;
    }

    pb-custom-form {
        margin-bottom: 1em;
    }
    
    a {
        color: #ba1e1e;
        text-decoration: none;
    }
    
    
    @media (max-width: 767px) {
        .people-list .list {
            grid-template-columns: auto;
        }

        form {
            display: block;
        }
        form label {
            margin: 0;
            display: block;
        }
        .people-list header {
            display: flex;
            flex-wrap: wrap;
        }

    }
}

pb-leaflet-map {
    display:block;
    height: 25em;
    width: 25em;
    position: absolute;
    top: 3em;
    right: 2em;
    z-index: 10;
    margin: 0;
    left:0;
}

/* Briefwechsel*/

    .bio {
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
    }

.briefwechsel {

    section {
        margin-bottom: 3em;

    }
    
    .info {
        width: 100%;
        margin-top: 3rem;
    }

    .info > div {
    margin: 1em;
    }
    
}

/* Briefwechsel and Korrenpondez */

 .grid.bio {
    display: grid;
    grid-template-columns: 1fr 2fr;
    column-gap: 2em;
    
} 

.overview {
    background-color: var(--bernoulli-red);
    color: white;
    padding: 0 0.5em 0.5em 0.5em;
    padding: 1rem;
}

.flex {
    display: flex;
}

.zero {
    margin: 0;
    padding: 0;
}

.card {
  overflow: hidden;
  margin: 0 auto;
}

.card img {
    height: 10.5rem;
}

.card-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.5rem 1rem;
}

.card-description.expanded {
  -webkit-line-clamp: unset;
}

.read-more {
  display: block;
  margin: 1rem;
  background-color: var(--bernoulli-red);
  border: none;
  color: white;
  cursor: pointer;
  font-weight: bold;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.read-more:hover {
  background-color: #0051a3;
}

.paper-card {
    box-shadow: rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px, rgba(0, 0, 0, 0.2) 0px 3px 1px -2px;
    border-radius: 2px;
    margin: 0 0 2em 0;
}
    
.paper-card .header {
    color: white;
    position: relative;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    overflow: hidden;
    background-color: var(--bernoulli-red);
    height: 3rem;
    padding-left: 16px;
    font-weight: 400;
    font-family: var(--bernoulli-base-font-family-bold);
    font-size: 16px;
}
    
.paper-card .title-text {
    padding: 16px 0;  
    display: inline-block;
    }
    
.paper-card-content {
    margin: 1em;
    padding-bottom: 1em;
}

.briefe {
    column-count: 2;
}

/* Static page (documentation) */

.static {
    position: relative;
    display: flex;
    justify-content: center;
}

.static pb-navigation {
    position: fixed;
    bottom: 45%;
    --paper-fab-background: #35424b;
    color: white;
}

.static pb-navigation[direction=backward] {
    left: 20px;
}

.static pb-navigation[direction=forward] {
    right: 20px;
}

@media (max-width: 769px) {
    .static pb-navigation {
        display: none;
    }
}

/* Search page */

.search {
    display: flex;
    flex-direction: row;
    margin-top: 10px;


.search-panel {
    flex: 1 1;
    margin: 0 20px;
}

.search-panel paper-card {
    width: 100%;
}

#results {
    flex: 2 1;
    overflow: scroll;
    margin: 0 20px;
    height: calc(100vh - 140px);
}

#results paper-card {
    width: 100%;
    margin-bottom: 15px;
    padding: 8px;
}

#results header {
    display: flex;
    justify-content: flex-start;
}
#results .count {
    margin-right: 20px;
    font-weight: bold;
}
.breadcrumb:link, .breadcrumb:visited {
    text-decoration: none;
    color: var(--paper-grey-600);
}
.breadcrumb:before {
    content: '&gt;';
    padding: 0 8px;
    font-weight: bold;
}
.breadcrumb:first-child::before {
    content: '';
}
.matches {
    display: table;
    margin-left: 20px;
    margin-top: 10px;
    font: var(--pb-results-body-font);
}
.matches p {
    display: table-row;
}
.matches p * {
    display: table-cell;
    padding: 4px 8px;
}

.hi {
    display: block;
}

#download-button, .menu-edit-odd {
    display: none;
}
}
#desktop-lang details summary{
    --pb-lang-input-color: white;
    color:var(--pb-lang-input-color);
}
.leaflet-container {
    z-index: 10;
}
