:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #24211f;
    background: #f7f5f1;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

button,
input {
    font: inherit;
}

.page {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0 96px;
}

.page-header {
    margin-bottom: 36px;
}

.eyebrow {
    margin: 0 0 10px;
    color: #95684d;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.045em;
}

.intro {
    margin-bottom: 0;
    color: #77716c;
    font-size: 1.05rem;
}

.admin-panel {
    margin: 0 0 30px;
    padding: 22px 24px;
    border: 1px solid #e6e0d9;
    border-radius: 12px;
    background: #fff;
}

.admin-panel h2 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.admin-panel p:last-child {
    margin-bottom: 0;
    color: #77716c;
}

.panel-heading,
.upload-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.panel-heading h2 {
    margin: 0;
}

.upload-form,
.login-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.sign-in summary {
    cursor: pointer;
    font-weight: 650;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

input[type="file"],
input[type="password"] {
    min-width: 0;
    padding: 10px;
    border: 1px solid #d8d1c9;
    border-radius: 7px;
    background: #fff;
}

input[type="password"] {
    flex: 1;
}

.primary-button,
.text-button {
    border: 0;
    cursor: pointer;
}

.primary-button {
    flex: none;
    padding: 11px 16px;
    border-radius: 7px;
    color: #fff;
    background: #704b39;
    font-weight: 650;
}

.primary-button:hover {
    background: #583a2c;
}

.text-button {
    padding: 6px 0;
    color: #704b39;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
}

.message {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 7px;
}

.success {
    color: #245b3e;
    background: #e8f4ec;
}

.error {
    color: #8a3027;
    background: #fbecea;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 18px;
}

.photo-item {
    min-width: 0;
}

.photo-card {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #e9e3dc;
    cursor: zoom-in;
}

.photo-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.photo-card:hover img {
    transform: scale(1.035);
}

.delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.delete-button {
    padding: 6px 0;
    border: 0;
    color: #8a3027;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.delete-button:hover {
    color: #641e18;
}

.empty-state {
    display: grid;
    min-height: 270px;
    place-content: center;
    justify-items: center;
    padding: 32px;
    border: 1px dashed #d7cfc6;
    border-radius: 12px;
    color: #77716c;
    text-align: center;
}

.empty-state h2 {
    margin: 14px 0 7px;
    color: #37312d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.6rem;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
}

.empty-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #d7cfc6;
    border-radius: 50%;
    font-size: 1.7rem;
    font-weight: 300;
}

.lightbox {
    position: fixed;
    width: min(100vw, 100%);
    max-width: none;
    height: min(100dvh, 100%);
    max-height: none;
    padding: 60px 76px;
    border: 0;
    background: rgb(20 18 17 / 96%);
    color: #fff;
}

.lightbox::backdrop {
    background: rgb(20 18 17 / 96%);
}

.lightbox-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgb(255 255 255 / 13%);
    cursor: pointer;
}

.lightbox-close {
    top: 16px;
    right: 18px;
    font-size: 1.8rem;
}

.lightbox-nav {
    top: 50%;
    font-size: 2rem;
    transform: translateY(-50%);
}

.lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.previous {
    left: 16px;
}

.next {
    right: 16px;
}

.lightbox-count {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    margin: 0;
    color: #e8e4e1;
    text-align: center;
}

@media (max-width: 600px) {
    .page {
        width: min(100% - 28px, 1120px);
        padding: 46px 0 64px;
    }

    .admin-panel {
        padding: 18px;
    }

    .upload-controls {
        align-items: stretch;
        flex-direction: column;
    }

    input[type="file"] {
        width: 100%;
    }

    .lightbox {
        padding: 58px 12px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 10px;
        transform: none;
    }
}
