/*
 * Misc chrome — age gate / search / 404 (agent: gate).
 *
 * New file rather than pages.css: pages.css only loads on page templates,
 * while the age gate ships in footer.php on EVERY page — so these styles are
 * enqueued globally from functions.php ('usr-misc', after style.css).
 *
 * Gate visuals 1:1 from /tmp/usr-figma/renders/age-gate.png:
 *   backdrop rgba(19,38,107,.97) · cream card ~440px r16 · centered logo →
 *   navy H3 "Research Confirmation" → RUO paragraph (lead bold) → red pill
 *   CTA → small underlined "Exit". v2 fields follow the same rhythm.
 * Search + 404 have no renders — tokens + components from style.css and the
 * archive system (assets/css/archive.css).
 */

/* =========================================================================
   AGE GATE (marked section — agent: gate)
   ========================================================================= */

.usr-age-gate {
  position: fixed;
  inset: 0;
  z-index: calc(var(--usr-z-drawer, 200) + 100); /* above header + drawers */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(19, 38, 107, 0.97); /* sampled from the render backdrop */
}

.usr-age-gate[hidden] { display: none !important; } /* display:flex would beat [hidden] */

/* Card — render: cream #FDF8F0, r16, ~440px, centered content. */
.usr-age-gate__card {
  width: min(440px, 100%); /* render: card ≈440px at 1440 */
  margin: auto; /* keeps the card centered even when it overflows viewport */
  padding: 36px 34px 26px;
  background: var(--usr-cream, #FDF8F0);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(6, 12, 38, 0.45);
  text-align: center;
}

.usr-age-gate__card:focus { outline: none; }

.usr-age-gate__logo img {
  display: inline-block;
  height: 36px; /* render: logo ≈36px tall */
  width: auto;
}

/* Title — render: navy medium H3, ls −1.5%. */
.usr-age-gate__title {
  margin: 18px 0 12px;
  color: var(--usr-navy, #13266B);
  font-size: var(--usr-fs-h3, 24px);
  line-height: var(--usr-lh-h3, 27px);
  font-weight: 500;
  letter-spacing: var(--usr-ls-heading, -0.015em);
}

/* Body — render: small centered secondary text, lead sentence bold. */
.usr-age-gate__desc {
  margin: 0 0 20px;
  color: var(--usr-secondary, #4A4A4A);
  font-size: var(--usr-fs-small, 13.8px);
  line-height: var(--usr-lh-small, 21.3px);
}

.usr-age-gate__desc strong { color: var(--usr-ink, #191919); }

/* First-order offer panel — tint-blue, left-aligned (v2 spec). */
.usr-age-gate__offer {
  margin: 0 0 14px;
  padding: 14px 16px 12px;
  background: var(--usr-tint-blue, #F1F5FF);
  border-radius: 10px;
  text-align: left;
}

.usr-age-gate__offer-label { display: block; color: var(--usr-navy, #13266B); }

.usr-age-gate__offer-title {
  margin: 2px 0 10px;
  color: var(--usr-ink, #191919);
  font-size: 15.5px;
  line-height: 20px;
  font-weight: 700;
}

.usr-age-gate__offer-note {
  margin: 6px 0 0;
  color: var(--usr-muted, #666666);
  font-size: 12px;
  line-height: 17px;
}

/* Field-of-research select. */
.usr-age-gate__field { margin: 0 0 16px; text-align: left; }

.usr-age-gate__field-label {
  display: block;
  margin: 0 0 5px;
  color: var(--usr-ink, #191919);
  font-size: 12.8px;
  line-height: 19.8px;
  font-weight: 700;
}

.usr-age-gate__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2313266B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  padding-right: 34px;
  cursor: pointer;
}

/* Required + remember checkboxes. */
.usr-age-gate__check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  color: var(--usr-ink, #191919);
  font-size: var(--usr-fs-small, 13.8px);
  line-height: 19.5px;
  text-align: left;
  cursor: pointer;
}

.usr-age-gate__check input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--usr-navy, #13266B);
}

.usr-age-gate__check input[aria-invalid="true"] { outline: 2px solid var(--usr-red, #B5172F); outline-offset: 1px; }

.usr-age-gate__check a { color: var(--usr-link-blue, #264BD0); }

.usr-age-gate__check--remember { color: var(--usr-secondary, #4A4A4A); }

/* Validation messages — spec copy, red + ⚠ like the shared form states. */
.usr-age-gate__errors { text-align: left; }

.usr-age-gate__error {
  margin: 0 0 8px;
  color: var(--usr-red, #B5172F);
  font-size: var(--usr-fs-small, 13.8px);
  line-height: var(--usr-lh-small, 21.3px);
}

.usr-age-gate__error::before {
  content: "\26A0"; /* ⚠ */
  display: inline-block;
  margin-right: 6px;
  font-weight: 700;
}

/* Primary CTA — render: full-width red stadium button. */
.usr-age-gate__confirm {
  width: 100%;
  margin-top: 6px;
  padding-top: 15px;
  padding-bottom: 15px;
}

/* "Already confirmed? Sign in". */
.usr-age-gate__signin {
  margin: 16px 0 10px;
  color: var(--usr-secondary, #4A4A4A);
  font-size: 13px;
  line-height: 19px;
}

.usr-age-gate__signin a { color: var(--usr-link-blue, #264BD0); font-weight: 700; }

/* Exit — render: small muted underlined link. */
.usr-age-gate__exit {
  display: inline-block;
  color: var(--usr-muted, #666666);
  font-size: 12.5px;
  line-height: 19px;
  text-decoration: underline;
}

.usr-age-gate__exit:hover,
.usr-age-gate__exit:focus { color: var(--usr-navy, #13266B); }

@media (max-width: 480px) {
  .usr-age-gate { padding: 14px; }
  .usr-age-gate__card { padding: 28px 22px 22px; }
}

/* =========================================================================
   SEARCH RESULTS (marked section — agent: gate)
   Extends the archive system (.usr-archive / .usr-archive-grid).
   ========================================================================= */

/* Retry / refine form under the H1. */
.usr-search-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 0 22px;
}

.usr-search-form .usr-input { flex: 1; }

/* Section headings between the product grid and the link list. */
.usr-search__section {
  margin: 0 0 16px;
  color: var(--usr-navy, #13266B);
  font-size: var(--usr-fs-h4, 19.5px);
  line-height: var(--usr-lh-h4, 24px);
  font-weight: 500;
  letter-spacing: var(--usr-ls-heading, -0.015em);
}

.usr-archive-grid + .usr-search__section { margin-top: 40px; }

/* Non-product results — simple links with a muted type tag. */
.usr-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.usr-search-list__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(19, 38, 107, 0.08);
}

.usr-search-list__item:first-child { border-top: 1px solid rgba(19, 38, 107, 0.08); }

.usr-search-list__link {
  color: var(--usr-link-blue, #264BD0);
  font-size: var(--usr-fs-body-l, 16px);
  line-height: 22px;
  font-weight: 500;
  text-decoration: none;
}

.usr-search-list__link:hover,
.usr-search-list__link:focus { text-decoration: underline; }

.usr-search-list__type {
  color: var(--usr-muted, #666666);
  font-size: 11.5px;
  line-height: 17px;
  font-weight: 700;
  letter-spacing: var(--usr-ls-label, 0.008em);
  text-transform: uppercase;
}

.usr-search-list + .usr-archive-pagination { margin-top: 32px; }

/* Empty state — collection suggestion chips inside .usr-archive-empty. */
.usr-search-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  max-width: 640px;
  margin: 22px auto 0;
  padding: 0;
}

.usr-search-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid rgba(19, 38, 107, 0.2);
  border-radius: var(--usr-radius-pill, 999px);
  background: var(--usr-white, #FFFFFF);
  color: var(--usr-navy, #13266B);
  font-size: 13.5px;
  line-height: 18px;
  font-weight: 700;
  text-decoration: none;
}

.usr-search-chip:hover,
.usr-search-chip:focus {
  background: var(--usr-tint-blue, #F1F5FF);
  border-color: var(--usr-navy, #13266B);
  text-decoration: none;
}

@media (max-width: 560px) {
  .usr-search-form { flex-direction: column; }
}

/* =========================================================================
   404 (marked section — agent: gate)
   ========================================================================= */

.usr-404 {
  padding: 90px 0 110px;
  text-align: center;
}

/* Navy display "404". */
.usr-404__code {
  margin: 0;
  color: var(--usr-navy, #13266B);
  font-size: 110px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: var(--usr-ls-heading, -0.015em);
}

.usr-404__title {
  margin: 18px 0 10px;
  color: var(--usr-navy, #13266B);
  font-size: var(--usr-fs-h2, 35.2px);
  line-height: var(--usr-lh-h2, 38px);
  font-weight: 500;
  letter-spacing: var(--usr-ls-heading, -0.015em);
}

.usr-404__text {
  margin: 0 auto;
  max-width: 480px;
  color: var(--usr-secondary, #4A4A4A);
  font-size: var(--usr-fs-body-l, 16px);
  line-height: var(--usr-lh-body-l, 24.8px);
}

.usr-404__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

/* Quiet RUO note. */
.usr-404__ruo {
  margin: 56px 0 0;
  color: var(--usr-muted, #666666);
  font-size: 12.5px;
  line-height: 19px;
}

@media (max-width: 560px) {
  .usr-404 { padding: 60px 0 80px; }
  .usr-404__code { font-size: 76px; }
  .usr-404__title { font-size: 27px; line-height: 32px; }
}

/* =========================================================================
   POLISH PASS (appended — agent: polish)
   Interaction smoothing for the search chips + age-gate links. Rules only
   fire on hover/focus/active.
   ========================================================================= */

.usr-search-chip,
.usr-age-gate__exit,
.usr-coa-search .usr-input {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.usr-search-chip:active { background: var(--usr-tint-blue, #F1F5FF); }

@media (prefers-reduced-motion: reduce) {
  .usr-search-chip,
  .usr-age-gate__exit,
  .usr-coa-search .usr-input { transition: none; }
}
