/* Photo map maker landing (/photo-map-maker) */

.photo-map-landing-app {
    align-items: start;
    gap: 12px 16px;
}

    .photo-map-landing-app > .filter-landing-stage {
        align-self: start;
        height: auto;
    }

.photo-map-landing-stage {
    position: relative;
    background: linear-gradient(160deg, #f4f6fb, #e8eef8);
    box-shadow: none;
    min-height: 0;
    height: auto;
    overflow: visible;
    padding: clamp(12px, 2vw, 20px);
    display: grid;
    place-items: center;
}

.dark .photo-map-landing-stage {
    background: linear-gradient(160deg, #121722, #0d1118);
}

.photo-map-frame {
    --poster-w: 900;
    --poster-h: 1125;
    --poster-max-w: min(100%, 460px);
    --poster-max-h: 72vh;
    position: relative;
    box-sizing: border-box;
    width: min(var(--poster-max-w), calc(var(--poster-max-h) * var(--poster-w) / var(--poster-h)));
    height: auto;
    max-width: 100%;
    aspect-ratio: var(--poster-w) / var(--poster-h);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(24, 32, 48, 0.18);
    background: #f6f5f3;
}

.photo-map-frame.is-panning,
.photo-map-canvas {
    cursor: grab;
}

.photo-map-frame.is-panning {
    cursor: grabbing;
}

.photo-map-canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--poster-w) / var(--poster-h);
    touch-action: none;
}

.photo-map-fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
}

.photo-map-landing-controls {
    display: grid;
    gap: 10px;
}

.photo-map-search {
    position: relative;
}

.photo-map-search-input,
.photo-map-text-input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    font: inherit;
}

.dark .photo-map-search-input,
.dark .photo-map-text-input {
    background: rgba(18, 22, 30, 0.72);
    border-color: rgba(255, 255, 255, 0.12);
}

.photo-map-search-results {
    position: absolute;
    z-index: 4;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: 220px;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(16, 24, 40, 0.12);
    background: #fff;
    box-shadow: 0 12px 32px rgba(20, 28, 44, 0.16);
}

.dark .photo-map-search-results {
    background: #171c26;
    border-color: rgba(255, 255, 255, 0.1);
}

.photo-map-search-results button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--main-200);
    font: inherit;
    cursor: pointer;
}

.photo-map-search-results button:hover,
.photo-map-search-results button:focus-visible {
    background: rgba(37, 99, 235, 0.1);
}

.photo-map-search-status {
    padding: 8px 10px;
    opacity: 0.72;
}

.photo-map-field {
    display: grid;
    gap: 6px;
}

.photo-map-field:has(> .filter-landing-select-dice) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
    column-gap: 8px;
}

.photo-map-field:has(> .filter-landing-select-dice) > .filter-landing-controls-label {
    grid-column: 1 / -1;
}


.photo-map-toolbar {
    display: flex;
    align-items: end;
    gap: 10px;
}

.photo-map-toolbar-size {
    flex: 1 1 auto;
    min-width: 0;
}

.photo-map-toolbar-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 1px;
}

.photo-map-toolbar-actions .filter-landing-preset--icon {
    width: 40px;
    height: 40px;
    min-height: 40px;
}

#seo-photo-map-props .filter-landing-prop-color {
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.photo-map-landing-controls .filter-landing-actions-3 {
    flex-wrap: wrap;
}

@media (min-width: 961px) {
    .photo-map-landing-app > .filter-landing-controls {
        grid-row: 1;
        align-self: start;
    }

    .photo-map-frame {
        --poster-max-w: min(100%, 520px);
    }
}

@media (max-width: 960px) {
    .seo-page:has(#seo-photo-map) .seo-page-hero--filter-demo {
        align-items: stretch;
    }

    .photo-map-landing-stage {
        padding: 10px;
    }

    .photo-map-frame {
        --poster-max-w: min(100%, 360px);
        --poster-max-h: 58vh;
    }
}

body.filter-app-mode .photo-map-landing-app {
    align-items: stretch;
    min-height: 0;
}

body.filter-app-mode .photo-map-landing-app > .filter-landing-stage {
    align-self: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

body.filter-app-mode .photo-map-landing-stage {
    height: 100%;
    min-height: 0;
    place-items: center;
    container-type: size;
    overflow: hidden;
}

body.filter-app-mode .photo-map-landing-app .photo-map-frame {
    width: min(100cqw, calc(100cqh * var(--poster-w, 4) / var(--poster-h, 5)));
    height: min(100cqh, calc(100cqw * var(--poster-h, 5) / var(--poster-w, 4)));
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: var(--poster-w, 4) / var(--poster-h, 5);
}

body.filter-app-mode .photo-map-canvas {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

@media (max-width: 960px) {
    body.filter-app-mode .photo-map-landing-app {
        grid-template-rows: minmax(0, 1fr) auto;
        min-height: 0;
    }

    body.filter-app-mode .photo-map-landing-stage {
        padding: 8px;
    }

    body.filter-app-mode .photo-map-landing-app > .filter-landing-controls {
        z-index: 1;
        max-height: min(34vh, 220px);
        overflow: auto;
        min-height: 0;
        overscroll-behavior: contain;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 600px) {
    body.filter-app-mode .photo-map-landing-app > .filter-landing-controls {
        max-height: min(32vh, 200px);
        gap: 8px;
        padding-inline: 8px;
    }
}
