:root {
    /* General Colors */
    --primary-color: #ff8a00;
    --primary-color-light: #e91e63;
    --primary-color-dark: #ad1457;
    --accent-color: #ff8a00;
    --accent-color-light: #fe8a00;
    --accent-color-opacity: rgba(255, 138, 0, 0.51);
    --purple-color: #5c2d91;
    --purple-dark: #512481;
    --text-color: #333;
    --text-color-light: #666;
    --text-color-lighter: #6c757d;
    --border-color: #e0e0e0;
    --border-color-light: #f0f0f0;
    --background-light: #f8f9fa;
    --background-lighter: #f5f5f5;
    --background-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --shadow-color-medium: rgba(0, 0, 0, 0.12);
    --shadow-color-dark: rgba(124, 124, 124, 0.4);

    /* Colours of this map in map-shared.css: the events orange of the pin, with white on top of it */
    --map-accent: #f7971c;
    --map-on-accent: #fff;
    --map-ink: #f7971c;
    --map-tint: #fdecd4;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-circle: 50%;

    /* Font Sizes */
    --font-size-xs: 0.9rem;
    --font-size-sm: 0.95rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.5rem;
    --font-size-xxl: 1.6em;

    /* Transition */
    --transition-speed: 0.3s ease;
}

#map {
    /* The whole map fits on screen, with a little room above and below (see --map-height in map-shared.css) */
    height: var(--map-height, calc(100vh - 48px)) !important;
    min-height: 420px !important;
    width: 100% !important;
    border: 1px solid #ccc;
    background-color: var(--background-lighter);
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 6px var(--shadow-color);
}
@media screen and (max-width: 650px){
    #map {
        height: calc(100% - 400px) !important;
        min-height: 800px !important;
    }
}

.sidebar {
    /* As tall as the map column: the map plus the "Map:" heading above it (55px) */
    height: calc(var(--map-height, calc(100vh - 48px)) + 55px);
    min-height: 475px;
    overflow-y: auto;
    padding-right: var(--spacing-md);
}
@media screen and (max-width: 650px) {
    .sidebar {
        height: 100% !important;
    }
}

/* Keep pagination visible while the sidebar list scrolls */
.sidebar .facetwp-pagination-wrapper {
    position: sticky;
    top: 0;
    bottom: auto;
    z-index: 5;
    background: #fff;
    padding: var(--spacing-xs) 0;
}

/* The wrappers that follow the list stick to the bottom instead */
.sidebar .facetwp-template ~ .facetwp-pagination-wrapper {
    top: auto;
    bottom: 0;
}

#page-title {
    color: var(--primary-color)!important;
}

.organization-card,
.event-card {
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: none;
    transition: var(--transition-speed);
    margin-bottom: var(--spacing-lg);
    cursor: pointer;
    background: white;
    position: relative;
}
.organization-card:hover,
.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
    border-color: var(--primary-color-light);
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    padding: var(--spacing-md) 1.25rem;
    border: none;
    display: flex;
    align-items: center;
    background-color: #fff;
}

.card-title {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
}
.card-body {padding-top: 5px;}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}
.event-date, .event-time, .event-organization, .event-online-badge {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}
/* Card icons in the events orange, as in the pin pop-up */
.event-meta .fa { color: var(--map-accent); }
.event-date { color: #444; }
.event-time { color: #666;}
.event-organization { color: #444; }

.event-online-badge {
    background: var(--primary-color-light);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-flex;
    width: fit-content;
    align-items: center;
}

.btn-view-map, .btn-primary {
    background: var(--primary-color-dark);
    font-size: var(--font-size-lg)!important;
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 500;
    transition: var(--transition-speed);
}
.btn-view-map:hover,
.btn-primary:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
}

.btn-details, .btn-events {
    background: var(--accent-color-light);
    font-size: var(--font-size-lg)!important;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 500;
    transition: var(--transition-speed);
}
.btn-details:hover, .btn-events:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}
.btn, .button { font-size: 14px !important; }

.custom-marker {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    padding: 0 !important;
}

/* Pins are always the events orange, the one in use (its pop-up is open) included */
.custom-marker .fa-map-marker {
    font-size: 4em;
    color: var(--map-accent);
}

/* The pin in use sits above the group that the other events at the same venue fall back into */
.custom-marker.event-marker {
    z-index: 1;
}

/* Date under the name of each event in the list of a pin group */
.map-cluster-list__date {
    display: inline-block;
    width: 100%;
    font-size: 11px;
    color: #444;
}

/* Pin pop-up of an event */
.map-event-popup {
    padding: 10px;
}

.map-event-popup__title {
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--map-accent);
}

.map-event-popup p {
    margin-bottom: 8px;
    color: #111;
}

.map-event-popup__row .fa {
    margin-right: 6px;
    color: var(--map-accent);
}

.map-event-popup .map-popup-actions {
    margin-top: 14px;
}

.maplibregl-popup-content {
    /* MapLibre sets its own font (Helvetica/Arial) on everything inside the map */
    font-family: "Lato", sans-serif;
    /* Long names wrap instead of pushing the pop-up out of shape */
    overflow-wrap: anywhere;
    padding: 15px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 15px var(--shadow-color);
    min-width: 300px;
}

.control-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
}

/* Legend of the ward areas. Not in use while the ward boundaries are hidden (see the
   map template); kept for when they come back. */
.legend {
    margin-top: 10px;
    font-size: 12px;
}
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid #ccc;
}

.facetwp-facet input.facetwp-search,
.facetwp-type-search input,
.facetwp-facet input[type="text"],
.facetwp-facet select,
.facetwp-type-dropdown select,
.facetwp-type-date_range .facetwp-date,
.postcode-field {
    border: 3px solid #cdcdcd;
    background-color: white;
    font-family: "Lato", sans-serif;
    color: #2b2b2b;
    font-size: 1.125em;
    padding: 8px 10px;
    width: 100%;
    -webkit-appearance: none;
    border-radius: 9px;
    min-height: 46px;
}
.facetwp-type-date_range input {
    width: 50%!important;
}
.facetwp-checkbox {
    display: block;
    margin-bottom: 5px;
    padding-left: 25px;
    position: relative;
}
.facetwp-input-wrap {
    width: 100%;
}

@media (max-width: 768px) {
    .event-meta { flex-direction: column; }
    .event-time { margin-left: 0; }
}

#search-form-toggle {
    font-size: 20px!important;
    font-weight: 700!important;
}

.facetwp-selection-label {
    font-weight: 700 !important;
}
.facetwp-selections li {
    display: inline-block;
    line-height: 1;
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: #fff;
    margin-left: 2px;
    margin-top: 2px;
}