@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
    --ink: #101214;
    --muted: #5a6270;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-border: rgba(16, 18, 20, 0.08);
    --accent: #2b6fdd;
    --accent-dark: #1f4fa6;
    --shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    color: var(--ink);
    background: #f4f6f9;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Map experience */
html, body {
    height: 100%;
}

.map-shell {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

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

.leaflet-tile.basemap-layer {
    filter: brightness(0.94) contrast(1.08) saturate(1.05);
}

.leaflet-tile.labels-layer {
    filter: brightness(0.9) contrast(1.2);
}

.map-header {
    position: absolute;
    top: 24px;
    left: 24px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: var(--shadow);
    z-index: 1001;
    max-width: 320px;
    backdrop-filter: blur(8px);
}

.map-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.map-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
}

.map-subtitle a {
    color: var(--accent-dark);
    font-weight: 500;
}

.map-cta {
    display: inline-flex;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    width: fit-content;
}

.map-cta:hover {
    background: var(--accent-dark);
}

.map-panel {
    position: absolute;
    top: 24px;
    right: 24px;
    width: min(360px, 90vw);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    z-index: 1001;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.map-panel.is-collapsed {
    transform: translateY(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

.panel-toggle {
    border: none;
    background: var(--panel);
    color: var(--accent-dark);
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    border: 1px solid var(--panel-border);
    cursor: pointer;
    z-index: 1002;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.panel-toggle:hover {
    transform: translateY(-2px);
}

.panel-toggle-inline {
    align-self: flex-end;
}

.panel-toggle-float {
    position: absolute;
    right: 24px;
    bottom: 24px;
}

.panel-toggle.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.panel-input {
    border: 1px solid rgba(16, 18, 20, 0.15);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.95rem;
    outline: none;
}

.panel-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 111, 221, 0.15);
}

.range-row {
    display: grid;
    gap: 10px;
}

.range-input {
    width: 100%;
    accent-color: var(--accent);
}

.range-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
}

.panel-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--muted);
}

.panel-actions {
    border-top: 1px solid rgba(16, 18, 20, 0.08);
    padding-top: 16px;
}

.panel-button {
    border: none;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
}

.panel-button:hover {
    background: var(--accent-dark);
}

.panel-link {
    font-size: 0.95rem;
    color: var(--accent-dark);
    font-weight: 500;
}

.panel-count {
    font-size: 0.9rem;
    color: var(--muted);
}

.info-card {
    border: 1px solid rgba(16, 18, 20, 0.1);
    border-radius: 16px;
    padding: 14px;
    background: #fff;
    display: grid;
    gap: 10px;
}

.info-card img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.info-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.info-meta {
    font-size: 0.9rem;
    color: var(--muted);
    display: grid;
    gap: 4px;
}

.info-actions a {
    color: var(--accent-dark);
    font-weight: 500;
    font-size: 0.9rem;
}

.leaflet-control-zoom {
    margin-bottom: 20px;
}

.leaflet-bar {
    border: none;
}

.leaflet-control-zoom a {
    background: var(--panel);
    color: var(--accent-dark);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.leaflet-control-zoom a:hover {
    background: #fff;
}

.leaflet-control-attribution {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    padding: 4px 10px;
    box-shadow: var(--shadow);
    margin: 0 16px 16px 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.leaflet-control-attribution a {
    color: var(--accent-dark);
    font-weight: 500;
}

/* Gallery experience */
.gallery-page {
    min-height: 100vh;
    background: #f4f6f9;
    color: var(--ink);
}

.gallery-header {
    padding: 32px 24px 0;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 600;
}

.gallery-subtitle {
    color: var(--muted);
    font-size: 1rem;
}

.gallery-controls {
    max-width: 1200px;
    margin: 24px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.gallery-controls .panel-section {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(16, 18, 20, 0.08);
    padding: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.gallery-grid {
    max-width: 1200px;
    margin: 24px auto 60px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.gallery-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(16, 18, 20, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.gallery-card-body {
    padding: 12px 14px 16px;
    display: grid;
    gap: 8px;
}

.gallery-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.gallery-card-meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    width: fit-content;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.show {
    display: flex;
}

.modal-card {
    background: #fff;
    border-radius: 20px;
    max-width: 980px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) minmax(200px, 1fr);
    gap: 24px;
    padding: 24px;
}

.modal-viewer {
    position: relative;
    background: #f1f1f1;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.modal-viewer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent-dark);
    min-width: 64px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-nav.prev {
    left: 12px;
}

.modal-nav.next {
    right: 12px;
}

.modal-index {
    font-size: 0.9rem;
    color: var(--muted);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
}

.modal-details {
    display: grid;
    gap: 12px;
}

.modal-details h2 {
    margin: 0;
    font-size: 1.4rem;
}

.modal-details p {
    margin: 0;
    color: var(--muted);
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: var(--accent-dark);
    font-weight: 500;
}

@media (max-width: 900px) {
    .map-header {
        max-width: 240px;
    }

    .map-panel {
        position: absolute;
        bottom: 24px;
        top: auto;
        right: 24px;
        left: 24px;
        width: auto;
        max-height: 45vh;
    }

    .gallery-controls {
        grid-template-columns: 1fr;
    }

    .modal-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .map-header {
        top: 16px;
        left: 16px;
        padding: 12px 14px;
    }

    .map-panel {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
