/* Government Ideas (gov-ideas.html).
 *
 * This file holds only what that page adds. The forms, the fields, the buttons
 * and the cards all come from css/my-contrib.css and css/business-plan.css,
 * which is where every account page on this site gets them, so this page reads
 * like the others rather than like a page of its own.
 *
 * Three things are genuinely new here: a row of filters above a list, a tick
 * box sitting in a row of fields, and the pager under the list.
 */

/* A row of filters. Same flex shape as .contrib-form, so a filter box lines up
 * with a field box on every other account page. */
.gov-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}
.gov-filters .field { flex: 1 1 180px; }

/* A tick box is a few pixels tall, so a row holding one is centred against the
 * row rather than lined up along the bottom the way a text box is. The label
 * carries the box so the words are part of the target: a 44-pixel-tall row is
 * what a thumb can actually hit.
 */
.field-tick { justify-content: center; }
.field-tick label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-weight: 400;
  margin-bottom: 0;
  cursor: pointer;
}
.field-tick input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
  margin: 0;
}

/* One category, connection or idea. */
.gov-item {
  border: 1px solid var(--border-dark, #94a3b8);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--white);
}
.gov-item h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.gov-item p { margin: 0 0 0.4rem; }
.gov-item p:last-of-type { margin-bottom: 0; }

/* The line saying who can see it, who wrote it, which department and which
 * subject. Small, because it is read after the title rather than before it.
 */
.gov-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Picking the people who can see one idea. */
.gov-pick fieldset {
  border: 1px solid var(--border-dark, #94a3b8);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin: 0.6rem 0 0;
}
.gov-pick legend { font-size: 0.8rem; font-weight: 700; padding: 0 0.35rem; }
.gov-pick label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.gov-pick input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; }

.gov-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.gov-pager .btn { height: 2.5rem; }
.gov-pager span { font-size: 0.85rem; color: var(--text-muted); }

/* The keyboard has to show where it is, on every control on the page. Written
 * here as well as in the shared stylesheets because a control added to this
 * page later must not be the one that loses it.
 */
.gov-item .btn:focus-visible,
.gov-pager .btn:focus-visible,
.gov-filters select:focus-visible,
.gov-filters input:focus-visible,
.field-tick input:focus-visible,
.gov-pick input:focus-visible {
  outline: 3px solid var(--accent, #0284c7);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .gov-item,
  .gov-pick fieldset {
    background: var(--card-dark, #1e293b);
  }
}

/* The check beside one idea on a problem. A reader spends a small, fixed
   number of these on each problem, so the row is deliberately plain and
   obvious rather than a styled control somebody has to learn: a real
   checkbox, its own words beside it, and the whole row clickable because the
   label wraps both.

   The row is at least 44 pixels tall so a thumb can hit it, which is the
   touch-target size every page here is checked against. */
.problem-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  margin: 0.6rem 0 0;
  cursor: pointer;
  font-weight: 600;
}
.problem-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-blue);
}
/* A reader who has spent every check still sees the boxes, so they can see
   what they chose. Only the empty ones stop responding, and the row says why
   when the pointer rests on it. */
.problem-check input[type="checkbox"]:disabled {
  cursor: not-allowed;
}
.problem-check input[type="checkbox"]:disabled + span {
  opacity: 0.65;
  cursor: not-allowed;
}
.problem-check input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--accent-blue);
  outline-offset: 2px;
}

/* "Use that", beside what the published .gov register says about this
   account's own email address. A real button, because it really does
   something, drawn as part of the sentence it sits in because that is where
   it belongs -- the alternative is a full-width button for a one-word action.

   It is still 44 pixels tall to the touch, which is what a thumb needs, done
   with padding rather than a height so the sentence around it does not open
   up a gap. */
.link-button {
  display: inline;
  padding: 0.6rem 0;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--accent-blue);
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--accent-blue-hover); }
.link-button:focus-visible { outline: 3px solid var(--accent-blue); outline-offset: 2px; }

/* The notice saying this is not a government website.
   It sits directly under the page's own title on every page about government
   work, because a reader who takes this for an official site needs telling
   before they read anything else, not in the small print at the foot. */
.gov-not-official {
  border-left: 4px solid var(--accent-blue);
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0 1.1rem;
  background: var(--white);
}
