@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;600;700&family=Work+Sans:wght@400;500;600&display=swap");

/* Give the header some height and style */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Work Sans", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Lora", serif;
}

.graph-hero {
  position: relative;
  width: 100%;
  height: 280px; /* you can change this */
  overflow: hidden;
  border-bottom: 1px solid #e0e0e0;
}

.graph-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.graph-hero-text {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  color: #ffffff;
}

.graph-hero-text h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
}

.graph-hero-text p {
  font-size: 1rem;
  max-width: 650px;
  opacity: 0.9;
}

/* Optional overlay to make text readable */
.graph-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.06),
      transparent 45%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(0, 0, 0, 0.3),
      rgba(0, 0, 0, 0.9)
    );
  z-index: 1;
}

/* Quote highlight */
.quote-card {
  margin: 1.5rem auto;
  padding: 1.2rem 1.6rem;
  max-width: 820px;
  background: linear-gradient(135deg, #f3f7ff, #e7efff);
  border-left: 4px solid #008aff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
}

.quote-card blockquote {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.6;
  color: #1f2b3a;
  font-style: italic;
}

.quote-card blockquote p {
  margin: 0;
}

.quote-card blockquote p:last-child {
  margin-top: 0.65rem;
  font-size: 1rem;
  color: #4a5568;
  font-style: normal;
  letter-spacing: 0.02em;
  /* Justify paragraph text across page content */
  .container-md p,
  .container-fluid p,
  .page-content p,
  .post-content p {
    text-align: justify;
    text-justify: inter-word;
  }
}

.bd-wrapper {
  background-color: white;
  max-width: 1100px;
  margin: 40px auto;
  padding: 20px;
  background: #fdfcf0; /* Paper aesthetic */
}

.bd-grid {
  background-color: white;
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Maintains 3 columns */
  gap: 20px;
  width: 100%;
  /* This prevents the grid from stretching height-wise independently of width */
  align-items: start;
}

.bd-panel {
  position: relative;
  border: 3px solid black;
  background-color: white;
  /* This is the magic line for horizontal/vertical locking */
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.bd-illustration {
  background-color: white;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 'background-size: cover' is actually safer for 'fixed' looks 
       as it prevents white gaps if the math is off by 1 pixel */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Character Dialogue Bubbles */
.speech-bubble {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  background: white;
  border: 2px solid black;
  border-radius: 15px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: "Work Sans", sans-serif;
  font-weight: bold;
  box-shadow: 3px 3px 0px black;
  line-height: 1.2;
}

/* Adjust for mobile screens */
@media (max-width: 800px) {
  .bd-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 panels per row on tablets */
  }
}

/* If you want to prevent the panels from getting TOO small on mobile */
@media (max-width: 600px) {
  .bd-grid {
    grid-template-columns: 1fr; /* Stack them vertically so they stay large */
  }
}

/* Permanent Speech Bubble */
.speech-bubble {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  background: white;
  border: 2px solid black;
  border-radius: 15px;
  padding: 8px 12px;
  font-family: "Work Sans", sans-serif;
  font-weight: bold;
  font-size: 13px;
  color: black;
  z-index: 10;
  box-shadow: 3px 3px 0px rgba(0, 0, 0, 0);
  line-height: 1.2;
  /* No more opacity: 0; No more transitions */
}

/* The Bubble Tail */
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px; /* Pushes it below the bubble */
    left: 30px;    /* Positions it horizontally */
    width: 0;
    height: 0;
    border-top: 15px solid black;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    z-index: -1;
}
.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: -11px; /* Slightly higher than the black tail to leave an outline */
    left: 31px;
    width: 0;
    height: 0;
    border-top: 13px solid white;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    z-index: 11;
}
/* Ensure the image fills the whole panel behind the bubble */
.bd-illustration {
  background-color: white;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: relative; /* Needed for absolute positioning of bubble */
}

.bd-panel {
  background-color: white;
  position: relative;
  border: 3px solid black;
  height: 350px; /* Adjust height based on your images */
  overflow: hidden;
}

/* Reset default margins that cause white space */
body,
html {
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevents unwanted horizontal scrolling */
}

.hero-section {
  margin-top: 0 !important; /* Removes any gap between the blue bar and the photo */
  width: 100vw;
  width: 100vw;
  height: calc(100vh - 50px); /* Adjusts height to account for the header bar */
  margin-top: -60px;
  margin-left: calc(-50vw + 50%);

  /* Background Image Settings */
  background-image: url("../../Images/monet_magpie.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Ensure the overlay also spans the full width */
.hero-overlay {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1); /* Adjust darkness here */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Typography styles */
.hero-content h1 {
  color: #ffffff;
  font-size: 4rem; /* Large bold text */
  margin-bottom: 10px;
  font-weight: bold;
}

.hero-content p {
  color: #ffffff;
  font-size: 1.6rem;
  margin-bottom: 30px;
}

.hero-content p2 {
  color: #ffffff;
  font-size: 1.2rem;
  margin-bottom: 30px;
}

/* Button style */
.hero-button {
  background-color: white;
  color: black;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  text-transform: uppercase;
  transition: 0.3s;
}

.hero-button:hover {
  background-color: #f0f0f0;
  transform: scale(1.05);
}

/* 1. Make the header float over the image */
header,
.navbar,
nav {
  position: absolute; /* Sits on top of the hero section */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 3000; /* Ensures it stays above the image */
  background-color: rgba(172, 200, 229, 0.95) !important;
  border: none !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
}

/* 2. Style the nav links so they are readable over the painting */
header a,
.navbar a,
nav a {
  color: #2c2c2c !important; /* Dark grey to match your text preference */
}

/* 3. Ensure the Hero Section starts at the very top */
.hero-section {
  margin-top: 0 !important;
  padding-top: 0 !important;
  top: 0;
  /* Keep your existing width/height settings */
}

/* Container for major research visuals */
.analysis-visual {
  padding: 40px 0;
  text-align: center;
}

.analysis-visual h3 {
  font-family: "Lora", serif;
  font-size: 2rem;
  margin-bottom: 20px;
  color: #2c2c2c;
}

/* The card surrounding the image */
.image-card {
  background: #ffffff;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin: 0 auto;
  max-width: 900px;
  transition: transform 0.3s ease;
}

.image-card:hover {
  transform: scale(1.01); /* Subtle "lift" when hovering */
}

.image-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Professional caption styling */
.caption {
  margin-top: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #666;
  border-top: 1px solid #f0f0f0;
  padding-top: 15px;
}

.caption strong {
  color: #acc8e5; /* Using your signature light blue */
}

.fun-fact-card {
  max-width: 900px;
  margin: 1.75rem auto;
  padding: 1.25rem 1.5rem;
  background: #f7fbff;
  border: 1px solid #d5e8ff;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.05);
}

.fun-fact-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0b5ba1;
}

.fun-fact-card p {
  margin: 0.5rem 0 0;
  color: #233044;
  font-size: 1.05rem;
  line-height: 1.6;
}

.highlight-card {
  max-width: 1000px;
  margin: 1.5rem auto;
  padding: 1.25rem 1.5rem;
  background: #fdfcf8;
  border: 1px solid #e4e9f2;
  border-left: 4px solid #4e7aa9;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.highlight-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #e8eef8;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: #2f3d52;
}

.highlight-card p {
  margin: 0.5rem 0 0;
  color: #233044;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: justify;
}

.callout-option {
  max-width: 1000px;
  margin: 1.25rem auto;
}

.accent-callout {
  padding: 12px 16px;
  background: #f7f9fc;
  border-radius: 6px;
}

.pull-quote {
  border-top: 1px solid #e4e9f2;
  border-bottom: 1px solid #e4e9f2;
  padding: 12px 0;
  font-style: italic;
  color: #233044;
  text-align: justify;
}

.chip-callout {
  margin: 1rem 0;
}

.chip-callout .chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #d6e6f5;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2f3d52;
  background: #f9fbff;
}

.chip-callout p {
  margin: 6px 0 0;
  text-align: justify;
  color: #233044;
}

/* Doodle divider */
.doodle-divider {
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
}

.doodle-divider svg {
  width: 100%;
  height: 80px;
  display: block;
}

.doodle-path {
  fill: none;
  stroke: #4e7aa9;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  transition: stroke-dashoffset 1.6s ease-out;
}

.doodle-divider.in-view .doodle-path {
  stroke-dashoffset: 0;
}

/* Interactive about card */
.about-doodle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 20px 0 40px;
}

.about-doodle-card {
  perspective: 1200px;
}

.about-doodle-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  background: #f9fbff;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  min-height: 200px;
}

.about-doodle-card:hover .about-doodle-inner,
.about-doodle-card:focus-within .about-doodle-inner,
.about-doodle-card.is-flipped .about-doodle-inner {
  transform: rotateY(180deg);
}

.about-doodle-face {
  position: absolute;
  inset: 0;
  padding: 18px;
  backface-visibility: hidden;
  border-radius: 12px;
}

.about-doodle-face.back {
  transform: rotateY(180deg);
  background: #eef3ff;
}

.doodle-underline {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.doodle-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #4e7aa9, #acc8e5);
  border-radius: 999px;
  opacity: 0.8;
}

.trail-emoji {
  display: inline-block;
  margin-left: 6px;
  animation: wiggle 1.3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }
  25% {
    transform: rotate(4deg) translateY(-1px);
  }
  50% {
    transform: rotate(-3deg) translateY(1px);
  }
  75% {
    transform: rotate(3deg) translateY(-1px);
  }
}

.dataset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 1rem 0 2rem;
  justify-content: center;
}

.dataset-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #1f2b3a;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid #d6e6f5;
  background: linear-gradient(145deg, #f9fbff, #f2f6fb);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease;
}

.dataset-btn.hot {
  color: #1f2b3a;
  border-color: #c9def2;
}

.dataset-btn.chill {
  color: #1f2b3a;
  border-color: #c9def2;
}

.dataset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  border-color: #b5d2ee;
}

.dataset-cta {
  text-align: center;
  font-weight: 500;
  font-style: italic;
  color: #1f2b3a;
  margin: 1.2rem 0 0.5rem;
}

.dataset-box {
  background: #f8fbff;
  border: 1px solid #e5eff9;
  border-radius: 14px;
  padding: 1.4rem 1.2rem;
  margin: 1rem 0 2rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.metric-card {
  min-width: 200px;
  background: #f9fbff;
  border: 1px solid #e5eff9;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.05);
}

.metric-title {
  font-weight: 700;
  color: #1f2b3a;
  letter-spacing: 0.03em;
  margin: 0 0 0.35rem;
}

.metric-meta {
  margin: 0;
  color: #344a62;
  font-size: 0.98rem;
}

.about-card {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px;
  margin: 1.5rem 0;
  background: #f8fbff;
  border: 1px solid #e5eff9;
  border-radius: 16px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.06);
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.about-text h2 {
  margin-top: 0;
  color: #1f2b3a;
}

.about-text p {
  margin: 0.6rem 0 1.1rem;
  color: #2f3d52;
}

.about-links h3 {
  margin: 0 0 0.5rem;
  color: #1f2b3a;
}

.about-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 14px;
}

.about-links a {
  color: #1f2b3a;
  text-decoration: none;
  font-weight: 600;
}

.about-links a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .about-card {
    grid-template-columns: 1fr;
  }
}

#scroll-progress {
  position: fixed;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 70vh;
  z-index: 2000;
  pointer-events: none;
}

#scroll-progress::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 6px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #e6eef7, #d2e2f4);
  border-radius: 999px;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.06);
}

#scroll-progress .progress-track {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 6px;
  height: 0;
  background: linear-gradient(180deg, #acc8e5, #4e7aa9);
  border-radius: 999px;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%);
  transition: height 0.12s ease-out;
}

#scroll-progress .progress-ski {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
  transition: top 0.1s ease-out;
}

/* Container set to a larger percentage of the screen */
.flourish-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;            /* Increased gap for a cleaner look at larger sizes */
  width: 95%;           /* Increased from 100% of a small container to 95% of the page */
  max-width: 1600px;    /* Prevents it from getting absurdly wide on huge monitors */
  margin: 40px auto;    /* Centers the whole block and adds vertical breathing room */
}

/* Individual plot wrappers */
.flourish-embed {
  flex: 1;              /* Grows to fill available space */
  width: 100%;          /* Forces the Flourish script to respect the flex container */
}

/* Responsive: Stacks plots vertically on tablets/phones */
@media (max-width: 1024px) {
  .flourish-container {
    flex-direction: column;
    align-items: center;
    width: 90%;
  }
  
  .flourish-embed {
    width: 100%;        /* Takes full width when stacked */
  }
}