/* =========================================================
   VOTING RECORDS HOME (voting-home.html)
   Theme colours are shared from styles.css. Each category
   button and bill card sets its own --accent and --accent-soft.
========================================================= */

/* Cards use display:flex/grid, so make sure the hidden
   attribute (used by the filters) still wins. */
.voting-home-page [hidden] {
  display: none !important;
}

/* ---------- Header ---------- */

.vh-header {
  padding: 44px 7vw 52px;
}

.vh-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px 0 0;
}

.vh-stats div {
  min-width: 120px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.vh-stats dt {
  color: #b9c9de;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vh-stats dd {
  margin: 4px 0 0;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
}

/* ---------- Page layout ---------- */

.vh-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 0;
}

/* ---------- Categories (large centred buttons) ---------- */

.vh-categories {
  text-align: center;
}

.vh-categories h2,
.vh-list-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  letter-spacing: -0.01em;
}

.vh-section-intro {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.vh-category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.vh-category-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: 240px;
  min-height: 168px;
  padding: 24px 18px 20px;

  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);

  font: inherit;
  color: #0f172a;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, box-shadow 0.15s ease;
}

.vh-category-button:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.vh-category-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

.vh-category-button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent);
}

.vh-category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.vh-category-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vh-category-button .vh-category-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.vh-category-button .vh-category-icon svg {
  width: 30px;
  height: 30px;
}

.vh-category-button[aria-pressed="true"] .vh-category-icon {
  background: var(--accent);
  color: #ffffff;
}

.vh-category-name {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
}

.vh-category-count {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ---------- Vote list ---------- */

.vh-list {
  margin-top: 56px;
  scroll-margin-top: 16px;
}

.vh-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.vh-results-count {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.vh-show-all {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: #0f172a;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.vh-show-all:hover {
  border-color: #94a3b8;
}

/* ---------- Search and outcome filter ---------- */

.vh-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.vh-search label,
.vh-filter-label {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 700;
}

.vh-search input:focus {
  outline: none;
  border-color: var(--irish-green);
  box-shadow: var(--focus-ring);
}

.vh-segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.vh-segmented button {
  width: auto;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.vh-segmented button:hover {
  color: #0f172a;
}

.vh-segmented button[aria-pressed="true"] {
  background: #0f172a;
  color: #ffffff;
}

/* ---------- Bill cards (full-width rectangles) ---------- */

.vh-bill-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vh-bill-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  min-width: 0;
  padding: 22px 26px;
  background: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-left: 5px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vh-bill-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
}

.vh-bill-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent);
}

.vh-bill-main {
  min-width: 0;
}

.vh-bill-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.vh-bill-category {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.vh-bill-date {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.vh-bill-card h3 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 1.18rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.vh-bill-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  max-width: 760px;
  margin: 0 0 12px;
  color: #475569;
  font-size: 0.94rem;
  line-height: 1.6;
}

.vh-bill-proposer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
}

.vh-party-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Right-hand column: outcome, tally, link */
.vh-bill-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-left: 26px;
  border-left: 1px solid #eef2f6;
}

.vh-outcome {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.vh-outcome-passed {
  color: #136c32;
  background: #dff7e7;
}

.vh-outcome-not-passed {
  color: #a71d19;
  background: #ffe2df;
}

.vh-outcome-unknown {
  color: #775e00;
  background: #fff5bd;
}

/* Tá / Níl split */
.vh-tally {
  width: 100%;
}

.vh-tally-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.vh-tally-bar span {
  height: 100%;
}

.vh-tally-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  color: #475569;
  font-size: 0.8rem;
}

.vh-tally-labels span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vh-tally-labels i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.vh-tally-labels strong {
  color: #0f172a;
}

.vh-bill-cta {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.vh-bill-cta span {
  display: inline-block;
  transition: transform 0.15s ease;
}

.vh-bill-card:hover .vh-bill-cta span {
  transform: translateX(4px);
}

/* ---------- Empty state and footnote ---------- */

.vh-empty {
  margin-top: 18px;
  padding: 40px 24px;
  text-align: center;
  background: var(--card-bg);
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
}

.vh-empty h2 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1.2rem;
}

.vh-empty p {
  margin: 0 0 18px;
  color: var(--muted);
}

.vh-empty .secondary-button {
  width: auto;
}

.vh-disclaimer {
  margin: 40px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Responsive ---------- */

/* Tablets: card side column drops under the main text */
@media (max-width: 820px) {
  .vh-bill-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .vh-bill-side {
    padding: 14px 0 0;
    border-left: 0;
    border-top: 1px solid #eef2f6;
  }
}

@media (max-width: 720px) {
  .vh-header {
    padding: 36px 20px 44px;
  }

  .vh-stats div {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .vh-toolbar {
    grid-template-columns: 1fr;
  }

  .vh-segmented {
    display: flex;
  }

  .vh-segmented button {
    flex: 1 1 0;
  }

  /* Two category buttons per row on phones */
  .vh-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .vh-category-button {
    width: auto;
    min-height: 140px;
    padding: 18px 12px 16px;
  }

  .vh-category-button .vh-category-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .vh-category-button .vh-category-icon svg {
    width: 25px;
    height: 25px;
  }

  .vh-category-name {
    font-size: 0.92rem;
  }

  .vh-list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .vh-bill-card {
    padding: 18px 18px 18px 16px;
  }

  .vh-bill-card h3 {
    font-size: 1.05rem;
  }
}
