:root {
    --color-bg: #2f3327;
    --color-card-bg: #3a3f2f;
    --color-accent: #c1272d;
    --color-accent-secondary: #1e3a5f;
    --color-text: #f2f0e8;
    --color-muted: #8f9280;
    --color-muted-light: #b8bba8;
    --color-border: #4a4f3d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

a {
    color: var(--color-accent-secondary);
}

.icon-pin {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 4px;
    background-color: currentColor;
    vertical-align: -1px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7.6 2 4 5.6 4 10c0 5.2 6.6 11.1 7.3 11.7.4.3 1 .3 1.4 0C13.4 21.1 20 15.2 20 10c0-4.4-3.6-8-8-8zm0 10.8c-1.5 0-2.8-1.3-2.8-2.8S10.5 7.2 12 7.2s2.8 1.3 2.8 2.8-1.3 2.8-2.8 2.8z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C7.6 2 4 5.6 4 10c0 5.2 6.6 11.1 7.3 11.7.4.3 1 .3 1.4 0C13.4 21.1 20 15.2 20 10c0-4.4-3.6-8-8-8zm0 10.8c-1.5 0-2.8-1.3-2.8-2.8S10.5 7.2 12 7.2s2.8 1.3 2.8 2.8-1.3 2.8-2.8 2.8z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* En-tête */
header.site-header {
    background: var(--color-card-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

header.site-header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    flex: 1;
    min-width: 0;
}

header.site-header .brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
}

header.site-header .brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

header.site-header .brand-name {
    color: var(--color-text);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

header.site-header .brand-subtitle {
    color: var(--color-muted);
    font-size: 0.7rem;
    line-height: 1.2;
}

header.site-header nav {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

header.site-header nav a {
    color: var(--color-muted-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
}

header.site-header nav a.active {
    background: var(--color-accent-secondary);
    color: var(--color-text);
}

main {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

/* Mur : une seule colonne, effet défilement continu même en desktop */
.wall-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.photo-card {
    background: var(--color-card-bg);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-card .photo-media {
    position: relative;
}

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

.date-badge {
    position: absolute;
    bottom: 0.6rem;
    right: 0.6rem;
    background: rgba(20, 22, 15, 0.7);
    color: var(--color-text);
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    backdrop-filter: blur(2px);
}

.photo-card .photo-meta {
    padding: 0.85rem 1rem;
}

.photo-card .photo-caption {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}

.photo-card .photo-location {
    color: var(--color-muted-light);
    font-size: 0.8rem;
    margin: 0;
}

.photo-card .photo-actions {
    padding: 0 1rem 0.85rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
}

.photo-card .photo-actions a,
.photo-card .photo-actions button {
    background: none;
    border: none;
    color: var(--color-accent-secondary);
    cursor: pointer;
    padding: 0;
    font: inherit;
    text-decoration: underline;
}

#loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--color-muted);
}

.photo-single {
    max-width: 600px;
    margin: 0 auto;
}

.photo-single .photo-media {
    position: relative;
}

.photo-single img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

.back-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--color-accent-secondary);
}

#map {
    width: 100%;
    height: 75vh;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--color-card-bg);
    color: var(--color-text);
}

.leaflet-popup-content a {
    color: var(--color-accent-secondary);
}

/* Admin */
.admin-form label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="file"],
.admin-form input[type="datetime-local"] {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: var(--color-card-bg);
    color: var(--color-text);
}

.admin-form button {
    margin-top: 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-table img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.admin-table button {
    background: var(--color-accent);
    color: #fff;
    border: none;
    padding: 0.35rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
}

.flash-error {
    background: rgba(193, 39, 45, 0.15);
    color: #f2a7aa;
    border: 1px solid var(--color-accent);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}
