/* ═══════════════════════════════════════════════════
   Hero / Section Image Picker Modal
   Used on: homepage, about page, any page with
   a tour-image or upload picker dialog.
═══════════════════════════════════════════════════ */
.hero-picker-btn {
    position: absolute; bottom: 1.75rem; right: 1.5rem; z-index: 20;
    background: rgba(0,0,0,0.55); color: #fff;
    border: 1px solid rgba(255,255,255,0.25); border-radius: 999px;
    padding: 0.45rem 1rem; font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.04em; cursor: pointer; transition: background 0.2s;
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap; user-select: none; pointer-events: auto;
}
.hero-picker-btn:hover { background: rgba(0,0,0,0.75); }
.hero-picker-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.hero-picker-modal.hidden { display: none; }
.hero-picker-dialog {
    background: #fff; border-radius: 14px; width: 100%;
    max-width: 900px;
    height: clamp(480px, 70vh, 620px); min-height: 0; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 24px 64px -12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.04);
}
@media (min-width: 640px) {
    .hero-picker-dialog { animation: picker-enter 0.16s ease-out backwards; }
    @keyframes picker-enter {
        from { opacity: 0; }
        to   { opacity: 1; }
    }
}
.hero-picker-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 1.25rem; border-bottom: 1px solid #f0f0f0;
    background: #fafafa; flex-shrink: 0; border-radius: 14px 14px 0 0;
}
.hero-picker-header h2 {
    font-size: 0.875rem; font-weight: 700; margin: 0; white-space: nowrap;
    letter-spacing: -0.01em; color: #111827;
}
.ip-modal-header-left {
    display: flex; align-items: center; gap: 0.6rem; min-width: 0; overflow: hidden;
}
.hero-picker-close-btn {
    background: none; border: none; cursor: pointer; color: #9ca3af;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; flex-shrink: 0; transition: background 0.12s, color 0.12s;
}
.hero-picker-close-btn:hover { background: #f3f4f6; color: #374151; }
.hero-picker-body {
    display: flex; flex: 1; min-height: 0; overflow: hidden; position: relative;
}
.hero-picker-left {
    width: 285px; flex-shrink: 0; overflow-y: auto;
    padding: 0.875rem; border-right: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex; flex-direction: column; gap: 0.45rem;
}
.hero-picker-right {
    flex: 1; overflow-y: auto; padding: 0.875rem;
    display: flex; flex-direction: column; gap: 0.625rem;
}
.hero-opt {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 0.875rem; border-radius: 8px;
    border: 1.5px solid #e5e7eb; cursor: pointer;
    font-size: 0.82rem; color: #374151;
    transition: border-color 0.14s, background 0.14s;
}
.hero-opt:hover:not(.selected) { border-color: #9ca3af; background: #f3f4f5; }
.hero-opt:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.hero-opt.selected { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.hero-opt-icon { flex-shrink: 0; color: #6b7280; display: flex; }
.hero-opt.selected .hero-opt-icon { color: #2563eb; }
.hero-opt strong { font-size: 0.82rem; font-weight: 600; color: #111827; display: block; line-height: 1.3; }
.hero-opt-sub { font-size: 0.72rem; color: #9ca3af; display: block; line-height: 1.3; }
.hero-opt.selected .hero-opt-sub { color: #60a5fa; }
.hero-search-sep {
    font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: #9ca3af; padding: 0.35rem 0.1rem 0.15rem;
    border-top: 1px solid #f0f0f0; margin-top: 0.2rem;
}
.hero-search-input {
    width: 100%; padding: 0.55rem 0.75rem; border: 1px solid #e5e7eb;
    border-radius: 7px; font-size: 0.84rem; box-sizing: border-box;
    transition: border-color 0.14s, box-shadow 0.14s; background: #fff;
}
.hero-search-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.hero-tour-item {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.5rem 0.55rem; border-radius: 6px; cursor: pointer;
    font-size: 0.79rem; color: #374151; transition: background 0.1s;
    width: 100%; border: 0; background: transparent; text-align: left;
    font-family: inherit;
}
.hero-tour-item:hover { background: #ebebed; }
.hero-tour-item:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; background: #f3f4f6; }
.hero-tour-item.active { background: #dbeafe; }
.hero-tour-thumb {
    width: 54px; height: 36px; object-fit: contain;
    border-radius: 4px; flex-shrink: 0; background: #e5e7eb;
}
.hero-tour-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; font-weight: 500; color: #111827; }
.hero-tour-loc { font-size: 0.72rem; color: #9ca3af; display: block; font-weight: 400; }
.hero-tour-item.active .hero-tour-name { color: #1e40af; }
.hero-tour-count {
    font-size: 0.68rem; color: #9ca3af; background: #f3f4f6;
    border-radius: 10px; padding: 1px 6px; flex-shrink: 0; white-space: nowrap;
}
/* Upload drop zone */
.hero-upload-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 160px; border: 2px dashed #e5e7eb; border-radius: 10px;
    padding: 1.75rem 1rem; text-align: center; font-size: 0.82rem;
    color: #6b7280; cursor: pointer; background: #fafafa;
    transition: border-color 0.14s, background 0.14s, color 0.14s;
    gap: 0.5rem;
    width: 100%; font-family: inherit;
}
.hero-upload-drop:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.hero-upload-drop:hover, .hero-upload-drop.dragover {
    border-color: #2563eb; background: #eff6ff; color: #2563eb;
}
.hero-upload-drop:hover .hero-upload-icon, .hero-upload-drop.dragover .hero-upload-icon { color: #2563eb; }
.hero-upload-icon { color: #c7cdd5; flex-shrink: 0; }
.hero-upload-preview { max-height: 140px; max-width: 100%; border-radius: 6px; margin-top: 0.5rem; object-fit: cover; }
.hero-upload-link { color: #2563eb; text-decoration: underline; }
/* Right panel header — hidden on desktop until a tour is loaded (.is-active) */
.hero-right-header {
    display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0;
}
@media (min-width: 640px) {
    .hero-right-header:not(.is-active) { display: none; }
}
.hero-back-btn {
    background: none; border: none; font-size: 0.78rem; font-weight: 500;
    cursor: pointer; color: #2563eb; padding: 0; white-space: nowrap;
    display: flex; align-items: center; gap: 0.2rem; transition: color 0.12s;
}
.hero-back-btn:hover { color: #1d4ed8; }
.hero-right-title { font-size: 0.82rem; font-weight: 600; color: #111827; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .hero-back-btn { display: none !important; } }
/* Image grid — justified rows */
.hero-img-grid {
    display: flex; flex-wrap: wrap; gap: 4px; align-content: start;
}
.hero-candidate-item {
    border-radius: 6px; overflow: hidden;
    cursor: pointer; border: 2.5px solid transparent;
    transition: border-color 0.14s; position: relative;
    box-sizing: border-box; background: #e9eaec;
    flex-shrink: 0;
    max-width: 100%; height: 110px; width: 160px;
}
.hero-candidate-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.hero-candidate-item:hover img { transform: scale(1.04); }
.hero-candidate-item:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.hero-candidate-item.selected { border-color: #2563eb; }
.hero-candidate-item.selected::after {
    content: '';
    position: absolute; top: 5px; right: 5px; z-index: 2;
    width: 22px; height: 22px; border-radius: 50%;
    background: #2563eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center no-repeat;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.hero-primary-badge {
    position: absolute; top: 4px; left: 4px;
    background: rgba(37,99,235,0.88); color: #fff;
    font-size: 0.55rem; padding: 2px 5px; border-radius: 3px;
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
/* Deliberate, source-bound escape hatch for a soft full-screen hero. */
.hero-quality-warning {
    border: 1px solid #b45309; border-left-width: 4px; border-radius: 8px;
    background: #fffbeb; color: #3f2d0b; padding: 0.85rem;
    font-size: 0.8rem; line-height: 1.45;
}
.hero-quality-warning[hidden] { display: none; }
.hero-quality-warning strong { color: #78350f; }
.hero-quality-warning p { margin: 0.4rem 0 0; }
.hero-quality-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    margin-top: 0.75rem;
}
.hero-quality-better,
.hero-quality-anyway {
    border-radius: 7px; padding: 0.48rem 0.75rem; cursor: pointer;
    font-size: 0.78rem; font-weight: 650;
}
.hero-quality-better { border: 1px solid #1d4ed8; background: #1d4ed8; color: #fff; }
.hero-quality-better:hover { background: #1e40af; }
.hero-quality-anyway { border: 1px solid #b45309; background: #fff; color: #92400e; }
.hero-quality-anyway:hover:not(:disabled) { background: #fef3c7; }
.hero-quality-anyway:disabled { cursor: not-allowed; opacity: 0.55; }
.hero-quality-acknowledged { color: #166534; font-weight: 600; }
.hero-processing-status {
    margin: 0.65rem 0; padding: 0.7rem 0.8rem; border: 1px solid #bfdbfe;
    border-radius: 7px; background: #eff6ff; color: #1e3a8a; font-size: 0.78rem;
}
.hero-processing-status[hidden] { display: none; }
.hero-processing-status.is-error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.hero-processing-status p { margin: 0 0 0.45rem; line-height: 1.45; }
.hero-processing-status progress {
    display: block; width: 100%; height: 0.45rem; border: 0; border-radius: 999px;
    overflow: hidden; appearance: none; background: #dbeafe;
}
.hero-processing-status progress::-webkit-progress-bar { background: #dbeafe; }
.hero-processing-status progress::-webkit-progress-value { background: #2563eb; }
.hero-processing-status progress::-moz-progress-bar { background: #2563eb; }
.hero-processing-status.is-error progress::-webkit-progress-value { background: #b91c1c; }
.hero-processing-status.is-error progress::-moz-progress-bar { background: #b91c1c; }
/* Empty / loading states */
.hero-empty-msg {
    grid-column: 1 / -1;
    font-size: 0.82rem; color: #b0b8c8; text-align: center;
    padding: 2.5rem 1rem; display: flex; flex-direction: column;
    align-items: center; gap: 0.75rem; line-height: 1.5;
}
.picker-spinner {
    grid-column: 1 / -1;
    width: 24px; height: 24px; border: 2.5px solid #e5e7eb;
    border-top-color: #2563eb; border-radius: 50%;
    animation: picker-spin 0.7s linear infinite; margin: 2.5rem auto;
}
@keyframes picker-spin { to { transform: rotate(360deg); } }
/* Skeleton loaders — flat pulse (no gradient) */
@keyframes picker-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.picker-skeleton {
    background: #e9eaec; border-radius: 5px;
    animation: picker-pulse 1.4s ease-in-out infinite;
}
.hero-img-skeleton { height: 90px; border-radius: 6px; }
.hero-tour-skeleton {
    display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem 0.55rem;
}
.hero-tour-skeleton-thumb { width: 54px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.hero-tour-skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.hero-tour-skeleton-name { height: 12px; border-radius: 3px; width: 75%; }
.hero-tour-skeleton-loc  { height: 10px; border-radius: 3px; width: 45%; }
.hero-tour-skeleton:nth-child(2) .picker-skeleton { animation-delay: 0.1s; }
.hero-tour-skeleton:nth-child(3) .picker-skeleton { animation-delay: 0.2s; }
.hero-tour-skeleton:nth-child(4) .picker-skeleton { animation-delay: 0.3s; }
.hero-tour-skeleton:nth-child(5) .picker-skeleton { animation-delay: 0.4s; }
.hero-img-skeleton:nth-child(2) { animation-delay: 0.07s; }
.hero-img-skeleton:nth-child(3) { animation-delay: 0.14s; }
.hero-img-skeleton:nth-child(4) { animation-delay: 0.21s; }
.hero-img-skeleton:nth-child(5) { animation-delay: 0.28s; }
.hero-img-skeleton:nth-child(6) { animation-delay: 0.35s; }
.hero-img-skeleton:nth-child(7) { animation-delay: 0.42s; }
.hero-img-skeleton:nth-child(8) { animation-delay: 0.49s; }
.hero-img-skeleton:nth-child(9) { animation-delay: 0.56s; }
/* Save button loading state */
.hero-picker-footer .btn-aerial-primary.is-saving {
    display: inline-flex; align-items: center; gap: 6px;
    pointer-events: none; opacity: 0.82;
}
.hero-picker-footer .btn-aerial-primary.is-saving::before {
    content: ''; flex-shrink: 0; display: block;
    width: 12px; height: 12px;
    border: 1.5px solid rgba(255,255,255,0.35); border-top-color: #fff;
    border-radius: 50%;
    animation: picker-spin 0.65s linear infinite;
}
/* Pagination */
.hero-page-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 0.6rem; font-size: 0.78rem; color: #6b7280; flex-shrink: 0;
}
.hero-page-btn {
    background: #fff; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 0.35rem 0.75rem; cursor: pointer; font-size: 0.78rem; font-weight: 500;
    color: #374151; display: inline-flex; align-items: center; gap: 0.25rem;
    transition: background 0.1s, border-color 0.1s;
}
.hero-page-btn:hover:not(:disabled) { background: #f3f4f6; border-color: #d1d5db; }
.hero-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.hero-page-label { font-size: 0.78rem; color: #6b7280; min-width: 3rem; text-align: center; }
.hero-step-indicator { display: none; font-size: 0.72rem; color: #9ca3af; font-weight: 500; }
/* Footer & cancel button */
.hero-picker-footer {
    padding: 0.8rem 1.25rem; border-top: 1px solid #f0f0f0;
    background: #fafafa; border-radius: 0 0 14px 14px;
    display: flex; justify-content: flex-end; gap: 0.625rem; flex-shrink: 0;
}
.picker-cancel-btn {
    background: none; border: 1px solid #e5e7eb; border-radius: 7px;
    padding: 0.45rem 1rem; font-size: 0.84rem; font-weight: 500;
    color: #374151; cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.picker-cancel-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.hero-drag-handle { display: none; }

@media (max-width: 639px) {
    .hero-step-indicator { display: block; }
    .hero-picker-modal { align-items: flex-end; padding: 0; background: rgba(0,0,0,0); }
    .hero-picker-modal.is-open { background: rgba(0,0,0,0.5); }
    .hero-picker-dialog {
        border-radius: 20px 20px 0 0; max-width: 100%;
        height: 88svh; min-height: 0; max-height: 88svh;
        transform: translate3d(0, 100%, 0);
        transition: transform 0.28s cubic-bezier(0, 0, 0.2, 1);
        box-shadow: none;
    }
    .hero-picker-modal.is-open .hero-picker-dialog {
        transform: translate3d(0, 0, 0);
        box-shadow: 0 -2px 20px rgba(0,0,0,0.12);
    }
    .hero-picker-modal.is-closing .hero-picker-dialog {
        transform: translate3d(0, 100%, 0);
        box-shadow: none;
        transition-duration: 0.22s;
    }
    .hero-drag-handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: #c7cdd5; margin: 10px auto 0; flex-shrink: 0; touch-action: none; cursor: grab; }
    .hero-picker-header { padding: 0.6rem 1rem; border-radius: 0; }
    .hero-picker-footer { border-radius: 0; }
    .hero-picker-left { width: 100%; flex-shrink: 0; border-right: none; border-bottom: 1px solid #f0f0f0; transition: transform 0.24s cubic-bezier(0, 0, 0.2, 1); padding-bottom: 1rem; }
    .hero-picker-right { position: absolute; inset: 0; background: #fff; transform: translateX(100%); transition: transform 0.24s cubic-bezier(0, 0, 0.2, 1); }
    .hero-picker-body.show-images .hero-picker-left { transform: translateX(-100%); }
    .hero-picker-body.show-images .hero-picker-right { transform: translateX(0); }
    .hero-back-btn { display: flex !important; }
    .hero-opt { padding: 0.8rem 0.9rem; font-size: 0.88rem; }
    .hero-search-input { padding: 0.65rem 0.75rem; font-size: 0.9rem; }
    .hero-tour-item { padding: 0.6rem 0.5rem; font-size: 0.85rem; min-height: 44px; }
}
