/**
 * Cesium3D Heritage Map - Modern Design System
 * 
 * Features:
 * - Modern glassmorphic UI with enhanced visual hierarchy
 * - Premium color palette with vibrant accents
 * - Smooth micro-animations for better UX
 * - Responsive design for all screen sizes
 * - Accessible contrast ratios and focus indicators
 * - Toggle switches for filter controls
 * - Enhanced panels with modern card design
 * 
 * Color Palette:
 * - Primary: Vibrant teal (#00d9c8, #00ffea)
 * - Secondary: Electric blue (#4f9dff)
 * - Background: Deep dark with subtle gradients
 * - Surface: Semi-transparent dark cards
 * - Text: Pure white (#ffffff) and soft gray (#b8c5db)
 */

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

:root {
    /* Colors */
    --primary-500: #00d9c8;
    --primary-400: #00ffea;
    --primary-600: #00b8aa;
    --secondary-500: #4f9dff;
    --secondary-400: #73b1ff;

    --bg-primary: #0a0e1a;
    --bg-secondary: #131826;
    --bg-tertiary: #1a2030;

    --surface-glass: rgba(20, 26, 40, 0.85);
    --surface-glass-light: rgba(28, 35, 50, 0.9);
    --surface-elevated: rgba(25, 32, 48, 0.95);

    --text-primary: #ffffff;
    --text-secondary: #b8c5db;
    --text-muted: #7a8aa3;
    --text-disabled: #4a5568;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 24px rgba(0, 217, 200, 0.3);

    /* Blur */
    --blur-sm: 8px;
    --blur-md: 12px;
    --blur-lg: 16px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    /* Typography */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body,
#cesiumContainer {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: var(--font-ui);
    color: var(--text-primary);
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 157, 255, 0.15), transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(0, 217, 200, 0.1), transparent 50%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========== UI CONTROLS ========== */
.ui-dock {
    position: absolute;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    z-index: 1000;
}

.ui-dock-right {
    left: auto;
    right: var(--spacing-lg);
    top: auto;
    bottom: var(--spacing-lg);
}

.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    height: 48px;
    min-width: 48px;
    padding: 0 var(--spacing-xl);
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.2), rgba(79, 157, 255, 0.15));
    color: var(--text-primary);
    border: 1.5px solid rgba(0, 217, 200, 0.3);
    border-radius: var(--radius-lg);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 217, 200, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.03em;
    transition: all var(--transition-base);
    backdrop-filter: blur(var(--blur-lg)) saturate(180%);
    position: relative;
    overflow: hidden;
}

.ui-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-400), var(--secondary-500));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.ui-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.ui-button img {
    width: 22px;
    height: 22px;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
}

.ui-button svg {
    width: 22px;
    height: 22px;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 1;
    stroke: currentColor;
    flex-shrink: 0;
}

.ui-button span {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.ui-button.text-button {
    min-width: 120px;
    text-transform: none;
    padding: 0 var(--spacing-2xl);
    font-size: 14px;
}

.ui-button>* {
    position: relative;
    z-index: 1;
}

.ui-button:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary-400);
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.35), rgba(79, 157, 255, 0.25));
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 32px rgba(0, 217, 200, 0.4),
        0 0 48px rgba(79, 157, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ui-button:hover::before {
    opacity: 0.15;
}

.ui-button:hover::after {
    opacity: 1;
}

.ui-button:active {
    transform: translateY(0);
}

.ui-button.active {
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.35), rgba(79, 157, 255, 0.25));
    border-color: var(--primary-400);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 32px rgba(0, 217, 200, 0.5),
        0 0 48px rgba(79, 157, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ui-button.active::before {
    opacity: 0.2;
}

.ui-button:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ========== PANELS ========== */
.panel {
    background: var(--surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
    backdrop-filter: blur(var(--blur-lg));
    animation: panel-enter var(--transition-slow) ease;
    overflow: hidden;
}

.panel h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 var(--spacing-lg) 0;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== OPTIONS BOX ========== */
#optionsBox {
    position: absolute;
    top: var(--spacing-lg);
    left: 190px;
    width: min(340px, 90vw);
    padding: var(--spacing-xl);
    display: none;
    z-index: 900;
}

#optionsBox .filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

#optionsBox label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: linear-gradient(135deg, rgba(26, 32, 45, 0.8), rgba(18, 24, 35, 0.9));
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    user-select: none;
    position: relative;
    overflow: hidden;
}

#optionsBox label::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.1), rgba(79, 157, 255, 0.05));
    opacity: 0;
    transition: opacity var(--transition-base);
}

#optionsBox label>* {
    position: relative;
    z-index: 1;
}

#optionsBox label:hover {
    background: linear-gradient(135deg, rgba(32, 40, 55, 0.9), rgba(24, 30, 42, 0.95));
    border-color: var(--border-medium);
    color: var(--text-primary);
    transform: translateX(4px);
}

#optionsBox label:hover::before {
    opacity: 1;
}

#optionsBox label.active {
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.25), rgba(79, 157, 255, 0.15));
    border-color: var(--primary-400);
    color: var(--text-primary);
    box-shadow:
        0 4px 16px rgba(0, 217, 200, 0.2),
        0 0 24px rgba(0, 217, 200, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

#optionsBox label.active::before {
    opacity: 1;
}

/* Custom Radio Button (Hidden, styled via label) */
#optionsBox input[type="radio"],
#optionsBox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#optionsBox .radio-indicator {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--border-strong);
    border-radius: var(--radius-full);
    position: relative;
    transition: all var(--transition-base);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
}

#optionsBox label:hover .radio-indicator {
    border-color: var(--primary-400);
    background: rgba(0, 217, 200, 0.1);
    box-shadow: 0 0 8px rgba(0, 217, 200, 0.2);
}

#optionsBox label.active .radio-indicator {
    border-color: var(--primary-400);
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    box-shadow:
        0 0 0 4px rgba(0, 217, 200, 0.2),
        0 0 16px rgba(0, 217, 200, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

#optionsBox label.active .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

/* ========== BASEMAP BOX ========== */
#baseMapBox {
    position: absolute;
    top: calc(60px + var(--spacing-lg));
    left: 190px;
    width: min(320px, 90vw);
    padding: var(--spacing-xl);
    display: none;
    z-index: 900;
}

#baseMapBox label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

#baseMapSelect {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--surface-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23b8c5db' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-2xl);
}

#baseMapSelect:hover {
    background-color: var(--surface-glass-light);
    border-color: var(--primary-500);
}

#baseMapSelect:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-color: var(--primary-500);
}

#baseMapNote {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(79, 157, 255, 0.1);
    border-left: 3px solid var(--secondary-500);
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

/* ========== INFO BOX ========== */
#infoBox {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: min(400px, 92vw);
    padding: var(--spacing-xl);
    display: none;
    z-index: 900;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

#infoBox::-webkit-scrollbar {
    width: 6px;
}

#infoBox::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

#infoBox::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: var(--radius-sm);
}

#infoContent {
    font-size: 14px;
    line-height: 1.6;
}

#appInfo {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

#appInfo p {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-secondary);
}

#appInfo p:last-child {
    margin-bottom: 0;
}

#entityInfo {
    margin-top: var(--spacing-lg);
}

#entityInfo .info-item {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

#infoContent button {
    margin: var(--spacing-sm) var(--spacing-sm) 0 0;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--surface-glass);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all var(--transition-base);
}

#infoContent button:hover {
    transform: translateY(-1px);
    border-color: var(--primary-500);
    background: var(--surface-glass-light);
    box-shadow: var(--shadow-sm);
}

/* ========== STORY MAP BOX ========== */
#storyMapBox {
    position: absolute;
    top: calc(152px + var(--spacing-lg));
    left: 190px;
    width: min(360px, 90vw);
    max-height: 60vh;
    padding: var(--spacing-xl);
    display: none;
    z-index: 900;
    overflow-y: auto;
}

#storyMapBox::-webkit-scrollbar {
    width: 6px;
}

#storyMapBox::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
}

#storyMapBox::-webkit-scrollbar-thumb {
    background: var(--primary-500);
    border-radius: var(--radius-sm);
}

#storyMapBox .story-item {
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, rgba(26, 32, 45, 0.8), rgba(18, 24, 35, 0.9));
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

#storyMapBox .story-item::before {
    content: '📍';
    font-size: 18px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

#storyMapBox .story-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-400), var(--secondary-500));
    opacity: 0;
    transition: opacity var(--transition-base);
}

#storyMapBox .story-item:hover {
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.2), rgba(79, 157, 255, 0.12));
    border-color: var(--primary-400);
    color: var(--text-primary);
    transform: translateX(6px);
    box-shadow:
        0 4px 16px rgba(0, 217, 200, 0.15),
        0 0 20px rgba(0, 217, 200, 0.1);
}

#storyMapBox .story-item:hover::after {
    opacity: 1;
}

/* Backward compatibility for old <p> tags */
#storyMapBox p {
    padding: var(--spacing-lg) var(--spacing-xl);
    margin: 0 0 var(--spacing-md) 0;
    background: linear-gradient(135deg, rgba(26, 32, 45, 0.8), rgba(18, 24, 35, 0.9));
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

#storyMapBox p::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-400), var(--secondary-500));
    opacity: 0;
    transition: opacity var(--transition-base);
}

#storyMapBox p:hover {
    background: linear-gradient(135deg, rgba(0, 217, 200, 0.2), rgba(79, 157, 255, 0.12));
    border-color: var(--primary-400);
    color: var(--text-primary);
    transform: translateX(6px);
    box-shadow:
        0 4px 16px rgba(0, 217, 200, 0.15),
        0 0 20px rgba(0, 217, 200, 0.1);
}

#storyMapBox p:hover::after {
    opacity: 1;
}

/* ========== CLOSE BUTTONS ========== */
#closeOptionsBox,
#closeBaseMapBox,
#closeInfoBox {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--danger);
    border: none;
    color: white;
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

#closeOptionsBox:hover,
#closeBaseMapBox:hover,
#closeInfoBox:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

#closeOptionsBox:active,
#closeBaseMapBox:active,
#closeInfoBox:active {
    transform: translateY(0) scale(0.98);
}

/* ========== LOADING SCREEN ========== */
#loadingScreen {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(79, 157, 255, 0.15), transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(0, 217, 200, 0.1), transparent 50%),
        var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: var(--font-display);
}

#loadingScreen p {
    margin-top: var(--spacing-xl);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-500);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 4px solid transparent;
    border-top-color: var(--secondary-500);
    border-radius: var(--radius-full);
    animation: spin 1.2s linear infinite reverse;
}

/* ========== ANIMATIONS ========== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes panel-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ========== MAP TITLE ========== */
#mapTitle {
    position: absolute;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    /* Behind panels (900) but above map */

    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-2xl);

    background: var(--surface-glass);
    backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);

    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;

    animation: panel-enter var(--transition-slow) ease;
}

#mapTitle .main-text {
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#mapTitle .edition {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: var(--spacing-sm);
    border-left: 1px solid var(--border-medium);
    text-shadow: 0 0 12px rgba(0, 217, 200, 0.4);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 12px;
        --spacing-xl: 20px;
    }

    .ui-dock {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ui-dock-right {
        bottom: var(--spacing-lg);
        right: var(--spacing-lg);
    }

    #optionsBox,
    #baseMapBox,
    #storyMapBox {
        left: var(--spacing-lg);
        top: calc(56px + var(--spacing-lg));
        width: min(92vw, 380px);
    }

    #infoBox {
        right: var(--spacing-lg);
        top: calc(56px + var(--spacing-lg));
        width: min(92vw, 380px);
    }
}

@media (max-width: 480px) {
    .panel h2 {
        font-size: 16px;
    }

    .ui-button {
        height: 40px;
        min-width: 40px;
        font-size: 12px;
    }

    #optionsBox label,
    #storyMapBox .story-item,
    #storyMapBox p {
        font-size: 13px;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

@media (max-width: 640px) {
    .ui-dock {
        flex-direction: row;
        top: 12px;
        left: 12px;
    }

    .ui-dock-right {
        top: auto;
        bottom: 12px;
        right: 12px;
    }

    #optionsBox,
    #baseMapBox,
    #storyMapBox {
        left: 12px;
        top: 68px;
        width: min(92vw, 320px);
    }

    #infoBox {
        right: 12px;
        top: 68px;
        width: min(92vw, 320px);
    }
}