:root {
    color-scheme: light;
    font-family: Georgia, "Times New Roman", serif;
    color: #302a26;
    background: #faf7f2;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #faf7f2;
}

.site-header,
.site-footer {
    padding: 1.25rem clamp(1.25rem, 5vw, 5rem);
}

.site-header {
    border-bottom: 1px solid #ded4c8;
}

.brand {
    color: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

main {
    display: grid;
    place-items: center;
    padding: 3rem 1.25rem;
}

.welcome {
    width: min(100%, 36rem);
    padding: clamp(1.25rem, 4vw, 2.5rem);
    text-align: center;
    background: #fff;
    border: 1px solid #eee6dc;
    border-radius: 1.5rem;
    box-shadow: 0 1.25rem 3rem rgb(88 65 43 / 8%);
}

.welcome-logo {
    display: block;
    width: min(100%, 29.125rem);
    height: auto;
    margin: 0 auto;
}

.welcome p {
    margin: 1.5rem 0 0;
    font-family: system-ui, sans-serif;
    font-size: 1.1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-footer {
    color: #74685f;
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    text-align: center;
}

.admin-body {
    min-height: 100vh;
    display: block;
    color: #302a26;
    background: #f5f0e9;
    font-family: system-ui, sans-serif;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 5vw, 4rem);
    color: #fff;
    background: #604b38;
}

.admin-nav {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.admin-nav a {
    color: inherit;
}

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

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    margin: 1rem 0;
}

.checkbox-row input {
    margin: 0;
    width: auto;
}

.admin-actions {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.danger-zone {
    border-top: 1px solid #d7c8c0;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.button-danger {
    background: #8c2633;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.75rem 1rem;
}

.public-section {
    margin: 3rem auto;
    max-width: 70rem;
    padding: 0 1.25rem;
}

.home-events {
    max-width: none;
    width: min(100%, 36rem);
}

.home-showcase {
    max-width: none;
    width: min(100%, 36rem);
}

.home-events .event-grid,
.home-showcase .item-grid {
    grid-template-columns: 1fr;
}

.home-showcase .item-card-image {
    aspect-ratio: auto;
    height: auto;
    object-fit: initial;
}

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

.eyebrow {
    color: #7b4860;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.event-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    margin-top: 1.5rem;
}

.event-card {
    background: #fffaf7;
    border: 1px solid #e7d8d0;
    border-radius: 1rem;
    padding: 1.25rem;
}

.event-card-image {
    background: #fff;
    border-radius: 0.75rem;
    display: block;
    height: auto;
    margin: 0;
    max-height: 36rem;
    object-fit: contain;
    width: 100%;
}

.event-card .image-zoom-trigger,
.event-card .home-card-image-link {
    display: block;
    margin: -0.5rem -0.5rem 1rem;
    width: calc(100% + 1rem);
}

.event-card h2,
.event-card h3 {
    margin: 0.35rem 0 0.75rem;
}

.event-date {
    color: #744057;
    font-weight: 700;
}

.event-cancelled {
    color: #9a2334;
    font-weight: 800;
}

.event-details dl {
    display: grid;
    gap: 0.5rem 1.25rem;
    grid-template-columns: max-content 1fr;
    margin: 2rem 0;
}

.event-details dt {
    font-weight: 800;
}

.event-description {
    line-height: 1.7;
    white-space: pre-line;
}

.event-poster {
    background: #fff;
    border-radius: 1rem;
    display: block;
    margin: 0;
    max-height: 42rem;
    object-fit: contain;
    width: 100%;
}

.event-gallery,
.admin-photo-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    margin-top: 2rem;
}

.event-gallery figure,
.admin-photo-grid article {
    margin: 0;
}

.event-gallery img,
.admin-photo-grid img,
.admin-event-image {
    border-radius: 0.75rem;
    display: block;
    max-width: 100%;
}

.event-gallery img,
.admin-photo-grid img {
    aspect-ratio: 4 / 3;
    object-fit: contain;
    width: 100%;
}

.event-gallery figcaption,
.admin-photo-grid p {
    line-height: 1.5;
    padding: 0.65rem 0;
}

.admin-event-image {
    margin: 1rem 0;
    max-height: 28rem;
    object-fit: contain;
}

.event-media-admin {
    border-top: 1px solid #d7c8c0;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
}

.event-media-admin form {
    margin-top: 1.25rem;
}

.field-help {
    color: #665a56;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.item-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    margin-top: 1.5rem;
}

.item-card {
    background: #fffaf7;
    border: 1px solid #e7d8d0;
    border-radius: 1rem;
    overflow: hidden;
    padding-bottom: 1rem;
}

.item-card-image {
    aspect-ratio: 1 / 1;
    background: #fff;
    display: block;
    object-fit: contain;
    width: 100%;
}

.item-card .image-zoom-trigger,
.item-card .home-card-image-link {
    display: block;
    width: 100%;
}

.home-card-image-link:focus-visible {
    outline: 3px solid #9e5977;
    outline-offset: 3px;
}

.item-card h2,
.item-card h3,
.item-card > p {
    margin-left: 1rem;
    margin-right: 1rem;
}

.item-card h2,
.item-card h3 {
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.item-search {
    margin: 1.5rem 0 2rem;
    max-width: 36rem;
}

.item-search > div {
    display: flex;
    gap: 0.75rem;
}

.item-search input {
    flex: 1;
}

.item-main-image {
    background: #fff;
    border-radius: 1rem;
    display: block;
    margin: 0;
    max-height: 48rem;
    object-fit: contain;
    width: 100%;
}

.item-description {
    line-height: 1.7;
    white-space: pre-line;
}

.item-gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    margin: 2rem 0;
}

.item-gallery figure {
    margin: 0;
}

.item-gallery img {
    aspect-ratio: 1 / 1;
    border-radius: 0.75rem;
    display: block;
    object-fit: contain;
    width: 100%;
}

.item-gallery figcaption {
    line-height: 1.5;
    padding: 0.65rem 0;
}

.image-zoom-trigger {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: zoom-in;
    display: block;
    font: inherit;
    padding: 0;
}

.image-zoom-trigger:focus-visible {
    outline: 3px solid #9e5977;
    outline-offset: 3px;
}

.detail-image-trigger {
    margin: 1.5rem auto;
    width: min(100%, 36rem);
}

.event-gallery .image-zoom-trigger,
.item-gallery .image-zoom-trigger {
    width: 100%;
}

.image-viewer {
    align-items: center;
    background: rgb(35 24 29 / 94%);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 1000;
}

.image-viewer-stage {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    overflow: hidden;
    position: absolute;
}

.image-viewer-image {
    cursor: grab;
    max-height: calc(100vh - 7rem);
    max-width: calc(100vw - 2rem);
    object-fit: contain;
    touch-action: none;
    transform-origin: center;
    user-select: none;
    will-change: transform;
}

.image-viewer-image.is-dragging {
    cursor: grabbing;
}

.image-viewer-controls {
    align-items: center;
    background: rgb(255 250 247 / 96%);
    border-radius: 999px;
    bottom: 1rem;
    box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 35%);
    display: flex;
    gap: 0.35rem;
    padding: 0.4rem;
    position: absolute;
    z-index: 1;
}

.image-viewer-control {
    align-items: center;
    background: #744057;
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 1.2rem;
    font-weight: 800;
    height: 2.75rem;
    justify-content: center;
    min-width: 2.75rem;
    padding: 0 0.8rem;
}

.image-viewer-control:hover,
.image-viewer-control:focus-visible {
    background: #542d40;
}

.image-viewer-reset {
    font-size: 0.9rem;
}

.image-viewer-close {
    background: #922b42;
    font-size: 1.5rem;
}

@media (max-width: 42rem) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .admin-nav {
        margin-left: 0;
        width: 100%;
    }
}

.admin-header a {
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.admin-header form {
    margin: 0;
}

.admin-main {
    display: block;
    max-width: 70rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 4rem) 1rem;
}

.admin-panel {
    padding: clamp(1.25rem, 4vw, 2.5rem);
    background: #fff;
    border: 1px solid #ded4c8;
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgb(65 45 28 / 8%);
}

.admin-panel-narrow {
    max-width: 34rem;
    margin: 0 auto;
}

.admin-panel h1 {
    margin-top: 0;
    font-family: Georgia, "Times New Roman", serif;
}

.admin-panel form:not(:last-child) {
    margin-bottom: 1.5rem;
}

.admin-panel label:not(.check-label) {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.admin-panel input:not([type="checkbox"]) {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #aa9a8b;
    border-radius: 0.4rem;
    font: inherit;
}

.admin-panel input:focus {
    outline: 3px solid rgb(181 116 64 / 25%);
    border-color: #9b5d31;
}

.check-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 1.25rem 0;
}

.admin-title-row,
.button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.button-primary,
.button-secondary,
.button-link {
    display: inline-block;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.button-primary {
    color: #fff;
    background: #9b5d31;
}

.button-secondary {
    color: #4a392b;
    border-color: #aa9a8b;
    background: #fff;
}

.button-link {
    padding: 0;
    color: #fff;
    background: transparent;
}

.table-scroll {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #e7ded4;
    text-align: left;
}

.validation-summary,
.field-validation-error {
    color: #9a2727;
}

.status-message {
    padding: 0.75rem 1rem;
    border-radius: 0.4rem;
    color: #234c2c;
    background: #e5f4e8;
}

.admin-panel hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #e7ded4;
}

@media (max-width: 40rem) {
    .admin-title-row,
    .button-row {
        align-items: stretch;
        flex-direction: column;
    }
}
