/* ==========================================================================
   Topic alerts: the "Follow" button and its small form (hub pages, beside
   the tags of publications, explainers and dispatches), the alerts section of
   the newsletter preferences page, and a few admin bits. Uses the tokens from
   site.css (public) and admin.css (admin). No JavaScript: <details> opens the form.
   ========================================================================== */

.fa-follow { margin: var(--s-3, 1.5rem) 0 0; max-width: 34rem; }
.fa-follow-item { margin: var(--s-3, 1.5rem) 0; }
.fa-follow-btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  min-height: 40px; padding: 0.5em 1em;
  font: 600 0.9rem var(--font); color: var(--accent-dark);
  background: var(--paper); border: 1px solid var(--accent-soft); border-radius: 999px;
  cursor: pointer; list-style: none; user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fa-follow-btn::-webkit-details-marker { display: none; }
.fa-follow-btn::marker { content: ""; }
.fa-follow-btn:hover { border-color: var(--accent); background: #F7F3FB; }
.fa-follow-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fa-follow-btn svg { flex-shrink: 0; color: var(--accent); }
.fa-follow[open] .fa-follow-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.fa-follow[open] .fa-follow-btn svg { color: #fff; }

.fa-form {
  margin-top: 0.75rem; padding: 1rem 1.1rem 0.9rem;
  background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius);
  box-shadow: 0 18px 36px -30px rgba(42, 27, 69, 0.55);
}
.fa-lead { margin: 0 0 0.8rem; font-size: 0.95rem; color: var(--text); }
.fa-lead strong { color: var(--ink); }
.fa-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; align-items: end; }
.fa-field label, .fa-topics legend, .fa-freq legend {
  display: block; margin-bottom: 0.4em; padding: 0;
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.fa-field input {
  width: 100%; min-height: 44px; padding: 0.6em 0.8em;
  font: 1rem var(--font); color: var(--text);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.fa-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.fa-submit {
  min-height: 44px; padding: 0.6em 1.4em;
  font: 600 0.95rem var(--font); color: #fff;
  background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius); cursor: pointer;
}
.fa-submit:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.fa-submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.fa-topics, .fa-freq { margin: 0 0 0.8rem; padding: 0; border: 0; min-width: 0; }
.fa-freq { margin: 0.85rem 0 0; }
.fa-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fa-chip { position: relative; display: inline-flex; cursor: pointer; }
.fa-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.fa-chip span { padding: 0.32em 0.8em; font-size: 0.84rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--paper); }
.fa-chip input:checked + span { background: #EFEAF5; border-color: var(--accent); color: var(--accent-dark); }
.fa-chip input:checked + span::before { content: "✓ "; }
.fa-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.fa-radio { display: flex; align-items: flex-start; gap: 0.55em; padding: 0.2em 0; font-size: 0.9rem; cursor: pointer; }
.fa-radio input { width: 1.05em; height: 1.05em; margin: 0.2em 0 0; accent-color: var(--accent); flex-shrink: 0; }
.fa-radio strong { font-weight: 600; color: var(--ink); }
.fa-hint { color: var(--muted); }
.fa-fine { margin: 0.8rem 0 0; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }
.fa-fine a { color: var(--accent-dark); text-decoration: underline; }

/* Manage page (inside the newsletter's preferences layout). */
.fa-manage { padding: var(--s-3, 1.5rem); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: calc(var(--header-h, 80px) + 1rem); }
.fa-manage .nl-section-title { margin-bottom: 0.4rem; }
.fa-manage-lede { margin: 0 0 1rem; font-size: 0.95rem; color: var(--muted); }
.fa-manage .nl-topics { margin-top: 0.9rem; }
.fa-manage .nl-topics legend { color: var(--muted); }
.fa-manage .nl-status-actions { justify-content: flex-start; }
.fa-saved { margin: 0 0 0.8rem; padding: 0.55rem 0.8rem; font-size: 0.92rem; color: #2F6B47; background: #EAF4EE; border-radius: var(--radius); }
.fa-pending { margin: 0.8rem 0 0; font-size: 0.88rem; color: #7840BF; }
.fa-privacy { margin: 1.1rem 0 0; padding-top: 0.9rem; border-top: 1px solid var(--line); font-size: 0.82rem; line-height: 1.55; color: var(--muted); }

@media (max-width: 520px) {
  .fa-row { grid-template-columns: 1fr; }
  .fa-submit { width: 100%; }
}

/* Admin page. */
.fa-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; border-left: 4px solid var(--line-strong, #ccc); }
.fa-switch.is-on { border-left-color: var(--success, #2F6B47); }
.fa-switch-text { flex: 1 1 26rem; }
.fa-switch-text p { margin: 4px 0 0; }
.fa-tiles { margin: 18px 0 22px; }
.fa-side { display: grid; gap: 22px; }
.fa-table td.num, .fa-table th.num, .nla-table td.num, .nla-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fa-sub { margin: 22px 0 8px; font-size: 0.95rem; }
@media (max-width: 900px) {
  .fa-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.fa-two > * { min-width: 0; }
.fa-two .table-wrap, .fa-runs .table-wrap { overflow-x: auto; }
@media (max-width: 700px) {
  .fa-two { grid-template-columns: minmax(0, 1fr); }
}

/* In a banner hero (topics, regions, Pakistan hub) the hero's pale label colour must not reach the white form. */
.fa-follow .fa-form label { color: var(--text); }
.fa-follow .fa-form .fa-field label { color: var(--muted); }
