:root {
    --ink: #22201d;
    --paper: #faf8f4;
    --accent: #8a3b2e;
    --muted: #6f6a63;
    --border: #ddd6cb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    background: var(--paper);
    color: var(--ink);
}

.site-header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.site-header h1 {
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.03em;
    font-size: 2rem;
}

.gallery-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.empty-message {
    text-align: center;
    color: var(--muted);
    margin-top: 3rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2.5rem;
    justify-items: center;
}

.artwork-card {
    margin: 0;
    text-align: center;
}

.artwork-thumb {
    width: 400px;
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.artwork-thumb:hover {
    opacity: 0.85;
}

.artwork-card figcaption {
    margin-top: 0.6rem;
    font-size: 0.95rem;
}

.artwork-title {
    font-style: italic;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 16, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.lightbox[hidden] { display: none; }

.lightbox-figure {
    margin: 0;
    max-width: 95vw;
    max-height: 90vh;
    text-align: center;
}

.lightbox-figure img {
    max-width: 95vw;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-figure figcaption {
    color: #f2ede4;
    margin-top: 1rem;
    font-size: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.8rem;
    background: none;
    border: none;
    color: #f2ede4;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Admin pages */
.admin-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.admin-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.admin-bar a { color: var(--accent); }

.login-form, .upload-form {
    background: #fff;
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 6px;
    max-width: 420px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.upload-form { max-width: none; }

.login-form label, .upload-form label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-form input, .upload-form input[type=text], .upload-form textarea, .upload-form input[type=file] {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

button, .btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

button:hover, .btn:hover { opacity: 0.9; }

.error-message {
    background: #fbeaea;
    color: #a33;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 0.9rem;
}

.success-message {
    background: #e9f7ec;
    color: #2a7a3b;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 0.9rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
}

.admin-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem;
    background: #fff;
    text-align: center;
}

.admin-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.admin-item .title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.delete-form button {
    background: #a33;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

/* ---------- Navigation, About, Contact ---------- */
html { scroll-behavior: smooth; }

.site-nav {
    margin-top: 1rem;
    display: flex;
    gap: 1.8rem;
    justify-content: center;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.site-nav a { color: var(--ink); text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--accent); }

.section-title {
    text-align: center;
    font-weight: 400;
    font-size: 1.5rem;
    margin: 0 0 2rem;
}

.about {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem 1rem;
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}
.about-photo {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.about-text h2 { margin: 0 0 1rem; font-weight: 400; font-size: 1.5rem; }
.about-text p { margin: 0; line-height: 1.7; font-size: 1.05rem; }

.artwork-card figcaption { display: flex; flex-direction: column; gap: 0.15rem; }


.contact {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    border-top: 1px solid var(--border);
}
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 1.2rem; padding: 0.5rem 0; line-height: 1.5; }
.contact-label {
    width: 5rem;
    flex-shrink: 0;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    padding-top: 0.2rem;
}
.contact a { color: var(--accent); }

@media (max-width: 640px) {
    .about { flex-direction: column; align-items: center; text-align: left; }
    .gallery-grid { grid-template-columns: 1fr; }
}

/* ---------- Admin additions ---------- */
.item-actions { display: flex; gap: 0.5rem; justify-content: center; align-items: center; }
.item-actions form { margin: 0; }
.btn { display: inline-block; text-decoration: none; }
.btn-secondary { background: #555; font-size: 0.85rem; padding: 0.4rem 0.8rem; }
.edit-preview { max-width: 100%; max-height: 220px; display: block; margin-bottom: 1rem; border: 1px solid var(--border); }
.profile-preview { width: 140px; height: 140px; object-fit: cover; border-radius: 50%; display: block; margin-bottom: 0.6rem; border: 1px solid var(--border); }
.upload-form small { display: block; margin: -0.6rem 0 1rem; color: #777; }
.upload-form h3 { margin: 1.5rem 0 1rem; }
.upload-form label.checkbox-label { font-weight: 400; margin-bottom: 1rem; }
.upload-form label.checkbox-label input { width: auto; margin: 0 0.4rem 0 0; }

/* ---------- Artwork description beside each piece ---------- */
.artwork-card { width: 400px; max-width: 100%; }
.artwork-card figcaption { align-items: center; }
.artwork-desc {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-top: 0.35rem;
}

/* ---------- Admin: colour picker ---------- */
.color-row { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.8rem; }
.color-row input[type=color] { width: 56px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: none; margin: 0; }
.color-row input[type=text] { max-width: 140px; margin: 0; }
.color-preview { padding: 1.2rem; border: 1px solid var(--border); border-radius: 4px; margin-bottom: 1.2rem; background: #faf8f4; color: #22201d; font-family: Georgia, serif; }
.upload-form .btn-secondary { margin-left: 0.5rem; }
