/* Shared by every page: the site header and nav, the home page, and the
   Senate and House pages. The vote-map parts are in style.css. */

.site-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #e4e4e4;
}
/* The logo: dot arc + the lowercase "whipcount" wordmark (same type as
   logo-wordmark.svg, the logo registered with Google). */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
}
.brand img { display: block; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a,
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.site-nav a:hover,
.dropdown-toggle:hover { background: #f0f0f0; }
.site-nav [aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); border-radius: 0; }
.dropdown-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Sign in / signed-in user, on the right. A fixed height so the header (and
   the pinned area on the Impeachment page) doesn't move when it fills in. */
.auth { margin-left: auto; display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; }
.signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid #ccc;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  background: #fff;
}
.signin:hover { background: #f5f5f5; }
.auth-error { color: var(--no); font-size: 13px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-name { font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout { color: var(--muted); }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg);
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.dropdown-menu a { display: block; width: 100%; }
.dropdown-menu a[aria-current="page"] { box-shadow: none; border-radius: 6px; background: #f0f0f0; }

/* Pages without the pinned map need their own top spacing. */
.page { padding-top: 12px; }
body > .site-header { padding-top: 16px; }

/* Home */
.hero { max-width: 720px; margin: 24px 0 32px; }
.hero h1 { font-size: 36px; margin: 0 0 8px; }
.hero p { font-size: 17px; line-height: 1.5; color: #444; margin: 0; }
.home h2 { font-size: 20px; margin: 0 0 12px; }
.home section + section { margin-top: 32px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.card:hover { border-color: #999; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.card .open { margin-top: auto; font-size: 14px; font-weight: 600; }
.card-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-preview .chamber figcaption { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }

/* Senate and House pages */
.page-head h1 { font-size: 28px; margin: 0; }
.chamber-summary { margin-top: 16px; }
.chamber-summary .chamber { grid-column: span 4; }
@media (max-width: 899px) {
  .chamber-summary .chamber { grid-column: span 12; }
}

/* My Votes menu */
.my-votes .dropdown-menu { min-width: 300px; max-height: 60vh; overflow-y: auto; }
.custom-votes { list-style: none; margin: 0; padding: 0; }
.custom-vote { display: flex; align-items: center; gap: 4px; }
.custom-vote.is-open .cv-name { font-weight: 700; }
.menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.menu-item:hover { background: #f0f0f0; }
.cv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-chamber { font-size: 12px; color: var(--muted); white-space: nowrap; }
.delete-vote { border: none; background: none; color: var(--muted); font-size: 16px; padding: 2px 8px; }
.delete-vote:hover { color: var(--no); background: #f7e8e8; }
.menu-note { padding: 6px 10px; font-size: 13px; color: var(--muted); }
.menu-actions { border-top: 1px solid #eee; margin-top: 4px; padding-top: 4px; }
.new-vote { font-weight: 600; border-bottom: 1px solid #eee; border-radius: 6px 6px 0 0; margin-bottom: 4px; }
.menu-actions .menu-item { font-weight: 600; }

/* Save Custom Vote dialog */
.save-dialog { padding: 20px 24px; width: min(420px, calc(100vw - 32px)); }
.save-dialog h2 { margin: 0 0 16px; font-size: 20px; }
.save-dialog .field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: none; padding: 0; font-size: 14px; font-weight: 600; }
.save-dialog input[name="name"] { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid #bbb; border-radius: 6px; }
.save-dialog fieldset label { font-weight: 400; display: flex; align-items: center; gap: 8px; }
.save-dialog legend { padding: 0; margin-bottom: 6px; }
.form-error { color: var(--no); font-size: 13px; min-height: 1em; margin: 0 0 8px; }
.form-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.form-buttons .primary { background: var(--text); border-color: var(--text); color: #fff; }

/* "Custom Vote: Name · Senate" in the Start from row */
.custom-status { margin-left: 8px; padding-left: 12px; border-left: 1px solid #ddd; color: var(--muted); }
.custom-status strong { color: var(--text); }
.custom-status a { color: inherit; }
.custom-status .unsaved { color: #b25e00; }

/* Footer on every page */
.site-footer {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 24px 0 8px;
  margin-top: 40px;
  border-top: 1px solid #e4e4e4;
  font-size: 13px;
  color: var(--muted);
}
.site-footer a { color: inherit; }

/* Privacy Policy and other long text */
.legal { max-width: 720px; margin: 8px auto 0; line-height: 1.6; font-size: 16px; }
.legal h1 { font-size: 32px; margin: 16px 0 4px; }
.legal .effective { color: var(--muted); margin-top: 0; }
.legal h2 { font-size: 21px; margin: 32px 0 8px; }
.legal h3 { font-size: 17px; margin: 20px 0 6px; }
.legal li { margin: 4px 0; }
