* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f6f4ef;
    color: #171717;
    margin: 0;
}

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

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

.site-nav,
.site-footer,
.page-shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 0 24px;
}

.site-nav {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 72px;
}

.site-nav div {
    display: flex;
    gap: 20px;
}

.brand {
    font-weight: 750;
}

.page-shell {
    padding-bottom: 56px;
}

.page-heading {
    padding: 56px 0 34px;
}

.page-heading.compact {
    padding-top: 28px;
}

.page-heading h1 {
    font-size: clamp(2.25rem, 6vw, 5rem);
    line-height: 0.95;
    margin: 0;
    max-width: 760px;
}

.page-heading p {
    color: #5d5a54;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 16px 0 0;
    max-width: 650px;
}

.eyebrow,
.meta {
    color: #7a332b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.banner-carousel {
    aspect-ratio: 3 / 1;
    background: #d9e5e8;
    border-radius: 8px;
    margin-top: 10px;
    overflow: hidden;
    position: relative;
}

.banner-slide {
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    transition: opacity 700ms ease;
    width: 100%;
}

.banner-slide img {
    height: 100%;
    object-fit: cover;
}

.banner-slide.active {
    opacity: 1;
    z-index: 1;
}

.start-page-heading {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    margin: 38px 0 22px;
}

.gallery-heading h1 {
    font-size: clamp(2rem, 5vw, 3.75rem);
    max-width: none;
}

.gallery-cards {
    display: grid;
    gap: 22px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gallery-card,
.gallery-row,
.photo-grid figure {
    background: #ffffff;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-card img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-card-body {
    padding: 18px;
}

.gallery-card h2,
.gallery-row h2 {
    font-size: 1.25rem;
    line-height: 1.2;
    margin: 6px 0 8px;
}

.gallery-card p,
.gallery-row p {
    color: #5d5a54;
    line-height: 1.55;
    margin: 0;
}

.gallery-card span {
    color: #171717;
    display: inline-block;
    font-weight: 400;
    margin-top: 14px;
}

.gallery-list {
    display: grid;
    gap: 14px;
}

.gallery-row a {
    display: grid;
    gap: 18px;
    grid-template-columns: 180px 1fr;
    padding: 12px;
}

.gallery-row img {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
}

.photo-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    left: 50%;
    position: relative;
    transform: translateX(-50%);
    width: min(120%, calc(100vw - 48px));
}

.photo-grid figure {
    margin: 0;
}

.photo-grid img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.photo-grid figcaption {
    display: grid;
    gap: 4px;
    padding: 12px 14px 14px;
}

.photo-grid figcaption span {
    font-size: 0.92rem;
    font-weight: 400;
}

.photo-grid figcaption small {
    color: #5d5a54;
}

.viewer-open {
    overflow: hidden;
}

.photo-viewer {
    align-items: center;
    background: rgba(17, 17, 17, 0.92);
    display: flex;
    inset: 0;
    padding: 26px;
    position: fixed;
    z-index: 20;
}

.photo-viewer[hidden] {
    display: none;
}

.photo-viewer figure {
    display: grid;
    gap: 14px;
    margin: 0 auto;
    max-height: calc(100vh - 52px);
    max-width: 2000px;
    min-width: 0;
    width: 100%;
}

.photo-viewer img {
    border-radius: 8px;
    max-height: calc(100vh - 130px);
    object-fit: contain;
    width: 100%;
}

.photo-viewer figcaption {
    color: #ffffff;
    display: grid;
    gap: 4px;
    text-align: center;
}

.photo-viewer figcaption span {
    font-weight: 700;
}

.photo-viewer figcaption small {
    color: #cfc8bd;
}

.viewer-nav {
    appearance: none;
    background: rgba(17, 17, 17, 0.58);
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font: 3rem/1 system-ui, sans-serif;
    font-weight: 750;
    padding: 10px 15px 14px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.viewer-prev {
    left: 34px;
}

.viewer-next {
    right: 34px;
}

.viewer-nav:disabled {
    cursor: default;
    opacity: 0;
    pointer-events: none;
}

.site-footer {
    color: #6d6960;
    padding-bottom: 28px;
}

.admin-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
}

.admin-heading-actions {
    display: flex;
    gap: 10px;
}

.button,
button.button {
    appearance: none;
    background: #171717;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    padding: 12px 16px;
}

.text-button {
    color: #5d5a54;
    font-weight: 700;
    padding: 12px 0;
}

.admin-form {
    background: #ffffff;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    max-width: 760px;
    padding: 22px;
}

.admin-form.wide {
    max-width: 980px;
}

.admin-gallery-row {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr auto;
    padding-right: 12px;
}

.gallery-row a.gallery-row-main {
    padding-right: 0;
}

.admin-row-actions {
    display: flex;
    gap: 10px;
}

.button.secondary {
    background: #2f6554;
}

.banner-admin-list {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 22px;
}

.banner-admin-list figure {
    background: #ffffff;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    margin: 0;
    overflow: hidden;
}

.banner-admin-list img {
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

.banner-admin-list figcaption {
    color: #5d5a54;
    font-weight: 700;
    padding: 12px 14px;
}

.banner-edit-list {
    display: grid;
    gap: 18px;
}

.banner-edit-row {
    border-top: 1px solid #e4ded3;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(240px, 2fr) minmax(260px, 1fr);
    padding-top: 18px;
}

.banner-edit-row img {
    aspect-ratio: 3 / 1;
    border-radius: 8px;
    object-fit: cover;
}

.banner-edit-fields {
    display: grid;
    gap: 12px;
}

.banner-order-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.banner-order-actions .button {
    padding: 8px 12px;
}

.edit-photo-list {
    display: grid;
    gap: 14px;
}

.edit-photo-row {
    align-items: start;
    border-top: 1px solid #e4ded3;
    display: grid;
    gap: 18px;
    grid-template-columns: 150px 1fr;
    padding-top: 14px;
}

.edit-photo-row img {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    object-fit: cover;
}

.edit-photo-fields {
    display: grid;
    gap: 14px;
}

.photo-order-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.photo-order-actions .button {
    padding: 8px 12px;
}

.remove-choice {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.add-images-panel {
    background: #f6f4ef;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    display: grid;
    gap: 16px;
    padding: 18px;
}

.add-images-panel h2 {
    font-size: 1.2rem;
    line-height: 1.2;
    margin: 0;
}

.cover-choice {
    align-items: center;
    background: #f6f4ef;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px 12px;
}

.cover-choice input {
    height: 18px;
    margin: 0;
    width: 18px;
}

.cover-choice span {
    color: #2f6554;
    font-weight: 750;
}

.cover-choice.align-end {
    align-self: end;
}

.gallery-image-fields,
.choice-list {
    display: grid;
    gap: 14px;
}

.choice-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e4ded3;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 12px;
}

.choice-row label {
    align-items: center;
    cursor: pointer;
    display: flex;
    flex: 1;
    gap: 12px;
}

.choice-order-actions {
    display: flex;
    gap: 8px;
}

.choice-order-actions .button {
    padding: 8px 12px;
}

.choice-row input {
    height: 18px;
    margin: 0;
    width: 18px;
}

.choice-row span {
    display: grid;
    gap: 3px;
}

.choice-row small {
    color: #5d5a54;
}

.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    font-weight: 700;
}

.field input,
.field textarea {
    border: 1px solid #d8d0c2;
    border-radius: 8px;
    color: #171717;
    font: inherit;
    padding: 12px;
    width: 100%;
}

.field textarea {
    resize: vertical;
}

.field span {
    color: #9d2f22;
    font-size: 0.9rem;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 16px;
}

.notice {
    border-radius: 8px;
    margin-bottom: 18px;
    max-width: 760px;
    padding: 14px 16px;
}

.notice.error {
    background: #f8e6e2;
    color: #7a332b;
}

@media (max-width: 640px) {
    .site-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        justify-content: center;
        padding-bottom: 18px;
        padding-top: 18px;
    }

    .gallery-row a {
        grid-template-columns: 1fr;
    }

    .photo-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .admin-gallery-row {
        grid-template-columns: 1fr;
        padding-right: 0;
    }

    .admin-row-actions {
        padding: 0 12px 12px;
    }

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

    .banner-edit-row {
        grid-template-columns: 1fr;
    }

    .admin-heading,
    .admin-heading-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .photo-viewer {
        padding: 18px;
    }

    .photo-viewer figure {
    }

    .photo-viewer img {
        max-height: calc(100vh - 170px);
    }

    .viewer-prev {
        left: 18px;
    }

    .viewer-next {
        right: 18px;
    }
}
