/* ================================
   Global styles
   ================================ */

:root {
    --darkpurple: #44354C;
    --brightpurple: #BB89BD;
    --lightpurple: #ECDAF2;
    --red: #E68999;
    --blue: #8DA7D7;
}

body {
    background-color: var(--darkpurple);
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 70vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

article {
    max-width: 700px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    margin: 20px 0 20px 0;
}

.left {
    align-items: flex-start;
    text-align: left;
}

.right {
    align-items: flex-end;
    text-align: right;
}

/* ================================
   Typography
   ================================ */

h1 {
    color: var(--brightpurple);
    font-family: "brando", serif;
    font-weight: 600;
    font-size: 24px;
    margin: 10px 0;
}

p {
    color: white;
    font-family: "brando", serif;
    font-size: 16px;
    line-height: 1.5;
}

/* ================================
   Images
   ================================ */

#titleIMG {
    width: 90vw;
    margin: 20px 0;
    margin-left: -15vw;
}

#map {
    width: 70%;
    aspect-ratio: 1.7/1;
    background: none;
    align-self: center;
}

.leaflet-bottom.leaflet-right {
    display: none;
}

g {
    width: 100%;
    align-self: center;
}

/* Standard-Tooltip-Styling */
.custom-tooltip {
    background-color: white !important;
    color: #44354C !important;
    border: 2px solid #44354C !important;
    border-radius: 0px;
    padding: 5px !important;
    font-family: "brando", serif !important;
    font-size: 12px;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0.3);
}

/* Tooltip-Pfeil anpassen */
.custom-tooltip:before {
    border-color: #44354C !important;
    display: none !important;
}

/* Einfache CSS-Styles für die Bilder */
img {
    display: block;
    margin: 10px 0;
}


/* ================================
   Article styles
   ================================ */

.graphics {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    width: 100%;
}

.text {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    max-width: 700px;
}

/* ================================
   Menu styles
   ================================ */

.menuContainer {
    width: 50vw;
    max-width: 500px;
    margin: 20px 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    position: relative;
    height: 50px;
    /* Höhe des Menüs */
}


/* Punkte */
.point {
    position: relative;
    z-index: 2;
    width: 5%;
    /* Breite jedes Punktes */
    aspect-ratio: 1/1;
    /* Höhe jedes Punktes */
    background-color: var(--lightpurple);
    /* Hintergrundfarbe der Punkte */
    border-radius: 50%;
    /* Runde Punkte */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    /* Textfarbe */
    cursor: pointer;
    /* Mauszeiger als Hand anzeigen */
    transition: background-color 0.3s ease;
}

.point:hover {
    background-color: var(--brightpurple);
}

/* Verbindungslinie zwischen Punkten */
.point:not(:last-child):after {
    content: '';
    position: absolute;
    width: calc(100% + 5px);
    /* Breite der Linie */
    height: 0.5vw;
    /* Dicke der Linie */
    background-color: var(--lightpurple);
    /* Farbe der Linie */
    top: 50%;
    /* Linie in der Mitte der Punkte */
    left: 100%;
    /* Linie nach dem Punkt positionieren */
    transform: translateY(-50%);
    /* Vertikale Zentrierung der Linie */
}

/* Beschriftung der Punkte standardmäßig verstecken */
.label {
    position: absolute;
    /* Positionierung für Text */
    top: -20px;
    width: 60px;
    text-align: center;
    font-family: "brando", serif;
    font-size: 12px;
    left: -15px;
    display: none;
    /* Standardmäßig verstecken */
}

/* Zeige die Beschriftung beim Hover an */
.point:hover .label {
    display: block;
    /* Nur beim Hover anzeigen */
}

/* Bildgrößenanpassung für die Kandidaten */
#donald,
#kamala {
    display: flex;
    justify-content: center;
    z-index: 2;
    /* Stellt sicher, dass die Kandidatenbilder über dem Hintergrundbild angezeigt werden */
    width: auto;
    /* Breite wird durch JavaScript festgelegt */
    aspect-ratio: 4 / 10;
    /* Verhältnis von Breite zu Höhe */
    object-fit: contain;
    /* Skaliert das Bild, ohne die Aspect Ratio zu verändern */
    margin: 0 10px;
    /* Abstand zwischen den Kandidatenbildern */
}

/* Wordcloud Container */
#wordCloud {
    width: 100%;
    aspect-ratio: 2/1;
    max-height: 500px;
    text-align: center;
    justify-content: center;
}

/* Grafik für die Kandidaten */
#candidatesGraphic {
    position: relative;
    /* Ermöglicht die absolute Positionierung von Hintergrundbildern */
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    /* Verteilt die Kandidaten gleichmäßig */
    align-items: flex-end;
    /* Kandidatenbilder am unteren Rand ausrichten */
    width: 80%;
    max-width: 500px;
    /* Maximale Breite für die Flexbox */
    aspect-ratio: 1 / 1;
    /* Quadratische Flexbox */
}

/* Hintergrundlinien */
#backgroundLines {
    position: absolute;
    /* Setzt das Hintergrundbild hinter die anderen Bilder */
    width: 100%;
    height: 100%;
    /* Hintergrundbild füllt die Flexbox vollständig aus */
    object-fit: contain;
    /* Hintergrundbild wird skaliert, ohne verzerrt zu werden */
    z-index: 1;
    /* Hintergrund bleibt hinter den Kandidatenbildern */
    margin: 0;
}

.candidateCounts {
    display: flex;
    flex-direction: column;
    width: 50%;
    align-items: center;
}

.candidateNames {
    margin: 0;
    font-weight: 500;
}

#candidatesDescriptions {
    margin-top: 20px;
    display: flex;
    flex-direction: row;
    width: 80%;
    max-width: 500px;
}

#countKamala,
#countDonald {
    font-family: "brando", serif;
    font-size: 12px;
    font-weight: 600;
    margin: 0 10px;
}

/* Media Queries*/
@media (max-width: 750px) {

    main {
        width: 90vw;
    }

    #wordCloud {
        max-width: 100%;

    }

    #map {
        width: 100%;
    }

    .menuContainer{

        width: 100%;
    }

    section{margin-top: 20px;
    margin-bottom: 20px;}
}