/* Custom styling layered on top of GitHub Primer.
   Uses Primer CSS variables so it matches the design system. */

body {
  background-color: var(--bgColor-muted, #f6f8fa);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

/* ---- Hero ---- */
.hero-banner {
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(9,105,218,.10), transparent),
    linear-gradient(180deg, var(--bgColor-default, #fff), var(--bgColor-muted, #f6f8fa));
}
.h1-mktg { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }

/* ---- Flags ---- */
.flag-thumb {
  border: 1px solid var(--borderColor-default, #d0d7de);
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
}
.flag-thumb--lg { width: 72px; height: 48px; }
.flag-thumb--xl { width: 132px; height: 88px; }

/* ---- People picker grid ---- */
.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.people-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
  margin: 0;
}
.people-card:hover {
  box-shadow: var(--shadow-floating-medium, 0 8px 24px rgba(140,149,159,.2));
  transform: translateY(-2px);
}
.people-card--selected {
  border-color: var(--borderColor-accent-emphasis, #0969da);
  box-shadow: 0 0 0 2px var(--borderColor-accent-emphasis, #0969da);
}
.people-card__flag {
  height: 120px;
  background: var(--bgColor-muted, #f6f8fa);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--borderColor-muted, #d8dee4);
  overflow: hidden;
}
.people-card__flag img { max-height: 90px; max-width: 80%; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.people-card__body { padding: 12px 16px; flex: 1; }
.people-card__name { font-size: 16px; font-weight: 600; margin: 0 0 2px; }
.people-card__meta { font-size: 12px; color: var(--fgColor-muted, #59636e); margin: 0 0 8px; }
.people-card__summary { font-size: 13px; color: var(--fgColor-default, #1f2328); margin: 0 0 8px; }
.people-card__rep { font-size: 12px; color: var(--fgColor-muted, #59636e); margin: 0; }
.people-card__action { padding: 0 16px 16px; }

/* ---- Petition layout ---- */
.petition-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.petition-sidebar { position: sticky; top: 16px; }
@media (max-width: 860px) {
  .petition-layout { grid-template-columns: 1fr; }
  .petition-sidebar { position: static; }
}
.sticky-side { position: sticky; top: 16px; }

.section-nav { display: flex; flex-direction: column; }
.section-nav__link {
  padding: 6px 8px; border-radius: 6px; font-size: 13px; color: var(--fgColor-muted, #59636e); text-decoration: none;
}
.section-nav__link:hover { background: var(--bgColor-muted, #f6f8fa); text-decoration: none; }
.section-nav__link.is-active { background: var(--bgColor-accent-muted, #ddf4ff); color: var(--fgColor-accent, #0969da); font-weight: 600; }

.source-list { list-style: none; padding: 0; margin: 0; }
.source-list li { padding: 4px 0; font-size: 13px; border-bottom: 1px solid var(--borderColor-muted, #eaeef2); }
.source-list li:last-child { border-bottom: 0; }

/* ---- Progress bar ---- */
.progress-wrap { background: var(--bgColor-muted, #eaeef2); border-radius: 6px; height: 8px; overflow: hidden; }
.progress-bar { display: block; height: 100%; background: var(--bgColor-success-emphasis, #1f883d); transition: width .3s ease; }

/* ---- Fact file ---- */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.fact-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--fgColor-muted, #59636e); margin-bottom: 2px; }
.fact-grid dd { margin: 0; font-size: 14px; font-weight: 500; }

/* ---- Form fields ---- */
.field-block { padding-top: 4px; }
.field-help { font-size: 13px; color: var(--fgColor-muted, #59636e); margin: 2px 0 8px; }
.textarea-long { min-height: 180px; }
.example-box { font-size: 13px; }
.example-box summary { cursor: pointer; color: var(--fgColor-accent, #0969da); user-select: none; }
.example-body {
  white-space: pre-wrap;
  background: var(--bgColor-muted, #f6f8fa);
  border: 1px dashed var(--borderColor-default, #d0d7de);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
  color: var(--fgColor-default, #1f2328);
}

.note { font-size: 12px; color: var(--fgColor-muted, #59636e); }

/* ---- Review document ---- */
.petition-doc { background: #fff; }
.answer-text { white-space: pre-wrap; }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }

/* ---- Print ---- */
@media print {
  .Header, .no-print, footer { display: none !important; }
  body { background: #fff; }
  .Box { border: none !important; box-shadow: none !important; }
  .petition-doc { padding: 0 !important; }
}
