/* =========================================================
   Layout CSS
   Purpose: Define page structure, spacing between regions,
   and responsive layout behaviour
   ========================================================= */

/* -------------------------
   Global layout rhythm
   ------------------------- */

header,
main,
footer {
    display: block;
}

/* Space major page sections */
main > section {
    padding-block: var(--space-7);
}

/* -------------------------
   Header layout
   ------------------------- */

header {
    border-bottom: 1px solid #ddd;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: var(--space-4);
}

/* Navigation */

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

nav a {
    display: inline-block;
    padding-block: var(--space-1);
}

/* Branding */

.site-branding a {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Desktop enhancement, horizontal navigation menu */

@media (width >= 48rem) {
    nav ul {
        flex-direction: row;
        gap: var(--space-5);
        margin: 0;     
    }
}

/* -------------------------
   Hero section
   ------------------------- */

section:first-of-type {
    padding-block: var(--space-8);
}

section:first-of-type h1 {
    max-width: 40rem;
}

section:first-of-type p {
    max-width: 36rem;
}

/* -------------------------
   Services overview layout
   ------------------------- */

section ul {
    margin-top: var(--space-5);
}

section ul > li {
    margin-bottom: var(--space-5);
}

/* -------------------------
   Footer layout
   ------------------------- */

footer {
    border-top: 1px solid #ddd;
    padding-block: var(--space-6);
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

footer nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* -------------------------
   Responsive adjustments
   ------------------------- */

/* Medium screens and up */
@media (width >= 48rem) {
    /* Services list becomes multi-column */

    section ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    section ul > li {
        margin-bottom: 0;
    }

    footer .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    footer nav ul {
        flex-direction: row;
        gap: var(--space-4);
    }
}

/* Large screens and up */
@media (width >= 64rem) {
    section ul {
        grid-template-columns: repeat(3, 1fr);
    }
}
