/*
 * Phones, tablets and narrow windows. Loaded on top of main.css for screens under 750px wide and
 * for touch screens. Same layout as before (stacked sections, 2x2 cards, slide-down menu), sized
 * for a real phone screen now that the page declares its width instead of being shrunk to fit.
 */

:root {
    --header: 56px;
}

/* ----------------------------------------------------------------- header */

HEADER {
    height: calc(var(--header) - 16px);
    padding: 8px 0px;
}

header div {
    margin-left: 12px;
}

header ol {
    margin-right: 6px;
}

header img {
    margin: 0px 6px;
}

header ol li {
    margin-left: 4px;
}

#logo {
    font-size: 1.1rem;
}

/* The narrowest phones (320px): logo and three icons still have to share one line. */
@media (max-width: 359.98px) {
    #logo {
        font-size: 0.95rem;
    }

    header ol a img {
        height: 32px;
    }
}

header ol a:hover p {
    top: calc(var(--header) - 8px);
}

/* ------------------------------------------------------------- menu (footer) */

/* Hidden by its own height rather than a fixed offset, so adding a tab can't leave one hanging
   below the header. Shows briefly on load as a hint, like on desktop, then slides away. */
@keyframes navHint {
    0%, 75% { top: var(--header); transform: none; }
    100% { top: 0; transform: translateY(-100%); }
}

footer {
    top: 0;
    height: auto;
    padding-bottom: 0;
    flex-wrap: wrap;
    transform: translateY(-100%);
    transition: top 0.3s ease-in-out, transform 0.3s ease-in-out;
    animation-name: navHint;
}

    footer:focus-within, .nav-open footer {
        top: var(--header) !important;
        transform: none;
    }

@media (hover: hover) {
    header:hover ~ footer, footer:hover {
        top: var(--header) !important;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    footer {
        animation: none;
    }
}

.footerTab {
    font-size: 1rem;
    padding: 0.9em;
    border-right: none;
    border-bottom: 2px solid #666;
}

/* --------------------------------------------------------------- homepage */

.homepage {
    margin-top: var(--header);
    height: calc(100vh - var(--header));
    height: calc(100dvh - var(--header));
}

    .homepage > DIV {
        grid-template-columns: auto;
        grid-template-rows: 1fr 1.61fr;
    }

.projectInfo {
    font-size: 1rem;
    padding: 6px 4%;
    width: 92%;
    height: auto;
    min-height: 20%;
}

    .projectInfo h3 {
        font-size: 1rem;
        line-height: 1.2rem;
    }

    .projectInfo .details {
        font-size: 0.7rem;
        letter-spacing: 0.1rem;
        margin: 0.4rem 0rem 0rem;
    }

/* ------------------------------------------------------------ project pages */

.hero {
    margin-top: var(--header);
}

    .hero video {
        height: 40.8vw;   /* same proportion as the 400px band on a 980px desktop */
    }

article {
    padding: 2rem 1rem;
    font-size: 1rem;
}

.details {
    font-size: 0.8rem;
    letter-spacing: 0.15rem;
}

.paragraph {
    flex-direction: column;
    margin-top: 40px;
    min-height: 0;
}

    .paragraph > DIV,
    .paragraph > DIV:first-of-type {
        width: 100%;
    }

.button {
    margin: 1rem 0rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

p + ol li {
    margin-left: 1.25rem;
}
