@font-face {
    font-family: 'Proxima Nova';
    src: url('Proxima Nova Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-color: #FCFFE7;
    --text-color: #000000;
    --accent-color: #4CAF50;
    --card-bg: rgba(30, 30, 30, 0.9);

    --ldf-color: #e53e3e;
    --udf-color: #3182ce;
    --other-color: #718096;
    --default-map-color: #E0D8B0;
    --map-stroke: #1a202c;

    --header-bg: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Proxima Nova', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.sticky-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: #2e2f31;
    z-index: 1000;
    border-bottom: 1px solid #333;
    padding: 10px 0;
}

.header-container {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.scrolly-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    flex-direction: row;
    gap: 40px;
}

.graphic-container {
    flex: 1;
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.maps-container {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.maps-container-pre {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 15vh;

    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.maps-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.maps-container-pre.active {
    opacity: 1;
    visibility: visible;
}

.map-section {
    transition: all 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#map-section-2011 {
    width: 0%;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-50px);
}

#map-section-2016 {
    width: 0%;
    opacity: 0;
    overflow: hidden;
    transform: translateX(-50px);
}

#map-section-2021 {
    width: 50%;
    opacity: 1;
    transition: all 0.5s ease;
}

.maps-container.show-parallel {
    gap: 20px;
}

.maps-container.show-parallel #map-section-2016 {
    max-width: 50%;
    width: 50%;
    opacity: 1;
    overflow: visible;
    transform: translateX(0);
}

.maps-container.show-parallel #map-section-2021 {
    max-width: 50%;
    width: 50%;
    overflow: visible;
}

.maps-container.show-triple #map-section-2011 {
    width: 33.333%;
    opacity: 1;
    overflow: visible;
    transform: translateX(0);
}

.maps-container.show-triple #map-section-2016 {
    width: 33.333%;
    opacity: 1;
    overflow: visible;
    transform: translateX(0);
}

.maps-container.show-triple #map-section-2021 {
    width: 33.333%;
    overflow: visible;
}

#map-section-pre2008 {
    width: 65%;
    opacity: 1;
    transition: all 0.5s ease;
}


.map-wrapper {
    width: 100%;
    max-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map-wrapper-pre2008 {
    width: 70%;
    margin: 0 auto;
}

.map-wrapper svg {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
}

#patch_1,
#patch_2 {
    display: none;
}

.graphic-caption {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #323335;
    text-align: center;
}

#caption-pre2008 {
    margin-top: 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #323335;
    text-align: center;
    white-space: nowrap;
}

.text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 10vh;
    padding-bottom: 10vh;
}

.step {
    background-color: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 80vh;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    opacity: 0.3;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease;
    transform: translateY(20px);
}

#step-4 {
    margin-bottom: 15vh;
}

.step.is-active {
    opacity: 1;
    transform: translateY(0);
    border-color: #555;
}

.step-cover {
    background-color: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 100vh;
}

.step-cover.is-active {
    border: none;
}

.headline {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1.1;
    margin-bottom: 15px;
    color: #2e2f31;
}

.step-4-headline {
    color: #ffffff;
}

.sub-headline {
    font-size: 1.5rem;
    font-weight: normal;
    color: #323335;
    margin-bottom: 20px;
}

.step .dateline {
    font-size: 0.8rem;
    color: #323335;
    letter-spacing: 1px;
}

.step .byline {
    font-size: 1rem;
    color: #323335;
    letter-spacing: 1px;
}

.scroll-icon {
    width: 60px;
    height: auto;
    margin-top: 40px;
    margin-bottom: 20px;
}

.step .scroll-instruction {
    font-size: 1.1rem;
    color: #323335;
    font-style: italic;
    opacity: 0.8;
}

.step h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #fff;
}

.step p {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 15px;
}

.highlight-ldf {
    background-color: var(--ldf-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.highlight-udf {
    background-color: var(--udf-color);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}


.ldf-color {
    background-color: var(--ldf-color);
}

.udf-color {
    background-color: var(--udf-color);
}

.other-color {
    background-color: var(--other-color);
}

.constituency-accordion {
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.constituency-accordion summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    outline: none;
    transition: color 0.3s;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.constituency-accordion summary::-webkit-details-marker {
    display: none;
}

.constituency-accordion summary::after {
    content: "\25BC";
    font-size: 0.8em;
    padding-left: 10px;
}

.ldf-accordion summary {
    color: #e53e3e;
}

.udf-accordion summary {
    color: #3182ce;
}


.constituency-accordion p {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ffffff;
}


path.constituency {
    transition: fill 0.8s ease-in-out;
    stroke: var(--map-stroke);
    stroke-width: 0.5;
    cursor: pointer;
}

path.constituency:hover {
    stroke: #fff;
    stroke-width: 1.5;
}

.tooltip {
    position: absolute;
    text-align: left;
    padding: 10px;
    font: 14px 'Proxima Nova', sans-serif;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #444;
    border-radius: 4px;
    pointer-events: none;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transition: opacity 0.2s ease;
}

.tooltip p {
    margin-bottom: 5px;
}

.tooltip p:last-child {
    margin-bottom: 0;
}

.outro-section {
    position: relative;
    padding: 60px 40px;
    background-color: var(--primary-bg);
    color: var(--text-color);
    font-family: var(--font-secondary);
    display: flex;
    justify-content: center;
    border-top: none;
}

.outro-content {
    max-width: 1200px;
    font-size: 1.25rem;
    line-height: 1.6;
    text-align: left;
}

.outro-content p {
    text-align: left;
}



@media screen and (max-width: 900px) {
    .scrolly-container {
        flex-direction: column;
        gap: 0;
    }

    .graphic-container {
        position: sticky;
        top: 60px;
        height: 42vh;
        z-index: 20;
        background: var(--bg-color);
    }

    .graphic-container::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 5vh;
        background: linear-gradient(to bottom, rgba(252, 255, 231, 1) 0%, rgba(252, 255, 231, 0) 100%);
        pointer-events: none;
        z-index: 20;
        transform: translateZ(0);
    }

    .maps-container,
    .maps-container-pre {
        height: 100%;
        padding-bottom: 0px;
        align-items: center;
    }

    .maps-container-pre {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 5px;
    }

    .map-wrapper {
        max-height: 100%;
    }

    #map-wrapper-pre2008 {
        width: 100%;
        height: 28vh;
        margin: 0 auto;
        margin-bottom: 0px;
        margin-top: 0px;
    }

    #caption-pre2008 {
        margin-top: 5px;
        font-size: 0.95rem;
    }

    .maps-container.show-parallel {
        gap: 5px;
        flex-direction: row;
    }

    .maps-container.show-triple {
        flex-direction: row;
        gap: 5px;
    }

    .text-container {
        position: relative;
        z-index: 10;
        padding-top: 15vh;
        padding-bottom: 0;
    }

    .step {
        margin-bottom: 50vh;
        background-color: transparent;
        border: none;
        box-shadow: none;
        pointer-events: auto;
    }

    .step p,
    .constituency-accordion p,
    .subheadline,
    .step .headline {
        color: #000;
    }

    .graphic-caption {
        font-size: 0.75rem;
        margin-top: 2px;
    }

    h1.headline {
        font-size: 2.2rem;
    }

    #step-4 {
        margin-bottom: 0;
        padding-bottom: 20px;
    }
}