/* remove sidebar image width constraints */
.cr-sidebar-left img,
.cr-sidebar-left svg,
.cr-sidebar-left .quarto-figure,
.cr-sidebar-left figure,
.cr-sidebar-left .cr-figure {
  max-width: none !important;
  width: auto !important;
}

/* optional: allow plots to overflow the sidebar area */
.cr-sidebar-left {
  overflow: visible !important;
}

/* ensure no clipping on the right side */
.cr-content {
  overflow-x: visible !important;
}

/* make font size smaller in closeread sections */
.cr-section {
  font-size: 0.9rem !important;
  background-color: #F5F5F5 !important;
}

.cr-section p,
.cr-section div,
.cr-section span {
  font-size: 0.9rem !important;
}

/* make cr-section content areas match graph background */
.cr-content {
  background-color: #F5F5F5 !important;
}

/* ensure plot areas blend with section background */
.cr-sidebar-left {
  background-color: #F5F5F5 !important;
}

/* ensure sidebar narrative areas also use light grey background */
.cr-sidebar-left .cr-narrative,
.cr-sidebar-left .cr-narrative-sidebar,
.cr-sidebar .cr-narrative,
.cr-sidebar {
  background-color: #F5F5F5 !important;
  color: #333333 !important;
}

/* override any dark background on focus elements */
.cr-sidebar-left [focus-on],
.cr-sidebar-left .cr-focus {
  background-color: #F5F5F5 !important;
  color: #333333 !important;
}

/* Full-width colorful banner */
.banner {
  position: relative;
  width: 100vw;
  height: 300px;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-bottom: 2rem;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.banner-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

.banner-overlay h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-overlay h2 {
  font-size: 1.2rem;
  margin-top: 0;
  font-weight: 300;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Fallback if no image is provided */
.banner:not(:has(.banner-image)) {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Limit maximum width on very wide screens to keep sidebar close to content */
@media (min-width: 1600px) {
  .cr-section {
    max-width: 1400px !important;
    margin: 0 auto !important;
  }
  
  /* Ensure the container doesn't get too spread out */
  .cr-sidebar-left .cr-container,
  .cr-sidebar-left {
    max-width: 1400px !important;
    margin: 0 auto !important;
  }
}

/* For ultra-wide screens, be even more restrictive */
@media (min-width: 2000px) {
  .cr-section {
    max-width: 1200px !important;
    margin: 0 auto !important;
  }
  
  .cr-sidebar-left .cr-container,
  .cr-sidebar-left {
    max-width: 1200px !important;
    margin: 0 auto !important;
  }
}

/* Ensure sidebar width adjusts appropriately on constrained layouts */
@media (min-width: 1600px) {
  .cr-sidebar-left .cr-sidebar {
    width: 35% !important;
    max-width: 400px !important;
  }
  
  .cr-sidebar-left .cr-content {
    width: 65% !important;
  }
}