/* Global styles */
* {
  box-sizing: border-box;

}

:root {
  --primary-color: rgb(239, 239, 239);
}


html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth; /* Ensure smooth scrolling */
  background-color: var(--primary-color); /* Use your CSS variable */

}

body {
  min-height: 1280px;
  color: #3b3b3b;
  background-color: var(--primary-color); /* Use your CSS variable */

}

h1,
h2,
h3,
h4,
a {
  margin: 0;
  font-weight: 400;
}

a,
a:visited,
a:hover {
  color: black;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

/* Intro and Outro Sections */
#intro {
  max-width: 50rem;
  margin: 1rem auto;
  text-align: center;
  background-color: var(--primary-color); /* Use your CSS variable */

}

.intro__hed {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 60px;
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  line-height: 1.3;
  padding-top: 80px;
}

h1 {
  font-family: 'Gothic A1', sans-serif;
  text-align: left;
  font-weight: 800;
  font-size: 48px;
  line-height: 1;
}

.para-1 {
  font-family: 'Source Serif 4', serif;
  font-weight: 300;
  font-size: 18px;
  text-align: justify;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: left;
  align-items: left;
  width: 33.33%;
  margin: 0 auto;
}

.intro__dek {
  color: #8a8a8a;
}

#intro {
  margin-bottom: 60px;
}

#outro {
  height: 100px;
}

#subhead {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700; /* Bold */
  font-style: italic; /* Italic */
  font-size: 32px;
  text-align: center;
}

.tabs {
  margin: 20px;
  text-align: center;
  display: none;
}



/* TEMPORARY FOR PLAYING WITH WORLD MAP BUTTON */





.tabs2 {
  margin: 20px;
  text-align: center;
  display: none; /* Initially hidden */
}

.tabs2.visible {
  display: block; /* Shown when 'visible' class is added */
}







/* TEMPORARY */









/* Media Queries */
@media (min-width: 840px) {
  .nav__examples {
    margin-top: 0;
    margin-left: 2rem;
  }
}

/* Media query for larger screens */
@media (min-width: 800px) {
  #map {
    margin-left: 450px; /* Adjust this value as needed */
  }
}

/* Styles for Scrolly Sections */
#scrolly,
#scrolly2 {
  position: relative;
  background-color: var(--primary-color); /* Use your CSS variable */
  padding-bottom: 10rem;
}

article {
  position: relative;
  padding: 0;
  max-width: 800px;
  margin-left: 20px;
  margin-bottom: 0vh;
}

.sticky-thing {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  width: 100%;
  margin: 0;
  background-color: #a42c2c00;
  z-index: 0;
  top: 12.5vh;
  height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-thing2 {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  width: 100%;
  margin: 0;
  background-color: #a42c2c00;
  z-index: 0;
  top: 0vh;
  height: 100vh; /* change this in order to lock the map into the screen */
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-thing p,
.sticky-thing2 p {
  font-size: 8rem;
  font-weight: 900;
  color: ar(--primary-color);
}

/* Styles for .step and .step2 elements */
.step,
.step2 {
  max-width: 400px;
  margin-left: 100px;
  margin-right: auto;
  margin-bottom: 35rem;
  min-height: 80vh; /* Ensure enough height for smooth scrolling */
}

.step:last-child,
.step2:last-child {
  margin-bottom: 10;
}

.step.is-active p,
.step2.is-active p {
  background-color: var(--primary-color); /* Use your CSS variable */
  opacity: 1;
  
}

.step p,
.step2 p {
  text-align: left;
  padding: 1rem;
  font-family: 'Source Serif 4', serif;
  font-weight: 300;
  font-size: 18px;
  text-align: justify;
  line-height: 1.5;
  background-color: var(--primary-color); /* Use your CSS variable */
  opacity: .5;
}

/* Styles for the Leaflet map container */
#map {
  width: 100%;
  height: 150%;
}

#map2 {
  width: 100vh;
}

.animated-marker span {
  background-color: #D02D00;
  border-radius: 50%;
  opacity: 0.85;
  display: block;
}

@keyframes grow-shrink {
  0% { transform: scale(0); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* Chart and Highchart News Containers */
.chart-container {
  display: flex; /* Keep the D3 and Highcharts containers side by side */
  align-items: flex-start; /* Align items at the top */
  justify-content: flex-start; /* Ensure items align to the start */
  margin-left: 80px;
}

.highchart-news-container {
  display: flex;
  background-color: var(--primary-color); /* Use your CSS variable */
  flex-direction: column; /* Stack Highcharts and news container vertically */
  width: 550px; /* Fixed width for Highcharts */
}

#chart1 {
  margin-right: 0px; /* Reduced space between D3 and Highcharts */
  width: 700px;
}

#container {
  width: 450px; /* Fixed width for Highcharts */
  height: 300px; /* Fixed height for Highcharts */
  margin-right: 0; /* Remove any unnecessary margin */
}

.highcharts-legend,
.highcharts-legend-box {
  display: none !important;
}

.highcharts-logo {
  display: none !important;
}

.highcharts-credits {
  display: none !important;
}

.tooltip {
  position: absolute;
  color: #0C3771;
  text-align: center;
  width: auto;
  height: auto;
  padding: 5px;
  font: 'IBM Plex Sans', sans-serif;
  border-radius: 4px;
  pointer-events: none;
}

/* News Container Styling */
#news-container {
  margin-top: 20px; /* Space above the news container */
  font-family: 'Georgia', serif; /* Use a serif font to match the style */
  max-width: 400px; /* Set a max width for the headlines */
  color: #3b3b3b;
  padding: 10px; /* Padding around the news container */
  background-color: var(--primary-color); /* Use your CSS variable */
  border-radius: 5px; /* Rounded corners */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
  margin-left: 40px; /* Margin for positioning */
}

/* News Item Styling */
.news-item {
  display: flex; /* Flexbox for number and content alignment */
  flex-direction: column; /* Stack number, content, and snippet vertically */
  align-items: flex-start; /* Align items at the start */
  margin-bottom: 20px; /* Space between each news item */
  padding-bottom: 10px; /* Padding for spacing inside each item */
  border-bottom: 1px solid #ddd; /* Light grey border for separation */
  transition: background-color 0.3s ease; /* Smooth transition for hover effect */
}

/* News Content Styling */
.news-content {
  font-size: 16px; /* Base font size */
  line-height: 1.5; /* Line height for readability */
  margin-bottom: 5px; /* Space below headline */
}

/* News Date Styling */
.news-date {
  font-weight: bold; /* Bold date */
  font-size: 16px; /* Slightly larger font size for the date */
  margin-right: 5px; /* Space between date and headline */
  text-transform: uppercase; /* Uppercase styling for consistency */
}

/* Highlighted Text Styling */
.highlight {
  font-weight: bold; /* Bold text */
  text-transform: uppercase; /* Uppercase text */
  background-color: yellow; /* Highlight color */
}

/* Snippet Styling */
.news-snippet {
  font-size: 14px; /* Smaller font size for the snippet */
  color: #555; /* Subtle color for differentiation */
  margin-top: 5px; /* Space above snippet */
  padding-left: 10px; /* Indentation to align with headline content */
  border-left: 3px solid #ddd; /* Optional left border to differentiate snippet */
}

/* Adjust headline hover state */
.news-item:hover {
  background-color: #f0f0f0; /* Slightly different background on hover */
}

.news-content .headline-link,
.news-content .headline-link:visited,
.news-content .headline-link:active {
  color: black; /* Plain black text for the headlines */
  text-decoration: none !important; /* Remove underline */
  font-weight: bold; /* Make the link bold */
  transition: color 0.3s ease; /* Smooth color transition on hover */
}

.news-content .headline-link:hover {
  color: #1f77b4 !important; /* Match the color of the frequency line (blue) */
  text-decoration: none !important; /* Ensure no underline on hover */
}

/* Container for the search input and compare input */
.search-box,
.compare-box { /* Apply the same styles to both search-box and compare-box */
  display: flex;
  align-items: center;
  border: 2px solid #4682b4; /* Border color */
  border-radius: 20px; /* Adjusted rounded corners */
  padding: 2px 5px; /* Reduced padding inside the box */
  background-color: var(--primary-color); /* Use your CSS variable */
  max-width: 300px; /* Maximum width of the search box */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Soft shadow effect */
  height: 30px; /* Reduced height for the search box */
  margin-top: 10px; /* Added margin to separate boxes */
}

/* Styling for the search input fields */
.search-box input[type="text"],
.compare-box input[type="text"] { /* Apply the same styles to both input fields */
  border: none; /* No border */
  background-color: var(--primary-color); /* Use your CSS variable */

  outline: none; /* No outline on focus */
  width: 100%; /* Full width of the search box */
  padding: 4px 8px; /* Reduced padding inside the input */
  font-size: 14px; /* Slightly smaller font size */
  line-height: 1.2; /* Adjust line height */
  border-radius: 15px; /* Rounded corners */
  height: 100%; /* Set input field height to fill the container */
}

#suggestions-container,
#compare-suggestions-container { /* Apply the same styles to both suggestion containers */
  padding-top: 2px;
  padding-left: 6px;
}

/* Styling for individual suggestion items */
.suggestion-item {
  padding: 8px 10px; /* Padding for suggestions */
  cursor: pointer; /* Pointer cursor on hover */
  color: #000; /* Text color for suggestions */
  font-size: 14px; /* Font size for suggestions */
}

.suggestion-item:hover {
  color: #4682b4; /* Background color on hover */
}

/* Styling for "No Results Found" message */
.no-results {
  padding: 8px 4px; /* Padding for no results message */
  font-size: 12px; /* Font size for no results message */
  font-weight: bold; /* Bold text */
  color: #333; /* Text color for no results */
  background-color: #e5e5e5; /* Background color */
  border-radius: 15px; /* Rounded corners */
  text-align: center; /* Center text */
}

/* Existing CSS styles remain unchanged */

/* Additional Styles for the Visualization */
.scroll-container {
  position: relative;
  padding-bottom: 10vh; /* To allow sticky to behave correctly */
  background-color: var(--primary-color); /* Use your CSS variable */

}

.sticky-chart {
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
  width: 90%;
  max-width: 1110px;
  margin: 0 auto;
  transform: translateX(-150px); /* This shifts the chart 150px to the left */
  background-color: var(--primary-color); /* Use your CSS variable */

}


.scrolly-viz {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 80%; /* Make sure it spans the entire width */
  margin: 0 auto; /* Center align the scrolly sections */
  margin-bottom: 40vh; /* Add margin to control visibility duration */
  padding: 0 0px; /* Ensure padding for mobile responsiveness */
  background-color: var(--primary-color); /* Use your CSS variable */

}

.step-chart {
  margin: 0;
  padding: 50px 0px; /* Ensure enough padding for each section to allow scrolling triggers */
  padding-left: 80px; /* Only left padding */
  width: 100%;
  text-align: right;
  
  min-height: 80vh; /* Ensures sections have enough height for Scrollama triggers */
  display: flex;
  justify-content: flex-end;
  background-color: var(--primary-color); /* Use your CSS variable */
}

/* Active step enhancements */
.step-chart.is-active {
  background-color: var(--primary-color); /* Use your CSS variable */
  padding: 70px 0; /* Increase padding when active to create visual separation */
  transition: background-color 0.6s ease, padding 0.6s ease; /* Smooth transition for background and padding */
}

.element0, .element1, .element2, .element3, .element4 {
  opacity: 1;
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-out;
  transform: translateY(100px);
  font-family: 'Source Serif 4', serif;
  font-weight: 300;
  font-size: 18px;
  text-align: justify;
  line-height: 1.5;
  color: #333;
  width: calc(40% + 150px);
  margin-left: calc(90% - 150px);
  z-index: 2;
  background-color: var(--primary-color); /* Use your CSS variable */

}

.element0.visible, .element1.visible, .element2.visible, .element3.visible, .element4.visible {
  opacity: 1;
  background-color: var(--primary-color); /* Use your CSS variable */

  transform: translateY(0);
}

@media screen and (max-width: 768px) {
  .element0, .element1, .element2, .element3, .element4 {
    width: 80%;
    font-size: 20px;
  }
  .para-1 {
    width: 100%; /* Make full width on mobile */
    margin: 0 auto; /* Center align if needed */
    padding: 0 15px; /* Add some padding to avoid the text touching the edges */
  }
}






/* Responsive Adjustments */
@media screen and (max-width: 768px) {
  .sticky-chart {
    width: 100%;
    max-width: 100%;
  }

  .scrolly-viz {
    max-width: 100%;
    padding: 0 15px;
  }

  .step-chart {
    padding: 50px 0;
    text-align: center; /* Center text for smaller screens */
  }

  .element0, .element1, .element2, .element3, .element4 {
    width: 80%;
    font-size: 20px;
  }
}




/* Spacer style to keep the chart in view longer */
.spacer {
  height: 50vh; /* Adjust height to control how long the chart stays in view */
}



.highcharts-exporting-group {
  display: none;
}




.button-container rect {
  fill: #7eabd0;
  stroke: #ccc;
  cursor: pointer;
}

.button-container rect.active {
  fill: #ffa500;
  stroke: #333;
}

.button-container text {
  pointer-events: none; /* Ensures the text won't interfere with the button click */
}





