/* #6292 — chrome contract stylesheet.
 *
 * The live app bakes the header/nav drawer/footer markup and styles it with
 * app CSS. chrome.js (which used to swap the theme's rail.css in after load)
 * was removed in #3816 because it caused a repaint flash, so any component the
 * WordPress theme adds to the chrome (/chrome) had no rule here and rendered
 * with UA defaults — the "Find" entry in the nav drawer was 299x15 px on an
 * iPhone and failed the 44 px touch-target gate.
 *
 * These rules are ported verbatim (scoped to chrome selectors only) from the
 * theme's rail.css, so the app and the theme agree. Every class the theme
 * ships in topnav_html/navsheet_html/pagefoot_html must be covered here or in
 * styles.css; scripts/check_chrome_classes.py enforces that contract.
 *
 * Do not add app-wide or element selectors to this file.
 */

/* ---- nav drawer -------------------------------------------------------- */
.navsheet__find {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 12px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-display, inherit);
  font-weight: 600;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.navsheet__find:hover,
.navsheet__find:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.navsheet__find:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---- top nav ----------------------------------------------------------- */
.nav-cmd__label { font-weight: 600; margin-left: 2px; }

.nav-drop__menu--wide { min-width: 320px; flex-wrap: wrap; }
.nav-drop__menu--wide a { width: 50%; }

.modal__x {
  width: 36px;
  height: 36px;
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  flex: none;
  cursor: pointer;
}
.modal__x:hover { color: var(--fg); border-color: var(--border-strong); }
.modal__x:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- preferences popover ----------------------------------------------- */
.pref { position: relative; }
.pref__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.pref__btn:hover { color: var(--fg); border-color: var(--border-strong); background: var(--fg-soft); }
.pref__btn > svg { width: 15px; height: 15px; }
.pref__pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(470px, 90vw);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(-7px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.pref__pop.is-open { opacity: 1; transform: none; pointer-events: auto; }
.pref__col { min-width: 0; }
.pref__k {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.pref__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}
.pref__opt:hover { background: var(--fg-soft); color: var(--fg); }
.pref__opt.is-active {
  background: var(--accent-soft);
  border-color: var(--border-strong);
  color: var(--fg);
  font-weight: 600;
}
.pref__opt .el-code { flex: none; }
.pref__static { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 9px; border-radius: 9px; color: var(--fg); font-size: 13px; }
@media (max-width: 719px) {
  .pref__pop { grid-template-columns: 1fr 1fr; right: -8px; }
}

/* ---- footer ------------------------------------------------------------ */
.pagefoot__logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.pagefoot__logo-mark { width: 36px; height: 36px; border-radius: 26%; display: block; flex: 0 0 auto; }
.pagefoot__logo--dark { color: var(--fg); }
.pagefoot__logo--light { color: var(--fg); }

.pagefoot__brand-links { margin-top: 14px; }
.pagefoot__note { line-height: 1.5; font-size: 12px; color: var(--muted); max-width: 24ch; }

.pagefoot__follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding-block: 22px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
}
.pagefoot__follow-head {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pagefoot__legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-top: var(--gap-md);
  padding-top: var(--gap-sm);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.pagefoot__legal-label { font-weight: 600; color: var(--fg); }
.pagefoot__legal a { color: var(--muted); text-decoration: none; }
.pagefoot__legal a:hover { color: var(--fg); }

.pagefoot__utility { display: flex; align-items: center; flex-wrap: wrap; gap: var(--gap-md); }
.pagefoot__utility .pref__btn { min-height: 40px; }
.pagefoot__report { display: inline-flex; align-items: center; }

.loporail-report-link { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.loporail-report-link:hover { color: var(--accent); }

/* ---- social links ------------------------------------------------------ */
.loporail-social-links { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; margin: 0; padding: 0; }
.loporail-social-links-item a { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); text-decoration: none; font-size: 14px; }
.loporail-social-links-item a:hover { color: var(--accent); }
.loporail-social-links-item .handle { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.loporail-social-links-item { display: inline-flex; align-items: center; }
.loporail-social-links-item-facebook,
.loporail-social-links-item-instagram,
.loporail-social-links-item-lemmy,
.loporail-social-links-item-mastodon,
.loporail-social-links-item-pixelfed,
.loporail-social-links-item-telegram,
.loporail-social-links-item-tiktok,
.loporail-social-links-item-tumblr,
.loporail-social-links-item-x { display: inline-flex; align-items: center; }

/* ---- store badges ------------------------------------------------------ */
.store-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.store-badges__label { font-size: 12px; color: var(--muted); }
.store-badge-link { display: inline-flex; align-items: center; text-decoration: none; }
.store-badge { height: 40px; width: auto; aspect-ratio: 4 / 1; object-fit: contain; display: inline-block; border-radius: 4px; background: transparent; }

/* ---- touch targets (mobile gate) --------------------------------------- */
@media (max-width: 960px) {
  .pagefoot a { display: inline-flex; align-items: center; min-height: 24px; }
  .pagefoot .loporail-report-link { min-height: 44px; }
  .nav-cmd { min-height: 44px; }
}
