* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    background: linear-gradient(white, #e0ebf5);
}

nav {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: #30434c;
    font-family: Bitter, serif;
    font-weight: bold;
}

nav ul,
.bottom ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    margin: 0.25rem;
    padding: 0;
    list-style: none;
    font-size: 1.1rem;
}

nav a {
    color: #dbad6a;
    text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
    color: #f5d59e;
}

nav a:focus-visible,
.bottom a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.title {
    margin: 0;
    padding: clamp(9rem, 22vw, 14rem) 1rem clamp(3rem, 8vw, 5rem);
    background: url("photos/clouds.gif") center / cover no-repeat;
    color: black;
    font-family: Limelight, serif;
    font-size: clamp(2.25rem, 7vw, 5rem);
    text-align: center;
}

h2 {
    margin: 2rem 1rem 1rem;
    padding-top: 1rem;
    scroll-margin-top: 5rem;
    font-family: Huninn, sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    text-align: center;
}

p {
    max-width: 70rem;
    margin: 1.5rem auto;
    padding: clamp(1rem, 5vw, 3rem);
    border: 1px dotted;
    background-color: floralwhite;
    font-family: Bitter, serif;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: center;
}

.container {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 90rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.column {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-item:focus-visible {
    outline: 3px solid #30434c;
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
    padding: 5px;
}

.image-preview {
    position: fixed;
    inset: 0;
    display: none;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 1rem;
    place-items: center;
    border: 0;
    background: transparent;
}

.image-preview[open] {
    display: grid;
}

.image-preview::backdrop {
    background: rgb(0 0 0 / 85%);
}

.preview-image {
    width: auto;
    max-width: 100%;
    max-height: 90vh;
    padding: 0;
    object-fit: contain;
}

.pdf-preview {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    width: min(100%, 70rem);
    height: min(90vh, 60rem);
    background: white;
}

.pdf-preview[hidden],
.preview-image[hidden] {
    display: none;
}

.pdf-frame {
    width: 100%;
    height: 100%;
    border: 0;
}

.pdf-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #30434c;
    color: white;
    font-family: Bitter, serif;
}

.pdf-controls button {
    padding: 0.5rem 0.75rem;
    border: 1px solid white;
    border-radius: 0.25rem;
    background: #30434c;
    color: white;
    font: inherit;
    cursor: pointer;
}

.pdf-controls button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pdf-controls a {
    color: #f5d59e;
}

.pdf-controls button:focus-visible,
.pdf-controls a:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
}

.preview-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid white;
    border-radius: 50%;
    background: #30434c;
    color: white;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.preview-close:focus-visible {
    outline: 3px solid white;
    outline-offset: 3px;
}

.pic {
    width: min(25%, 15rem);
    margin: 0 auto;
}

.bottom {
    margin: 0 1rem 3rem;
    padding: 0.5rem;
    border: 1px solid;
    background-color: floralwhite;
    font-family: Bitter, serif;
}

.bottom li {
    border-bottom: 1px solid #416476;
}

@media (max-width: 770px) {
    html {
        scroll-padding-top: 10rem;
    }

    h2 {
        scroll-margin-top: 10rem;
    }

    .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .column {
        width: 100%;
    }

    .pic {
        width: min(50%, 30rem);
    }
}

@media (max-width: 599px) {
    nav ul,
    .bottom ul {
        gap: 0.5rem 1rem;
    }

    .bottom li {
        border-bottom: 0;
    }

    .pic {
        width: min(60%, 30rem);
    }

    .pdf-controls {
        gap: 0.5rem;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .pdf-open-link {
        flex-basis: 100%;
        text-align: center;
    }
}
