/* AerialMedia Premium Theme CSS */

:root {
    color-scheme: light;

    /* Canonical typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: var(--font-heading);
    --font-accent: var(--font-body);

    /* Brand and interaction */
    --ui-primary: #2563EB;
    --ui-primary-hover: #1E40AF;
    --ui-primary-active: #1E3A8A;
    --ui-focus: #2563EB;
    --ui-focus-inverse: #60A5FA;
    --ui-accent-inverse: #93C5FD;
    --ui-on-primary: #FFFFFF;

    /* Approved partner identity colors. Keep third-party wordmarks exact. */
    --brand-fuchs-gold: #D4922A;
    --brand-fuchs-slate: #1E293B;

    /* Text, surfaces, and borders */
    --ui-text-strong: #111827;
    --ui-text: #374151;
    --ui-text-muted: #667085;
    --ui-text-disabled: #9CA3AF;
    --ui-surface: #FFFFFF;
    --ui-surface-subtle: #F9FAFB;
    --ui-surface-muted: #F3F4F6;
    --ui-surface-inverse: #0F172A;
    --ui-surface-inverse-soft: rgb(255 255 255 / 10%);
    --ui-surface-inverse-raised: rgb(15 23 42 / 82%);
    /* Photo heroes preserve the image; contrast belongs to a bounded copy
       surface, not a heavy full-frame veil. Homepage keeps its own treatment. */
    --ui-image-scrim: rgb(15 23 42 / 18%);
    --ui-hero-copy-surface: rgb(15 23 42 / 72%);
    --ui-hero-text-shadow: 0 2px 10px rgb(0 0 0 / 78%);
    --ui-overlay-scrim: rgb(15 23 42 / 72%);
    --ui-border: #D1D5DB;
    --ui-border-strong: #8791A1;
    --ui-border-inverse: rgb(255 255 255 / 20%);
    --ui-text-inverse-muted: rgb(255 255 255 / 82%);
    --ui-link-inverse: #9CA3AF;

    /* Semantic pairs */
    --ui-info: #1D4ED8;
    --ui-info-bg: #EFF6FF;
    --ui-info-border: #BFDBFE;
    --ui-success: #047857;
    --ui-success-bg: #ECFDF5;
    --ui-success-border: #A7F3D0;
    --ui-warning: #B45309;
    --ui-warning-bg: #FFFBEB;
    --ui-warning-border: #FDE68A;
    --ui-danger: #B91C1C;
    --ui-danger-bg: #FEF2F2;
    --ui-danger-border: #FECACA;

    /* 4px half-step / 8px base spacing */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;

    /* Shape, elevation, and motion. Structural surfaces (cards, panels,
       controls, menus) are rectilinear by default. Circles and pills are
       explicit semantic exceptions for avatars/identity icons and
       badges/chips/tracks respectively — see the shape-contract allowlists
       in components.css. */
    --radius-control: 0;
    --radius-card: 0;
    --radius-full: 9999px;
    --radius-circle: 9999px;
    --shadow-surface: none;
    --shadow-interactive: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-overlay: 0 16px 40px rgba(15, 23, 42, 0.16);
    --motion-fast: 150ms ease-out;
    --motion-overlay: 200ms ease-out;

    /* Layering. Tailwind references these variables so its minifier cannot
       renumber utility z-index values independently from authored CSS. */
    --layer-base: 0;
    --layer-raised: 10;
    --layer-overlay: 20;
    --layer-page-controls: 30;
    --layer-sticky: 40;
    --layer-navigation: 50;
    --layer-modal: 1000;

    /* Compatibility aliases. New styles use the semantic ui tokens above. */
    --aerial-black: var(--ui-text-strong);
    --aerial-charcoal: var(--ui-text);
    --aerial-gray: var(--ui-text);
    --aerial-silver: var(--ui-text-muted);
    --aerial-light: var(--ui-surface-muted);
    --aerial-white: var(--ui-surface);
    --aerial-blue: var(--ui-primary);
    --aerial-blue-light: var(--ui-accent-inverse);
    --aerial-blue-lighter: var(--ui-info-border);
    --aerial-blue-dark: var(--ui-primary-hover);
    --aerial-sky: #E0F2FE;
    --aerial-sky-lighter: #F0F9FF;
    --color-primary: var(--ui-primary);
    --color-primary-dark: var(--ui-primary-hover);
    --color-primary-light: var(--ui-focus-inverse);
    --color-success: var(--ui-success);
    --color-warning: var(--ui-warning);
    --color-error: var(--ui-danger);
    --color-neutral-900: var(--ui-text-strong);
    --color-neutral-800: #1F2937;
    --color-neutral-700: var(--ui-text);
    --color-neutral-600: #4B5563;
    --color-neutral-500: var(--ui-text-muted);
    --color-neutral-400: var(--ui-text-disabled);
    --color-neutral-300: var(--ui-border-strong);
    --color-neutral-200: var(--ui-border);
    --color-neutral-100: var(--ui-surface-muted);
    --color-neutral-50: var(--ui-surface-subtle);
    --spacing-xs: var(--space-2);
    --spacing-sm: var(--space-4);
    --spacing-md: var(--space-8);
    --spacing-lg: var(--space-12);
    --spacing-xl: var(--space-16);
    --spacing-xxl: var(--space-24);
    --spacing-section: var(--space-24);
    --shadow-sm: var(--shadow-surface);
    --shadow-md: var(--shadow-surface);
    --shadow-lg: var(--shadow-overlay);
    --shadow-xl: var(--shadow-overlay);
    --shadow-hover: var(--shadow-interactive);
}

/* Utility classes for custom colors - Clean & Minimalist */
.bg-aerial-black { background-color: var(--aerial-black); }
.bg-aerial-charcoal { background-color: var(--aerial-charcoal); }
.bg-aerial-gray { background-color: var(--aerial-gray); }
.bg-aerial-silver { background-color: var(--aerial-silver); }
.bg-aerial-blue { background-color: var(--aerial-blue); }
.bg-aerial-blue-light { background-color: var(--aerial-blue-light); }
.bg-aerial-blue-lighter { background-color: var(--aerial-blue-lighter); }
.bg-aerial-sky { background-color: var(--aerial-sky); }
.bg-aerial-sky-lighter { background-color: var(--aerial-sky-lighter); }

.text-aerial-black { color: var(--aerial-black); }
.text-aerial-charcoal { color: var(--aerial-charcoal); }
.text-aerial-gray { color: var(--aerial-gray); }
.text-aerial-blue { color: var(--aerial-blue); }
.text-aerial-sky { color: var(--ui-accent-inverse); }
.text-aerial-silver { color: var(--aerial-silver); }
.text-aerial-white { color: var(--aerial-white); }

/* Hand-rolled hover variant — `aerial-blue` is a custom (non-Tailwind)
   color, so the `hover:text-aerial-blue` utility isn't generated by the
   build. The nav links rely on it for hover/tap feedback (mobile links
   aren't `.nav-link`, so this is their only hover affordance). */
.hover\:text-aerial-blue:hover { color: var(--aerial-blue); }

.border-aerial-black { border-color: var(--aerial-black); }
.border-aerial-blue { border-color: var(--aerial-blue); }
.border-aerial-blue-lighter { border-color: var(--aerial-blue-lighter); }
.border-aerial-gray { border-color: var(--aerial-gray); }

/* Utility Classes */
.text-shadow-lg {
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Global Styles */
html {
    background-color: var(--ui-surface-inverse);
}

html {
    /* Clip at the root too: absolutely-positioned descendants (e.g.
       Tailwind's sr-only spans inside horizontally-scrolled tables) size
       against the initial containing block, so they widen <html> and the
       window scrolls sideways even though <body> clips — seen on the
       organizer billing page at mobile widths (2026-07 audit). clip (not
       hidden) keeps position: sticky working. */
    overflow-x: clip;
}

body {
    font-family: var(--font-body);
    color: var(--ui-text);
    line-height: 1.6;
    overflow-x: clip;
}

/* Contain absolutely-positioned descendants (e.g. Tailwind sr-only spans in
   table headers) within horizontal scrollers. Without a positioned ancestor
   they anchor to the initial containing block, phantom-widening <html> so
   the page pans sideways on mobile (organizer billing, 2026-07 audit). */
.overflow-x-auto {
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ui-text-strong);
}

.display-font {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Navigation Enhancements */
.navbar {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-md);
}

.nav-link {
    position: relative;
    font-weight: 600;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--aerial-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Persistent "you are here" state — keyed off active_nav context
   processor in base.html. Reuses the hover underline so the current
   section reads as a settled version of the hover affordance. */
.nav-link.is-active {
    color: var(--aerial-blue);
}

.nav-link.is-active::after {
    width: 100%;
}

/* Hero Sections */
.hero-aerial {
    position: relative;
    height: calc(100vh - 80px);
    height: calc(100dvh - 80px);
    min-height: 500px;
    overflow: hidden;
    background: var(--aerial-black);
}

.hero-aerial-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 50%;
}

/* Keep homepage hero in compositor layer to prevent scroll-away flash */
body.homepage .hero-aerial-image {
    will-change: transform;
}

.hero-aerial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
}

.hero-aerial-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--aerial-white);
    padding: var(--spacing-md);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5.8vw, 5rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    color: var(--aerial-white);
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: var(--spacing-lg);
    color: var(--aerial-white);
}

/* Feature Sections */
.section-aerial {
    padding: var(--spacing-xxl) 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.85rem, 3.75vw, 2.9rem);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.section-subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    text-align: center;
    color: var(--aerial-silver);
    margin-bottom: var(--spacing-xl);
    font-weight: 400;
}

/* Instagram Feed */
.instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1px;
    background: var(--aerial-black);
    padding: 1px;
}

.instagram-item {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background: var(--aerial-gray);
}

.instagram-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.instagram-item:hover img {
    transform: scale(1.1);
}

.instagram-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-item:hover .instagram-overlay {
    opacity: 1;
}

/* Testimonials - Enhanced */
.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid #E5E7EB;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
}

/* Decorative quote mark */
.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 4rem;
    font-family: Georgia, serif;
    color: #E5E7EB;
    line-height: 1;
    pointer-events: none;
}

.testimonial-quote {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1.5rem;
    font-style: italic;
    flex: 1;
}

.testimonial-author {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.25rem;
}

.testimonial-role {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: #6B7280;
}

.testimonial-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.star-icon {
    color: #F59E0B;
}


.parallax-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--aerial-white);
    padding: var(--spacing-md);
}

/* Loading States */
.skeleton-loader {
    background: var(--aerial-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hero sections fit between nav and bottom of viewport */
    .hero-aerial,
    .hero-section {
        height: calc(100vh - 80px);
        height: calc(100dvh - 80px);
        min-height: 400px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2.1rem;
    }

    .tour-card-content {
        padding: 1.5rem;
    }
}

/* Social Connection Components */
.social-connection-list {
    space-y: 1rem;
}

.social-connection-item {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.social-connection-item:hover {
    border-color: var(--aerial-blue);
    background: #eff6ff;
}

.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon.google {
    background: #4285f4;
    color: white;
}

.social-icon.facebook {
    background: #1877f2;
    color: white;
}

.social-icon.github {
    background: #24292e;
    color: white;
}

/* Print Styles */
@media print {
    .navbar,
    .hero-aerial,
    .instagram-grid,
    footer {
        display: none;
    }

    .section-aerial {
        page-break-inside: avoid;
    }
}

/* ========================================
   AERIAL MEDIA BRAND ENHANCEMENTS
   Design Preferences: Sky & Freedom, Clean & Minimalist, Excitement
   ======================================== */

/* Aerial-Inspired Visual Elements */
.aerial-float {
    animation: floatSky 6s ease-in-out infinite;
}

@keyframes floatSky {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

/* Solid sky section treatment */
.bg-sky-section {
    background: var(--aerial-sky-lighter);
    position: relative;
}

.bg-sky-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--aerial-white);
    opacity: 0.5;
    pointer-events: none;
}

/* Boutique Exclusive - Refined Details */
.refined-border {
    border: 1px solid var(--aerial-blue-lighter);
    transition: border-color 0.3s ease;
}

.refined-border:hover {
    border-color: var(--aerial-blue);
}

/* Adventure Excitement - Pulse Animation */
.pulse-on-hover {
    transition: all 0.3s ease;
}

.pulse-on-hover:hover {
    animation: excitementPulse 0.8s ease-in-out;
}

@keyframes excitementPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Clean White Space Utilities */
.section-breathing {
    padding-top: var(--spacing-section);
    padding-bottom: var(--spacing-section);
}

.cta-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background: var(--ui-primary-hover);
    color: var(--ui-on-primary);
}

.cta-section .section-title {
    color: var(--ui-on-primary);
}

.cta-section-subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--ui-text-inverse-muted);
    margin-bottom: 2.5rem;
}

.content-breathing {
    padding: var(--spacing-xl);
}

/* Immersive Image Overlays */
.image-hover-zoom {
    overflow: hidden;
}

.image-hover-zoom img {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-hover-zoom:hover img {
    transform: scale(1.15);
}

/* Professional Touch - Subtle Accents */
.accent-line-left {
    position: relative;
    padding-left: 1.5rem;
}

.accent-line-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--aerial-blue-light);
}

/* Creative Hover States */
.creative-hover-slide {
    position: relative;
    overflow: hidden;
}

.creative-hover-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: var(--aerial-blue);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.creative-hover-slide:hover::after {
    left: 0;
}

/* Responsive Breathing Space */
@media (max-width: 768px) {
    .section-breathing {
        padding-top: var(--spacing-xl);
        padding-bottom: var(--spacing-xl);
    }

    .content-breathing {
        padding: var(--spacing-md);
    }
}

/* ═══════════════════════════════════════════════════
   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: var(--layer-overlay);
    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 (not inline-flex) avoids Safari hit-test bug where padding isn't clickable */
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap; user-select: none; pointer-events: auto;
    text-decoration: none;
}
.hero-picker-btn:hover { background: rgba(0,0,0,0.75); }
.hero-picker-actions {
    position: absolute;
    right: 1.5rem;
    bottom: 1.75rem;
    z-index: var(--layer-page-controls);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: calc(100% - 3rem);
}
.hero-picker-actions--start {
    right: auto;
    left: 1.5rem;
    justify-content: flex-start;
}
.hero-picker-actions .hero-picker-btn {
    position: static;
}
.hero-picker-modal {
    position: fixed; inset: 0; z-index: var(--layer-modal);
    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;
    /* Fixed height prevents content-driven growth which causes a visible resize flash on open */
    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);
}
/* Desktop fade — `backwards` fill-mode applies opacity:0 before the first paint,
   preventing the one-frame flash at full opacity before the animation's from-state kicks in */
@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;
}
.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; }
/* Touch target ≥ 40px on mobile (UI review, 2026-06). */
@media (max-width: 639px) {
    .hero-picker-close-btn { width: 40px; height: 40px; }
}
.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;
}
.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;
}
.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 (same algorithm as gallery list) */
.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;
    /* Safety: cap size before JS layout fires */
    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; }
/* Selected: border only — no outer box-shadow that bleeds outside grid cell */
.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;
}
/* Empty / loading states — span full grid width */
.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%; }
/* Stagger delay for natural feel */
.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;
}
/* Portfolio photo multi-upload thumbnail grid — CSS Grid for reliable no-overlap layout */
.tm-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px; margin-top: 0.75rem;
}
.tm-thumb-item {
    position: relative; aspect-ratio: 1;
    border-radius: 6px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12); background: #f3f4f6;
}
.tm-thumb-item img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.tm-thumb-remove {
    position: absolute; top: 3px; right: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.12s; padding: 0;
}
.tm-thumb-remove:hover { background: rgba(220,38,38,0.85); }
.picker-cancel-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.hero-drag-handle { display: none; }

@media (max-width: 639px) {
    .hero-step-indicator { display: block; }
    /* Backdrop: instant color change (no transition) — background transitions cause repaints that compete with transform GPU animation */
    .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); }
    /* Dialog: fixed height = no growth when content loads (growth causes top-edge jump since
       the sheet is align-items:flex-end). min-height:0 overrides the base 480px constraint. */
    .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-opt-icon { font-size: 1.25rem; }
    .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; }
    .hero-tour-thumb { width: 52px; height: 35px; }
    .hero-tour-loc { font-size: 0.76rem; }
    .hero-tour-count { font-size: 0.72rem; }
    .hero-img-grid { gap: 4px; }
}
