:root{
    --color-bg: #cfe5dd;
    --color-line: #357783;
    --color-purple: #c93b79;
    --color-ink: #00233e;
}

@font-face {
    font-family: 'Lexend';
    src: url('Lexend-Regular.woff2') format('woff2'),
        url('Lexend-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

html, body{ 
    padding: 0; 
    margin: 0;
    box-sizing: border-box;
    font-family: 'Lexend';
    color: var(--color-ink);
}

.graphic{
    height: 100vh;
    width: 100vw;
    background-color: var(--color-bg);
    padding: 40px;
    position: relative;
    box-sizing: border-box;
}

@media only screen and (max-width: 1024px) {
  .graphic {
    height: 1900px;
  }
}

.graphic__inner{
    box-sizing: border-box;
    position: relative;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
}

.graphic__line{
    height: 2px;
    width: 100%;
    position: absolute;
    top: 50%;
    background-color: var(--color-line);
    z-index: 10;
    background-image: linear-gradient(90deg, var(--color-line) 0%, var(--color-line) 3%, transparent 3%, transparent 97%, var(--color-line) 97%);
}

/* Dots for time gap between 1869 and 1944 */
.graphic__line::before {
    content: '';
    position: absolute;
    left: clamp(8%, 9.25%, 12%);
    right: clamp(86.5%, 87.75%, 90%);
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: repeating-linear-gradient(
        to right,
        var(--color-bg),
        var(--color-bg) 2px,
        transparent 2px,
        transparent 5px
    );
    z-index: 1;

    @media screen and (min-width: 1024px) {
      left: clamp(9%, 11%, 12%);
      right: clamp(85.5%, 86.75%, 89%);
    }

    @media screen and (min-width: 1440px) {
          left: clamp(10%, 10.25%, 12%);
    right: clamp(85.5%, 87.25%, 90%);
    }

    @media screen and (min-width: 1600px) {
          left: clamp(9%, 9.75%, 12%);
    right: clamp(86.5%, 87.75%, 90%);
    }

    @media screen and (min-width: 1920px) {
          left: clamp(8.5%, 9.25%, 12%);
    right: clamp(85.5%, 87.5%, 90%);
    }

    @media screen and (min-width: 2560px) {
          left: clamp(7.75%, 8.75%, 12%);
    right: clamp(86.5%, 87.75%, 90%);
    }
    @media screen and (min-width: 3840px) {
          left: clamp(7%, 8.25%, 10%);
    right: clamp(86.5%, 87.75%, 90%);
    } 
}

@media only screen and (max-width: 1024px) {
  .graphic__line {
    height: 100%;
    width: 2px;
    top: 0;
    left: 50%;
    background-image: linear-gradient(180deg, var(--color-line) 0%, var(--color-line) 3%, transparent 3%, transparent 97%, var(--color-line) 97%);
  }
  
  .graphic__line::before {
    left: 50%;
    right: auto;
    top: 9.5%;
    bottom: 87.5%;
    width: 6px;
    height: auto;
    transform: translateX(-50%);
    background: repeating-linear-gradient(
        to bottom,
        var(--color-bg),
        var(--color-bg) 2px,
        transparent 2px,
        transparent 5px
    );
  }
}



.graphic__item{
    background-color: var(--color-line);
    color: #fff;
    width: 50px;
    height: 50px;
    position: absolute;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    left: calc(var(--offset) * 1%);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 0 0 0px var(--color-purple);
}

.graphic__item:hover {
    box-shadow: 0 0 0 4px var(--color-purple);
}
.graphic__item:hover .graph__item__content{
    box-shadow: 0 0 0 4px var(--color-purple);
    transition: box-shadow 0.2s ease-in-out;
    box-shadow: 0 0 0 7px var(--color-purple);
    border-radius: 50%;
}

.graphic__item.active{
    background-color: var(--color-purple);
}

@media only screen and (max-width: 1024px) {
  .graphic__item {
    transform: translateX(-50%);
    top: calc(var(--offset) * 1%);
    left: 50%;
  }
}


.graph__item__content{
    left: 50%; 
    top: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
}

.graphic__item__title{
    position: absolute;
    color: var(--color-ink);
    text-align: center;
    width: 100%;
}

[data-orientation="up"] .graph__item__content{
    transform: translate(-50%, calc(-50% - 120px));
}

[data-orientation="down"] .graph__item__content{
    transform: translate(-50%, calc(-50% + 120px));
    
}


@media only screen and (max-width: 1024px) {
  [data-orientation="up"] .graph__item__content {
    transform: translate(calc(-50% - 120px), -50%)
  }

  [data-orientation="down"] .graph__item__content{
    transform: translate(calc(-50% + 120px ), -50%); 
 }
}


[data-orientation="up"] .graph__item__content::before{
    width: 2px;
    background-color: var(--color-purple);
    height: 95px;
    content: '';
    position: absolute;
    top: 50%;
    right: 50%;
    z-index: -1;
    transform: translateX(50%);
    transition: all 0.2s ease-in-out;
}

.graphic__item:hover .graph__item__content::before {
    width: 4px;
    background-color: var(--color-purple);
}

[data-orientation="down"] .graph__item__content::before{
    width: 2px;
    background-color: var(--color-purple);
    height: 95px;
    content: '';
    position: absolute;
    bottom: 50%;
    right: 50%;
    z-index: -1;
    transform: translateX(50%);
    transition: all 0.2s ease-in-out;
}

.graphic__item:hover [data-orientation="down"] .graph__item__content::before {
    width: 4px;
    background-color: var(--color-purple);
}

@media only screen and (max-width: 1024px) {
  .graphic__item:hover .graph__item__content::before {
    width: 95px;
    background-color: var(--color-purple);
}
    [data-orientation="up"] .graph__item__content::before{
    height: 2px;
    background-color: var(--color-purple);
    width: 95px;
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: none;
    z-index: -1;
    transition: all 0.2s ease-in-out;
}
  [data-orientation="down"] .graph__item__content::before{
    height: 2px;
    background-color: var(--color-purple);
    width: 95px;
    content: '';
    position: absolute;
    bottom: 50%;
    right: 50%;
    z-index: -1;
    transform: none;
    transition: all 0.2s ease-in-out;
    }
    
    .graphic__item:hover [data-orientation="up"] .graph__item__content::before,
    .graphic__item:hover [data-orientation="down"] .graph__item__content::before {
        height: 4px;
        background-color: var(--color-purple);
    }
}




[data-orientation="up"] .graph__item__content .graphic__item__title{
    transform: translateY(calc(-100% - 10px));

}

[data-orientation="down"] .graph__item__content .graphic__item__title{
    transform: translateY(calc(10px));
}

@media only screen and (max-width: 1024px) {
  [data-orientation="down"] .graph__item__content .graphic__item__title{
      top: 0;
      transform: translateY(calc(-100% - 10px));
  }
}

.graphic__item__image{
    width: 120px;
    height: 120px;
    background-color: #FFFFFF;
    border-radius: 50%; 
    background-size: 95%;
    background-repeat: no-repeat;
    background-position: center;
    transition: all 0.2s ease-in-out;
}

.graphic__item:hover .graphic__item__image {
    transform: scale(1.05);
}

.graphic__item::before{
    content: attr(data-year);
    text-align: center;
    color: #fff;
    display: grid;
    place-items: center;
    height: 100%;
    position: relative;
    z-index: 1;
}

.dialog-year{
    color: var(--color-purple);
    font-weight: bold;
    font-size: 30px;
}

.dialog-title{
    font-weight: bold;
    font-size: 30px;
}

.dialog-close {
  position: absolute;
  right: 32px;
  top: 32px;
  width: 32px;
  height: 32px;
  opacity: 1;
  background-color: transparent;
  border: none;
  cursor: pointer;
}
.dialog-close:hover {
  opacity: 1;
  cursor: pointer;
}
.dialog-close:before, .dialog-close:after {
  position: absolute;
  left: 15px;
  content: ' ';
  height: 33px;
  width: 2px;
  background-color: var(--color-ink);
}
.dialog-close:before {
  transform: rotate(45deg);
}
.dialog-close:after {
  transform: rotate(-45deg);
}