#event-map {
    background-color: #eeeeee !important;
	height : 430px;
}
.event-integration-wrapper {
    background-color: #eeeeee;
	position : relative;
	padding-top : 70px;
}
/* This kills the default Google "Off-White" land tiles */
/* #event-map .gm-style div:first-child {
    background-color: transparent !important;
} */
/* --- Timeline Container Setup --- */
.event-timeline {
    padding: 4em 1em;
    position: relative;
    overflow: hidden;
}

/* --- Year Selector --- */
.event-year-selector {
    display: flex !important;
    justify-content: flex-start;
    align-items: center;
    /* flex-wrap: wrap; */
    gap: 0 !important;
    padding: 28px 20px 4px;
}

.event-year-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 0 !important;
    border: 2px solid #9e1a1e;
    background: #fff;
    color: #9e1a1e;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
	min-width : 0 !important;
}
.event-year-pill:first-child {
	border-radius:8px 0 0 8px !important;
}
.event-year-pill:last-child {
	border-radius:0 8px 8px 0 !important;
}
.event-year-pill:hover {
    background: #fdecec;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(158,26,30,0.2);
}

.event-year-pill:focus-visible {
    outline: 2px solid #9e1a1e;
    outline-offset: 2px;
}

.event-year-pill.is-active {
    background-color: #9e1a1e !important;
    border-color: #9e1a1e;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(158,26,30,0.35);
    /* transform: translateY(-1px); */
}

@media (max-width: 500px) {
    .event-year-selector {
        gap: 8px;
        padding: 20px 14px 0;
    }

    .event-year-pill {
        min-width: 70px;
        padding: 8px 16px;
        font-size: 14px;
    }
}

.event-timeline-container {
    position: relative;
    /* max-width: 1200px; */
    /* margin: 0 auto; */
	padding : 40px 40px 1px 40px;
}

/* The Central "Spine" Line */
.central-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #9e1a1e; /* Dark brown/red from prototype */
    transform: translateX(-50%);
}

/* Timeline Item Wrapper (The ZigZag Logic) */
.timeline-item {
    position: relative;
    width: 50%;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
}

.timeline-item.left {
    left: 0;
    padding-right: 80px;
    justify-content: flex-end;
}

.timeline-item.right {
    left: 50%;
    padding-left: 80px;
    justify-content: flex-start;
}

/* Dynamic Dots & Connectors */
.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--event-color); /* Matches the badge color */
    border: 4px solid #fff;
    border-radius: 50%;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.left .timeline-dot { right: -12px; }
.right .timeline-dot { left: -12px; }

.timeline-connector {
    position: absolute;
    width: 80px;
    height: 3px;
    background: var(--event-color); /* Matches the badge color */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.left .timeline-connector { right: 0; }
.right .timeline-connector { left: 0; }

/* --- The Main Card (Integrated) --- */
.event-main-card {
    display: grid;
    grid-template-columns: 85px 1fr auto; 
    align-items: stretch;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-decoration: none;
    overflow: hidden; 
    position: relative;
    width: 100%;
    max-width: 500px; /* Limits size to match prototype "leaf" feel */
}

/* Internal Grey Sidebar */
.inner-date-card {
    grid-column: 1;
    margin: 10px 0 10px 10px; 
    background: #eeeeee;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-self: stretch; 
}

.month-label {
    color: #fff;
    font-weight: bold;
    padding: 0.25em;
    text-align: center;
    background-color: var(--event-color); /* Dynamic color sync */
}

/* Container for the icon - Spaced and centered */
.inner-date-card .icon-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100%;
    flex-grow: 1; 
    padding: 8px 0;
}

/* --- THE COLOR SYNC FIX --- */

/* Material Symbols */
.inner-date-card .material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-size: 42px !important;
    /* Use the variable passed from PHP */
    color: var(--event-color) !important; 
    display: block;
    line-height: 1;
}

/* Font Awesome */
.inner-date-card .icon-wrap i {
    font-size: 36px !important;
    color: var(--event-color) !important;
    display: block;
    line-height: 1;
}

/* Dashicons */
.inner-date-card .dashicons {
    width: 32px;
    height: 32px;
    font-size: 32px;
    color: var(--event-color) !important;
}

/* SVG/Image Icons (Optional Color Filter) */
.inner-date-card .icon-wrap img {
    max-width: 42px;
    height: auto;
    display: block;
    /* Note: Images cannot be colored by CSS 'color'. 
       If you need to color an IMG, you'd need an SVG filter. */
}

/* Text Content */
.event-details {
    grid-column: 2;
    padding: 10px; 
    align-self: center; 
}

.event-details h3, 
.event-details p {
    max-width: 100%;
    word-wrap: break-word;
    margin: 0;
    color: #000000;
}

/* The Flush Badge */
.type-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 4px 12px;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 0 0 0 10px;
    white-space: nowrap;
    z-index: 10;
    background-color: var(--event-color); /* Dynamic color sync */
}

/* Icon Sizing & Styles */
.inner-date-card .material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-size: 42px !important;
    color: #333;
    display: block;
    line-height: 1;
}

.inner-date-card .icon-wrap i {
    font-size: 36px !important;
    color: #333;
    display: block;
}

.inner-date-card .icon-wrap img {
    max-width: 42px;
    height: auto;
    display: block;
}


.event-header {
    position: relative;
    margin-bottom: 30px;
}

.event-hero-badge {
    position: absolute;
    top: 0;
    right: 0;
    color: #fff;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 0 0 0 12px;
    white-space: nowrap;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta-top {
    display: flex;
    align-items: center;
    /* gap: 25px; */
}

/* Reserve room on the right of the title so the hero badge never overlaps the text */
.event-title-area {
    padding-right: 170px;
    box-sizing: border-box;
}

.event-icon-circle {
    /* Dynamics */
    width: fit-content;
    height: auto;
    display: inline-flex;
    
    /* Layout */
    align-items: flex-start;
    justify-content: flex-start;
    
    /* Spacing & Visuals */
    background: #f8f8f8;
    padding-right: 25px;
}

.event-icon-circle .material-symbols-rounded,
.event-icon-circle i {
    font-size: 48px !important;
    color: var(--event-color) !important; /* Dynamic Color */
}

.event-title-area h1 {
    margin: 0 0 5px 0;
    font-size: 32px;
}

.event-page-date {
    font-size: 18px;
    margin: 0;
    color: #444;
}

@media screen and (max-width: 720px) {
    /* Badge drops below the icon/title row instead of overlapping it */
    .event-header {
        display: flex;
        flex-direction: column-reverse;
    }

    .event-hero-badge {
        position: static;
        display: inline-block;
        align-self: flex-start;
        border-radius: 12px;
        margin-bottom: 10px;
        max-width: 100%;
    }

    .event-title-area {
        padding-right: 0;
    }

    .event-title-area h1 {
        font-size: 26px;
    }
}

.event-map-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}


html .gm-style .gm-style-iw {
    font-family: 'Avenir Next', sans-serif !important;
    padding: 10px !important;
	font-size : 20px;
}

html .gm-style .gm-style-iw-d {
    overflow: hidden !important;
}

html .gm-style .map-info-title {
    font-weight: 800;
    color: #9e1a1e; /* CP Red Title inside the popup */
    margin-bottom: 5px;
    display: block;
}
/* Remove the outline from the details link in the map popup */
html .gm-style-iw a:focus,
html .gm-style-iw a:active,
html .gm-style-iw button:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Optional: Ensure the link still looks like a button without the outline */
html .gm-style-iw .details-link {
    text-decoration: none;
    display: inline-block;
    color: #9e1a1e; 
    font-weight: bold;
}
html .gm-style-iw-chr {
	display : none;
}
.my-iw-title {
	color : #000000;
	font-size : 2.5rem;
	font-weight : 700;
}
.my-iw-date {
	font-size : 2.25rem;
	font-weight : 700;
	color : #9e1a1e;
}

.gm-style-iw.gm-style-iw-c {
	background-color : #fff !important;
}

/* Container for the SVG pin */
.custom-pin-container {
    width: 30px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* The SVG itself */
.custom-pin-svg {
    filter: drop-shadow(0px 3px 2px rgba(0,0,0,0.4));
    transition: transform 0.2s ease;
}

.custom-pin-svg:hover {
    transform: scale(1.1);
}

/* Ghost "Ottawa" pin shown when the map has no event markers to plot */
.custom-pin-container.ghost-pin {
    opacity: 0.55;
    filter: grayscale(35%);
}

.leaflet-tooltip.ghost-marker-label {
    background: rgba(255, 255, 255, 0.92);
    border: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
    color: #9e1a1e;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
}

.leaflet-tooltip.ghost-marker-label::before {
    border-top-color: rgba(255, 255, 255, 0.92);
}

html .leaflet-container a {
	color: #9e1a1e !important;
	font-size : 1.75rem;
}

@media screen and ( max-width : 1120px ){
	.event-main-card .event-details {
		padding-top : 30px;
	}
	.event-timeline-container {
		padding-left : 20px;
		padding-right : 20px;
	}
	.timeline-item.left {
		padding-right : 40px;
	}
	.timeline-item.right {
		padding-left : 40px;
	}
	.timeline-connector {
		width : 40px;
	}
	.event-details h3 {
		font-size : 2.75rem;
	}
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    /* 1. Container - allow natural width */
    .event-timeline-container {
        padding: 0 !important;
        position: relative;
        width: 100% !important;
    }

    /* 2. Trunk Line - locked to the left */
    .central-line {
        left: 30px !important;
        margin: 0 !important;
        transform: none !important;
    }

    /* 3. Timeline Item - The fix for the right-side padding */
    .timeline-item {
        width: 100% !important;
        left: 0 !important;
        margin: 0 !important;
        /* Keep the 70px left for the line, and add 20px on the right */
        padding: 20px 20px 20px 70px !important; 
        
        justify-content: flex-start !important;
        text-align: left !important;
        flex-direction: row !important;
        
        /* Ensure the card doesn't bleed out */
        box-sizing: border-box !important; 
    }

    /* 4. Timeline Dot */
    .timeline-dot {
        left: 20px !important; 
        right: auto !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    /* 5. Connector */
    .timeline-connector {
        left: 30px !important;
        width: 40px !important;
        right: auto !important;
    }

    /* 6. Card - reset any fixed widths */
    .event-main-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important; /* Forces the gap you need */
    }
}
@media (max-width: 720px) {
	.event-details h3 {
		font-size : 2rem;
	}
    .timeline-item {
		padding-left: 20px !important;
		padding-bottom : 0px !important;
	}
	.event-timeline-container {
		padding-bottom : 20px !important;
	}
	.central-line,
	.timeline-dot,
	.timeline-connector {
		display : none !important;
	}
}

@media (max-width: 500px) {
    /* 1. Re-establish relative positioning for the absolute badge */
    .event-main-card {
        display: grid !important;
        grid-template-columns: 85px 1fr !important;
        grid-template-rows: auto auto auto;
        position: relative !important; 
        align-items: start;
        max-width: 100% !important;
    }

    /* 2. Flatten the structure to control date, title, and location individually */
    .event-details {
        display: contents !important;
    }

    /* 3. Keep Badge Absolute (Top Right) */
    .type-badge {
        position: absolute !important;
        top: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        z-index: 10;
        /* Matches your original sizing */
        border-radius: 0 0 0 10px !important; 
    }

    /* 4. Position Date Text below the badge area */
    .event-date-text {
        grid-column: 2;
        grid-row: 1;
        /* Adjust 35px to match the actual height of your badge */
        margin: 35px 0 10px 10px !important; 
    }

    /* 5. Title and Location span the full width of the card */
    .event-main-card h3 {
        grid-column: 1 / 3;
        grid-row: 2;
        padding: 5px 15px !important;
        margin: 0 !important;
    }

    .location-text {
        grid-column: 1 / 3;
        grid-row: 3;
        padding: 0 15px 15px 15px !important;
        margin: 0 !important;
        color: #666;
    }

    /* 6. Ensure the icon box doesn't get pushed down by the date margin */
    .inner-date-card {
        grid-column: 1;
        grid-row: 1;
        margin: 10px !important;
    }
}

.event-integration-wrapper .select2-container {
	position : absolute;
	left : 50%;
	top : 10px;
	transform : translateX(-50%);
	background-color : #ffffff;
	padding : 8px 10px;
	z-index : 9;
	border-radius : 12px;
} 

.event-integration-wrapper .select2-container .select2-selection--single {
	display : flex;
	align-items : center;
	gap : 10px;
}
.event-integration-wrapper .select2-container .select2-selection--single .select2-selection__rendered { padding-right : 0; }

.event-integration-wrapper .select2-container--default .select2-selection--single .select2-selection__arrow {
	position : relative;
	flex : 0;
	right : auto;
	top : auto;
	flex-basis : 40px;
}

.select2-results__option {
	text-align : center;
	font-size : 25px;
	padding : 8px 10px 0 10px;
	margin-bottom : 0;
}
.select2-container--default .select2-results > .select2-results__options {
	max-height : 300px;
	border-bottom-right-radius : 12px;
	border-bottom-left-radius : 12px;
}