/* Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #0d0d0d;
  color: #f5f5f5;
  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: #e10600;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: #ffc107;
}

img {
  max-width: 100%;
  height: auto;
}

header {
  background-color: #1c1c1c;
  padding: 0.5rem 1rem;
  border-bottom: 4px solid #e10600;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
}

.logo {
  width: 60px;
  height: auto;
}

.menu-item {
  font-size: 1.25rem;
  font-weight: 700;
  margin-left: 1rem;
}

.desktop-nav {
  display: none;
}

/* Sidebar navigation (mobile) */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  background-color: #111;
  overflow-x: hidden;
  transition: width 0.4s ease;
  padding-top: 60px;
}

.sidenav a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 1.5rem;
  color: #ccc;
  transition: color 0.2s ease;
}

.sidenav a:hover {
  color: #fff;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 1rem;
  font-size: 2rem;
  color: #fff;
  margin-left: 50px;
}

.container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  text-align: center;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url('../img/LewisHamiltonHome.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.containerearly {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  text-align: center;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
    url('../img/earlyyears.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-title {
  font-family: 'Russo One', sans-serif;
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(225, 6, 0, 0.8);
  animation: fadeInDown 1s ease forwards;
}

.subtitle {
  font-family: 'Russo One', sans-serif;
  font-size: 1.75rem;
  color: #ffc107;
  margin-bottom: 0.75rem;
  animation: fadeInDown 1.2s ease forwards;
}

.tagline {
  max-width: 700px;
  font-size: 1rem;
  margin: 0 auto 2rem auto;
  color: #ddd;
  animation: fadeIn 1.5s ease forwards;
}

/* OUTSIDE HELP FOR CODING FOR ANYTHING INVOLVING STATS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  animation: fadeInUp 1.8s ease forwards;
}

.stat {
  border: 3px solid #e10600;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-label {
  font-weight: 700;
  color: #ffc107;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.stat:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 10px rgba(225, 6, 0, 0.6);
}

/* Call to action button */
.cta-button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0d0d0d;
  background-color: #ffc107;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.cta-button:hover {
  background-color: #e10600;
  color: #fff;
}





/* THIS IS FOR THE EARLY YEARS OF FORMULA 1 */

.timeline {
  margin: 2rem auto;
  max-width: 700px;
}
/* Make embedded videos shrink to fit the timeline width */
.timeline iframe,
.tech-leaps iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;   /* keeps a nice video shape */
}

.timeline-list {
  list-style: none;
  padding: 0;
}
.timeline-year {
  cursor: pointer;
  background: #e10600;
  color: #fff;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  font-family: 'Russo One', sans-serif;
}
.timeline-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.8);
  border-left: 4px solid #ffc107;
  padding: 0 1rem;
  text-align: left;
}
.timeline-content p {
  padding-bottom: 2%
}
.timeline-content.open {
  max-height: 500px; /* adjust as needed */
  padding: 1rem;
}

/* IMAGE CREDIT!! */
.image-credit-box {
  position: relative;
  display: inline-block;
}

.image-credit-box img {
  width: 100%;
  border-radius: 8px;
}

.image-credit-box .credit {
  position: absolute;
  bottom: 4px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.image-credit-box .credit a {
  color: #ffc107;
}

/* THIS IS FOR THE CAROSEL */

.carousel-container {
  position: relative;
  max-width: 750px;
  margin: 2rem auto;
  overflow: hidden;
}

.carousel {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-item {
  min-width: 100%;
  box-sizing: border-box;
  padding: 1rem;
  text-align: center;
}

.carousel-item img {
  width: 550px;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

.caption {
  margin-top: 0.5rem;
  color: #ccc;
  font-size: 0.9rem;
}

/* Arrow buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 2rem;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s ease;
  z-index: 10;
}

.carousel-btn:hover {
  background: rgba(225, 6, 0, 0.8);
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}












/* ----------------------------------------------------------------------
  Media queries
  Adjust layout at larger screen sizes
-----------------------------------------------------------------------*/

@media screen and (min-width: 768px) {
  .page-title {
    font-size: 4rem;
  }
  .subtitle {
    font-size: 2rem;
  }
  .tagline {
    font-size: 1.125rem;
  }
  .stat-value {
    font-size: 2rem;
  }
  nav .menu-item {
    margin-left: 2rem;
  }
}

@media screen and (min-width: 1080px) {
  /* Show the desktop nav and hide the mobile nav */
  .mobile-nav {
    display: none;
  }
  .desktop-nav {
    display: flex;
  }
}

/* ----------------------------------------------------------------------
  Animations
  Subtle fade-in and slide effects for a polished feel
-----------------------------------------------------------------------*/

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }