/* ===========================================================================
   VFPG Share Toolkit — styles.
   Brand: NUPGE Convention 2025 style tile (navy / royal blue / lime), with
   Futura in place of Optima & Open Sans. `Owners` leads the display stack —
   it engages automatically if an Adobe Fonts kit is added in index.astro,
   and falls back to Futura (macOS/iOS) then Jost (loaded from Google Fonts).
   =========================================================================== */

:root {
  /* NUPGE Convention 2025 palette */
  --navy-deep:  #003349;   /* PMS 2189 — primary text */
  --navy:       #034a74;   /* PMS 654 */
  --blue:       #345d9d;   /* PMS 7684 — hero panel */
  --steel:      #5f99af;   /* PMS 7696 */
  --green:      #76bc21;   /* PMS 368 */
  --lime:       #cddb00;   /* PMS 381 — the action colour */
  --offwhite:   #edf2f7;   /* page background */

  --panel:      #ffffff;
  --text:       var(--navy-deep);
  --muted:      #3d5a72;   /* navy-deep softened, AA on off-white & white */
  --muted-2:    #5d7689;

  --line:       rgba(0, 51, 73, 0.14);
  --line-strong:rgba(0, 51, 73, 0.32);

  --maxw: 1120px;
  --pad: clamp(20px, 5vw, 56px);

  /* futura-pt = Adobe Fonts kit rrh7jej (same kit as the main site). */
  --display: 'futura-pt', 'Futura PT', Futura, 'Jost', 'Century Gothic', sans-serif;
  --ui: 'futura-pt', 'Futura PT', Futura, 'Jost', 'Century Gothic', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ui);
  background: var(--offwhite);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--lime); color: var(--navy-deep); }

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Page scaffolding --------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(28px, 4.5vw, 52px) var(--pad) clamp(56px, 8vw, 104px);
}

/* ---- Site navigation (mirrors the voicesforpublicgood.ca navbar31) -------
   Fixed paper-white bar with logo + hamburger at every width; the menu is a
   full-height panel that slides in from the right, links stacked with the
   yellow hover, social icons at the bottom. One deliberate deviation: the
   panel gets the paper-white background (the site's own panel is transparent,
   which lets links vanish into whatever is behind them). */
.sitebar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  background: #fcfcfc;
  min-height: 4.5rem;
  padding: 0 5%;
  display: flex;
  flex-flow: column;
  justify-content: center;
  box-shadow: 0 -3px 17px 3px rgba(0, 0, 0, 0.2);
}

body { padding-top: 4.5rem; } /* clear the fixed bar */

.sitebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
}

.sitebar-logo { display: block; flex-shrink: 0; }
.sitebar-logo img { display: block; width: 125px; height: auto; }

/* hamburger — three 24×2 black lines, morphs to an X when open */
.sitebar-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 48px;
  height: 48px;
}
.burger-line {
  width: 24px;
  height: 2px;
  background: #000;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
html.nav-open .burger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
html.nav-open .burger-line:nth-child(2) { opacity: 0; }
html.nav-open .burger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* slide-in menu panel */
.sitebar-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 150;
  height: 100dvh;
  min-width: min(320px, 100dvw);
  background: #fcfcfc;
  border-left: 1px solid #000;
  padding: 6.5rem 5% 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  overflow: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s var(--ease), visibility 0s linear 0.4s;
}
html.nav-open .sitebar-menu {
  transform: none;
  visibility: visible;
  transition: transform 0.4s var(--ease);
}

.sitebar-menu-links {
  display: grid;
  gap: 1rem 2.5rem;
  max-width: 50rem;
}
.sitebar-menu-links a {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.2;
  color: #000;
  padding: 0.5rem 2rem;
}
.sitebar-menu-links a:hover { background: var(--lime); }

.sitebar-menu-social {
  display: flex;
  gap: 0.75rem;
  align-self: center;
}
.sitebar-menu-social a {
  display: flex;
  align-items: center;
  color: #000;
  transition: color 0.2s var(--ease);
}
.sitebar-menu-social a:hover { color: var(--blue); }

@media screen and (max-width: 991px) {
  .sitebar-menu-links a { font-size: 1.5rem; }
}
@media screen and (max-width: 767px) {
  .sitebar-menu { width: 100dvw; border-left: none; }
}

/* ---- Hero — royal blue panel, slanted convention tagline ----------------- */
.hero {
  margin-bottom: clamp(28px, 4vw, 44px);
  padding: clamp(32px, 5.5vw, 64px) clamp(24px, 4.5vw, 56px);
  background: var(--blue);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

/* quarter-round motif from the style tile, tucked in the corner */
.hero::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: clamp(90px, 16vw, 180px);
  height: clamp(90px, 16vw, 180px);
  background: var(--steel);
  border-top-left-radius: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5.2vw, 56px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  transform: skewX(-6deg);
  color: #ffffff;
  max-width: 15ch;
  position: relative;
  z-index: 1;
}

/* lime underline on the lead word(s) — toolkit.js wraps them in .hero-accent */
.hero-accent {
  box-shadow: inset 0 -0.16em 0 0 var(--lime);
  padding-bottom: 0.04em;
}

.hero-sub {
  margin-top: 18px;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 500;
  color: #eaf1f9;
  max-width: 52ch;
  position: relative;
  z-index: 1;
}

/* ---- Filter chips --------------------------------------------------------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: clamp(24px, 3.5vw, 36px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--navy);
  background: #ffffff;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.chip svg { width: 14px; height: 14px; opacity: 0.9; }
.chip:hover { color: var(--navy-deep); border-color: var(--navy); }
.chip.active {
  color: var(--navy-deep);
  background: var(--lime);
  border-color: var(--lime);
  font-weight: 700;
}
.chip.active svg { opacity: 1; }

/* ---- Card grid ------------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: clamp(16px, 2.4vw, 24px);
  align-items: start;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 2.6vw, 26px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0, 51, 73, 0.05), 0 8px 24px rgba(0, 51, 73, 0.06);
  animation: card-in 0.5s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 8) * 55ms);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.card-text {
  font-size: 15.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.card-media {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.card-media img { display: block; width: 100%; height: auto; }

.card-link {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--lime);
  border-radius: 8px;
  background: var(--offwhite);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.card-link:hover { border-color: var(--line-strong); background: #e2eaf2; }
.card-link { min-width: 0; }
.card-link-title { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.card-link-domain { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ---- Actions --------------------------------------------------------------- */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.icon-row { display: flex; gap: 8px; flex-wrap: wrap; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  color: var(--navy);
  background: #ffffff;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
  transform: translateY(-1px);
}
.icon-btn:active { transform: none; }
.icon-btn.did {
  color: var(--navy-deep);
  background: var(--lime);
  border-color: var(--lime);
}

/* Utils buttons read as secondary via a ghost treatment — a positional
   border divider would orphan itself whenever .card-actions wraps
   (which happens routinely with 8 platform icons). */
.icon-row.utils .icon-btn {
  border-color: transparent;
  background: var(--offwhite);
  color: var(--muted);
}
.icon-row.utils .icon-btn:hover {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}
.icon-row.utils .icon-btn.did {
  color: var(--navy-deep);
  background: var(--lime);
  border-color: var(--lime);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--navy-deep);
  font-family: var(--ui);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.primary-btn svg { width: 16px; height: 16px; }
.primary-btn:hover { background: #d9e622; transform: translateY(-1px); }
.primary-btn:active { transform: none; }
.primary-btn.did { background: var(--green); color: #ffffff; }

.empty { color: var(--muted); font-size: 15px; padding: 24px 0; }

/* persistent per-card note (e.g. “caption copied — paste it into Facebook”) */
.card-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(205, 219, 0, 0.18);
  border: 1px solid var(--lime);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-deep);
}

/* ---- Toast ------------------------------------------------------------------ */
.vpg-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  max-width: min(92vw, 480px);
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid var(--lime);
  background: var(--navy-deep);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 100;
}
.vpg-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Footer ------------------------------------------------------------------ */
.foot {
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px;
  border-top: 1.5px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.foot a { color: var(--navy); transition: color 0.2s var(--ease); }
.foot a:hover { color: var(--blue); }

/* ---- Screen-reader-only live region ------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Reduced motion ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .icon-btn, .primary-btn, .chip, .vpg-toast,
  .sitebar-menu, .burger-line { transition: none; }
}
