/* ============================================================
   GrammarBound — homepage deadline urgency banner (FEAT)
   A thin strip that sits between the navy hero and the first
   light section. Rotates the action-required admissions
   deadlines and ramps its tone as each one nears.

   Link AFTER scheme.css on index.html:
     <link rel="stylesheet" href="/gb-deadline-banner.css" />
   Behaviour lives in /gb-deadline-banner.js.

   Colours stay inside the navy + brass system; the final two
   tiers borrow the map's warm "score" terracotta (#9A3412 /
   #C2724E) rather than a pure red.
   ============================================================ */

/* CLS: reserve the strip's height before the (async) JS insert, so filling it
   doesn't shift the page. gb-deadline-banner.js locks this to the exact rendered
   height once mounted, and collapses the slot if there's no banner to show. */
.gbd-slot { min-height: 53px; }
@media (max-width: 620px) { .gbd-slot { min-height: 118px; } }

.gbd-strip {
  width: 100%;
  font-family: "Spectral", Georgia, serif;
  background: var(--gbd-tint, transparent);
  border-top: 1px solid var(--gbd-rule, #E4D5A8);
  border-bottom: 1px solid var(--gbd-rule, #E4D5A8);
  /* tiers set their colour variables; defaults = calm */
  --gbd-accent: #C99B43;
  --gbd-label: #5B6473;
  --gbd-tint: transparent;
  --gbd-rule: #E4D5A8;
}

/* ── Urgency tiers ─────────────────────────────────────────── */
.gbd-strip.gbd-calm        { --gbd-accent:#C99B43; --gbd-label:#5B6473; --gbd-tint:transparent;               --gbd-rule:#E4D5A8; }
.gbd-strip.gbd-approaching { --gbd-accent:#C99B43; --gbd-label:#7A5A1E; --gbd-tint:rgba(201,155,67,0.06);     --gbd-rule:#E4D5A8; }
.gbd-strip.gbd-soon        { --gbd-accent:#A6741F; --gbd-label:#A6741F; --gbd-tint:rgba(201,155,67,0.11);     --gbd-rule:#D8B968; }
.gbd-strip.gbd-urgent      { --gbd-accent:#B23A2E; --gbd-label:#9A3412; --gbd-tint:rgba(154,52,18,0.07);      --gbd-rule:#C2724E; }
.gbd-strip.gbd-today       { --gbd-accent:#9A3412; --gbd-label:#9A3412; --gbd-tint:rgba(154,52,18,0.11);      --gbd-rule:#9A3412; }

.gbd-inner {
  max-width: 1100px; margin: 0 auto; padding: 13px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}

.gbd-body { display: flex; align-items: center; gap: 13px; min-width: 0; transition: opacity 0.28s ease; }
.gbd-strip.is-leaving .gbd-body { opacity: 0; }

.gbd-marker { width: 9px; height: 9px; flex: none; border-radius: 1px; background: var(--gbd-accent); }
.gbd-soon   .gbd-marker { animation: gbd-pulse-brass 2.1s ease-out infinite; }
.gbd-urgent .gbd-marker,
.gbd-today  .gbd-marker { animation: gbd-pulse-terra 1.5s ease-out infinite; }
@keyframes gbd-pulse-brass {
  0%   { box-shadow: 0 0 0 0 rgba(201,155,67,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(201,155,67,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,155,67,0); }
}
@keyframes gbd-pulse-terra {
  0%   { box-shadow: 0 0 0 0 rgba(178,58,46,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(178,58,46,0); }
  100% { box-shadow: 0 0 0 0 rgba(178,58,46,0); }
}

.gbd-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; white-space: nowrap; flex: none; color: var(--gbd-label);
}
.gbd-sep { width: 1px; height: 15px; flex: none; background: var(--gbd-rule); }
.gbd-text { min-width: 0; white-space: nowrap; }
.gbd-kicker { font-size: 16px; font-weight: 500; color: #16244C; }
.gbd-date { font-size: 15px; color: #6B7280; }

.gbd-count { display: flex; align-items: baseline; gap: 7px; flex: none; font-family: "IBM Plex Mono", ui-monospace, monospace; color: var(--gbd-accent); }
.gbd-count-big { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.gbd-count-small { font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: #6B7280; }

.gbd-tail { display: flex; align-items: center; gap: 14px; flex: none; }
.gbd-dots { display: flex; gap: 5px; }
.gbd-dot { width: 5px; height: 5px; flex: none; border-radius: 1px; background: #D8C9A2; transition: background 0.3s ease; }
.gbd-dot.is-on { background: #A6741F; }
.gbd-urgent .gbd-dot.is-on, .gbd-today .gbd-dot.is-on { background: #9A3412; }

.gbd-close {
  width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; padding: 0; border-radius: 4px;
  color: #9CA3AF; transition: background 0.15s ease, color 0.15s ease;
}
.gbd-close:hover { background: rgba(0,0,0,0.05); color: #6B7280; }
.gbd-close:focus-visible { outline: 2px solid var(--gbd-accent); outline-offset: 2px; }

/* On a phone the single horizontal row can't fit label + name + count, so the
   deadline name truncated to "Medwa…". Stack the body across up to three lines
   (marker+label · name+date · count), pin the close button top-right, and drop
   the decorative rotation dots. */
@media (max-width: 620px) {
  .gbd-inner { position: relative; gap: 0; padding: 12px 40px; align-items: center; }
  .gbd-body { flex-wrap: wrap; width: 100%; row-gap: 5px; column-gap: 9px; justify-content: center; text-align: center; }
  .gbd-sep { display: none; }
  .gbd-text { flex-basis: 100%; white-space: normal; }
  .gbd-count { flex-basis: 100%; justify-content: center; }
  .gbd-label { font-size: 10px; }
  .gbd-kicker { font-size: 15px; }
  .gbd-tail { position: absolute; top: 9px; right: 12px; gap: 0; }
  .gbd-dots { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gbd-body { transition: none; }
  .gbd-marker { animation: none !important; }
}
