* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background: #000000;
    overflow-x: hidden;
}

.site-title {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
}

.layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    width: 100vw;
    min-height: 100vh;
    padding: 48px 0 0;
    position: relative;
}

.gallery-layout {
    align-items: stretch;
}

.image-panel {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

.image-panel img {
    display: block;
    width: 100%;
    height: calc(100vh - 48px);
    object-fit: cover;
}

.contact-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 440px;
    padding: 28px 32px;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    line-height: 1.6;
    text-align: center;
}

.contact-card p {
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.contact-card p:first-child {
    margin-bottom: 14px;
    font-size: 1.45rem;
    font-weight: 600;
}

.contact-card p:last-child {
    margin-bottom: 0;
}

.contact-card a {
    color: #ffffff;
    text-decoration: none;
}

.contact-card a:hover,
.contact-card a:focus-visible {
    text-decoration: underline;
}

.sidebar {
    width: 183.333px;
    align-self: stretch;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #000000;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    width: 100%;
}

.menu a {
    width: 100%;
    flex: 1 1 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #ffffff;
    text-decoration: none;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    background: #000000;
    border: 1px solid #1f1f1f;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
    background: #171717;
    transform: translateX(-3px);
}

.gallery-panel {
    flex: 1 1 auto;
    min-height: calc(100vh - 48px);
    padding: 96px 48px 48px;
    background-image: linear-gradient(rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.72)), url("background.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

.gallery-item {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.04);
}

.gallery-empty {
    color: #ffffff;
    font-size: 1.1rem;
}

.lightbox {
    width: min(92vw, 1100px);
    padding: 24px;
    border: 0;
    background: rgba(0, 0, 0, 0.94);
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.lightbox img {
    display: block;
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 14px;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
}

.admin-page {
    background-image: linear-gradient(rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.7)), url("background.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.admin-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    width: min(1100px, calc(100vw - 48px));
    margin: 0 auto;
    padding: 90px 0 40px;
}

.admin-card {
    padding: 28px;
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
}

.admin-card h1,
.admin-card h2 {
    margin-top: 0;
}

.admin-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.upload-form {
    display: grid;
    gap: 14px;
}

.upload-form input,
.upload-form button {
    font: inherit;
}

.upload-form input[type="text"],
.upload-form input[type="password"] {
    padding: 12px 14px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.upload-form input[type="file"] {
    padding: 10px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.upload-form button {
    padding: 14px 18px;
    border: 0;
    color: #ffffff;
    background: #000000;
    cursor: pointer;
}

.secondary-button,
.delete-button {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
    cursor: pointer;
}

.admin-message {
    margin: 16px 0;
    padding: 12px 14px;
}

.admin-message-success {
    background: rgba(20, 93, 42, 0.8);
}

.admin-message-error {
    background: rgba(134, 30, 30, 0.82);
}

.admin-gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.admin-gallery-list figure {
    margin: 0;
}

.admin-gallery-list img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 8px;
}

.admin-gallery-list figcaption {
    margin-bottom: 10px;
    font-size: 0.85rem;
    word-break: break-word;
}

.admin-gallery-list form {
    margin: 0;
}

.admin-layout-single {
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
}

.admin-login-card {
    width: 100%;
}

@media (max-width: 700px) {
    .site-title {
        top: 10px;
        width: calc(100% - 32px);
        font-size: 1.2rem;
    }

    .layout {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 52px 0 0;
    }

    .image-panel {
        width: 100%;
    }

    .image-panel img {
        height: auto;
    }

    .contact-card {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: calc(100% - 40px);
        max-width: none;
        padding: 22px 24px;
    }

    .sidebar {
        width: 100%;
        align-self: auto;
    }

    .gallery-panel {
        min-height: auto;
        padding: 88px 20px 28px;
    }

    .menu {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .menu a {
        aspect-ratio: auto;
        min-height: 120px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
        width: calc(100vw - 24px);
        padding: 84px 0 24px;
    }

    .admin-card-header {
        flex-direction: column;
    }
}
