body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f4f4f4;
    color: #333;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: #222;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .logo {
    font-weight: bold;
    font-size: 1.2rem;
}

.site-header nav a {
    color: #fff;
    margin-left: 16px;
    text-decoration: none;
}

.site-header nav a:hover {
    text-decoration: underline;
}

.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.gallery-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.gallery-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.gallery-item-info {
    padding: 10px 12px 12px;
}

.gallery-item-title {
    font-weight: 600;
    margin-bottom: 8px;
}

/* Комментарии */
.comments {
    margin-bottom: 8px;
}

.comment {
    margin-bottom: 4px;
    font-size: 0.9rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Формы */
.comment-form textarea,
.comment-form input[type="text"],
.upload-form input[type="text"],
.upload-form input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 6px;
    padding: 6px 8px;
    font-size: 0.9rem;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

button:hover {
    background-color: #0056b3;
}

/* Кнопка удаления */
.delete-form button {
    background-color: #dc3545;
}

.delete-form button:hover {
    background-color: #b02a37;
}

.comment-delete-form button {
    background-color: #dc3545;
    padding: 4px 8px;
    font-size: 0.8rem;
}

.comment-delete-form button:hover {
    background-color: #b02a37;
}

/* Модальное окно для полноэкранного просмотра */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-image {
    max-width: 95vw;
    max-height: 95vh;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .site-header nav {
        margin-top: 8px;
    }
}
.title-form {
    display: flex;
    gap: 6px;
}

.title-form input[type="text"] {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.9rem;
}
