/* ==========================================================================
   1. PAGE CONTAINERS & QUARTO OVERRIDES
   ========================================================================== */

/* Hide duplicate Quarto auto-generated title block when using .hero-banner */
.quarto-title-block {
  display: none;
}

.home-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.5rem 1rem 4rem 1rem;
}

/* ==========================================================================
   2. STICKY HEADER & GLIDING LOGO (_header.html)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #4f4947;
  border: 2px solid var(--brix-mid-gray);
  border-bottom: 4px solid var(--brix-orange);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.logo-stage {
  position: relative;
  height: 88px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  transition: height 0.35s ease;
}

.site-header.scrolled .logo-stage {
  height: 64px;
}

.gliding-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: left 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-header.scrolled .gliding-logo {
  left: 1.5rem;
  transform: translateX(0);
}

.gliding-logo img {
  height: 54px;
  width: auto;
  transition: height 0.35s ease;
}

.site-header.scrolled .gliding-logo img {
  height: 40px;
}

.projects-bar {
  background-color: #3b3634;
  border-top: 2px solid var(--brix-blue);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 1rem;
}

.projects-label {
  font-weight: 800;
  color: #f2ecea;
  letter-spacing: 0.03em;
  margin-right: 0.25rem;
}

.project-link {
  color: #f2ecea;
  text-decoration: none;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background-color: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.project-link:hover {
  background-color: var(--brix-blue);
  color: #ffffff;
  border-color: #f2ecea;
  transform: translateY(-2px);
}

/* ==========================================================================
   3. FIXED FOOTER, THEME TOGGLE & SCROLL-TO-TOP (_footer.html)
   ========================================================================== */

.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #4f4947;
  border-top: 4px solid var(--brix-orange);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.15);
  padding: 0.6rem 1.5rem;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-icon-link,
.footer-icon-btn {
  color: #f2ecea;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.footer-icon-link:hover,
.footer-icon-btn:hover {
  background-color: var(--brix-blue);
  color: #ffffff;
  border-color: #f2ecea;
  transform: translateY(-2px);
}

/* Show Moon icon in Light Mode, Sun icon in Dark Mode */
.theme-icon-sun {
  display: none;
}
.theme-icon-moon {
  display: block;
}
body.quarto-dark .theme-icon-sun {
  display: block;
}
body.quarto-dark .theme-icon-moon {
  display: none;
}

/* Floating Scroll-to-Top Button */
.back-to-top {
  position: fixed;
  bottom: 4.5rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-color: #4f4947;
  color: #f2ecea;
  border: 2px solid var(--brix-orange);
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  z-index: 999;
}

.back-to-top:hover {
  background-color: var(--brix-orange);
  color: #ffffff;
  border-color: var(--brix-blue);
  transform: translateY(-3px);
}

/* ==========================================================================
   4. CARDS: HOME FEED, ABOUT BIO, & HERO BANNER
   ========================================================================== */

/* Universal Brix Card & Markdown Banner */
.brix-card,
.about-bio-card,
.analysis-card {
  background-color: var(--brix-card-bg);
  border: 2px solid var(--brix-mid-gray);
  border-left: 7px solid var(--brix-orange);
  border-radius: 10px;
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.about-bio-card {
  max-width: 780px;
  margin: 0 auto 2.25rem auto;
}

.hero-banner {
  background-color: #4f4947;
  color: #f2ecea;
  padding: 2rem 2.25rem;
  border-radius: 10px;
  border-left: 7px solid var(--brix-orange);
  margin-bottom: 2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.hero-banner h1,
.about-heading {
  color: var(--brix-orange);
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 800;
}

.about-text {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--brix-dark-gray);
  margin-bottom: 1.1rem;
}

.about-text:last-child {
  margin-bottom: 0;
}

.inline-home-link {
  color: var(--brix-orange);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.inline-home-link:hover {
  color: var(--brix-blue);
}

/* Home Feed Post Cards */
.posts-feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 780px;
  margin: 0 auto;
}

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background-color: var(--brix-card-bg);
  border: 2px solid var(--brix-mid-gray);
  border-left: 7px solid var(--brix-orange);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease;
}

.post-card:hover {
  transform: translateY(-5px) scale(1.01);
  border-color: var(--brix-blue);
  border-left-color: var(--brix-blue);
  box-shadow: 0 10px 22px rgba(19, 157, 221, 0.18);
}

.post-title {
  margin: 0 0 0.35rem 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--brix-orange);
  transition: color 0.2s ease;
}

.post-card:hover .post-title {
  color: var(--brix-blue);
}

.post-date {
  font-size: 0.92rem;
  color: var(--brix-mid-gray);
  margin-bottom: 0.75rem;
  display: block;
}

.post-excerpt {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--brix-dark-gray);
}

/* About Page LinkedIn & GitHub Embed Cards */
.embed-cards-grid {
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 700px) {
  .embed-cards-grid {
    grid-template-columns: 1fr;
  }
}

.rich-embed-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  background-color: var(--brix-card-bg);
  border: 2px solid var(--brix-mid-gray);
  border-top: 5px solid var(--brix-blue);
  border-radius: 10px;
  padding: 1.5rem;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.22s ease;
}

.rich-embed-card.github-card {
  border-top-color: var(--brix-orange);
}

.rich-embed-card:hover {
  transform: translateY(-5px);
  border-color: var(--brix-orange);
  box-shadow: 0 10px 22px rgba(19, 157, 221, 0.16);
}

.rich-embed-card.github-card:hover {
  transform: translateY(-5px);
  border-color: var(--brix-blue);
  box-shadow: 0 10px 22px rgba(19, 157, 221, 0.16);
}

.embed-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.embed-platform-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brix-mid-gray);
}

.embed-card-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brix-dark-gray);
}

.embed-card-desc {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--brix-dark-gray);
  margin: 0 0 1.1rem 0;
}

.embed-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.embed-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  background-color: var(--brix-offwhite);
  color: var(--brix-dark-gray);
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  border: 1px solid rgba(119, 114, 111, 0.3);
}

.lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.py-dot  { background-color: #3572A5; }
.ojs-dot { background-color: #f1e05a; }
.qmd-dot { background-color: #dd5313; }

.embed-cta {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--brix-orange);
  transition: color 0.2s ease;
}

.rich-embed-card:hover .embed-cta {
  color: var(--brix-blue);
}

/* ==========================================================================
   5. MPG DASHBOARD & CHOROPLETH MAP LAYOUT (mpg.qmd)
   ========================================================================== */

.calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  background: var(--brix-surface-subtle, #f9f7f6);
  padding: 1.25rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--brix-mid-gray);
  border-left: 5px solid var(--brix-blue);
  margin-bottom: 1.25rem;
}

.stat-pill {
  display: inline-block;
  background: var(--brix-card-bg);
  border: 2px solid var(--brix-orange);
  color: var(--brix-dark-gray);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  margin: 0 0.2rem;
  box-shadow: 2px 2px 0px var(--brix-orange);
}

.result-line {
  font-size: 1.1rem;
  line-height: 2.0;
  margin: 0;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

#choropleth-map {
  width: 100%;
  height: 500px;
  min-width: 0;
  overflow: hidden;
}

.side-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.side-card {
  background: var(--brix-card-bg);
  border: 2px solid var(--brix-mid-gray);
  border-top: 5px solid var(--brix-orange);
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.98rem;
  line-height: 1.7;
  min-width: 0;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.side-card.national-card {
  border-top-color: var(--brix-blue);
}

@media (max-width: 900px) {
  .calc-row,
  .map-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  #choropleth-map {
    height: 350px;
  }
}
/* --- Fuel Price Year Slider (Brix Orange track, Charcoal Gray thumb) --- */
.year-slider-card {
  background: var(--brix-card-bg, #f9f7f6);
  border: 2px solid var(--brix-mid-gray, #77726f);
  border-radius: 8px;
  padding: 1rem 1.75rem 1.35rem;
  margin-bottom: 1.25rem;
}

.year-slider-title {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--brix-dark-gray, #4f4947);
}

.year-slider-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 1.75rem; /* Space for 1993 / active year / 2025 labels */
}

.year-slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--brix-orange, #dd5313);
  outline: none;
  cursor: pointer;
}

/* Charcoal Gray Selector Thumb (Chrome/Safari/Edge) */
.year-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 28px;
  border-radius: 4px;
  background: var(--brix-dark-gray, #4f4947);
  border: 2px solid #2b2625;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  cursor: grab;
  transition: transform 0.12s ease;
}

.year-slider-input::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.08);
}

/* Charcoal Gray Selector Thumb (Firefox) */
.year-slider-input::-moz-range-thumb {
  width: 18px;
  height: 28px;
  border-radius: 4px;
  background: var(--brix-dark-gray, #4f4947);
  border: 2px solid #2b2625;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

.year-slider-endpoints {
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brix-mid-gray, #77726f);
  margin-top: 0.35rem;
}

.year-slider-active-label {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-family: monospace;
  font-weight: 800;
  font-size: 0.95rem;
  color: #ffffff;
  background: var(--brix-dark-gray, #4f4947);
  padding: 0.1rem 0.5rem;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
}

/* --- Histogram Container --- */
.histogram-card {
  width: 100%;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem 0.5rem;
  background: var(--brix-card-bg, #f9f7f6);
  border: 2px solid var(--brix-mid-gray, #77726f);
  border-radius: 8px;
  box-sizing: border-box;
}

#burden-histogram {
  width: 100%;
  height: 310px;
}

@media (max-width: 768px) {
  #burden-histogram {
    height: 260px;
  }
}