/* ==============================================================
   Michael Schrijnder Photography
   Main site stylesheet
   ============================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    background: #fff;
    color: #222;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

a {
    color: inherit;
}

/* ==============================================================
   Header
   ============================================================== */

.site-header {
    height: 64px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4vw;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.brand {
    text-decoration: none;
    font-weight: 650;
    letter-spacing: 0.04em;
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    font-size: 0.95rem;
}

/* ==============================================================
   Main content
   ============================================================== */

main {
    width: min(1400px, 92vw);
    margin: 0 auto;
    padding: 2rem 0 5rem;
}

/* --------------------------------------------------------------
   Featured slideshow
   -------------------------------------------------------------- */

#slideshow {
    position: relative;
    width: 100%;
    height: 100%;
}

#slideshow .slide-layer {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    z-index: 0;
    pointer-events: none;

    transition: opacity 1.5s ease-in-out;
}

#slideshow .slide-layer.visible {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
}

#slideshow .slide-layer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==============================================================
   Hero / featured presentation
   ============================================================== */

.hero {
    display: grid;
    grid-template-columns:
        minmax(0, 900px)
        minmax(240px, 1fr);

    gap: 3rem;
    align-items: center;
    min-height: auto;
}

/*
 * The featured presentation area is deliberately limited.
 *
 * Desktop maximum:
 *   900 px wide
 *   600 px high
 *
 * The photograph itself uses object-fit: contain, so the complete
 * photograph remains visible and is never cropped.
 */

.hero-photo {
    grid-column: 1;
    grid-row: 2;

    position: relative;

    width: min(900px, 100%);
    height: min(600px, 66.67vw);

    overflow: hidden;
}

/*
 * The two slideshow layers occupy exactly the same
 * 900 × 600 presentation window.
 */

.hero-photo .hero-layer {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    z-index: 0;
    pointer-events: none;

    transition: opacity 1.5s ease-in-out;
}

.hero-photo .hero-layer.visible {
    opacity: 1;
    z-index: 1;
    pointer-events: auto;
}

.hero-photo .hero-layer img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.hero-photo {
    position: relative;
}

.hero-photo .hero-layer {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-photo .hero-layer.visible {
    opacity: 1;
}

.hero-photo .hero-layer a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    position: relative;
}

.hero-photo .hero-layer img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.hero-photo .hero-layer span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    padding: .6rem .8rem;

    text-align: center;

    background: rgba(255, 255, 255, .85);
}

.hero-photo img {
    display: block;

    width: 100%;
    height: 100%;

    max-width: 900px;
    max-height: 600px;

    object-fit: contain;
}

.hero-photo a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.hero-photo span {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.95rem;
}

/* ==============================================================
   Hero text
   ============================================================== */

.hero-copy h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 0.95;
    margin: 0.2rem 0 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
}

/* ==============================================================
   Section headings
   ============================================================== */

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 3rem 0 1.5rem;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
}

.section-heading a {
    text-decoration: none;
}

/* ==============================================================
   Featured / photograph grid
   ============================================================== */

.photo-grid {
    display: grid;

    /*
     * Four columns remain on a desktop, but the grid does not
     * stretch all the way to the browser edges.
     */
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 1.4rem;

    /*
     * Keep the grid comfortably readable on large screens.
     */
    max-width: 1200px;
    margin: 0 auto;
}

.photo-card a {
    text-decoration: none;
}

.photo-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f3f3f3;
}

.photo-card h3 {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0.55rem 0 0;
}

.empty {
    padding: 2rem 0;
    color: #666;
}

/* ==============================================================
   Album grid
   ============================================================== */

.album-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.album-card {
    border: 1px solid #eee;
    padding: 2rem;
    text-decoration: none;
    min-height: 150px;
}

.album-card h2 {
    margin: 0 0 0.5rem;
}

/* ==============================================================
   Individual photograph page
   ============================================================== */

.photo-view {
    display: grid;
    grid-template-columns:
        minmax(0, 900px)
        280px;

    gap: 2.5rem;
    align-items: start;
}

/*
 * Detailed photograph view:
 *
 * Desktop maximum presentation area is also 900 x 600 px.
 */

.photo-view > img {
    display: block;

    width: 100%;
    max-width: 900px;
    height: 600px;
    max-height: 600px;

    object-fit: contain;
}

/* ==============================================================
   Photograph information
   ============================================================== */

.photo-info h1 {
    font-size: 1.4rem;
    margin-top: 0;
}

button,
.download {
    display: inline-block;
    border: 1px solid #bbb;
    background: #fff;
    padding: 0.65rem 0.85rem;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    margin: 0.3rem 0.3rem 0.8rem 0;
}

.details {
    border-top: 1px solid #eee;
    padding-top: 0.8rem;
}

.details dl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem 0;
    font-size: 0.9rem;
}

.details dt {
    font-weight: 650;
}

.details dd {
    margin: 0 0 0.6rem;
    color: #555;
}

/* ==============================================================
   Tablet
   ============================================================== */

@media (max-width: 1100px) {

    main {
        width: min(94vw, 1000px);
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /*
     * On tablets the presentation box scales with the available
     * screen width rather than remaining fixed at 900 px.
     */
    .hero-photo {
        width: 100%;
        height: min(600px, 66.67vw);
    }

    .hero-photo img {
        max-width: 100%;
        max-height: 100%;
    }

    .photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 100%;
    }

    .photo-view {
        grid-template-columns: 1fr;
    }

    .photo-view > img {
        width: 100%;
        max-width: 100%;
        height: min(600px, 66.67vw);
        max-height: 600px;
    }

    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==============================================================
   Phone
   ============================================================== */

@media (max-width: 600px) {

    main {
        width: 94vw;
    }

    .site-header {
        padding: 0 3vw;
    }

    nav {
        gap: 1rem;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .album-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 1.5rem;
    }

    .hero-copy h1 {
        font-size: 3rem;
    }

    /*
     * Phone presentation area:
     *
     * width  = 94vw
     * height = approximately 63vw
     *
     * This keeps the presentation area comfortably within the
     * available screen while retaining the desktop 900 x 600
     * proportion.
     */
    .hero-photo {
        width: 100%;
        height: 63vw;
        min-height: 220px;
        max-height: 600px;
    }

    .hero-photo img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
    }

    .photo-view > img {
        width: 100%;
        height: 63vw;
        min-height: 220px;
        max-height: 600px;
    }
}

