:root {
    --header-height: 200px;
    --footer-height: 32px;
    --background-color: #fff;
    /* desktop dropdown menus, pale yellow to set them apart from the page */
    --subnav-background: #fff;
    /*--subnav-background: #fff8d0;*/
    --logo-height: 80px;
    /* keep the logo image's 394x116 aspect ratio so it isn't cropped */
    --logo-width: calc(var(--logo-height) * 394 / 116);
    --logo-red: #cc0202;
    --hyperlink-regular: #157614;
    --hyperlink-hover: #23c036;
    --hyperlink-visited:#054c04;
}

@font-face {
    font-family: Montserrat;
    src: url("Montserrat-VariableFont_wght.ttf");
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: NotoCondensed;
    src: url("Noto_Sans/static/NotoSans_Condensed-Regular.ttf");
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: NotoCondensed;
    src: url("Noto_Sans/static/NotoSans_Condensed-Bold.ttf");
    font-weight: bold;
    font-display: swap;
}

body {
    background-color: var(--background-color);
    font-family: NotoCondensed, "Arial Narrow", sans-serif;
    font-size: 22px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 16px);
    min-height: calc(100dvh - 16px);
}

#header {
    margin-bottom: 2rem;
}

#logo {
    height: var(--logo-height);
    width: 80%;
    position: relative;
}

#logo img {
    width: 80%;
    height: 100%;
    object-fit: contain;
    object-position: left-center;
    z-index: 1;
    position: absolute;
}

summary.navbar::after {
        content: "\2630";
}

details[open] > summary.navbar::after {
        content: "\00D7";
        font-size: 1.8em;
}

/* hide content when menu is open on mobile */
#header:has(details[open]) ~ #content, #header:has(details[open]) ~ #footer {
    display: none;
}

/* hide the disclosure triangle: ::marker for Chrome/Firefox,
   ::-webkit-details-marker for Safari */
summary {
    list-style: none;
    cursor: pointer;
}

summary::marker {
    content: "";
}

summary::-webkit-details-marker {
    display: none;
}

#main-nav {
    overflow: hidden;
    background-color: inherit;
    font-weight: bold;
    font-size: 30px;
    font-family: inherit;
    margin: 0px;
}

.navbar a, .subnav-heading{
    border: none;
    background-color: inherit;
    color: #000;
    display: block;
    font-family: inherit;
    font-size-adjust: .7;
    font-weight: inherit;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    opacity: 100%;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.active {
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

.subnav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.navbar a.navlink {
    color: #666;
    font-size-adjust: 0.5;
}

.subnav li:last-child a.navlink {
    margin-bottom: 0;
}

#content {
    margin-left: 10%;
    margin-right: 10%;
    font-family: NotoCondensed, "Arial", sans-serif;
}

#content h2 {
  scroll-margin-top: var(--header-height); /* Modern browsers */
  padding-top: var(--header-height); /* Fallback for older browsers */
  margin-top: calc(-1 * var(--header-height)); /* Fallback for older browsers */
  font-weight: bold;
  font-family: NotoCondensed, "Arial Narrow", sans-serif;
}

#content a {
    color: var(--hyperlink-regular);
    text-decoration: none;
}

#content a:visited {
    color: var(--hyperlink-visited);
}

#content a:hover {
    color: var(--hyperlink-hover);
    transition: color 0.2s;
}

#content a:active {
    color: coral;
    transition: color 0s;
}

.homepage {
    font-family: Montserrat, sans-serif;
    font-weight: 450;
    font-size: 1.5rem;
    line-height: 2.5rem;

    text-align: center;
}

body::before {
    margin: 3%;
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("BDDP__Black%20Logotype_96dpi.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.07;
    z-index: -1;
}

#content .homepage h2 {
    font-size: 2rem;
    font-family: inherit;
    font-weight: 750;
}

/* on pages with several sections, only one is shown: the one named in
   the URL (#0, #1, ...), or the one containing the URL's target (e.g. a
   footnote, #fn:1). With no target in the URL, show the first section */
.section:not(:target) {
  display: none;
}

.section:target, .section:has(:target) {
  display: block;
}

#content:not(:has(:target)) > .section:first-of-type {
  display: block;
}

#footer {
    font-family: NotoCondensed, Arial, sans-serif;
    font-size: 1.2rem;
    background-color: #000;
    color: #ddd;
    margin: auto -8px -8px;
    min-height: var(--footer-height);
    box-sizing: border-box;
    padding: 4px 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 4em;
    row-gap: 0.5em;
    text-align: center;
}

@media screen and (max-width: 799.98px) {
    /* the footer wraps to three lines on phones */
    :root {
        --footer-height: 62px;
    }

    /* narrow side margins so the text uses more of the screen */
    #content {
        margin-left: 16px;
        margin-right: 16px;
    }

    /* put the menu toggle in the top right corner, level with the logo
       (8px is the default body margin above the logo) */
    summary.navbar {
        position: absolute;
        top: 8px;
        right: 16px;
        width: var(--logo-height);
        height: var(--logo-height);
        line-height: var(--logo-height);
        text-align: center;
        font-size: 40px;
    }

    /* keep the logo clear of the toggle: on very narrow screens it
       shrinks to fit the space to the left of it */
    #logo {
        width: calc(100% - var(--logo-height) - 8px);
    }

    #main-nav:has(#navbar[open]) {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100dvh - 16px - var(--logo-height) - var(--footer-height));
        margin-bottom: var(--footer-height);
    }

    /* hide the page content while the mobile menu is open */
    #main-nav:has(#navbar[open]) ~ #content {
        display: none;
    }
}

@media screen and (prefers-reduced-motion: no-preference) {
    .subnav {
        --subnav-duration: 0.3s;
        display: grid;
        grid-template-rows: 1fr;
    }

    .subnav ul {
        min-height: 0;
        overflow: hidden;
    }

    details[open] > .subnav {
        animation: subnav-open var(--subnav-duration) ease-out;
    }

    /* "forwards" holds the drawer at zero height until the script closes it */
    details[open].closing > .subnav {
        animation: subnav-close var(--subnav-duration) ease-in forwards;
    }
}

@media screen and (min-width: 800px) and (prefers-reduced-motion: no-preference) {
    .subnav {
        --subnav-duration: 0.15s;
    }
}

@keyframes subnav-open {
    from {
        grid-template-rows: 0fr;
        opacity: 0;
    }
    to {
        grid-template-rows: 1fr;
        opacity: 1;
    }
}

@keyframes subnav-close {
    from {
        grid-template-rows: 1fr;
        opacity: 1;
    }
    to {
        grid-template-rows: 0fr;
        opacity: 0;
    }
}

@media screen and (min-width: 800px) {

    /* give smaller margin on desktop */
    #header {
        margin-bottom: 3rem;
    }

    #header:has(details[open]) ~ #content {
        display: block;
    }

    #header:has(details[open]) ~ #footer {
        display: flex;
    }

    /****layout****/

    #logo {
        width: var(--logo-width);
        float: left;
        margin-right: 3rem;
    }

    #logo img {
        width: 100%;
        height: auto;
    }
    .navbar a, .navbar details {
        float: left;
    }

    .navbar details {
        position: relative;
    }

    /* shrink the nav text on narrower screens so all items fit on one
       line beside the logo; below ~1100px they wrap onto a second line */
    #main-nav {
        overflow: visible;
        display: flow-root;
        container-type: inline-size;

    }

    /* scale navbar font so it doesn't wrap around on smaller/zoomed in screens */
    #navbar {
        font-size: min(30px, 100cqi / 41);
    }

    /****navigation links ****/

    /* navbar is kept open by nav.js; hide its toggle */
    summary.navbar {
        display: none;
    }

    .subnav {
        position: absolute;
        z-index: 1;
        background-color: var(--subnav-background);
        left: 0;
        right: 0;
    }

    .navbar a, .subnav-heading {
        width: auto;
        padding: 0.53em 0.9em;
    }

    .navbar a.navlink {
        float: none;
        opacity: 80%;
        width: auto;
        padding-top: 10px;
        padding-bottom: 10px;
        margin: 0;
        font-size-adjust: 0.5;
        line-height: 1.2;
    }

    /* for subnav headings, darken on hover */
    .navbar a.navlink:hover, .subnav-drawer:hover .subnav-heading {
        opacity: 100%;
        color: black;
        transition: opacity 0.2s;
    }

    .homepage {
        margin: 5% 5%;
        line-height: 3.5rem;
        font-size: 2.3rem;
    }

    #content .homepage h2 {
        font-size: 2.3rem;
    }
}

/* anchor navbar to the right of the screen on large screens */
@media screen and (min-width: 2800px) {
    #navbar {
        width: max-content;
        margin-left: auto;
    }
}
