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

:root {
    --color-bg: #0f0f0f;
    --color-surface: #fafaf8;
    --color-ink: #1a1a1a;
    --color-muted: #6b6b6b;
    --color-accent: #2d5a27;
    --color-accent-light: #e8f0e6;
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-serif: "Playfair Display", Georgia, serif;
    --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.35);
    --radius: 12px;
}

html,
body {
    margin: 0;
    height: 100%;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-ink);
}

.site-header {
    position: relative;
    z-index: 1000;
    padding: 1rem 1.5rem;
    background: var(--color-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-header__title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.site-header__subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--color-muted);
}

.site-header__brand {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

.site-header__brand:hover {
    color: var(--color-accent);
}

.page-home {
    min-height: 100%;
    background: var(--color-surface);
}

.home {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

.home__section-title {
    margin: 0 0 1.25rem;
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.project-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-card {
    display: block;
    padding: 1.25rem 1.5rem;
    color: inherit;
    text-decoration: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
    border-color: rgba(45, 90, 39, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.project-card__body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.project-card__text {
    min-width: 0;
    flex: 1;
}

.project-card__curator {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 5.5rem;
    text-align: center;
}

.curator-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-muted);
    background: #eee;
}

.curator-label {
    font-size: 0.6875rem;
    line-height: 1.35;
    color: var(--color-muted);
}

.project-card__title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.project-card__meta {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-muted);
}

.map-layout {
    position: relative;
    height: calc(100vh - 73px);
}

.map {
    width: 100%;
    height: 100%;
}

/* Zwart-wit basiskaart */
.map--grayscale .leaflet-tile-pane {
    filter: grayscale(100%) contrast(1.08) brightness(1.02);
}

/* Fietslaag iets minder grijs zodat paden opvallen */
.map--grayscale .leaflet-overlay-pane {
    filter: saturate(0.4) contrast(1.2);
}

.legend {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 1000;
    max-width: 260px;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-size: 0.8125rem;
}

.legend__title {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
}

.legend__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.legend__list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.legend__list li:last-child {
    margin-bottom: 0;
}

.legend__swatch {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend__swatch--path {
    background: linear-gradient(135deg, #4a7c3f 40%, #8fbc8f 40%);
    border: 1px solid #3d6b34;
}

.legend__swatch--border {
    background: transparent;
    border: 2px solid #4a5568;
    border-radius: 2px;
}

.legend__swatch--marker-gecheckt {
    background: #2d8a4e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #2d8a4e;
}

.legend__swatch--marker-ongecheckt {
    background: #8b939e;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #8b939e;
}

.legend__swatch--marker-waarschuwing {
    background: #e67e22;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e67e22;
}

.legend__hint {
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--color-muted);
    line-height: 1.4;
}

/* Custom markers */
.laadpaal-marker {
    border: 2.5px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.laadpaal-marker--gecheckt {
    background: #2d8a4e;
}

.laadpaal-marker--ongecheckt {
    background: #8b939e;
}

.laadpaal-marker--gecheckt:hover,
.laadpaal-marker--gecheckt.laadpaal-marker--active {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(45, 138, 78, 0.45);
}

.laadpaal-marker--ongecheckt:hover,
.laadpaal-marker--ongecheckt.laadpaal-marker--active {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(139, 147, 158, 0.45);
}

.laadpaal-marker--waarschuwing {
    background: #e67e22;
}

.laadpaal-marker--waarschuwing:hover,
.laadpaal-marker--waarschuwing.laadpaal-marker--active {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.45);
}

.laadpaal-marker--waarschuwing svg {
    padding: 3px;
    transform: translateY(-1px) scale(1.12);
    transform-origin: center center;
}

.laadpaal-marker svg {
    display: block;
    width: 100%;
    height: 100%;
    padding: 5px;
    color: #fff;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 15, 0.55);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s ease;
}

.modal__panel {
    position: relative;
    width: min(520px, 100%);
    max-height: min(80vh, 640px);
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow-modal);
    animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-ink);
}

.modal__panel:has(.modal__photo-wrap:not([hidden])) .modal__close {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.modal__header {
    padding: 2rem 2rem 0;
}

.modal__panel:has(.modal__photo-wrap:not([hidden])) .modal__header {
    padding-top: 1.5rem;
}

.modal__meta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.modal__meta-text {
    min-width: 0;
}

.modal__location {
    margin: 0 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
}

.modal__address {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--color-muted);
}

.modal__title {
    margin: 0;
    padding-right: 2rem;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: 0.015em;
}

.modal__photo-wrap {
    margin: 0;
    padding: 0;
    line-height: 0;
}

.modal__photo {
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
    background: #eee;
}

.modal__body {
    padding: 1.25rem 2rem 1.5rem;
}

.modal__panel:has(.modal__photo-wrap:not([hidden])) .modal__body {
    padding-top: 1rem;
}

.modal__story {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.modal__footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 2rem 1.75rem;
}

.modal__stats {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.modal__stat {
    display: grid;
    grid-template-columns: 1.25rem 1fr;
    column-gap: 0.625rem;
    align-items: center;
    position: relative;
}

.modal__stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-muted);
}

.modal__stat-icon .bi {
    font-size: 0.9375rem;
    line-height: 1;
}

.modal__stat-value {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.3;
    color: var(--color-ink);
}

.modal__stat-key {
    color: var(--color-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal__maps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    margin-left: auto;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: #1a1a1a;
    border-radius: 999px;
    transition: background 0.15s ease, transform 0.15s ease;
}

.modal__maps:hover {
    background: #333;
    transform: translateY(-1px);
}

.modal__source {
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--color-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 640px) {
    .legend {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        max-width: none;
    }

    .modal__header,
    .modal__body,
    .modal__footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .modal__meta {
        flex-direction: column;
        align-items: stretch;
    }

    .modal__maps {
        align-self: flex-end;
    }
}
