:root {
    --bg: #f4f1ea;
    --card: #ffffff;
    --text: #252525;
    --muted: #666666;
    --line: #d8d1c4;
    --accent: #5f6f3e;
    --accent-dark: #46532f;
    --danger: #8a2e2e;
    --success: #2f6b3f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.wrap {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: linear-gradient(135deg, #29351f, #5f6f3e);
    color: #ffffff;
    padding: 42px 0;
}

.site-header h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 3rem);
}

.site-header p {
    margin: 0;
    max-width: 720px;
    color: rgba(255, 255, 255, 0.9);
}

.site-footer {
    margin-top: 40px;
    padding: 24px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.project-list {
    padding: 30px 0;
    display: grid;
    gap: 24px;
}

.project-card,
.form-card,
.empty-state {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

.project-card h2,
.form-card h2,
.empty-state h2 {
    margin-top: 0;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 14px;
}

.description {
    white-space: normal;
    margin-bottom: 14px;
}

.posted-by {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.image-button {
    appearance: none;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.image-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.image-button:hover img {
    transform: scale(1.03);
}

.form-card {
    margin: 30px auto;
    max-width: 720px;
}

form {
    display: grid;
    gap: 14px;
}

label {
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

button,
.form-card a.button-link {
    border: none;
    background: var(--accent);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

button:hover,
.form-card a.button-link:hover {
    background: var(--accent-dark);
}

.help-text {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: -4px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert.error {
    background: #f8e9e9;
    color: var(--danger);
    border: 1px solid #e4bebe;
}

.alert.success {
    background: #e8f4ec;
    color: var(--success);
    border: 1px solid #b9d9c2;
}

.logged-in-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.logged-in-row p {
    margin: 0;
}

.logged-in-row a {
    color: var(--accent-dark);
    font-weight: 700;
}

.empty-state {
    margin: 30px 0;
    text-align: center;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.86);
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: min(100%, 1100px);
    max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111111;
    font-size: 32px;
    line-height: 1;
    padding: 0;
}

@media (max-width: 760px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card,
    .form-card,
    .empty-state {
        padding: 18px;
    }

    .logged-in-row {
        align-items: flex-start;
        flex-direction: column;
    }
}