:root {
    --color-bg: #fbf6ee;
    --color-surface: #ffffff;
    --color-text: #2c1f12;
    --color-muted: #6b5a48;
    --color-border: #e7dccb;
    --color-orange: #b85427;
    --color-orange-dark: #8d3c17;
    --color-green: #2f5240;
    --color-green-dark: #1f3a2c;
    --color-brown: #5b3a1e;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--color-text);
    background:
        radial-gradient(1200px 800px at 85% -10%, #f3e3c8 0%, transparent 60%),
        radial-gradient(900px 700px at 5% 110%, #e6dfcd 0%, transparent 55%),
        var(--color-bg);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    color: var(--color-green-dark);
    letter-spacing: 0.01em;
}

header {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

header nav a {
    font-weight: 600;
    text-decoration: none;
    color: var(--color-orange-dark);
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-muted);
    background: var(--color-surface);
}

.hero {
    padding: 0.5rem 0 2rem;
    text-align: center;
}
.hero h1 {
    margin-bottom: 0.25rem;
    font-size: clamp(2.75rem, 7vw, 4.25rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-orange-dark);
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.hero h1 .amp {
    font-family: 'Italianno', 'Cormorant Garamond', cursive;
    font-style: normal;
    font-weight: 400;
    color: var(--color-green-dark);
    font-size: 1.4em;
    line-height: 0;
    margin: 0 -0.05em 0 -.2em;
    vertical-align: -0.08em;
    letter-spacing: 0;
}
.hero .ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 0.75rem auto 1.25rem;
    color: var(--color-green-dark);
    opacity: 0.65;
}
.hero .ornament::before,
.hero .ornament::after {
    content: '';
    width: clamp(48px, 12vw, 96px);
    height: 1px;
    background: linear-gradient(to right, transparent, currentColor, transparent);
}
.hero .ornament span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--color-orange);
    box-shadow: 0 0 0 4px rgba(184, 84, 39, 0.08);
}
.hero .subtitle {
    color: var(--color-green-dark);
    font-size: 1.35rem;
    font-style: italic;
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.hero .hero-help {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 32rem;
    margin: 0 auto;
}

.auth { max-width: 400px; margin: 2rem auto; background: var(--color-surface); padding: 2rem; border-radius: 6px; border: 1px solid var(--color-border); }
.auth h1 { margin-bottom: 1rem; }
.auth label { display: block; margin-bottom: 1rem; color: var(--color-brown); }
.auth input { display: block; width: 100%; padding: 0.5rem; margin-top: 0.25rem; border: 1px solid var(--color-border); border-radius: 4px; background: var(--color-bg); color: var(--color-text); font-family: inherit; font-size: 1rem; }
.auth input:focus { outline: 2px solid var(--color-orange); outline-offset: 1px; }

.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--color-orange);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    letter-spacing: 0.03em;
}
.btn:hover { background: var(--color-orange-dark); }

.error { color: #842020; margin-bottom: 1rem; padding: 0.5rem; background: #f7e6e1; border: 1px solid #e6c7be; border-radius: 4px; }

.error-page { text-align: center; padding: 3rem 0; }
.error-page h1 { margin-bottom: 0.5rem; color: var(--color-orange-dark); }
.error-page a { color: var(--color-green-dark); }

.empty-state { text-align: center; padding: 2.5rem 1.5rem; color: var(--color-muted); border: 1px dashed var(--color-border); border-radius: 10px; margin: 2rem 0; background: rgba(255,255,255,0.55); font-style: italic; }

.photo-strip { margin: 2rem 0; }

.photo-grid { display: grid; gap: 1rem; }
.photo-grid-strip { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.photo-grid-admin { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }

.photo-tile {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    aspect-ratio: 1 / 1;
    box-shadow: 0 1px 2px rgba(91, 58, 30, 0.06), 0 8px 20px -12px rgba(91, 58, 30, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease;
}
.photo-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(91, 58, 30, 0.08), 0 16px 32px -14px rgba(91, 58, 30, 0.28);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; image-orientation: from-image; }

.photo-tile-admin { aspect-ratio: auto; padding: 0; margin: 0; }
.photo-tile-admin > a { display: block; aspect-ratio: 4 / 3; }
.photo-tile-admin figcaption { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--color-border); }
.photo-name { color: var(--color-muted); font-size: 0.9rem; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.uploader {
    margin: 1.5rem auto 2.5rem;
    padding: 1.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(91, 58, 30, 0.05), 0 12px 28px -16px rgba(91, 58, 30, 0.18);
    max-width: 640px;
}
.upload-buttons { display: flex; gap: 0.85rem; flex-wrap: wrap; justify-content: center; }

.btn {
    transition: background 150ms ease, transform 120ms ease, box-shadow 150ms ease;
}
.btn-primary { background: var(--color-orange); color: #fff; padding: 0.7rem 1.75rem; border-radius: 999px; font-size: 1.05rem; box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 6px 14px -6px rgba(184, 84, 39, 0.55); }
.btn-primary:hover { background: var(--color-orange-dark); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 10px 18px -6px rgba(141, 60, 23, 0.55); }
.btn-secondary { background: var(--color-green-dark); color: #fff; padding: 0.7rem 1.75rem; border-radius: 999px; font-size: 1.05rem; box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 6px 14px -6px rgba(31, 58, 44, 0.55); }
.btn-secondary:hover { background: var(--color-green); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(0,0,0,0.05), 0 10px 18px -6px rgba(47, 82, 64, 0.55); }
.btn-small { padding: 0.3rem 0.85rem; font-size: 0.85rem; background: var(--color-orange); color: #fff; text-decoration: none; border-radius: 999px; }
.btn-small:hover { background: var(--color-orange-dark); }

.upload-progress { margin-top: 1.5rem; }
.upload-progress-bar { width: 100%; height: 10px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 999px; overflow: hidden; }
.upload-progress-fill { height: 100%; background: var(--color-orange); width: 0%; transition: width 120ms ease; }
.upload-progress-label { margin-top: 0.5rem; color: var(--color-muted); font-size: 0.95rem; text-align: center; }
.upload-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 240px; overflow-y: auto; border-top: 1px solid var(--color-border); }
.upload-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.25rem; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.upload-item-name { color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-status { color: var(--color-muted); flex-shrink: 0; }
.upload-item.done .upload-item-status { color: var(--color-green-dark); }
.upload-item.failed .upload-item-status { color: #842020; }

.admin-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.admin-meta { color: var(--color-muted); font-size: 0.9rem; }
.admin-meta a { color: var(--color-orange-dark); }
