body {
    background: #656565;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

#wrapper {
    display: flow-root;
    position: relative;
    width: min(100%, 980px);
    padding-bottom: 1rem;
}

#menu {
    height: auto;
    min-height: 41px;
    width: 100%;
}

#content {
    display: flow-root;
}

#content :is(#banner, #banner_age) {
    width: auto;
}

#content #main_container {
    box-sizing: border-box;
    max-width: 100%;
}

/* Bind the old illustrations to the page frame so they track the article. */
#content :is(#age_right, #eggs_right) { left: 58%; }
#content #Pied_Oystercatcher_right { left: 57%; }

#content .mcePaste {
    display: none;
}

/* The breeding articles' fixed-height wrappers cannot contain the restored videos. */
#content > div:has(#eggs_right, #age_right[src*="Chicks_files/"]),
#content #container > div:has(#eggs_right, #age_right[src*="Chicks_files/"]) {
    display: flow-root;
    height: auto !important;
}

#content td:has(.eggs1) {
    text-align: center;
    vertical-align: middle;
}

#content td:has(.eggs1) img {
    position: static;
    float: none;
    margin: .25rem;
    vertical-align: middle;
}

#content .range-map {
    width: auto;
    height: auto;
    margin: 0 auto 1rem;
    background: none;
}

#content .range-map img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

#content .range-map > a {
    display: block;
    text-align: center;
    color: #005b9d;
}

#content .range-map .detailed_maps {
    position: static;
    width: auto;
    height: auto;
    margin: .65rem 0;
    font-size: inherit;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: 1rem;
    transform: translateY(-200%);
    z-index: 10;
    padding: .5rem .75rem;
    background: white;
    color: #0056a3;
}

.skip-link:focus {
    transform: none;
}

.primary-menu, .submenu-list {
    list-style: none;
}

.menu-trigger {
    display: none;
}

.primary-menu {
    display: flex;
    flex-wrap: wrap;
    min-height: 41px;
}

.menu-item {
    position: relative;
}

.menu-label {
    --menu-toggle-width: 28px;
    display: flex;
    min-height: 41px;
}

.menu-label a {
    display: block;
    height: 27px;
    padding: 8px 34px 5px;
    color: #bbb;
    font: bold 11px Arial, Helvetica, sans-serif;
    text-decoration: none;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    flex: 0 0 var(--menu-toggle-width);
    box-sizing: border-box;
    height: 34px;
    color: #bbb;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
}

.js-menu .menu-toggle {
    display: inline-grid;
    place-items: center;
}

.menu-item a:focus-visible, .menu-toggle:focus-visible, .menu-trigger:focus-visible,
#photo-viewer button:focus-visible, a[data-lightbox]:focus-visible {
    outline: 2px solid #006ab6;
    outline-offset: -2px;
}

.submenu {
    display: grid;
    grid-template-rows: 1fr;
}

.submenu-list {
    min-height: 0;
    overflow: hidden;
}

.submenu a {
    display: block;
    padding: 3px 5px;
    color: #000;
    font: 10px Arial, Helvetica, sans-serif;
    text-decoration: none;
}

.submenu a:is(:hover, :focus-visible) {
    background: #737373;
    color: #fff;
}

.js-menu .submenu {
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows .3s ease, opacity .2s ease, visibility 0s linear .3s;
}

.js-menu [data-open] > .submenu {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

@media (min-width: 1024px) {
    .menu-label:has(> #menu1) { --menu-highlight: url("/modules/mod_swmenufree/images/button4_1.gif"); }
    .menu-label:has(> #menu27) { --menu-highlight: url("/modules/mod_swmenufree/images/button4_2.gif"); }
    .menu-label:has(> #menu2) { --menu-highlight: url("/modules/mod_swmenufree/images/button4_3.gif"); }
    .menu-label:has(> #menu50) { --menu-highlight: url("/modules/mod_swmenufree/images/button4_4.gif"); }
    .menu-label:has(> #menu41) { --menu-highlight: url("/modules/mod_swmenufree/images/button4_5.gif"); }

    .js-menu .menu-label:has(> .menu-toggle) {
        --menu-highlight-size: calc(100% - 8px) 35px;
    }

    .js-menu .menu-label > a:has(+ .menu-toggle) {
        padding-inline-end: calc(34px - var(--menu-toggle-width));
    }

    .menu-toggle {
        padding-bottom: 6px;
        font-size: 12px;
        line-height: 1;
    }

    .menu-item:is(:hover, :focus-within, [data-open]) > .menu-label {
        background: var(--menu-highlight, #fff) center top / var(--menu-highlight-size, auto) no-repeat;
    }

    .menu-item:is(:hover, :focus-within, [data-open]) > .menu-label > :is(a, .menu-toggle) {
        color: #000;
    }

    .submenu {
        position: absolute;
        top: 40px;
        left: 15px;
        width: max-content;
        min-width: 100%;
        background: #fff;
        border: 1px solid #666;
        box-sizing: border-box;
        z-index: 5;
    }

    .submenu-list li:first-child { padding-top: 1px; }
    .submenu-list li:last-child { padding-bottom: 1px; }

    :not(.js-menu) > .primary-menu .menu-item:not(:hover):not(:focus-within) > .submenu {
        visibility: hidden;
    }
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--thumb-width, 150px), 100%), 1fr));
    gap: .75rem;
    margin: 1rem;
}

.photo-gallery img {
    width: 100%;
    height: auto;
    max-height: var(--thumb-height, 140px);
    object-fit: contain;
}

.photo-gallery figcaption {
    margin-top: .4rem;
    font-size: .8rem;
}

.bird-list, .captioned-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
    align-items: start;
    gap: 1rem;
    margin: .75rem 0;
    text-align: center;
    list-style: none;
}

.bird-list {
    margin-inline: clamp(1rem, 4.5vw, 3rem);
    font-size: .875rem;
    font-style: italic;
}

.bird-list a {
    display: grid;
    justify-items: center;
    gap: .4rem;
    color: #005b9d;
}

.bird-list img, .captioned-photos img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.captioned-photos figcaption {
    margin-top: .4rem;
}

@media (min-width: 1024px) {
    #content[data-page="/"] #container_left {
        height: auto;
        min-height: 660px;
    }

    #content[data-page="/hoodie-info/hoodiehabitats"] #container > div:has(> #habitats_right1) {
        height: auto !important;
    }

    #content[data-page="/hoodie-info/hoodiehabitats"] .habitats_table:has(> .captioned-photos) {
        box-sizing: border-box;
        width: 100%;
        margin-inline: 0 !important;
        padding-inline: 30px;
    }

    #content[data-page="/hoodie-info/hoodiehabitats"] .captioned-photos {
        align-items: end;
    }

    #content[data-page="/hoodie-info/hoodiehabitats"] img {
        max-width: 100%;
        height: auto;
    }

    #content[data-page="/is-myhoodie-breeding"] #container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1rem;
    }

    #content[data-page="/is-myhoodie-breeding"] #container > p {
        grid-column: 1 / -1;
    }

    #content[data-page="/is-myhoodie-breeding"] :is(#container_left_bottom, #breeding_right) {
        grid-column: 1;
        width: auto;
        height: auto;
        padding: 0;
        text-align: start;
    }

    #content[data-page="/is-myhoodie-breeding"] .eggs {
        grid-column: 2;
        grid-row: span 2;
        position: static;
        width: auto;
        height: auto;
    }
}

.lapwing-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
    align-items: center;
    gap: 1rem;
    margin: .75rem 0;
}

.lapwing-comparison img, .eggs img {
    max-width: 100%;
    height: auto;
}

.pied-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.pied-overview-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 1rem;
}

.pied-overview img {
    max-width: 100%;
    height: auto;
}

.pied-overview-media > img {
    justify-self: center;
}

@media (min-width: 1024px) {
    .pied-overview {
        grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    }
}

.captioned-photos:has(.photo-pair) {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.photo-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: .5rem;
}

a[data-lightbox] {
    cursor: zoom-in;
}

.article-video {
    display: block;
    clear: both;
    margin: .5rem auto;
    text-align: center;
}

.article-video iframe {
    display: block;
    max-width: 100%;
    height: auto;
    aspect-ratio: var(--video-ratio, 500 / 288);
    margin-inline: auto;
    border: 0;
}

.article-video a {
    display: inline-block;
    margin-top: .25rem;
}

#photo-viewer {
    box-sizing: border-box;
    max-width: min(calc(100% - 1rem), 72rem);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    margin: auto;
    padding: 1rem;
    overflow: auto;
    overscroll-behavior: contain;
}

#photo-viewer[open] {
    animation: photo-open .3s ease-out;
}

#photo-viewer::backdrop {
    background: #000b;
}

#photo-viewer[open]::backdrop {
    animation: backdrop-open .3s ease-out;
}

@keyframes photo-open {
    from { opacity: 0; transform: scale(.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes backdrop-open {
    from { opacity: 0; }
    to { opacity: 1; }
}

#photo-viewer img {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    max-height: 68dvh;
    margin: .75rem auto;
    object-fit: contain;
}

.photo-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .75rem;
}

#photo-viewer button {
    min-height: 44px;
    padding: .4rem .75rem;
    font: inherit;
}

@media (max-width: 1023px) {
    #header {
        padding: 0;
    }

    #menu {
        background: #272727;
        color: #fff;
    }

    .js-menu .menu-trigger {
        display: flex;
        align-items: center;
        gap: .6rem;
        width: 100%;
        min-height: 48px;
        padding: .6rem 1rem;
        border: 0;
        background: linear-gradient(#545454, #292929);
        color: inherit;
        font: 600 1rem Arial, sans-serif;
        cursor: pointer;
    }

    .menu-icon {
        display: block;
        width: 1rem;
        height: .75rem;
        border-block: 2px solid currentColor;
        box-sizing: border-box;
        background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
    }

    .primary-menu {
        display: block;
        min-height: 0;
    }

    .js-menu .primary-menu:not([data-open]) {
        display: none;
    }

    .menu-label {
        border-top: 1px solid #666;
    }

    .menu-label a {
        flex: 1;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        min-height: 44px;
        height: auto;
        min-width: 0;
        padding: .65rem 1rem;
        color: inherit;
        font: 600 .9375rem/1.35 Arial, sans-serif;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .menu-label :is(a, button):is(:hover, :focus-visible),
    .menu-label a[aria-current="page"] {
        background: #484848;
    }

    .menu-toggle {
        flex: 0 0 48px;
        height: auto;
        min-height: 44px;
        border-left: 1px solid #666;
        color: inherit;
    }

    .menu-toggle span {
        display: inline-block;
        transition: transform .2s ease;
    }

    .menu-toggle[aria-expanded="true"] span {
        transform: rotate(180deg);
    }

    .submenu-list {
        background: #fff;
    }

    .submenu a {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        min-height: 44px;
        padding: .6rem 1.5rem;
        font: .9375rem/1.35 Arial, sans-serif;
        overflow-wrap: anywhere;
    }

    #content {
        box-sizing: border-box;
        max-width: 54rem;
        margin-inline: auto;
        padding: clamp(1rem, 4vw, 2rem);
        font-size: 1rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    /* Imported articles have inline sizes, layout tables and absolute-positioned photos. */
    #content :where(div, table, td, th, p, img, iframe) {
        box-sizing: border-box;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    #content :where(div, table, td, th, p, img) {
        float: none !important;
        position: static !important;
        width: auto !important;
        min-height: 0 !important;
        height: auto !important;
        margin-inline: 0 !important;
        padding-inline: 0 !important;
    }

    #content :where(div, table, td, th) {
        margin-block: 0 !important;
        padding-block: 0 !important;
    }

    #content :where(p, td, div[style*="text-align"]) {
        text-align: start !important;
    }

    #content :where(p, td, div)[style*="font-size"],
    #content :where(#container, #container_left, #container_left_hoodieinfo, #age_left,
        #Pied_Oystercatcher_left, .table_text, .style_3, .style_6, .copyright, .copyright_right) {
        font-size: inherit !important;
        line-height: inherit !important;
    }

    #content p {
        margin-block: .6rem;
    }

    #content .article-spacer {
        display: none;
    }

    #content br + br {
        display: none;
    }

    #content #age_right + p {
        padding-top: 0 !important;
    }

    #content[data-page="/faq"] #container > br {
        display: none;
    }

    #content[data-page="/faq"] #container > .style_13 {
        padding-top: .75rem;
    }

    #content :is(#pageheading, #pageheading2, #headline) {
        padding-block-end: .5rem !important;
    }

    #content #pageheading {
        font-size: clamp(1.9rem, 4.8vw, 2.25rem);
        line-height: 1.12;
    }

    #content #logo {
        font-size: clamp(2.5rem, 9vw, 3.75rem);
        line-height: 1.07;
    }

    #content #headline {
        padding-block: .35rem .8rem !important;
        font-size: clamp(1.05rem, 3.6vw, 1.375rem);
        line-height: 1.3;
    }

    #content a.style_04 {
        color: #005b9d;
    }

    #content :is(.border_orange, .border_orange1) {
        height: 1px !important;
        padding: 0;
        margin-block: 1rem;
    }

    #content table, #content :is(thead, tbody, tfoot, tr, td, th) {
        display: block;
    }

    #content table {
        padding-block: .5rem !important;
    }

    #content td {
        padding-block: .25rem !important;
    }

    #content tr[data-photo-row] {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
        gap: .5rem;
        align-items: start;
    }

    #content td:has(.eggs1) {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: .5rem;
    }

    #content td:has(.eggs1) a {
        flex: 0 1 9.75rem;
        max-width: calc((100% - .5rem)/2);
    }

    #content div[style*="Chicks_files/img1.png"] {
        background-size: 0 0 !important;
    }

    #content div[style*="Chicks_files/img1.png"]::after {
        content: "";
        display: block;
        max-width: 742px;
        aspect-ratio: 742 / 296;
        margin: .75rem auto;
        background-image: inherit;
        background-size: contain;
        background-repeat: no-repeat;
    }

    #content .photo-gallery {
        gap: .75rem;
        margin: 1rem 0;
        grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
    }

    #content .photo-gallery img {
        display: block;
        width: 100% !important;
    }

    #content[data-page="/"] #container {
        display: grid;
        gap: 1rem;
    }

    #content[data-page="/"] :is(#container_left, #container_right) {
        display: contents;
    }

    #content[data-page="/"] #container_right > img {
        grid-row: 1;
    }

    #content[data-page="/"] #container_left_bottom {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
    }

    #content[data-page="/"] .home_social {
        flex-basis: 100%;
    }

    #content[data-page="/"] #container_right_bottom {
        display: grid;
        grid-template-columns: minmax(0, 8.25rem) minmax(0, 1fr);
        align-items: center;
        gap: .75rem;
    }

    #content[data-page="/"] .contact p {
        margin-block: .2rem;
    }

    #content[data-page="/"] .volunteer {
        grid-column: 1 / -1;
        text-align: start;
    }

    #content[data-page="/"] .copyright {
        order: 1;
    }

    #content :is(.copyright, .copyright_right) {
        text-align: start;
        font-size: .875rem !important;
    }

    .bird-list {
        margin-inline: 0;
    }
}

@media (min-width: 680px) and (max-width: 1023px) {
    #content[data-page="/"] #container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    #content[data-page="/"] :is(#container_left, #container_right) {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: 1rem;
    }

    #content[data-page="/"] #container_right_bottom {
        grid-template-columns: minmax(0, 6rem) minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .captioned-photos:has(.photo-pair) {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .js-menu .submenu, .menu-toggle span {
        transition: none;
    }

    #photo-viewer[open], #photo-viewer[open]::backdrop {
        animation: none;
    }
}

