/* Global Styles */ 
  html, body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
  }

  body {
    background-color: #1A274A; 
  }  

 
/* SIDE NAV MENU --- code courtery of https://www.w3schools.com/howto/howto_js_sidenav.asp */
  .sidenav {
    height: 100%; 
    width: 0; /* 0 width - change this with JavaScript */
    position: fixed; 
    z-index: 1;
    top: 0; 
    left: 0;
    background-color: #1A274A; 
    overflow-x: hidden; 
    padding-top: 60px; 
    transition: 0.5s;   
  }

    /* The navigation menu links */
  .sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #fefbee;
    display: block;
    transition: 0.3s;
  }

    /* When you mouse over the navigation links, change their color */
  .sidenav a:hover {
    color: #6893d8;
  }

    /* Position and style the close button (top right corner) */
  .sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
  }

    /* Menu icon (hamburger) */
  .menu-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 30px;
    color: #fefbee;
    z-index: 1001; 
    cursor: pointer;
    background-color: transparent;
    border: none;
  }

    /* Style page content - push the page content to the right when you open the side navigation */
  #main {
    transition: margin-left .5s;
  }

/* INTRO SECTION */

@media (min-width: 768px) {
  .mobile-learn-button{
    display: none; 
  }
}  

  .intro-section {
    position: relative;
    height: 100vh;
    filter: grayscale(45%);
    overflow: hidden;
    transition: opacity 0.4s ease-out;
    background-color: #1a274a;
  }
  
  /* Background flag */
  .background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    filter: grayscale(45%);
  }

  .background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #06092761;
    z-index: -1;
  }
  
  /* Title overlay */
  .intro-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fefbee;
    width: 80%;
  }
  
  /* Fonts */
  @font-face {
    font-family: 'American Average';
    src: url('../font/AmericanAverage-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'The Bold Font';
    src: url('../font/THEBOLDFONT-FREEVERSION.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
  }
  
  /* Main heading */
  .main-text {
    font-size: 7rem;
    margin-bottom: 1rem;
    width: 75%;
    line-height: 70%;
    font-family: 'American Average';
    text-align: center;
  }
  
  /* Subheading */
  .sub-text {
    font-size: 1.5rem;
    font-weight: 300;
    max-width: 700px;
    width: 50%;
    font-family: 'The Bold Font';
    padding-top: 2%;
  }
  
  /* Scroll to learn */
  .scroll-indicator {
    margin-top: 4rem;
    text-align: center;
    animation: fadeInUp 5s ease-in-out;
    font-family: 'The Bold Font';
  }
  
  .scroll-indicator span {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }
  
  .arrow {
    font-size: 5rem;
    animation: bounce 2s infinite;
    color: #fefbee;
  }
  
  /* Animations */
  @keyframes bounce {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(10px);
    }
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

/* SCROLL b/t intro and glance sections */  
  .intro-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px; /* adjust fade height */
    background: linear-gradient(to bottom, transparent, #1A274A);
    z-index: 0;
  }

/* rest of page background */
  .fixed-background-wrapper {
    background: url('../img/capitol.jpeg') center center / cover no-repeat fixed;
    background-color: #1A274A; /* fallback */
    filter: grayscale(45%);
  }

  #glance-section {
    position: relative;
    text-align: center;
    color: white;
    padding: 8rem 2rem 6rem 2rem; /* top, right, bottom, left */
  }
  
  .glance-header {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fefbee;
    width: 100%;
  }
  
  .glance-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  .glance-box {
    background-color: #fefbee;
    flex: 1 1 300px;
    min-height: 250px;
    max-width: 500px;
    padding: 1rem;
    box-sizing: border-box;
    position: relative;
  }
  
  /* Base text style */
  .box-text {
    font-size: 1.2rem;
    color: #1A274A;
    position: relative;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    opacity: 1;
    visibility: visible;
  }
  
  /* Hide all text by default on hover (box 1 and 3) */
  .glance-box:hover .box-text {
    opacity: 0;
    visibility: hidden;
  }
  
  /* Reveal chart container on hover (box 1 and 3) */
  .chart-container {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  }
  
  .glance-box:hover .chart-container {
    opacity: 1;
    visibility: visible;
  }
  
  /* ===== Box 2 ===== */
  
  /* Start hidden */
  #box2 .box-text.a2 {
    opacity: 0;
    visibility: hidden;
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  }
  
  /* Fade in on hover */
  #box2:hover .box-text.a2 {
    opacity: 1;
    visibility: visible;
  }
  
  /* ==== box 4 ==== */ 
  #box4 .box-text.a4 {
    opacity: 0;
    visibility: hidden;
    font-size: 5rem;
    line-height: 1.4;
    text-align: center;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
  }
  
  /* Fade in on hover */
  #box4:hover .box-text.a4 {
    opacity: 1;
    visibility: visible;
  }
 
/* TIMELINE SECTION  ---- code courtery of Scott: https://jsbin.com/hiqorahime/edit?html,css,js,output */

  .timeline-intro {
    font-family: 'The Bold Font', sans-serif;
    font-size: 2rem;
    color: #fefbee;
    margin: 2rem 0 1rem 4rem;
    text-align: left;
  }


  /* slideshow styles */
  .slideshow-container {
    position: relative;
    display: flex;
    overflow-x: scroll;
    align-items: center;
    height: 667px;
  }
  

  .slideshow-container .spacer {
    min-width: 35vw !important;
    height: 100%;
    background: transparent !important;
    pointer-events: none;
    flex-shrink: 0; 
  }

  #timeline-section .slideshow-container > section {
    min-width: 375px;
    height: 50%;
    margin: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-snap-align: start;
    transition: transform 0.2s ease-in-out; 
    position: relative;
  }
  
  #timeline-section .slideshow-container > section > img {
    position:absolute;
    top:0px;
    left:0px;
    transition:0.4s;
  }

    /* horizontal line */
    .timeline-line {
      position: absolute;
      top: 50%;
      left: 0;
      height: 4px;
      width: 7500px;
      background-color: #fefbee;
      z-index: 5;
      pointer-events: none;
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); 
    }

    /* Small vertical dash in the center */
    .slideshow-container > section::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 4px;
      height: 20px;
      background-color: #fefbee; /* same color as line */
      transform: translate(-50%, -50%);
      z-index: 6;
      pointer-events: none;
    }

    .slideshow-container > .spacer::after {
      display: none;
    }

    .timeline-spacer {
      flex-shrink: 0;
      width: auto;
      height: 100%;
      background: transparent;
      pointer-events: none;
    }
    
  .timeline-content {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
  }

  .top-half,
  .bottom-half {
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    z-index: 2;
    position: relative;
  }

  .timeline-image {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    filter: grayscale(20%);
  }

    /* Text styles */
    .timeline-date,
    .timeline-caption {
      background-color: #991529a8; 
      padding: 0.5rem 1rem;
      color: #fefbee;
      text-shadow: none;
      font-size: 1rem;
      line-height: 1.4;
      max-width: 90%;
    } 

    .timeline-date {
      font-weight: bold;
      font-size: 2.2rem;
    }

    /* hover effects */
    #timeline-section .slideshow-container > section:hover {
      transform: scale(1.1); /* Grows by 5% on hover */
      z-index: 3; /* Keeps it above its neighbors */
    }

    /* New overlay layer inside each section */
  .slideshow-container > section .hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: grayscale(100%);
    transition: opacity 0.3s ease-in-out;
    z-index: 5;
  }

    /* Hide the overlay when hovering */
  .slideshow-container > section:hover .hover-overlay {
    opacity: 0;
  }

  #timeline-explainer {
    padding: 4rem 2rem;
    background-color: #1a274ac1;
    color: #fefbee;
    font-family: 'The Bold Font', sans-serif;
  }

  .copy-container {
    display: flex;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
  }

  .copy-container .column {
    flex: 1 1 45%;
    font-size: 1.1rem;
    line-height: 1.6;
  }

/* TRENDS SECTION */
  #trends-section {
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    min-height: 90vh; /* almost full screen height */
    padding: 2rem;
  }

  .trends-header{
    font-size: 7rem;
    margin-bottom: 4rem;
    line-height: 70%;
    font-family: 'American Average';
    text-align: center;
    color: #fefbee;
    margin-top: 5rem;
  }

  .trends-graph-container {
    width: 100%;
    max-width: 900px;
    background-color: #fefbee;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin-bottom: 2rem;
  }
  
  .flourish-embed {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }
  
  .trends-graph {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
  }

  #trends-explainer {
    width: 100% !important;
    padding: 4rem 2rem;
    background-color: #1a274ac1;
    color: #fefbee;
    font-family: 'The Bold Font', sans-serif;
    box-sizing: border-box;
  }

/* GAP SECTION */ 
#gap-section {
  padding: 4rem 2rem;
}

.gap-main-text {
  font-size: 7rem;
  margin-bottom: 4rem;
  line-height: 70%;
  font-family: 'American Average';
  text-align: center;
  color: #fefbee;
}

.gap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); /* slightly bigger minimum width */
  gap: 2rem; 
  max-width: 1400px;
  margin: 0 auto;
}

/* Default card (square-ish) */
.gap-card {
  background-color: #fefbee;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Wide card */
.gap-card.wide {
  grid-column: span 2;
}

/* Tall card */
.gap-card.tall {
  grid-row: span 2;
}

/* Chart inside */
.gap-chart {
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
  flex-grow: 1;
}

/* Caption under the chart */
.gap-caption {
  padding: 1rem;
  font-size: 1rem;
  text-align: left;
  color: #1A274A;
}

/* Hover lift effect */
.gap-card:hover {
  transform: scale(1.02);
}

.gap-explainer{
  width: 100%;
  padding: 4rem 2rem;
  color: #1a274a;
  font-family: 'The Bold Font', sans-serif;
  box-sizing: border-box;
}

  /* Mobile Responsive */
  @media (max-width: 768px) {
    .gap-grid {
      grid-template-columns: 1fr;
    }

    .gap-card.wide,
    .gap-card.tall {
      grid-column: span 1;
    }
  }


/* FOOTER */
#site-footer {
  background-color: #1A274A;
  color: #fefbee;
  text-align: center;
  font-family: 'The Bold Font', sans-serif;
  font-size: 0.9rem;
  padding: 2rem 1rem;
  margin-top: 4rem;
}

.footer-content p {
  margin: 0.5rem 0;
}

/* ====== Mobile Home Section Adjustments ====== */
@media (max-width: 768px) {
  
  /* Shrink the main text on mobile */
  .intro-text-overlay .main-text {
    font-size: 5rem;
    line-height: .8;
    width: 90%;
  }

  .intro-text-overlay .sub-text {
    font-size: 1rem;
    width: 90%;
    padding-top: 1rem;
  }

  /* Style the "Learn" button */
  .learn-button {
    display: inline-block;
    background-color: #1a274a;
    color: #fefbee;
    font-family: 'The Bold Font', sans-serif;
    font-size: 1.5rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
  }
  
  .learn-button:hover {
    background-color: #1a274a;
  }

  /* Fade-in animation for the Learn button */
@keyframes fadeInButton {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-learn-button {
  margin-top: 2rem;
  text-align: center;
  animation: fadeInButton 4s ease forwards;
}


  /* Show the sidenav and menu button again */
  .sidenav, .menu-icon {
    display: block !important;
  }

  /* Keep hiding everything else */
  .fixed-background-wrapper,
  #glance-section,
  #timeline-section,
  #trends-section,
  #gap-section,
  .scroll-indicator,  
  #site-footer, 
  #mySidenav, 
  .menu-icon {
    display: none !important;
  }


  
}
