/* ==========================================================================
   Underwood & Associates, LLC — responsive layer
   --------------------------------------------------------------------------
   Loaded AFTER style.css / style-2.0.8.css on every page. The two older files
   stay as they are: this one only overrides what has to change to work at
   phone and tablet widths, plus the footer hours block added 2026-11-22.

   Breakpoints follow the old sheet's own steps so nothing lands between two
   rules: 1024px is the tablet/mobile step, 700px the phone step, 480px the
   small-phone step. One extra step, 560px, only unstacks the footer hours
   block, which is the narrowest width where the copyright and hours still sit
   side by side without wrapping. One more, 1201px, only centres the homepage
   tagline box, which the old sheet pins to the right edge above 1200px.
   Change a number here only if you change it in both files.
   ========================================================================== */

/* ==========================================================================
   1. Foundations — every width
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

/* The old sheet sized the two absolute nav wrappers for content-box: 160px of
   content plus 5px of padding each side. Under border-box above, the 160px now
   includes that padding, so the white panel behind the flip logo and the blue
   project strip lose 10px and stop covering the 160px flip elements. 170px
   restores the original footprint; the tablet step below still overrides this
   to full width. */
#nav-wrapper,
#sub-nav-wrapper { width: 170px; }

html { -webkit-text-size-adjust: 100%; }

/* The old sheet let a single wide element push the whole page sideways. Clip
   rather than hide: clip does not create a scroll container, so nothing inside
   starts scrolling. */
html,
body { overflow-x: clip; }

img,
svg,
video { max-width: 100%; }

img { height: auto; }

/* A floated image beside a paragraph needs the paragraph to keep its own
   space; this keeps long words from forcing the column wider. */
#main-content p { overflow-wrap: break-word; }

/* Contact page hours line, matching the address block beside it. */
.contact-hours {
    padding-left: 24px;
    font-weight: 300;
    font-size: 18px;
    position: relative;
}
.contact-hours .icon { position: absolute; left: 1px; top: 4px; }

/* Visible keyboard focus. The old sheet set outline: none on inputs and never
   gave anything else a focus style. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #7b92c8;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Keyboard users land here first. Hidden until focused, then it sits over the
   header so it is readable without pushing the layout. */
.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    background: #d6672e;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    transition: top .15s ease-in;
}

.skip-link:focus {
    top: 0;
    color: #fff;
}

#main-content:focus { outline: none; }

/* The menu button is a real <button> now. Strip the browser's default look but
   keep the old sheet's position and size, which still apply at desktop width. */
.nav-toggle {
    background: none;
    border: 0;
    padding: 0;
    color: #d6672e;
    line-height: 1;
    cursor: pointer;
}

.nav-toggle:hover { color: #7b92c8; }

/* The desktop menu opens on hover. The button toggles .is-open, so mirror the
   hover rules or the button does nothing on a wide screen. Desktop only: on a
   phone the menu is a panel, and the 228px height would stretch the header. */
@media (min-width: 1025px) {
    nav.is-open,
    nav.is-open #flip-wrapper #nav-back {
        height: 228px;
    }

    nav.is-open #flip-wrapper #nav-back { transform: rotateY(0deg); }
    nav.is-open #flip-wrapper #nav-front { transform: rotateY(180deg); }
}

/* ==========================================================================
   2. Footer — every width
   --------------------------------------------------------------------------
   The footer was two floats plus a clearing block. It is a flex row now so the
   hours block can sit beside the copyright with a divider between them and the
   menu can still hold the right edge. DOM order is menu, copyright, hours, so
   the order property puts the hours after the copyright.
   ========================================================================== */

footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 0;
    padding: 24px;
}

.footer-copyright {
    float: none;
    order: 1;
}

.footer-hours {
    order: 2;
    /* The divider sits midway between the two blocks: 24px clear of the
       copyright text, 24px clear of the hours text. */
    margin-left: 24px;
    padding-left: 24px;
    border-left: 1px solid #ccc;
    /* Stretch so the divider runs the full height of the row, not just the
       height of these three lines. */
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Same type as the copyright block beside it: 12px, #333, no extra leading. */
.footer-hours p { font-size: 12px; margin: 0; color: #333; }
.footer-hours .footer-hours-title { color: #333; }

.footer-menu {
    float: none;
    order: 3;
    margin-left: auto;
}

.portnw-link {
    clear: none;
    order: 4;
    flex-basis: 100%;
    padding-top: 12px;
}

/* ==========================================================================
   2b. Desktop hero: 1201px and up
   --------------------------------------------------------------------------
   The old sheet pins #main-tagline to the right edge above 1200px: a 720px
   box at right: 0. Its text is centred inside that box, so it reads right of
   centre on the page and further right the wider the window gets. Below
   1200px the same sheet sets width: 100%, which is the centred look. This
   centres the 720px box instead, so the slide-in travel stays 720px rather
   than stretching to the full page width.
   ========================================================================== */

@media (min-width: 1201px) {

    #main-tagline {
        width: 720px;
        right: auto;
        left: 50%;
        margin: 0 0 0 -360px;
    }
}

/* ==========================================================================
   3. Tablet and below — 1024px
   --------------------------------------------------------------------------
   The old sheet stacked the content but left the logo block absolutely
   positioned over it, so every page carried a 166px to 230px top margin to get
   out from under the logo. The header goes into the flow here and the margin
   goes away.
   ========================================================================== */

@media (max-width: 1024px) {

    /* ---- Header ---- */
    #nav-wrapper {
        position: sticky;
        top: 0;
        z-index: 50;
        width: 100%;
        margin: 0;
        padding: 10px 16px;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* The drawing logo is 160x228; at this width the wordmark beside it is the
       whole identity, and the drawing would eat a third of the screen. */
    #nav-front { display: none; }

    #ua-text-logo {
        position: static;
        width: 132px;
        padding: 0;
        order: 1;
    }

    #ua-text-logo img { width: 100%; height: auto; }

    nav {
        position: static;
        order: 2;
        margin-left: auto;
        perspective: none;
        /* A non-flat transform-style makes nav a containing block, which would
           trap the absolutely positioned menu inside a zero-width box. */
        transform-style: flat;
        /* The old sheet gives nav a fixed 228px height to fit the logo card. */
        width: auto;
        height: auto;
    }

    /* The old sheet turns the icon white because it sat over the home photo.
       In the header bar it sits on white, so it needs the brand colour. */
    body#home .nav-toggle { color: #d6672e; }
    body#home .nav-toggle:hover { color: #7b92c8; }

    #flip-wrapper {
        position: static;
        transform: none;
        transform-style: flat;
    }

    /* The menu is a panel under the header, not a card that flips. */
    #nav-back {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: auto;
        height: auto;
        transform: none;
        background: #d6672e;
        display: none;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    }

    nav.is-open #nav-back,
    nav.hover #nav-back { display: block; }

    #nav-back ul {
        padding: 8px 16px 12px;
        list-style: none;
    }

    #nav-back li { padding: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
    #nav-back li:last-child { border-bottom: 0; }

    /* 44px targets. */
    #nav-back li a {
        display: block;
        padding: 12px 4px;
        font-size: 15px;
        letter-spacing: .04em;
    }

    .nav-toggle {
        position: static;
        order: 3;
        margin-left: auto;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 0;
        padding: 0;
        color: #d6672e;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
    }

    /* ---- Project category strip ---- */
    #sub-nav-wrapper {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0;
        top: auto;
        left: auto;
    }

    .projects__sub-menu { min-height: 0; }

    ul.projects__sub-menu-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0 16px;
        padding: 10px 16px;
        font-size: 13px;
        letter-spacing: .03em;
    }

    ul.projects__sub-menu-list li { padding: 4px 0; }

    /* ---- Content ---- */
    #main-wrapper { min-height: 0; }

    #main-content {
        width: 100%;
        max-width: 100%;
        padding: 28px 20px 40px;
        border: 0;
        text-align: left;
    }

    /* The title no longer has to clear the logo. */
    #main-content h1.gallery-title,
    #main-content h1.projects-title {
        margin: 0 0 24px;
        text-align: center;
        font-size: clamp(26px, 5.5vw, 40px);
        word-spacing: .12em;
    }

    h2.orange-heading { margin: 24px 0 4px; }
    h2.contact-title { font-size: 20px; }

    div.column-wrapper-right,
    div.column-wrapper-left { width: 100%; float: none; }

    /* ---- Home hero ---- */
    #main-wrapper.home-page {
        min-height: 68vh;
        align-items: center;
        justify-content: center;
        padding: 32px 20px;
    }

    #main-tagline {
        position: static;
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
        /* The tagline slides in from the right on a 16s loop. Desktop clips
           that inside the 720px box; the mobile box has to clip it too or the
           slide widens the body and lets the page pan sideways. */
        overflow: hidden;
    }

    #main-tagline h2 {
        font-size: clamp(20px, 6vw, 30px);
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
        margin: 6px 0;
    }

    #home-intro { padding: 32px 20px 40px; }

    #home-intro p {
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
        text-align: left;
    }

    /* ---- Grids ---- */
    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-column-gap: 12px;
        row-gap: 12px;
    }

    .project-category__title-wrapper { padding: 6px 4px; }
    .project-category__title { font-size: 15px; letter-spacing: .02em; }

    .projects__main-wrapper {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .projects__listings-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* ---- Forms ---- */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    textarea,
    select {
        width: 100%;
        max-width: 100%;
    }

    input:focus { width: 100%; }

    /* ---- Footer ---- */
    footer { padding: 20px 16px; }

    .footer-copyright { text-align: left; margin: 0; width: auto; }
    .footer-menu { text-align: left; margin: 0; width: auto; }
    .social-icons { text-align: left; }

    .footer-menu { flex-basis: 100%; margin-left: 0; }

    .portnw-link { text-align: left; }
}

/* ==========================================================================
   3b. Footer hours — 560px
   --------------------------------------------------------------------------
   The copyright block and the hours block sit side by side with a vertical
   divider down to 560px, which is the narrowest width where both still fit
   without wrapping. Below that the divider turns horizontal and the hours
   stack under the copyright.
   ========================================================================== */

@media (max-width: 560px) {

    .footer-hours {
        border-left: 0;
        border-top: 1px solid #ccc;
        margin: 12px 0 0;
        padding: 12px 0 0;
        flex-basis: 100%;
        align-self: auto;
        display: block;
    }
}

/* ==========================================================================
   4. Phone — 700px
   ========================================================================== */

@media (max-width: 700px) {

    #main-content { padding: 20px 16px 32px; }

    /* A floated image at this width leaves a 130px column of text beside it. */
    .image-right,
    .image-left {
        float: none;
        display: block;
        margin: 0 auto 20px;
        padding: 0;
    }

    .projects__listings-wrapper { grid-template-columns: minmax(0, 1fr); }

    ul.gallery-list li > img { width: 72px; height: 72px; }

    .staff-bio-wrapper img { float: none; }

    .accordion section p { padding: 0 16px 16px; }

    .contact-address { padding-left: 20px; }
}

/* ==========================================================================
   5. Small phone — 480px
   ========================================================================== */

@media (max-width: 480px) {

    #main-content { padding: 16px 14px 28px; }

    #main-content h1.gallery-title,
    #main-content h1.projects-title {
        font-size: clamp(22px, 7vw, 28px);
        letter-spacing: .015em;
    }

    h2.orange-heading { font-size: 20px; }

    .project-grid { grid-column-gap: 8px; row-gap: 8px; }
    .project-category__title { font-size: 13px; }

    #main-tagline h2 { font-size: clamp(18px, 6.4vw, 24px); }

    ul.gallery-list li > img { width: 64px; height: 64px; }

    .footer-hours p { font-size: 11px; }
}

/* ==========================================================================
   6. Motion and print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    #main-tagline h2,
    #main-tagline h2 * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

@media print {
    #nav-wrapper,
    #sub-nav-wrapper,
    .skip-link,
    .footer-menu,
    .portnw-link,
    .social-icons { display: none !important; }

    body,
    #main-content,
    footer { background: #fff !important; color: #000 !important; }

    #main-content { width: 100% !important; padding: 0 !important; border: 0 !important; }

    #main-tagline { position: static !important; width: auto !important; }

    a { color: #000 !important; text-decoration: underline; }

    img { max-width: 100% !important; }

    .footer-hours { border-left: 0 !important; margin: 0 !important; padding: 0 !important; }
}
