@media screen and (max-width: 979px) {
    html { font-size: 16px; }
    html, body { height: auto; min-height: 100%; }
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100svh;
        font-size: 16px;
        line-height: 1.55;
        letter-spacing: .02em;
    }
    #container, #content, #blog-content, #header-container, #logo, #footer, #topbar,
    #heading, #payoff, #content .sidebarmiddle, #content .widgets, #content .textwidget,
    #content .two-thirds-left, #content .two-thirds-right {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }
    #container {
        order: 2;
        flex: 1 0 auto;
        padding: 0;
        margin: 0 auto;
        max-width: 48rem;
    }
    #aard-mobile-header, #logo-container, #header, #topbar-holder { order: 0; }
    #aard-mobile-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        background: #222820;
        color: #fff;
    }
    #logo-container, #header, #topbar-holder {
        position: static;
        display: block;
        height: auto !important;
        padding: 0;
        overflow: visible;
        width: auto;
        background: #222820;
    }
    #logo { padding: .8rem 1rem; }
    #logo table td { height: auto; }
    #logo p { margin: 0; color: white; font-size: 1.75rem; line-height: 1; }
    #logo span { display: block; color: #e2e4dc; font-size: .9rem; margin-top: .2rem; }
    #aard-mobile-header button, .aard-gallery-controls button {
        min-height: 44px;
        padding: .5rem 1rem;
        border: 1px solid #959e91;
        border-radius: 3px;
        background: #222820;
        color: white;
        font: inherit;
        cursor: pointer;
    }
    #aard-mobile-header > button { margin-right: 1rem; order: 0; }
    #header, #topbar-holder { grid-column: 1 / -1; }
    #aard-mobile-header [hidden], #grace[hidden] { display: none !important; }
    #header .menu { margin: 0; }
    #header .menu ul li { float: none; background: none; }
    #header .menu > ul { background: #222820; }
    #header .menu ul li a {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        gap: .65rem;
        min-height: 44px;
        height: auto;
        padding: .6rem 1rem;
        color: #fff;
        opacity: 1 !important;
        border-top: 1px solid #465042;
        font-size: 1rem;
    }
    #header .menu ul li a .menu-subtitle { color: #cad3c4; margin: 0; }
    #header .menu ul li ul { height: auto !important; }
    #topbar { display: flex; align-items: center; gap: .8rem; float: none; padding: .55rem 1rem; background: #333a31; }
    #sociables a, #sociables img { display: block; }
    #sociables a { padding: .55rem; }
    #search, #sociables { float: none; }
    #searchform { display: flex; gap: .3rem; }
    #topbar #s { width: min(36vw, 15rem); }
    #topbar input { min-height: 36px; box-sizing: border-box; font-size: 16px; }
    #grabber, #header-s, #footer-s, #content-s, #blog-content-s { display: none; }
    #heading, #payoff { float: none; height: auto; margin: 0; padding: .85rem 1rem; text-align: left; }
    #heading h1, #payoff h2 { margin: 0; padding: 0 !important; line-height: 1.25; }
    #payoff:has(h2:empty) { display: none; }
    #content, #blog-content { padding: .45rem; }
    .innerborder { padding: clamp(.85rem, 3vw, 1.5rem); background-color: rgba(255,255,255,.95); }
    .td-breadcrumb, .td-breadcrumb span, .td-breadcrumb a { height: auto; width: auto; }
    .td-breadcrumb { background: none; margin-bottom: 1rem; }
    #content { overflow-wrap: anywhere; }
    #content p, #content li, #content .textwidget {
        font-size: 1rem;
        line-height: 1.55;
        color: #444;
    }
    #content .textwidget span { line-height: inherit !important; }
    #content .widgets a { text-decoration: underline; }
    #content img, #blog-content img, #content video, #content iframe, #content embed,
    #content figure, #content table, #content .wp-caption, #content input, #content textarea {
        max-width: 100%;
        box-sizing: border-box;
    }
    #content img, #blog-content img, #content video { height: auto; }
    #content figure { margin-inline: 0; }
    #content iframe[src*="youtube"], #content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
    #content .wp-has-aspect-ratio .wp-block-embed__wrapper iframe { width: 100%; height: 100%; }
    #content .one-third-left, #content .one-third-right, #content .two-thirds-left,
    #content .two-thirds-right, #content .sidebarmiddle, #content .one-half,
    #content .one-third, #content .two-third, #content .one-fourth, #content .one-fifth,
    #content .one-sixth, #content .widget {
        width: 100%;
        float: none;
        margin: 0;
        min-width: 0;
    }
    #content .widgets { padding: 1rem 0 0; }
    #content .two-thirds-left .sidebarmiddle, #content .two-thirds-right .sidebarmiddle {
        background: none;
        float: none;
        padding: 0;
        height: auto !important;
        display: flow-root;
    }
    #content .sidebarbottom { display: none; }
    #content .sidebarmiddle img { max-width: 100%; margin: 0 0 .75rem; float: none; }
    #content .one-half > h2 { margin: 1.15rem 0 .75rem; }
    #content .divider { width: 100%; }
    .contact-row, .contact-field, .contact-label { float: none; width: 100%; }
    .contact-field input[type=text], .contact-field textarea { width: 100%; font-size: 1rem; }
    #footer-container { position: static; order: 3; height: auto; margin-top: auto; background-color: #222820; }
    #footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .25rem 1rem; }
    #footer a { display: inline-flex; align-items: center; float: none; min-height: 44px; margin: 0; color: #fff; opacity: 1 !important; }
    #bgholder:has(#bgimg) { display: block !important; pointer-events: none; }
    #bgholder #bgimg { width: 100% !important; height: 100% !important; object-fit: cover; object-position: center; }
    #grace { max-width: 100%; overflow: hidden; }
    #grace:has(iframe), #grace:has(video) { width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; }
    #grace:has(iframe) :is(#grace-mask,#grace-holder,iframe), #grace:has(video) :is(#grace-mask,#grace-holder,video) {
        width: 100% !important; height: 100% !important; position: static;
    }
    .aard-gallery { display: grid; grid-template-columns: minmax(0, 1fr); background: #1b201a; }
    .aard-gallery-track { grid-area: 1 / 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .aard-gallery-track::-webkit-scrollbar { display: none; }
    .aard-gallery-track img { flex: 0 0 100%; width: 100%; min-width: 0; aspect-ratio: 960 / 680; object-fit: contain; scroll-snap-align: start; }
    .aard-gallery-thumbs {
        grid-area: 1 / 1;
        align-self: end;
        justify-self: start;
        position: relative;
        display: flex;
        max-width: calc(100% - 12px);
        margin: 0 6px 6px;
        overflow-x: auto;
        scrollbar-width: thin;
        background: rgba(15, 20, 15, .65);
    }
    .aard-gallery-thumbs button { flex: 0 0 44px; height: 44px; padding: 5px; background: transparent; cursor: pointer; }
    .aard-gallery-thumbs img { display: block; width: 34px; height: 34px; object-fit: cover; opacity: .7; }
    .aard-gallery-thumbs button[aria-current] img { outline: 2px solid white; opacity: 1; }
    .aard-gallery-controls { grid-area: 2 / 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .6rem; color: #fff; }
    .aard-gallery-controls button:disabled { opacity: .5; cursor: default; }
    :focus-visible { outline: 3px solid #db953b; outline-offset: -3px; }
}

