/* grámoments — brand stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

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

:root {
    --burgundy:     #6D1E34;
    --burgundy-dk:  #4e1525;
    --burgundy-lt:  #8a2a44;
    --lilac:        #C8A2C8;
    --lilac-lt:     #e0cce0;
    --lilac-dk:     #a87ca8;
    --champagne:    #EADCC5;
    --champagne-dk: #d4c4a8;
    --champagne-lt: #f5f0e8;
    --cream:        #faf8f5;
    --text-dark:    #2a0d18;
    --text-mid:     #7a4a58;
    --text-light:   #b08898;
    --border:       #e8ddd5;
    --white:        #ffffff;
}

body {
    font-family: 'Jost', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-weight: 300;
}

/* ── Top bar ── */
.top-bar {
    background: var(--lilac);
    border-bottom: 3px solid var(--lilac-dk);
    padding: 0 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.top-bar .logo img {
    height: 44px;
    width: auto;
    display: block;
}

.top-bar nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ── Page container ── */
.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* ── Typography ── */
h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 500;
    color: var(--burgundy);
    margin: 0 0 0.25rem;
    letter-spacing: 0.01em;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--burgundy);
    margin: 0 0 1rem;
    letter-spacing: 0.02em;
}

p {
    margin: 0 0 1rem;
    color: var(--text-mid);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    font-family: 'Jost', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--burgundy);
    color: var(--champagne-lt);
}
.btn-primary:hover { background: var(--burgundy-dk); }

.btn-secondary {
    background: transparent;
    color: var(--burgundy);
    border: 1px solid var(--burgundy);
}
.btn-secondary:hover {
    background: var(--burgundy);
    color: var(--champagne-lt);
}

.btn-danger {
    background: transparent;
    color: #a33;
    border: 1px solid #e8cccc;
}
.btn-danger:hover { background: #fdf0f0; }

.btn-ghost {
    background: transparent;
    color: var(--burgundy);
    border: 1px solid var(--border);
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
}
.btn-ghost:hover {
    background: var(--champagne-lt);
    border-color: var(--burgundy);
}

/* ── Form elements ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-family: 'Jost', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
    color: var(--text-dark);
    margin-bottom: 0.85rem;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--lilac-dk);
}

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 0.3rem;
}

/* ── Cards ── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--lilac);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h2 { margin-bottom: 1rem; }

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--lilac);
}

.section-header h2 { margin: 0; }

/* ── Action row ── */
.action-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.copy-confirm {
    font-size: 0.8rem;
    color: var(--lilac-dk);
    opacity: 0;
    transition: opacity 0.3s;
    font-style: italic;
}
.copy-confirm.show { opacity: 1; }

/* ── Status messages ── */
.msg-error   { color: #a33; font-size: 0.82rem; margin-top: 0.5rem; }
.msg-success { color: #2a6b3a; font-size: 0.82rem; margin-top: 0.5rem; font-style: italic; }
.msg-muted   { color: var(--text-light); font-size: 0.82rem; }

/* ── Photo grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

.photo-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    transition: box-shadow 0.2s;
}

.photo-card:hover {
    box-shadow: 0 4px 20px rgba(109, 30, 52, 0.1);
}

.photo-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.photo-card .photo-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.65rem;
}

.photo-card .photo-actions a,
.photo-card .photo-actions button {
    flex: 1;
    padding: 0.4rem 0.5rem;
    font-family: 'Jost', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.photo-card .photo-actions a {
    background: var(--burgundy);
    color: var(--champagne-lt);
    border: none;
}
.photo-card .photo-actions a:hover { background: var(--burgundy-dk); }

.photo-card .photo-actions button {
    background: transparent;
    color: #a33;
    border: 1px solid #e8cccc;
}
.photo-card .photo-actions button:hover { background: #fdf0f0; }

/* ── Album list ── */
.album-list { list-style: none; padding: 0; margin: 0; }

.album-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1rem 1.5rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
}

.album-item:hover { box-shadow: 0 2px 12px rgba(109, 30, 52, 0.07); }
.album-item strong { font-size: 0.95rem; font-weight: 500; color: var(--burgundy); }
.album-item small  { color: var(--text-light); font-size: 0.8rem; }
.album-item .assigned { color: var(--text-mid); font-size: 0.83rem; margin: 0.3rem 0 0.75rem; }

.album-actions { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

.album-footer {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.album-footer select {
    flex: 1;
    margin: 0;
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

/* ── Organiser list ── */
.org-list { list-style: none; padding: 0; margin: 0; }

.org-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

/* ── QR table ── */
.qr-table-wrap { overflow-x: auto; margin-bottom: 2rem; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

th {
    text-align: left;
    font-family: 'Jost', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--burgundy);
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--lilac);
    background: var(--lilac-lt);
}

td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid #f5eeea;
    vertical-align: middle;
    color: var(--text-mid);
}

tr:last-child td { border-bottom: none; }

.token {
    font-family: monospace;
    background: var(--champagne-lt);
    color: var(--burgundy);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.78rem;
}

.target { font-family: monospace; font-size: 0.78rem; color: var(--text-light); }

.update-row { display: flex; gap: 6px; align-items: center; }
.update-row select {
    flex: 1;
    margin: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
}
.qr-msg { font-size: 0.78rem; margin-top: 4px; }

/* ── Upload file input ── */
.file-label {
    display: block;
    width: 100%;
    padding: 0.85rem;
    border: 1.5px dashed var(--lilac);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-mid);
    text-align: center;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    background: rgba(200, 162, 200, 0.05);
}
.file-label:hover {
    border-color: var(--lilac-dk);
    background: rgba(200, 162, 200, 0.1);
}
.file-label input[type="file"] { display: none; }

/* ── Album info block ── */
.album-info {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--burgundy);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.album-info .album-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--burgundy);
    margin: 0 0 0.2rem;
}
.album-info .album-meta { font-size: 0.83rem; color: var(--text-light); margin: 0; }

/* ── Slug hint ── */
.slug-hint { font-size: 0.72rem; color: var(--text-light); margin: 0 0 0.25rem; letter-spacing: 0.04em; }

/* ── QR image ── */
.qr-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 0 0 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .top-bar { padding: 0 1.25rem; }
    .page { padding: 1.5rem 1rem; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .album-footer { flex-wrap: wrap; }
    table { font-size: 0.78rem; }
    th, td { padding: 0.6rem 0.75rem; }
}

/* ── Lightbox ── */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 13, 24, 0.95);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--champagne);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(234, 220, 197, 0.1);
    border: 1px solid rgba(234, 220, 197, 0.2);
    color: var(--champagne);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.75rem 1.1rem;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}

.lightbox-arrow:hover { background: rgba(234, 220, 197, 0.2); }
.lightbox-arrow.prev { left: 1.25rem; }
.lightbox-arrow.next { right: 1.25rem; }

.lightbox-counter {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(234, 220, 197, 0.5);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

/* ── Login / Upload page centering ── */
body.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--lilac-lt) 0%, var(--champagne-lt) 60%);
}

body.centered-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: linear-gradient(160deg, var(--lilac-lt) 0%, var(--champagne-lt) 60%);
}

.auth-wrap {
    width: 100%;
    max-width: 380px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-logo img { height: 80px; }

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.25rem;
    box-shadow: 0 4px 32px rgba(109, 30, 52, 0.08);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin: 0 0 0.2rem;
}

.auth-card > p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 1.75rem;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.82rem;
    text-align: center;
    margin-top: 0.25rem;
}

/* ── Upload guest card ── */
.upload-wrap {
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.upload-logo { margin-bottom: 2rem; }
.upload-logo img { height: 160px; }

.upload-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2.25rem;
    box-shadow: 0 4px 32px rgba(109, 30, 52, 0.08);
}

.camera-icon {
    width: 52px;
    height: 52px;
    background: var(--burgundy);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.upload-card h1 {
    font-size: 1.5rem;
    margin: 0 0 0.4rem;
}

.upload-card p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 0 1.5rem;
}

.upload-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.82rem;
    margin-top: 0.25rem;
}

#file-name {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    min-height: 1.2rem;
    font-style: italic;
}

#status { margin-top: 1rem; font-size: 0.88rem; min-height: 1.2rem; }