:root {
    color-scheme: light;
}

body {
    background: #F4F1EB;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem;
}

/* ── Brand colours ─────────────────────────────────────────── */
.site-header {
    background: #501964;
    color: #fff;
    padding: 1.25rem 1.5rem;
    text-align: center;
}

.site-header__logo {
    display: block;
    margin: 0 auto 0.5rem;
    width: clamp(80px, 20vw, 160px);
    height: auto;
}

.site-header__title {
    margin: 0;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    font-weight: 700;
    color: #fff;
}

.site-header a {
    color: inherit;
    text-decoration: none;
}

.admin-header {
    background: #501964;
    color: #fff;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.admin-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.admin-header__title {
    font-weight: 700;
}

.admin-header__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.admin-header__nav a {
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.95rem;
}

.admin-header__nav a:hover,
.admin-header__nav a:focus {
    background: rgba(255, 255, 255, 0.15);
}

.admin-header__user {
    font-size: 0.9rem;
    opacity: 0.9;
}

.btn-brand {
    background: #501964;
    border-color: #501964;
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus {
    background: #245c3f;
    border-color: #245c3f;
    color: #fff;
}

/* ── Public inventory ─────────────────────────────────────── */
.hero {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.homepage {
    background: #f6f2ea;
}

.homepage .homepage-intro h2,
.homepage .homepage-card h3 {
    color: #6b5876;
}

.homepage .button {
    background: #6b5876;
}

.homepage .button:hover,
.homepage .button:focus {
    background: #584763;
}

.homepage .hero,
.homepage .homepage-card {
    background: #fcfbf7;
    box-shadow: 0 0 0 1px #e5e1d2;
}

.homepage-hero {
    display: grid;
    gap: 1rem;
}

.homepage-logo {
    width: min(100%, 460px);
    height: auto;
}

.homepage-intro h2 {
    margin-top: 0;
}

.homepage-cards {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    margin-bottom: 1.5rem;
}

.homepage-card {
    border-radius: 8px;
    border-left: 4px solid #6b5876;
    padding: 1.25rem 1.5rem;
}

.homepage-card h3 {
    margin-top: 0;
}

.homepage-card p {
    margin-bottom: 0;
}

.homepage-card__action {
    margin-top: 1rem;
}

.site-footer {
    background: #501964;
    color: rgba(255, 255, 255, 0.85);
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.site-footer a {
    color: #fff;
}

.button,
button:not(.btn) {
    background: #501964;
    border: 0;
    color: #fff;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button.secondary {
    background: #4f4f4f;
}

.inventory-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.inventory-controls input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
}

.inventory-note {
    margin-top: -0.25rem;
    margin-bottom: 1rem;
}

.inventory-note a {
    color: #584763;
    font-weight: 600;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-btn.active {
    background: #be9ad6;
}

.inventory.grid-view {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .inventory.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.inventory.list-view {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.inventory-item {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.inventory.list-view .inventory-item {
    flex-direction: column;
}

@media (min-width: 540px) {
    .inventory.list-view .inventory-item {
        flex-direction: row;
    }
}

.image-wrap {
    background: #ececec;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.inventory.list-view .image-wrap {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
}

@media (min-width: 540px) {
    .inventory.list-view .image-wrap {
        width: 180px;
        min-width: 180px;
        height: 120px;
        aspect-ratio: unset;
    }
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content {
    padding: 0.75rem;
}

.inventory-meta {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #444;
}

.tags {
    color: #335;
    font-size: 0.9rem;
}

/* ── Admin dashboard filters ───────────────────────────────── */
.dashboard-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dashboard-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-filter-label {
    font-weight: 600;
    white-space: nowrap;
}

/* ── Admin tables ──────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    vertical-align: top;
}

.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.inline-form {
    display: inline;
}

/* ── Photo picker ──────────────────────────────────────────── */
.photo-picker {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 280px;
    background: #e9ecef;
    border-radius: 0.5rem;
    cursor: pointer;
    overflow: hidden;
    border: 2px dashed #adb5bd;
    transition: border-color 0.2s;
}

.photo-picker:hover,
.photo-picker:focus-within {
    border-color: #501964;
}

.photo-picker__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    pointer-events: none;
    user-select: none;
}

.photo-picker__placeholder svg {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    stroke: currentColor;
}

.photo-picker__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}