html{ scroll-padding-top: 65px; } /* For anchors to avoid header */
body{
    background-color: #343a40;
    color:#f8f9fa;
    --footer-height: 39px;
    /* 40px for inner navbar + 0.5rem top + 0.5rem bottom nav margin + 1rem page top margin + 1rem footer bottom margin + footer */
    --page-visible-max-padded-height-no-footer: calc(100vh - 40px - 3rem);
    --page-visible-max-padded-height: calc(var(--page-visible-max-padded-height-no-footer) - var(--footer-height));
    --page-content-start-height: calc(40px + 2rem);
    font-family: "Noto Sans", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    font-size: 0.95rem;
}
#app-main-navbar-collapse{
    height:40px;
    align-items:center;
}

@media (max-width: 380px) {
    body{
        /* Bigger footer on xs to see wrapped text */
        --footer-height: 59px;
    }
}
footer{
    min-height: var(--footer-height);
    max-height: var(--footer-height);
    overflow: hidden;
}

h1,h2,h3{
    font-family: "Noto Serif", serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-variation-settings:"wdth" 100;
}
h1{ font-size: 1.8rem; }
h2{ font-size: 1.6rem; }
h3{ font-size: 1.4rem; }
h4{ font-size: 1.2rem; }
h5{ font-size: 0.94rem; font-weight: bold; }
@media (min-width: 768px) {
    h1{ font-size: 2.3rem; }
    h2{ font-size: 2rem; }
    h3{ font-size: 1.75rem; }
}
h1+h2{
    margin-top:0;
}
.lead{
    font-size:1.16rem;
}
.text-muted-dark-bg {
    color:#bfbfbf!important;
}

/*dark back*/
a { color: #3a8eb3; }
a:hover{ color: #5ca2c1; text-decoration: underline; }
/*white back*/
.card a { color: #0083bd; }
.card a:hover { color: #105e81; }

/* Overrule something in App Framework that doesn't play nicely with grids */
table td{ white-space: normal!important;}

.full-height-of-page{
    min-height: var(--page-visible-max-padded-height);
}

/* Main image on page */
.zoom-image,.non-zoom-image{
    width:100%;
    height:100%;
    overflow:hidden;
}
/* 40px is nav content. Nav has 0.5rem padding top/bottom. Then page has 1rem margin top/bottom. */
@media (min-width: 768px) {
    .page-height-sticky {
        top: var(--page-content-start-height);
        position: sticky;
        max-height: var(--page-visible-max-padded-height-no-footer);
    }
    /* Not in full screen mode */
    body > .zoom-image.page-height-sticky {
        position: initial;
        top: unset;
        max-height: unset;
    }
}
.non-zoom-image.preview-img{
    min-width:100px;
    min-height:100px;
}
.non-zoom-image.full-size-img,
.zoom-image.full-size-img{
    min-height:400px;
}
.non-zoom-image{
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


/* *** OpenSeaDragon styles *** */
.zoom-image .openseadragon-container svg {
    pointer-events: none!important;
}
.zoom-image .openseadragon-container svg * {
    pointer-events: visible;
}
.zoom-image .openseadragon-container path:hover {
    fill: #ffffff44;
    stroke: white;
}
.openseadragon-canvas {
    outline: none;
}
.zoom-image .tooltip {
    opacity: 0.8;
    max-width: 250px;
    background-color: rgb(255, 255, 255);
    position: fixed;
    display: none;
}
.zoom-image-full-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.9;
    z-index: 10;
}

.bg-black{
    background-color: #000!important;
}

/*Preview img layouts*/
.window-panel-set-scroll .preview-img {
    max-height:250px;
    max-width:250px;
}
.source-page-img {
    max-height:250px;
    max-width:100%;
}


/* *** Page layouts *** */
.panel-page-grid,
.window-page-grid,
.collection-grid {
    display: grid;
    grid-template-columns: 1fr;
}
.panel-page-grid {
    grid-template-areas:
        "summary"
        "image"
        "linked-panels"
        "stats"
        "source-text"
        "article-links"
        "collection-links";
}
.window-page-grid {
    grid-template-areas:
        "summary"
        "image"
        "stats"
        "source-text"
        "article-links"
        "collection-links";
}
@media (min-width: 768px) {
    .panel-page-grid,
    .window-page-grid {
        grid-template-columns: 5fr 1fr 4fr;
        grid-template-rows: 1fr;
        column-gap: 1rem;
    }
    .panel-page-grid {
        grid-template-areas:
          "summary          summary          image"
          "linked-panels    linked-panels    image"
          "stats            stats            stats"
          "source-text      source-text      source-text"
          "article-links    collection-links collection-links";
    }
    .window-page-grid {
        grid-template-areas:
          "summary          summary          image"
          "stats            stats            image"
          "source-text      source-text      source-text"
          "article-links    collection-links collection-links";
    }
}

.grid-summary {
    grid-area:summary;
}
.grid-image {
    grid-area:image;
}
.grid-linked-panels {
    grid-area:linked-panels;
    place-self: end stretch;
}
.grid-linked-panels .table-responsive { /*We probably won't have a table here forever, but for now*/
    border-radius: .25rem;
    margin-bottom: 0;
}
.grid-data-stats{
    grid-area:stats;
}
.grid-source-text {
    grid-area:source-text;
}
.grid-article-links{
    grid-area:article-links;
}
.grid-collection-links{
    grid-area:collection-links;
}

/* Stats tabular data */
.stats-list{
    margin:0;
    padding:0;
    list-style: none;
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(300px, auto));
    gap: 0.5rem 1rem;
}
@media (max-width: 410px) {
    .stats-list {
        grid-template-columns:1fr;
    }
}
.stats-list .stat-item {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 1rem;
    align-items: center;
}
.stats-list .stat-item .stat-label{
    font-weight: bold;
    color: #666;
    flex:1 1 180px;
}
.stats-list .stat-item .stat-value{
    flex:4 1 160px;
}


/* *** Collections page *** */
.collection-grid {
    grid-template-areas:
        "filters"
        "items";
    --item-border-width: 3px;
    --item-gap: 2rem;
    --filter-panel-width: 215px;
    --min-column-width: 175px;
}
@media (min-width: 768px) {
    .collection-grid {
        grid-template-columns: 1fr var(--filter-panel-width);
    }
    .collection-grid {
        grid-template-areas: "items filters";
    }
    .collection-grid .grid-filters {
        margin-top:1px; /*Compensate for the .card 1px border*/
    }
}
.collection-grid .grid-filters{
    grid-area:filters;
}
.collection-grid .grid-items{
    grid-area:items;
}
.collection-grid .grid-items .items{
    column-gap: var(--item-gap);
    column-count: auto;
    column-width: var(--min-column-width);
    margin-top: calc(0px - var(--item-gap) - var(--item-border-width)); /* Hide the border-top at the top of all columns, with :before, and offset the margin-top on each .item at top of a column */
}
.collection-grid .grid-items .items .item{
    margin-top: var(--item-gap);
    padding-top: var(--item-gap);
    page-break-inside: avoid;
    border-top: var(--item-border-width) solid #bfbfbf;
}
.collection-grid .grid-items .items :nth-child(1 of .item:not(.d-none)) {
    margin-top: 0 !important;
}
/* Hide the border-top at the top of all columns */
.collection-grid .grid-items .items:before{
    content: "";
    background: #ffffff;
    width: 100%;
    height: var(--item-border-width);
    display: block;
    column-span: all;
    top: var(--item-border-width);
    position: relative;
}
/*Show/hide filters*/
/*Default state if show on web and hide on mobile*/
.collection-grid.show-filters .grid-filters,
.collection-grid              > .show-filters-btn,
.collection-grid.hide-filters > .show-filters-btn{
    display: block;
}
.collection-grid              .grid-filters,
.collection-grid.hide-filters .grid-filters,
.collection-grid.show-filters > .show-filters-btn,
.collection-grid              .grid-items .show-filters-btn{
    display: none;
}
.collection-grid .item{
    display:flex;
    gap:1rem;
}
.collection-grid .item .preview-img{
    min-width: 130px;
    height:150px;
}
/* 15px = .container padding, 1.25rem = .card padding, 1px = .card border, var(--min-column-width)=175px, var(--item-gap)=2rem  */
@media (min-width: calc(175px * 2 + 15px * 2 + 1.25rem * 2 + 2rem + 2 * 1px)) {
    .collection-grid .item{
        display:block;
    }
    .collection-grid .item .preview-img{
        width:100%;
        height:170px;
    }
}
@media (min-width: 576px) {
    .collection-grid.hide-filters .grid-items .show-filters-btn,
    .collection-grid              .grid-items .show-filters-btn{
        display:block;
        position:absolute;
        top:1rem;
        right:1.25rem;
        width:var(--filter-panel-width);
    }
    .collection-grid.show-filters .grid-items .show-filters-btn{
        display:none;
    }
    .collection-grid.hide-filters{
        grid-template-columns: 1fr;
    }
    .collection-grid              .grid-filters .hide-filters-btn,
    .collection-grid.show-filters .grid-filters .hide-filters-btn{
        margin-top:1.25rem;
    }
}
@media (min-width: 768px) {
    .collection-grid.hide-filters .grid-filters,
    .collection-grid              .grid-items .show-filters-btn,
    .collection-grid.show-filters .grid-items .show-filters-btn{
        display: none;
    }
    .collection-grid              .grid-filters,
    .collection-grid.show-filters .grid-filters,
    .collection-grid.hide-filters .grid-items .show-filters-btn{
        display: block;
    }
    .collection-grid.hide-filters .grid-items .show-filters-btn{
        top:1.25rem;
    }
}



/* *** Expanding divs *** */
/* See also height-limit-overflow.js*/
.height-limit {
    overflow: hidden;
    transition: max-height 0.50s ease-in-out;
}
.height-limit-fade-100.overflowed:before,
.height-limit-fade-150.overflowed:before{
    content:'';
    position:absolute;
    left:0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to top, white, white 1rem, transparent);
}
.height-limit-fade-100.overflowed:before {
    height: 100px;
}
.height-limit-fade-150.overflowed:before {
    height: 150px;
}
.height-limit .expand-link {
    display:none;
}
.height-limit.overflowed .expand-link {
    display:block;
    content:'More';
    position: absolute;
    text-align:center;
    left: 0;
    right: 0;
    bottom:0;
    font-weight:bold;
    color:#444;
    cursor:pointer;
}


/* *** Horizontal scroll divs *** */
.horizontal-scroll{
    scroll-snap-type: x mandatory;
    overflow-x: scroll;
    display: flex;
    scroll-behavior: smooth;
    gap:1rem;
    scrollbar-width: none;  /* Firefox, Safari 18.2+, Chromium 121+ */
}
.horizontal-scroll::-webkit-scrollbar {
    display: none;  /* Older Safari and Chromium */
}
.horizontal-scroll .scroll-panel,
.horizontal-scroll .scroll-card {
    flex: none;
    scroll-snap-align: center;
}
.horizontal-scroll .scroll-card{
    width:250px;
}
.horizontal-scroll .scroll-panel{
    width: 80%;
}
@media (min-width: 768px) {
    .horizontal-scroll .scroll-panel{
        width: 90%;
    }
}
.horizontal-scroll .arrow-nav{
    min-width: 48px;
}
.horizontal-scroll .scroll-panel .nav-left,
.horizontal-scroll .scroll-panel .nav-right{
    cursor: pointer;
}
.horizontal-scroll .scroll-panel:first-of-type .nav-left,
.horizontal-scroll .scroll-panel:last-of-type .nav-right {
    cursor: auto;
    opacity: 0.3;
}


/* *** Misc *** */
.quote-border-left{
    border-left: 3px solid #ddd;
}
.source-img{
    max-width: 110px;
    max-height: 250px;
}

.btn svg {
    vertical-align: sub;
}


/* *** Collection badges *** */
.collection-badge {
    font-size: 1rem;
    font-weight: 700;
    line-height:1;
    display:inline-block;
    vertical-align: baseline;
    white-space: nowrap;
    transition: color .15s ease-in-out, background-color .15s ease-in-out;
    /* Fallback styles for Firefox, emulate Boostrap .badge */
    padding: .25em .4em;
    border-radius: 4px;
    background-color:#bfbfbf;
}
.collection-badge span{
    color:#232323;
}
a.collection-badge{
    background-color: #0083bd;
}
a.collection-badge span{
    color:#fff;
}
a.collection-badge:hover {
    /* Fallback styles for Firefox, emulate Boostrap .badge */
    background-color: #105e81;
}
a.collection-badge:focus {
    /* Fallback styles for Firefox, emulate Boostrap .badge */
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .5);
}
@supports (mask-border-source: url()) or (-webkit-mask-box-image-source: url()) {
    .collection-badge {
        /* Remove fallbacks */
        border-radius: 0;
        border-style: none;
        background: none;
        /* Modern style with mask */
        --label-shape-hole: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='135 -729 652 499'><path d='M192.62-232q-23.36 0-39.99-16.64Q136-265.29 136-288.66v-383.01q0-23.37 16.63-39.85T192.62-728h388.46q13.19 0 25 5.66 11.8 5.66 20.69 16.42l147.38 191.38q11.7 16.92 11.7 34.54t-11.7 34.54L626.77-254.08q-8.89 10.76-20.69 16.42-11.81 5.66-25 5.66z M580-479.5 m-50,0 a50,50 0 1,0 100,0 a50,50 0 1,0 -100,0 Z' fill-rule='evenodd'/></svg>");
        --label-shape: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='135 -729 652 499'><path d='M192.62-232q-23.36 0-39.99-16.64Q136-265.29 136-288.66v-383.01q0-23.37 16.63-39.85T192.62-728h388.46q13.19 0 25 5.66 11.8 5.66 20.69 16.42l147.38 191.38q11.7 16.92 11.7 34.54t-11.7 34.54L626.77-254.08q-8.89 10.76-20.69 16.42-11.81 5.66-25 5.66z' fill-rule='evenodd'/></svg>");
        --label-slice: 50% 17 50% 2;
        --label-width: 50% 19px 50% 2px;
        padding:.2rem .28rem .2rem .2rem;
        margin:-0.2rem -0.3rem -0.2rem -0.2rem;
        -webkit-mask-box-image-source: var(--label-shape);
        -webkit-mask-box-image-slice: var(--label-slice);
        -webkit-mask-box-image-width: var(--label-width);
        -webkit-mask-box-image-repeat: stretch;
        mask-border-source: var(--label-shape);
        mask-border-slice: var(--label-slice);
        mask-border-width: var(--label-width);
        mask-border-repeat: stretch;
    }
    a.collection-badge {
        /* Remove fallbacks */
        background: none;
    }
    a.collection-badge:hover {
        /* Remove fallbacks */
        background: none;
    }
    a.collection-badge:focus {
        /* Remove fallbacks */
        box-shadow: none;
        /* Modern style with mask */
        background-color: rgba(0, 123, 255, .5);
    }
    .collection-badge span{
        /* Modern style with mask */
        -webkit-mask-box-image-source: var(--label-shape-hole);
        -webkit-mask-box-image-slice:var(--label-slice);
        -webkit-mask-box-image-width: var(--label-width);
        -webkit-mask-box-image-repeat: stretch;
        mask-border-source: var(--label-shape-hole);
        mask-border-slice: var(--label-slice);
        mask-border-width: var(--label-width);
        mask-border-repeat: stretch;
        padding-right: 20px;
        padding-bottom: 5px;
        padding-top: 4px;
        padding-left: 6px;
        display: inline-block;
        transition: color .15s ease-in-out, background-color .15s ease-in-out;
    }
    .collection-badge span {
        /* Modern style with mask */
        background-color: #bfbfbf;
    }
    a.collection-badge span {
        /* Modern style with mask */
        background-color: #0083bd;
    }
    a.collection-badge span:hover {
        /* Modern style with mask */
        background-color: #105e81;
    }
}

/* ** Bootstrap blue kex override *** */
.page-item.active .page-link { /*panel set story pagination*/
    background-color: #0083bd;
    border-color: #0083bd;
}
.custom-control-input:checked~.custom-control-label::before {/* filter toggles*/
    color: #fff;
    border-color: #0083bd;
    background-color: #0083bd;
}

/* ** Cathedral window map SVG ** */
.cathedral-map svg text {
    font-size: 43px;
    fill: #aaaaaa;
}
.cathedral-map svg text.heading {
    fill: #ffffff;
    font-family: Arial-BoldMT, Arial;
    font-size: 35.16px;
    font-weight: 700;
}
.cathedral-map svg a text {
    fill: #3a8eb3;
}
.cathedral-map svg a text:hover {
    fill:#5ca2c1;
    text-decoration: underline #5ca2c1;
}