/* ==================================================================
   capability-equity/resources.html — resource cards + email dialog
   Prefixed .res- so nothing here leaks into other pages.
   ================================================================== */

/* ---------- Resource cards ---------- */
/* The whole card is the click target: the trigger button's ::after stretches
   over the card (.card is already position: relative), so the heading and copy
   stay real headings/paragraphs instead of living inside a <button>. */
.res-card { display: flex; flex-direction: column; cursor: pointer; }
.res-card > p { flex: 1; }

.res-trigger {
  align-self: flex-start;
  margin-top: 1.25rem;
  padding: 0;
  background: none; border: 0;
  font: inherit; font-weight: 600;
  color: var(--c-page);
  cursor: pointer;
}
.res-trigger::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.res-card:hover .res-trigger { text-decoration: underline; text-underline-offset: 3px; }
.res-trigger:focus-visible { outline: none; }
.res-card:has(.res-trigger:focus-visible) {
  outline: 2px solid var(--c-page);
  outline-offset: 3px;
}

/* ---------- Dialog ---------- */
.res-dialog {
  --res-error: #ffa8a8;
  width: min(440px, calc(100% - 2rem));
  margin: auto;
  padding: 2rem 1.75rem 1.75rem;
  background: var(--c-bg-alt);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-e3);
}
.res-dialog::backdrop { background: rgba(0, 7, 14, .78); backdrop-filter: blur(4px); }
.res-dialog[open] { animation: res-in .22s ease-out; }
@keyframes res-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .res-dialog[open] { animation: none; }
}
html:has(.res-dialog[open]) { overflow: hidden; }

.res-close {
  position: absolute; top: .6rem; right: .6rem;
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 999px;
  font-size: 1.6rem; line-height: 1;
  color: var(--c-muted);
  cursor: pointer;
}
.res-close:hover { color: var(--c-text); background: color-mix(in srgb, var(--c-page) 10%, transparent); }
.res-close:focus-visible { outline: 2px solid var(--c-page); outline-offset: 2px; }

.res-title { font-size: 1.4rem; font-weight: 700; line-height: 1.2; margin: 0 2rem .6rem 0; }
.res-dialog .res-title:focus,
.res-dialog .res-title:focus-visible { outline: none; }
.res-copy { color: var(--c-muted); margin-bottom: 1.25rem; }
.res-copy strong { color: var(--c-text); font-weight: 600; overflow-wrap: anywhere; }

.res-label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; }
.res-input {
  width: 100%;
  padding: .75rem .9rem;
  font: inherit;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}
.res-input::placeholder { color: color-mix(in srgb, var(--c-muted) 75%, transparent); }
.res-input:focus { outline: 2px solid var(--c-page); outline-offset: 1px; border-color: var(--c-page); }
.res-input[aria-invalid="true"] { border-color: var(--res-error); }

.res-error { min-height: 1.4em; margin: .4rem 0 .9rem; font-size: .88rem; color: var(--res-error); }
.res-submit { width: 100%; justify-content: center; }
.res-submit[disabled] { opacity: .7; cursor: progress; transform: none; }

.res-demo {
  margin-bottom: 1.25rem;
  padding: .6rem .8rem;
  font-size: .85rem;
  color: var(--c-muted);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm);
}
