/*   Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/*Color variables*/
:root {
    --white: #FFFFFF;
    --cream: #F5F6F2;
    --light-gray: #F5F6F5;
    --bright-gray: #eeeeee;
    --dark-gray: #333333;
    --red: #C8102E;
    --soft-black: #444444;
    --blue: #0066CC;
    --dark-blue: #003366;
}



/* Style links globally */
a {
  color: var(--blue);
  transition: color 0.3s ease; /* Smooth hover transition */
}

a:visited {
  color: var(--dark-blue);
}

a:hover {
  color: var(--red);
  text-decoration-thickness: 2px;
}

/* Dark mode and toggle */
/* .dark-mode {
    --white: #333333;
    --cream: #333333;
    --light-gray: #444444;
    --bright-gray: #666666;
    --dark-gray: #FFFFFF;
}

.mode-toggle {
    color: var(--dark-gray);
    text-decoration: none;
    margin: 0 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.mode-toggle:hover {
    color: var(--red);
} */


/* Body */
body {
  font-family: Outfit, "Helvetica Neue", Roboto, Arial, sans-serif;
  background-color: var(--white);
  color: var(--dark-gray);
  line-height: 1.6;
  transition: all 0.3s ease;
}

body h1 {
  font-weight: 100 !important;
  font-size: 3.5rem !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15); /* Subtle drop shadow */
}

body h2 {
  font-weight: 400 !important;
}

header {
    text-align: center;
}


/* Container on home page */
.homecontainer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}


/* Nav: Header menu */
header nav {
  background-color: var(--white);
  padding: 1rem;
  text-align: center;
  border-top: 4px solid var(--red);
  border-bottom: 1px inset var(--red);
}

nav#headermenu a {
  margin: 0 2rem;
}

 @media (max-width: 768px) {
  nav#headermenu a {
    margin: 0 1rem;
  }
}

nav#headermenu a, nav#headermenu a:visited {
  color: var(--dark-gray);
  text-decoration: none;
  font-weight: bold;
}

nav#headermenu a:hover {
  color: var(--red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Nav: Back button below content */
nav#go-back {
  text-align: center;
  margin: 2rem 0;
  font-weight: bold;
  font-size: 1.5em;
  transition: color 0.3s ease;
}

nav#go-back a {
  text-decoration: none;
  color: var(--dark-gray);
}

nav#go-back a:hover {
  color: var(--red);
}




/* - [ ] is this in use? */

/* Hero */
.hero {
  background-color: var(--light-gray);
  padding: 2rem;
  border-radius: 20px;
  /* margin-top: 1.5rem; */
  margin-bottom: 1.5rem;
  text-align: center;
  border: 3px solid var(--white);
}

/* Button */
.button {
  background-color: var(--red);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.button:hover {
  background-color: var(--dark-gray);
}


/* Header */
#headertext {
  text-align: center;
  font-size: 2rem !important;
  font-weight: 400 !important;
  background-color: var(--white);
  color: var(--dark-gray);
  /* border-bottom: 2px dotted var(--cream); */
  padding: 0.5rem;
  margin-bottom: 1rem;
}


/* Footer */
footer {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  width: 100%; /* Ensures full width */
  background-color: var(--white);
  color: var(--bright-gray);
  border-top: 2px solid var(--red);
  text-align: center;
  padding: 0.5rem;
  font-size: 10px;
}


/* Blog page */
.blog {
  text-align: center;
  margin: 0 auto 0.5rem;
  max-width: 40rem;
  width: 22rem;
  border: 1px solid #cccccc; /* Soft, subtle border */ 
  border-radius: 8px;
  padding: 0.5em;
  margin-bottom: 1.5rem;
}

/* Blog page entries heading */
.blog h2 {
  font-size: 1.8rem;
}
/* Smaller heading on mobile devices */
@media (max-width: 768px) {
  .blog h2 {
    font-size: 1.5rem !important;
  }
}


/* Article */
article {
  background-color: var(--white);
  max-width: 50em;
  margin: 2em auto; /* Slight vertical margin, center horizontally */
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1); /* Soft, subtle border */
  padding: 1rem 3rem; 
}

article > h1 {
  font-size: 3rem !important;
  line-height: 1.2; /* Tighten line spacing slightly */
  text-align: center;
}
/* Smaller heading on mobile devices */
@media (max-width: 768px) {
  article > h1 {
    font-size: 1.7rem !important;
  }
  article > h2 {
    font-size: 1.6rem !important;
  }
}

article img {
  display: block; /* Prevent inline spacing issues */
  margin: 1.5rem auto; /* Center image with spacing */
  max-width: 100%; /* Responsive image */
}

article p {
  font-size: 1.125rem; /* Slightly larger text for readability */
  line-height: 1.6; /* Improved line spacing */
  margin-bottom: 1.25rem; /* Space between paragraphs */
  color: var(--soft-black); /* Softer black for text */
}
/* Smaller heading on mobile devices */
@media (max-width: 768px) {
  article p {
    font-size: 1rem !important;
  }
  article > h2 {
    font-size: 1.1rem !important;
    font-style: italic;
  }
}

article blockquote {
  font-style: italic;
  background-color: var(--light-gray); /* Subtle background from your palette */
  color: var(--dark-gray); /* Uses your dark gray variable */
  border-left: 5px solid var(--red) !important; /* Matches nav and accent color */
  padding: 1rem 1.5rem; /* Comfortable padding */
  margin: 1rem 0;
  /* Ensure long words/URLs wrap */
  overflow-wrap: break-word; 

}

article ol {
  color: var(--soft-black);
  list-style-position: outside;
  font-size: 1.125rem; /* Matches paragraph text size */
  font-style: normal;
  line-height: 2em; /* Spacing beetween list items */
  margin-left: 1rem; /* Matches paragraph spacing for alignment */
}


/* Tooltips */
.tooltip {
    text-decoration: none;
    color: var(--dark-gray);
}

@media only screen and (min-width: 600px) {
    .tooltip {
        border-bottom: 1px dashed black;
    }
}


/* General table formatting */
table {
  width: 100%;
  max-width: 600px; /* Limits table width */
  margin: 20px 0; /* Adds spacing above and below */
  border-collapse: collapse; /* Removes gaps between cells */
}

th, td {
  padding: 12px 15px; /* Adds internal spacing */
  text-align: left; /* Aligns text to the left */
  border-bottom: 1px solid #ddd; /* Adds subtle row separators */
}

th {
  background-color: #f5f5f5; /* Light gray header background */
  font-weight: bold;
  color: #333;
}

tr:nth-child(even) {
  background-color: #fafafa; /* Slight zebra striping */
}

tr:hover {
  background-color: #f0f0f0; /* Hover effect */
  transition: background-color 0.3s ease; /* Smooth transition */
}

td a {
  color: #0066cc; /* Blue link color */
  text-decoration: none; /* Removes underline */
}

td a:hover {
  text-decoration: underline; /* Underline on hover */
  color: #003366; /* Darker blue on hover */
}


/*Data page*/
div#peak-flow, div#races {
    text-align: center;
}

div#peak-flow table, div#races table {
  margin-left: auto;
  margin-right: auto;
  max-width: 280px; /* Limits table width */
}

/* Image and video styles */

/* Image captions */
figcaption {
    text-align: center;
    margin-top: -20px;
    margin-bottom: 20px;
}

/* Center images on front pages */
figure {
  margin: 0; /* Remove default figure margins */
  text-align: center; /* Center the image within the figure */
}

/* Responsive image */
.responsive-img {
  display: block;
  margin: 0 auto 20px;
  max-width: 366px; /* Use max-width instead of width */
  width: 100%; /* Allow the image to scale down */
  height: auto;
  border-radius: 20px;
}

@media (max-width: 768px) {
  .responsive-img {
      width: 341px;
      height: 406px;
  }
}

/* Center videos */
.video {
  text-align: center; 
}


dl {
  max-width: 800px;
  margin: 0 auto;
}
dt {
  font-weight: bold;
  margin-top: 1em;
  
}
dd {
  margin-bottom: 1em;
}

dt a, dt a:visited, dt a:hover {
  text-decoration: none;
  color: var(--red);
}
dt a > span {
  font-size: 10px;
  vertical-align:middle;
}

time {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  margin: 0 auto -1rem;
  padding: 0.1rem;
  color: var(--dark-gray);
  font-style: italic;
}

/* --- */

/* Header */
header#mainheader {
  position: fixed; /* Fix the header to the top */
  top: 0;
  left: 0;
  width: 100%; /* Full width */
  background-color: var(--white); /* Ensure background is solid */
  z-index: 1000; /* Ensure it stays above parallax content */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow for depth */
}


/* Show menu link for current page in red */
.activepage {
  color: var(--red) !important;
}


main {
  margin-top: 6rem; /* Adjust the value as needed */
}

/* Language Dropdown */
.language-dropdown {
  position: relative;
  display: inline-block;
  margin: 0 2rem;
}

.language-dropdown .languages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 100%;
  width: 100%;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  top: 100%;
  right: 0;
  border: 1px solid #ccc;
  border-top: none;
}

.language-dropdown:hover .languages {
  display: block;
}

.language-dropdown .drop-button {
  padding: 2px 4px;
  border: 1px solid #ccc;
  cursor: pointer;
  background-color: #f9f9f9;
  display: inline-block;
  font-size: 0.8em;
  color: var(--dark-gray) !important;
  text-decoration: none !important;
  font-weight: bold;
}

.language-dropdown .languages li a {
  color: black !important;
  padding: 2px 4px;
  text-decoration: none !important;
  display: block;
  font-size: 0.7em;
  margin: 0 !important;
}

.language-dropdown .languages li a:hover {
  background-color: #f1f1f1;
  color: var(--red) !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}

.language-dropdown .languages .active a {
  background-color: #e0e0e0;
  font-weight: bold;
  color: var(--red) !important;
}

/* Fun Facts section: site color scheme, no black backgrounds */
.fun-facts-list {
  list-style: none;
  padding: 0 1.5rem 0 1.5rem;
  margin: 0 0 2rem 0;
}
.fun-facts-list li {
  background: var(--cream);
  color: var(--dark-gray);
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1.1rem 1.5rem;
  font-size: 1.15rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-left: 4px solid var(--red);
  font-weight: normal;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.2s ease;
}
.fun-facts-list:first-of-type li:first-child {
  opacity: 1;
}
.fun-facts-list li:hover {
  opacity: 1;
  transform: translateX(4px);
}
/* Dim the first fact when any fact is hovered */
.fun-facts-list:hover .fun-facts-list:first-of-type li:first-child {
  opacity: 0.6;
}
.fun-facts-list li:target {
  opacity: 1;
  transform: translateX(4px);
}
.fun-facts-list li:target ~ li:first-child {
  opacity: 0.6;
}
.fun-facts-list li strong {
  font-weight: normal;
}
.anchor-link {
  color: var(--white) !important;
  background: var(--red);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  margin-right: 0.75rem;
  text-decoration: none;
  border: 2px solid var(--red);
  transition: background 0.2s, color 0.2s;
}
.anchor-link:hover, .anchor-link:focus {
  background: var(--dark-gray);
  color: var(--white) !important;
  outline: 2px solid var(--dark-gray);
}
.category-link {
  color: var(--white) !important;
  background: var(--red);
  border-radius: 4px;
  padding: 0.25em 0.75em;
  margin-right: 0.5em;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.category-link:hover, .category-link:focus {
  background: var(--dark-gray);
  color: var(--white) !important;
  outline: 2px solid var(--dark-gray);
}
.random-fun-fact {
  background: none;
  color: var(--dark-gray);
  border-radius: 0;
  padding: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  box-shadow: none;
  border: none;
  font-weight: normal;
  display: block;
}

.fun-fact-link {
  color: var(--red);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}
.fun-fact-link:hover, .fun-fact-link:focus {
  color: var(--dark-gray);
  outline: 2px dashed var(--red);
}

.fact-source {
  font-size: 0.98em;
  color: #b77;
  margin-left: 0.1em;
  font-style: normal;
  display: inline;
  font-weight: normal;
}
.fact-source a {
  color: #b77;
  text-decoration: none;
  font-weight: 400;
  transition: text-decoration 0.2s, color 0.2s;
}
.fact-source a:hover, .fact-source a:focus {
  color: var(--dark-gray);
  text-decoration: underline;
  outline: 2px dashed var(--red);
}

/* Fun Facts page content padding */
main main {
  padding-left: 2rem;
  padding-right: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

main main h2 {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  main main {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  main main h2 {
    padding-left: 1rem;
  }
}

.fun-fact-single {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
.fun-fact-single p {
  text-align: center;
}
.fun-fact-single p strong {
  display: inline-block;
  margin-top: 42px;
}
.fun-fact-random-link {
  color: inherit;
  text-decoration: none;
  font-size: 1.3em;
  font-weight: 500;
  border-bottom: 1px dotted #ccc;
  transition: color 0.2s, border-bottom 0.2s;
}
.fun-fact-random-link:hover, .fun-fact-random-link:focus {
  color: var(--red);
  text-decoration: underline;
  border-bottom: 1px solid var(--red);
}
.show-another-fact {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.5em 1.2em;
  background: var(--cream);
  color: var(--red);
  border-radius: 4px;
  border: 1px solid var(--red);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.show-another-fact:hover, .show-another-fact:focus {
  background: var(--red);
  color: var(--white);
}