/* grant-connect-deploy/css/closed-grant-interstitial.css
   ────────────────────────────────────────────────────────────────────────────
   CLOSED-GRANT INTERSTITIAL — D1 (Phase D, 2026-05-14)

   Overlay card shown when a user opens the workspace for a grant whose
   programStatus is not "active". Renders above the dimmed workspace via a
   scrim. Uses cgi- prefix. Brand tokens scoped to #workspace-pane-root.

   Color conventions:
     amber  = between-intakes / upcoming / paused  (still has hope)
     gray   = closed / discontinued                (definitively ended)
   ──────────────────────────────────────────────────────────────────────── */

/* ── Scrim overlay — sits on top of the workspace shell ─────────────────── */
.cgi-scrim {
  position: fixed;
  inset: 56px 0 0 0;        /* below the fixed 56px nav */
  z-index: 80;              /* above pane (z-index:40) and tour (z-index:70) */
  background: rgba(31, 42, 36, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 52px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (prefers-reduced-motion: reduce) {
  .cgi-scrim { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.cgi-card {
  width: min(560px, 100%);
  background: var(--wsp-paper, #FFFEF9);
  border: 1px solid var(--wsp-rule-2, #d3ccba);
  border-radius: 16px;
  box-shadow: 0 8px 36px -8px rgba(31, 42, 36, 0.28);
  overflow: hidden;
  font-family: var(--wsp-font-body, "DM Sans", system-ui, sans-serif);
  animation: cgi-appear 0.22s ease;
}
@keyframes cgi-appear {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .cgi-card { animation: none; }
}

/* ── Card header ─────────────────────────────────────────────────────────── */
.cgi-card__top {
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--wsp-rule, #e3decf);
  background: linear-gradient(180deg, var(--cgi-tint-bg, #fbf7e9), var(--wsp-paper, #FFFEF9));
  position: relative;
}

/* close button */
.cgi-card__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--wsp-ink-3, #5e6b63);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  transition: background 0.14s, color 0.14s;
}
.cgi-card__close:hover { background: rgba(0,0,0,0.06); color: var(--wsp-ink, #1f2a24); }

/* kicker line — e.g. "BETWEEN INTAKES" */
.cgi-card__kicker {
  font-family: var(--wsp-font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cgi-tint-text, #8a6700);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
}
.cgi-card__kicker svg { width: 13px; height: 13px; flex-shrink: 0; }

/* heading */
.cgi-card__heading {
  font-family: var(--wsp-font-display, "Fraunces", Georgia, serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  color: var(--wsp-ink, #1f2a24);
  letter-spacing: -0.01em;
  margin: 0;
  padding-right: 32px; /* room for close button */
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.cgi-card__body {
  padding: 20px 28px 22px;
}

.cgi-card__lead {
  font-size: 14.5px;
  color: var(--wsp-ink-2, #3a4a42);
  line-height: 1.6;
  margin: 0 0 6px;
}
.cgi-card__lead strong { color: var(--wsp-ink, #1f2a24); font-weight: 600; }

/* timing callout (deadlineNotes) */
.cgi-card__when {
  font-family: var(--wsp-font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 11.5px;
  color: var(--wsp-ink-3, #5e6b63);
  letter-spacing: 0.02em;
  line-height: 1.55;
  background: var(--cgi-tint-bg, #fbf7e9);
  border: 1px solid var(--cgi-tint-line, #e6d49a);
  border-radius: 9px;
  padding: 10px 12px;
  margin: 12px 0 0;
}
.cgi-card__when strong { color: var(--cgi-tint-text, #8a6700); font-weight: 500; }

/* ── Action paths ────────────────────────────────────────────────────────── */
.cgi-card__paths {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 18px;
}

.cgi-path {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0 14px;
  align-items: center;
  text-align: left;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid var(--wsp-rule, #e3decf);
  background: var(--wsp-paper, #FFFEF9);
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}
.cgi-path:hover {
  border-color: var(--wsp-rule-2, #d3ccba);
  background: var(--wsp-paper-2, #F4EFDE);
}
.cgi-path:focus-visible {
  outline: 2px solid var(--wsp-forest, #2D6A4F);
  outline-offset: 2px;
}

/* primary = forest green */
.cgi-path--primary {
  border-color: var(--wsp-forest, #2D6A4F);
  background: var(--wsp-forest-ll, #f0f5f1);
}
.cgi-path--primary:hover { background: var(--wsp-forest-l, #e6efe9); }

.cgi-path__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--wsp-forest-l, #e6efe9);
  color: var(--wsp-forest, #2D6A4F);
}
.cgi-path__icon svg { width: 16px; height: 16px; }

.cgi-path__icon--amber {
  background: var(--wsp-amber-l, #f6efd6);
  color: var(--wsp-amber, #b08300);
}
.cgi-path__icon--gray {
  background: #f3f1ea;
  color: var(--wsp-ink-3, #5e6b63);
}

.cgi-path__text { min-width: 0; }
.cgi-path__text strong {
  display: block;
  font-size: 14.5px;
  color: var(--wsp-ink, #1f2a24);
  font-weight: 600;
  line-height: 1.3;
}
.cgi-path--primary .cgi-path__text strong { color: var(--wsp-forest-d, #1f4f3a); }
.cgi-path__text span {
  display: block;
  font-size: 12px;
  color: var(--wsp-ink-3, #5e6b63);
  margin-top: 2px;
  line-height: 1.4;
}

.cgi-path__arrow {
  color: var(--wsp-rule-2, #d3ccba);
  font-size: 16px;
  flex-shrink: 0;
  transition: color 0.14s, transform 0.14s;
  line-height: 1;
}
.cgi-path:hover .cgi-path__arrow {
  color: var(--wsp-ink-3, #5e6b63);
  transform: translateX(2px);
}

/* ── Card footer ─────────────────────────────────────────────────────────── */
.cgi-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 28px 18px;
  border-top: 1px solid var(--wsp-rule, #e3decf);
  font-family: var(--wsp-font-mono, "IBM Plex Mono", ui-monospace, monospace);
  font-size: 10.5px;
  color: var(--wsp-ink-4, #717e76);
  letter-spacing: 0.03em;
}
.cgi-card__foot a {
  color: var(--wsp-ink-3, #5e6b63);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cgi-card__foot a:hover { color: var(--wsp-ink, #1f2a24); }

/* ── Color variants ──────────────────────────────────────────────────────── */

/* amber — between-intakes, upcoming, paused */
.cgi-card--amber {
  --cgi-tint-bg: #fbf7e9;
  --cgi-tint-line: #e6d49a;
  --cgi-tint-text: #8a6700;
}

/* gray — closed, discontinued */
.cgi-card--gray {
  --cgi-tint-bg: #f3f1ea;
  --cgi-tint-line: #dcd8cc;
  --cgi-tint-text: var(--wsp-ink-3, #5e6b63);
}
.cgi-card--gray .cgi-card__top {
  background: linear-gradient(180deg, #f3f1ea, var(--wsp-paper, #FFFEF9));
}
.cgi-card--gray .cgi-card__kicker { color: var(--wsp-ink-3, #5e6b63); }
.cgi-card--gray .cgi-card__when strong { color: var(--wsp-ink-3, #5e6b63); }

/* ── Notify-me confirmation inline state ─────────────────────────────────── */
.cgi-path--confirmed {
  border-color: var(--wsp-forest, #2D6A4F);
  background: var(--wsp-forest-ll, #f0f5f1);
  pointer-events: none;
  cursor: default;
}
.cgi-path--confirmed .cgi-path__icon {
  background: var(--wsp-forest-l, #e6efe9);
  color: var(--wsp-forest, #2D6A4F);
}
.cgi-path--confirmed .cgi-path__text strong { color: var(--wsp-forest-d, #1f4f3a); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
/* P0-4 (2026-05-14): on mobile/tablet, `.cgi-card` could grow past the viewport
   and clip its bottom CTAs because the card had `overflow: hidden` and no max-
   height. The scrim's `overflow-y: auto` works on most browsers but Lens 4 saw
   trapped users on 320-414. Make the CARD itself scrollable up to viewport
   height (minus the 56px nav + 8px breathing room). Cap applies up to 768px
   to also cover tablet portrait where the card is densest. */
@media (max-width: 768px) {
  .cgi-card {
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 600px) {
  .cgi-scrim {
    padding: 32px 12px 28px;
    align-items: flex-start;
  }
  .cgi-card__top { padding: 20px 20px 16px; }
  .cgi-card__body { padding: 16px 20px 18px; }
  .cgi-card__foot { padding: 12px 20px 16px; }
  .cgi-card__heading { font-size: 18px; }
  .cgi-path { padding: 11px 13px; }
}
