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

/* ─── Design Tokens ──────────────────────────────────────────── */
:root {
  --ieeep-dark-blue: #005488;
  --ieeep-light-blue: #00aeef;
  --ieeep-ink: #4d4d4d;
  --ieeep-bg: #FFFDF8;
  --ieeep-shadow: 0 18px 40px rgba(0, 84, 136, 0.10);
}

/* ─── Base ───────────────────────────────────────────────────── */
body {
  background-color: var(--ieeep-bg);
  color: var(--ieeep-ink);
  font-family: "Roboto", sans-serif;
}

h1,
h2,
h3 {
  color: var(--ieeep-dark-blue);
  font-family: "Roboto", sans-serif;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.3rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  margin-top: 2.5rem;
}

/* Quarto zeroes the top margin of a page's first h2, which crowds the title
   when the page opens with a heading (as Reports does). */
main.content > #title-block-header + section > h2:first-child {
  margin-top: 1.5rem;
}

a {
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--ieeep-light-blue);
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background-color: var(--ieeep-dark-blue) !important;
  box-shadow: 0 10px 25px rgba(0, 84, 136, 0.15);
}

/* Title / brand text */
.navbar-title,
.navbar-brand,
.navbar-brand:hover,
.navbar-brand:focus {
  color: #ffffff !important;
  font-weight: 700;
}

/* Nav links */
.navbar .nav-link {
  color: #ffffff !important;
  font-weight: 600;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #D8F4FF !important;
}

/* Active page link */
.navbar .nav-link.active {
  color: #D8F4FF !important;
  border-bottom: 2px solid #D8F4FF;
}

/* Logo image if used */
.navbar-brand img {
  height: 2rem;
  width: auto;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.nav-footer {
  background-color: var(--ieeep-dark-blue);
  color: #ffffff;
}

.nav-footer a,
.nav-footer .nav-footer-left,
.nav-footer .nav-footer-center,
.nav-footer .nav-footer-right {
  color: #ffffff;
}

.nav-footer a:hover,
.nav-footer a:focus {
  color: #D8F4FF;
}

/* ─── Hero ───────────────────────────────────────────────────── */
.quarto-title-banner {
  min-height: clamp(360px, 40vw, 620px);
}

.quarto-title-banner .quarto-title {
  grid-column: screen-start / screen-end;
  margin-inline: auto;
  max-width: min(1280px, calc(100% - 4rem));
  padding-top: clamp(4.5rem, 10vw, 8rem);
  padding-bottom: clamp(4.5rem, 10vw, 8rem);
  width: 100%;
}

.quarto-title-banner h1.title {
  color: #ffffff;
  max-width: 30ch;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.hero {
  display: block;
  margin: 1.5rem 0 2rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  background: transparent;
  border: 1px solid rgba(0, 84, 136, 0.10);
  border-radius: 1.75rem;
  box-shadow: var(--ieeep-shadow);
}

.hero-copy p,
p {
  font-size: 1.08rem;
  line-height: 1.7;
}

/* ─── Eyebrow Label ──────────────────────────────────────────── */
.eyebrow {
  color: var(--ieeep-light-blue);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

/* Markdown wraps the text of these blocks in a paragraph; keep it from
   picking up body-copy sizing and spacing. */
.eyebrow p,
.stat-card p {
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

/* ─── Grids ──────────────────────────────────────────────────── */
.stats-row,
.feature-grid,
.contact-grid {
  display: grid;
  gap: 1.1rem;
  margin: 1.5rem 0 2rem;
}

.stats-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ─── Cards ──────────────────────────────────────────────────── */
.stat-card,
.feature-card,
.contact-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 84, 136, 0.10);
  border-radius: 1.25rem;
  box-shadow: var(--ieeep-shadow);
  padding: 1.25rem;
}

.stat-number,
.stat-label {
  display: block;
}

.stat-number {
  color: var(--ieeep-light-blue);
  font-family: "Roboto", sans-serif;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-weight: 600;
  line-height: 1.55;
}

.feature-card h3,
.contact-card h3 {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  margin-top: 0;
}

.feature-card i,
.contact-card i,
.eyebrow i {
  color: var(--ieeep-light-blue);
}

/* ─── Callout ────────────────────────────────────────────────── */
.callout-note {
  margin-top: 2rem;
}

/* ─── Grantee Map ────────────────────────────────────────────── */
.grantee-map {
  border: 1px solid rgba(0, 84, 136, 0.14);
  border-radius: 1rem;
  box-shadow: var(--ieeep-shadow);
  display: block;
  height: min(72vh, 680px);
  margin: 1.5rem 0 2.5rem;
  min-height: 480px;
  overflow: hidden;
  width: 100%;
}

/* Let the mapgl widget fill the container Quarto wraps it in. */
.grantee-map .cell,
.grantee-map .cell-output-display,
.grantee-map .maplibregl {
  height: 100%;
  margin: 0;
}

.grantee-map .maplibregl-popup {
  max-width: 340px !important;
}

.grantee-map .maplibregl-popup-content {
  background: transparent;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(0, 84, 136, 0.22);
  padding: 0;
}

/* The tip touches the white body when the popup sits above a point and the
   blue header when it sits below, so color it to match either way. */
.grantee-map .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.grantee-map .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.grantee-map .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: #ffffff;
  filter: drop-shadow(0 2px 2px rgba(0, 84, 136, 0.12));
}

.grantee-map .maplibregl-popup-anchor-top .maplibregl-popup-tip,
.grantee-map .maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.grantee-map .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: #005488;
}

.grantee-map .maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #ffffff;
}

.grantee-map .maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #ffffff;
}

/* Hover card */
.grantee-tooltip {
  background: #ffffff;
  border: 1px solid rgba(77, 77, 77, 0.28);
  border-radius: 18px;
  color: #404040;
  font-family: Roboto, Arial, sans-serif;
  overflow: hidden;
  width: 320px;
}

.grantee-tooltip__header {
  background: #005488;
  color: #ffffff;
  padding: 20px 22px;
}

.grantee-tooltip__name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
}

.grantee-tooltip__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grantee-tooltip__pill {
  background: rgba(216, 244, 255, 0.24);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 12px;
}

.grantee-tooltip__body {
  padding: 14px 18px 18px;
}

.grantee-tooltip__row {
  align-items: center;
  border-bottom: 1px solid rgba(77, 77, 77, 0.18);
  display: grid;
  gap: 14px;
  grid-template-columns: 48px 1fr;
  padding: 12px 0;
}

.grantee-tooltip__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.grantee-tooltip__icon {
  align-items: center;
  background: #e2f5fd;
  border-radius: 13px;
  color: #005488;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.grantee-tooltip__icon i {
  font-size: 24px;
  line-height: 1;
}

.grantee-tooltip__label {
  color: #404040;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}

.grantee-tooltip__value {
  color: #005488;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}

.grantee-tooltip__row.is-inactive .grantee-tooltip__icon {
  background: #eeeeee;
  color: #9a9a9a;
}

.grantee-tooltip__row.is-inactive .grantee-tooltip__value {
  color: #6f6f6f;
}

/* ─── Reports ────────────────────────────────────────────────── */
.reports-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 84, 136, 0.14);
  border-left: 0.45rem solid rgba(0, 174, 239, 0.38);
  border-radius: 1.25rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 4.75rem minmax(0, 1fr) auto;
  min-height: 9.25rem;
  padding: 1.75rem 2rem;
  position: relative;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.report-card:hover,
.report-card:focus-within {
  border-left-color: var(--ieeep-light-blue);
  box-shadow: 0 16px 34px rgba(0, 84, 136, 0.12);
  transform: translateY(-3px);
}

.report-card__icon {
  align-items: center;
  background: rgba(0, 174, 239, 0.10);
  border-radius: 1rem;
  color: var(--ieeep-dark-blue);
  display: flex;
  font-size: 1.75rem;
  height: 4.75rem;
  justify-content: center;
  width: 4.75rem;
}

.report-card__body h3 {
  color: var(--ieeep-dark-blue);
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 0;
}

.report-card__body p {
  font-size: 0.98rem;
  line-height: 1.45;
  margin: 0.4rem 0 0;
}

.report-year-tabs,
.report-half-tabs {
  margin-top: 1.5rem;
}

.report-year-tabs > .nav-tabs,
.report-half-tabs > .nav-tabs {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.report-year-tabs > .nav-tabs .nav-link,
.report-half-tabs > .nav-tabs .nav-link {
  background: rgba(0, 174, 239, 0.10);
  border: 1px solid rgba(0, 84, 136, 0.10);
  border-radius: 999px;
  color: var(--ieeep-dark-blue);
  font-weight: 700;
  line-height: 1;
  margin: 0;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.report-year-tabs > .nav-tabs .nav-link {
  min-width: 5.25rem;
  padding: 0.85rem 1.3rem;
  text-align: center;
}

.report-half-tabs > .nav-tabs .nav-link {
  min-width: 4rem;
  padding: 0.72rem 1.1rem;
  text-align: center;
}

.report-year-tabs > .nav-tabs .nav-link:hover,
.report-half-tabs > .nav-tabs .nav-link:hover {
  background: rgba(0, 174, 239, 0.20);
  border-color: rgba(0, 174, 239, 0.45);
  color: var(--ieeep-dark-blue);
  transform: translateY(-1px);
}

.report-year-tabs > .nav-tabs .nav-link.active,
.report-half-tabs > .nav-tabs .nav-link.active {
  background: var(--ieeep-dark-blue);
  border-color: var(--ieeep-dark-blue);
  box-shadow: 0 7px 16px rgba(0, 84, 136, 0.18);
  color: #ffffff;
}

.report-year-tabs > .nav-tabs .nav-link:focus-visible,
.report-half-tabs > .nav-tabs .nav-link:focus-visible {
  box-shadow: 0 0 0 0.22rem rgba(0, 174, 239, 0.28);
  outline: 2px solid var(--ieeep-dark-blue);
  outline-offset: 2px;
}

.panel-tabset.report-year-tabs > .tab-content,
.panel-tabset.report-half-tabs > .tab-content {
  border: 0;
  padding: 0;
}

.panel-tabset.report-year-tabs > .tab-content {
  margin-top: 1.75rem;
}

.panel-tabset.report-half-tabs > .tab-content {
  margin-top: 0.25rem;
}

/* Grantee reports: put the period pills on the same row as the year pills.
   Quarto copies the tabset classes onto .tab-content too and wraps nested
   tabsets in .tabset-margin-container, so selectors are scoped accordingly. */
.panel-tabset.report-nested-tabs {
  align-items: center;
  column-gap: 2.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
}

.panel-tabset.report-nested-tabs > .nav-tabs {
  grid-column: 1;
  grid-row: 1;
}

.tab-content.report-nested-tabs,
.tab-content.report-nested-tabs > .tab-pane.active,
.report-nested-tabs .tabset-margin-container,
.report-nested-tabs .panel-tabset.report-half-tabs {
  display: contents;
}

.report-nested-tabs .panel-tabset.report-half-tabs > .nav-tabs {
  grid-column: 2;
  grid-row: 1;
}

.report-nested-tabs .tab-content.report-half-tabs {
  grid-column: 1 / -1;
  grid-row: 2;
}

.report-half-tabs .reports-grid {
  margin-top: 1.5rem;
}

.report-empty {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(0, 84, 136, 0.22);
  border-radius: 1rem;
  color: var(--ieeep-ink);
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
}

.report-empty i {
  color: var(--ieeep-light-blue);
  font-size: 1.4rem;
}

.report-empty p {
  margin: 0;
}

.report-card__button,
.report-global-button {
  align-items: center;
  background: var(--ieeep-dark-blue);
  border-radius: 0.9rem;
  color: #ffffff;
  display: inline-flex;
  font-size: 1.1rem;
  font-weight: 700;
  gap: 0.55rem;
  justify-content: center;
  line-height: 1;
  min-height: 3.5rem;
  padding: 0.9rem 1.35rem;
  text-decoration: none;
  white-space: nowrap;
}

.report-card__button:hover,
.report-card__button:focus,
.report-global-button:hover,
.report-global-button:focus {
  background: #003f66;
  color: #ffffff;
}

.report-card__button i,
.report-global-button i {
  font-size: 1.1rem;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row,
  .feature-grid,
  .contact-grid,
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .panel-tabset.report-nested-tabs {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 1rem;
  }

  .report-nested-tabs .panel-tabset.report-half-tabs > .nav-tabs {
    grid-column: 1;
    grid-row: 2;
  }

  .report-nested-tabs .tab-content.report-half-tabs {
    grid-row: 3;
  }

  .report-card {
    grid-template-columns: 4.25rem minmax(0, 1fr);
    padding: 1.25rem;
  }

  .report-card__icon {
    font-size: 1.5rem;
    height: 4.25rem;
    width: 4.25rem;
  }

  .report-card__button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hero {
    padding: 1.25rem;
  }

  .quarto-title-banner {
    min-height: 320px;
  }

  .quarto-title-banner .quarto-title {
    max-width: calc(100% - 2rem);
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .quarto-title-banner h1.title {
    max-width: 100%;
  }

  .grantee-map {
    height: 70vh;
    min-height: 420px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
