/* UX-02/03: map canvas, skip link, static footer (no overlap), mobile bottom nav. */

.tym-map {
    width: 100%;
    height: 320px;
    border-radius: 8px;
    background: var(--tv-sand);
    border: 1px solid var(--tv-line);
}

.tym-map.is-mock {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tv-ink-soft);
    font-family: var(--tv-font);
    font-size: 0.85rem;
    text-align: center;
    padding: 12px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 10px 16px;
    background: var(--tv-ink);
    color: var(--tv-ivory);
    font-family: var(--tv-font);
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    left: 0;
}

#footer.tv-footer-static {
    position: static;
    margin-top: 3rem;
}

/* Mobile bottom navigation (UX-02). */
.tv-bottom-nav {
    display: none;
}

@media (max-width: 767.98px) {
    .tv-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        justify-content: space-around;
        background: var(--tv-ivory);
        border-top: 1px solid var(--tv-line);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }

    .tv-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        color: var(--tv-ink-soft);
        font-family: var(--tv-font);
        font-size: 0.68rem;
        text-decoration: none;
    }

    .tv-bottom-nav a i { font-size: 1.1rem; }

    body { padding-bottom: 64px; }
}

/* Global search suggestions dropdown (SEARCH-01). */
.search-suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: var(--tv-card);
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(36, 33, 29, 0.15);
    max-height: 280px;
    overflow-y: auto;
}

.search-suggest-item {
    display: block;
    padding: 8px 12px;
    color: var(--tv-ink);
    font-family: var(--tv-font);
    font-size: 0.85rem;
    text-decoration: none;
}

.search-suggest-item:hover, .search-suggest-item:focus {
    background: var(--tv-sand);
    color: var(--tv-ink);
}

#search { position: relative; }

/* AJAX loading skeletons (data-skeleton containers). */
.tv-skeleton-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
    margin: 8px 0;
}

.tv-skeleton {
    border: 1px solid var(--tv-line);
    border-radius: 8px;
    background: var(--tv-card);
    padding: 12px;
}

.tv-skeleton-img { height: 160px; border-radius: 6px; margin-bottom: 10px; }
.tv-skeleton-line { height: 12px; border-radius: 6px; margin-bottom: 8px; }
.tv-skeleton-line-short { width: 60%; margin-bottom: 0; }

.tv-skeleton-img,
.tv-skeleton-line {
    background: linear-gradient(90deg, var(--tv-line) 25%, var(--tv-ivory) 50%, var(--tv-line) 75%);
    background-size: 200% 100%;
    animation: tv-shimmer 1.4s ease-in-out infinite;
}

@keyframes tv-shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tv-skeleton-img, .tv-skeleton-line { animation: none; }
}

/* AJAX failure message + retry. */
.tv-request-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--tv-line);
    border-radius: 6px;
    background: var(--tv-card);
    color: var(--tv-ink);
    font-family: var(--tv-font);
    font-size: 0.9rem;
}

.tv-request-error-global {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1080;
    width: min(420px, calc(100vw - 24px));
    box-shadow: 0 4px 12px rgba(36, 33, 29, 0.2);
}

.tv-request-retry { min-height: 44px; }

/* Gallery upload queue: previews, per-file progress, cancel/retry. */
.tv-upload-queue { margin: 8px 0 16px; }

.tv-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid var(--tv-line);
    border-radius: 8px;
    background: var(--tv-card);
    font-family: var(--tv-font);
}

.tv-upload-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--tv-sand);
    flex: 0 0 auto;
}

.tv-upload-info { flex: 1 1 auto; min-width: 0; }

.tv-upload-name {
    font-size: 0.85rem;
    color: var(--tv-ink);
    overflow-wrap: anywhere;
}

.tv-upload-progress {
    height: 8px;
    border-radius: 4px;
    background: var(--tv-line);
    overflow: hidden;
    margin: 6px 0 4px;
}

.tv-upload-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    background: var(--tv-gold);
    transition: width 0.2s ease;
}

.tv-upload-status { font-size: 0.78rem; color: var(--tv-muted); }
.tv-upload-status.is-error { color: var(--tv-ochre); }
.tv-upload-status.is-done { color: var(--tv-ochre); }

.tv-upload-item .btn { min-height: 44px; flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
    .tv-upload-bar { transition: none; }
}

/* LENS: camera stage extras (grid overlay, capture preview, fallback). */
.lens-stage { background: var(--tv-ink); }

.lens-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(247, 245, 240, 0.55) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(247, 245, 240, 0.55) 1px, transparent 1px);
    background-size: 33.34% 33.34%;
}

#lens-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--tv-ink);
}

.lens-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lens-actions .btn { min-height: 44px; }

.lens-fallback {
    padding: 12px;
    border: 1px solid var(--tv-line);
    border-radius: 8px;
    background: var(--tv-card);
    font-family: var(--tv-font);
}

.lens-fallback .btn { min-height: 44px; }

/* PRO-01: export format/resolution selects injected by tym-export.js beside the export button. */
.tym-export-options { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tym-export-option { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 0.875rem; color: var(--tv-muted); }
.tym-export-option select { min-height: 44px; width: auto; }

/* TOUR-01: QR + canonical URL block on tour detail. */
.tour-qr-block { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
#tour-qr {
    min-width: 120px;
    min-height: 120px;
    padding: 8px;
    background: var(--tv-card);
    border: 1px solid var(--tv-line);
    border-radius: 8px;
    line-height: 0;
}
#tour-qr svg { width: 160px; height: 160px; }
/* Keep page content scrollable clear of the fixed consent banner. */
body:has(#cookie-banner) { padding-bottom: 170px; }

/* Auto-scroll (and keyboard focus) must land clear of the fixed consent banner. */
body:has(#cookie-banner) :is(a, button, input, select, textarea, [tabindex]) { scroll-margin-bottom: 96px; }

/* Single upload dropzone tile instead of 20 empty placeholders. */
.add-gallery-wrapper .upload-image { width: 100%; height: 100%; min-height: 120px; border: 2px dashed var(--tv-sand, #DFC38B); background: transparent; color: var(--tv-ochre, #80600B); cursor: pointer; gap: 6px; }
.add-gallery-wrapper .upload-image .fas { font-size: 1.6rem; }
.tv-upload-hint { font-size: .78rem; font-weight: 600; padding: 0 6px; text-align: center; }
/* Long profile names must wrap inside their block. */
.profile-name-strong, .profile-name-strong * { overflow-wrap: anywhere; word-break: break-word; }

/* Carousel arrows on the slider frame (44px targets). */
.tym-carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(247,245,240,.92); color: var(--tv-ink, #24211D); font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 3; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.tym-carousel-prev { left: 8px; }
.tym-carousel-next { right: 8px; }
.tym-carousel-btn:focus-visible { outline: 3px solid var(--tv-gold, #B8860B); }

/* Names must wrap in the dropdown and on the profile page. */
.user-menu .profile-name, .profile-name, .profile-name-strong { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.text.strong { flex-wrap: wrap; }
.text.strong .profile-name-strong { min-width: 0; }
