:root {
    --background: #f7f5f0;
    --text: #2b2b2b;
    --text-secondary: #707070;
    --link-hover: #555555;

    --content-width: 760px;
    --wide-width: 1360px;

    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;
}


/* --------------------------------------------------
   Base
-------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--background);
    color: var(--text);

    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
}


/* --------------------------------------------------
   Site width
-------------------------------------------------- */

header,
main,
footer {
    width: calc(100% - 80px);
    max-width: var(--wide-width);
    margin-left: auto;
    margin-right: auto;
}


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

header {
    padding-top: var(--space-4);
    padding-bottom: var(--space-1);
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.2;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

.header-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
}


/* --------------------------------------------------
   Navigation
-------------------------------------------------- */

nav {
    margin: 0;
}

nav a {
    margin-right: var(--space-3);
    color: inherit;
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
}

nav a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* --------------------------------------------------
   Main content
-------------------------------------------------- */

main {
    padding-top: var(--space-2);
    padding-bottom: var(--space-6);
}


/* --------------------------------------------------
   Typography
-------------------------------------------------- */

h1,
h2,
h3 {
    font-weight: 500;
    line-height: 1.25;
}

main h1 {
    margin-top: 0;
    margin-bottom: var(--space-3);
    font-size: 20px;
    line-height: 1.1;
}

main h2 {
    margin-top: var(--space-5);
    margin-bottom: var(--space-2);
    font-size: 24px;
}

main h3 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
    font-size: 20px;
}

p {
    margin-top: 0;
    margin-bottom: var(--space-3);
}


/* --------------------------------------------------
   Links
-------------------------------------------------- */

main a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

main a:hover {
    color: var(--link-hover);
}


/* --------------------------------------------------
   Images
-------------------------------------------------- */

main img {
    display: block;
    max-width: 100%;
    height: auto;
}


/* --------------------------------------------------
   Gallery
-------------------------------------------------- */

.gallery {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    column-gap: var(--space-4);
    row-gap: var(--space-5);
}

.gallery-item {
    flex: 0 0 auto;
}

.gallery-item img {
    display: block;
    width: auto;
    height: auto;
}

/* Tile-aware gallery scaling */

.gallery-item.layout-1x1 img {
    max-width: 220px;
    max-height: 220px;
}

.gallery-item.layout-1x2 img {
    max-width: 320px;
    max-height: 240px;
}

.gallery-item.layout-2x2 img {
    max-width: 320px;
    max-height: 320px;
}

.gallery-item.layout-2x3 img,
.gallery-item.layout-3x2 img {
    max-width: 400px;
    max-height: 400px;
}

.gallery-item.layout-3x3 img {
    max-width: 400px;
    max-height: 400px;
}

.gallery-item h3 {
    margin-top: 0;
    margin-bottom: 2px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
}

.gallery-item h3 a {
    text-decoration: none;
}

.gallery-item h3 a:hover {
    text-decoration: underline;
}
.gallery-count {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: var(--space-3);
}

/* --------------------------------------------------
   Secondary text / metadata
-------------------------------------------------- */

.meta,
.metadata,
.caption,
figcaption {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}


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

footer {
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);

    color: var(--text-secondary);
    font-size: 15px;

    border-top: 1px solid #d8d5cf;
}


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

@media (max-width: 800px) {

    header,
    main,
    footer {
        width: calc(100% - 48px);
    }
}

@media (max-width: 900px) {

    .gallery {
        column-gap: var(--space-3);
        row-gap: var(--space-4);
    }
}

@media (max-width: 700px) {

    .gallery {
        display: flex;
        flex-wrap: wrap;
    }

    .gallery-item {
        max-width: 100%;
    }

    .gallery-item img {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 560px) {

    body {
        font-size: 17px;
    }

    header,
    main,
    footer {
        width: calc(100% - 32px);
    }

    main {
        padding-top: var(--space-4);
        padding-bottom: var(--space-5);
    }

    main h1 {
        font-size: 28px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

}

@media (max-width: 560px) {
    .artwork-nav {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .artwork-nav-prev,
    .artwork-nav-gallery,
    .artwork-nav-next {
        text-align: left;
    }
}

.content {
    max-width: var(--content-width);
}

.home-image {
    margin-top: 0;
}

.home-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 320px;
    max-height: 320px;
}

.artwork-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 600px;
    max-height: 75vh;
}

.artwork-content {
    margin-top: var(--space-3);
}

.artwork-meta {
    margin-top: var(--space-3);
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.artwork-meta p {
    margin-bottom: 4px;
}

.artwork-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-3);
    border-top: 1px solid #d8d5cf;
    font-size: 15px;
}

.artwork-nav-prev {
    text-align: left;
}

.artwork-nav-gallery {
    text-align: center;
}

.artwork-nav-next {
    text-align: right;
}

.artwork-nav a {
    color: var(--text);
    text-decoration: underline;
}

.artwork-nav a:hover {
    color: var(--link-hover);
}

/* --------------------------------------------------
   Process
-------------------------------------------------- */

.process-list {
    margin-top: var(--space-4);
    padding-left: 1.2em;
}

.process-list li {
    margin-bottom: var(--space-2);
}

.process-list a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.process-list a:hover {
    color: var(--link-hover);
}

.process-content img {
    display: block;
    width: auto;
    height: auto;
    max-width: 320px;
    margin-top: var(--space-3);
    margin-bottom: var(--space-3);
}

.process-content h3 {
    margin-top: var(--space-4);
    margin-bottom: var(--space-1);

    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}

/* --------------------------------------------------
   Mobile
-------------------------------------------------- */

@media (max-width: 700px) {

    /* Header */
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-1) var(--space-3);
    }

    nav a {
        margin-right: 0;
    }

    /* Gallery list */
    .gallery-item.layout-1x1 img,
    .gallery-item.layout-1x2 img,
    .gallery-item.layout-2x2 img,
    .gallery-item.layout-2x3 img,
    .gallery-item.layout-3x2 img,
    .gallery-item.layout-3x3 img {
        max-width: 100%;
        max-height: none;
    }

    /* Single artwork */
    .artwork-image img {
        max-width: 100%;
        max-height: none;
    }
}