/* feed.reason.direct overrides. Served from /assets/user.css (theme.custom-css-file). */

/* --- Accessibility (WCAG 2.2 AA, checked with axe-core) ------------------ */

/* Glance's dim text is lightness = contrast-multiplier x 35%, about 3:1 on
   these backgrounds. Raise the factor per theme to reach 4.5:1 while keeping
   it below base text (58%). Glance's own formula, so light themes still work:
   default 48% -> 4.8:1, teal-city 56% -> 4.8:1, paper 54% -> 4.8:1. */
:root {
  --color-text-subdue: hsl(var(--ths), calc(var(--scheme) var(--cm) * 48%));
}
:root[data-theme="teal-city"] {
  --color-text-subdue: hsl(var(--ths), calc(var(--scheme) var(--cm) * 56%));
}
:root[data-theme="paper"] {
  --color-text-subdue: hsl(var(--ths), calc(var(--scheme) var(--cm) * 54%));
}
:root[data-theme="reason"] {
  --color-text-subdue: hsl(var(--ths), calc(var(--scheme) var(--cm) * 48%));
}

/* Keep keyboard focus visible everywhere (reason.direct convention). */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Targets at least 24px tall: the source/site link under each headline and
   bookmark links. */
.list-horizontal-text a,
.bookmarks-link {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
}
/* Headline links: each wrapped line counts as its own target. */
a.title.size-title-dynamic {
  line-height: 24px;
}
/* Hacker News and Lobsters titles are bare inline links; a one-line title
   would be only 18px tall. */
.widget-type-hacker-news a.size-title-dynamic,
.widget-type-lobsters a.size-title-dynamic {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
}
.list-horizontal-text a.block {
  display: block;
}

/* Links inside running text are underlined, not told apart by color alone. */
.about p a,
.about li a,
.footer p a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --- About page text (html widget) --------------------------------------- */
.about-title {
  font-size: var(--font-size-h3);
  color: var(--color-text-highlight);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1em;
}
.about p,
.about li {
  line-height: 1.6;
  margin-bottom: 0.6em;
}
.about h3 {
  margin: 1.4em 0 0.5em;
  color: var(--color-text-highlight);
  font-size: var(--font-size-h4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.about ul {
  list-style: square;
  padding-left: 1.2em;
}
.about code {
  font-size: 0.95em;
}

/* --- Footer: one quiet line, wraps on phones ----------------------------- */
.footer p {
  text-align: center;
  line-height: 1.6;
}

/* About: source list links, 24px targets. */
.sources-list a {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
}

/* --- Header wordmark: reason.direct's nav brand ---------------------------
   Same face, case, tracking and glow as the header on www.reason.direct.
   Share Tech Mono (SIL OFL 1.1), latin subset, served from here because the
   CSP allows fonts from this host only. brand.js makes it a link. */
@font-face {
  font-family: "Share Tech Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/share-tech-mono-latin.woff2") format("woff2");
}
:root {
  --rd-brand: #ff00ff;
  --rd-brand-hover: #00ffff;
  --rd-brand-glow: 0 0 20px rgba(255, 0, 255, 0.3);
  --rd-brand-glow-hover: 0 0 20px rgba(0, 255, 255, 0.25);
}
/* Light theme: the neon colors fail contrast on paper, so darker, no glow. */
:root[data-theme="paper"] {
  --rd-brand: #990099;
  --rd-brand-hover: #006b6b;
  --rd-brand-glow: none;
  --rd-brand-glow-hover: none;
}
.header .logo {
  display: flex;
  align-items: center;
  font-family: "Share Tech Mono", ui-monospace, monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rd-brand);
  text-shadow: var(--rd-brand-glow);
}
.rd-brand {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: inherit;
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}
.rd-brand:hover {
  color: var(--rd-brand-hover);
  text-shadow: var(--rd-brand-glow-hover);
}

/* --- "reason" theme: the rest of reason.direct's look --------------------
   Its font everywhere, cyan on hover like the main site's links. */
:root[data-theme="reason"] body {
  font-family: "Share Tech Mono", ui-monospace, monospace;
}
:root[data-theme="reason"] a:hover {
  color: #00ffff;
}
/* Glance draws the show-more arrow with an icon-font glyph that doesn't
   render under this font; draw it as a CSS chevron instead. */
:root[data-theme="reason"] .expand-toggle-button-icon::before {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
:root[data-theme="reason"] .expand-toggle-button.container-expanded .expand-toggle-button-icon::before {
  transform: rotate(-135deg);
}

/* --- Live now: a small red tag before each stream title ------------------ */
.live-badge {
  display: inline-block;
  padding: 0 0.45em;
  margin-right: 0.3em;
  border-radius: 3px;
  background: #c80000; /* white on this is 6:1 in every theme */
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.6;
  text-transform: uppercase;
  vertical-align: 0.1em;
}
a.live-link {
  display: inline-block;
  line-height: 24px;
}

/* --- US economy (FRED) ---------------------------------------------------- */
.fred-list a {
  display: inline-block;
  min-height: 24px;
  line-height: 24px;
}

/* --- Weather page ----------------------------------------------------------- */
.wx-map {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
.wx-table-wrap {
  overflow-x: auto;
}
.wx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-h5);
}
.wx-table th,
.wx-table td {
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-separator);
}
.wx-table thead th {
  color: var(--color-text-subdue);
  font-size: var(--font-size-h6);
  font-weight: normal;
  text-transform: uppercase;
}
.wx-table tbody th {
  color: var(--color-text-highlight);
  font-weight: normal;
}
.wx-spark {
  display: block;
}
.aqi-dot {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-right: 0.4em;
  border-radius: 50%;
  vertical-align: 0.05em;
}
.aqi-good { background: #00e400; }
.aqi-moderate { background: #ffff00; }
.aqi-usg { background: #ff7e00; }
.aqi-unhealthy { background: #ff0000; }
.aqi-very { background: #8f3f97; }
.aqi-hazardous { background: #7e0023; }
.fred-spark {
  display: block;
}
