/* Theme + text-size overrides, loaded on every page.
 *
 * The compiled Tailwind utilities (output.min.css) hardcode the dark
 * palette as fixed rgb values — there's no tailwind.config.js in this repo
 * to rebuild from, so light mode is layered on top here instead, keyed off
 * `data-theme="light"` on <html>. Loaded AFTER output.min.css in _head.html
 * so these rules win on equal specificity; selectors are deliberately kept
 * at the same specificity as the ones they override (attribute + class
 * beats a bare class already) so nothing needs !important.
 *
 * `.text-ink` is intentionally NOT touched here — it's used as the
 * high-contrast label color on filled amber/teal buttons (bg-signal,
 * bg-teal), and needs to stay dark in both themes for those buttons to
 * stay readable.
 */

/* Text-size preference (the A/A/A control) is applied as an inline
 * font-size on <html> by _head.html / _footer.html's scripts directly —
 * that always wins the cascade regardless of stylesheet load order or
 * caching, which a plain CSS rule here turned out not to reliably do.
 * This file only styles the toggle buttons themselves below. */

:root[data-theme="light"] body {
  background-color: #F7F7F5;
}

:root[data-theme="light"] .bg-ink {
  background-color: #F7F7F5;
}

:root[data-theme="light"] .bg-ink\/95 {
  background-color: rgba(247, 247, 245, .92);
}

:root[data-theme="light"] .bg-ink\/30 {
  background-color: rgba(226, 229, 233, .5);
}

:root[data-theme="light"] .bg-panel {
  background-color: #FFFFFF;
}

:root[data-theme="light"] .text-fg {
  color: #0E1116;
}

:root[data-theme="light"] .text-dim {
  color: #454E5C;
}

:root[data-theme="light"] .text-dim\/60 {
  color: rgba(69, 78, 92, .65);
}

:root[data-theme="light"] .text-dim\/70 {
  color: rgba(69, 78, 92, .75);
}

:root[data-theme="light"] .placeholder-dim::placeholder {
  color: #767F8C;
}

:root[data-theme="light"] .border-line {
  border-color: #E3E5E9;
}

:root[data-theme="light"] .divide-line\/40 > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(227, 229, 233, .8);
}

:root[data-theme="light"] .divide-line\/60 > :not([hidden]) ~ :not([hidden]) {
  border-color: rgba(227, 229, 233, .9);
}

:root[data-theme="light"] .bg-line {
  background-color: #E3E5E9;
}

:root[data-theme="light"] .bg-line\/60:hover,
:root[data-theme="light"] .hover\:bg-line\/60:hover {
  background-color: rgba(227, 229, 233, .6);
}

:root[data-theme="light"] .text-signal {
  color: #96530A;
}

:root[data-theme="light"] .text-teal {
  color: #15766F;
}

:root[data-theme="light"] ::selection {
  background: #FFB454;
  color: #15181F;
}

/* Theme toggle button itself */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(38 43 54 / 1);
  color: rgb(138 147 163 / 1);
  flex-shrink: 0;
}

:root[data-theme="light"] .theme-toggle {
  border-color: #E3E5E9;
  color: #5B6472;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* Font-size toggle (− / A / +) — all three buttons the same fixed-size
 * click target, regardless of how big their glyph is. */
.fontsize-toggle {
  display: inline-flex;
  align-items: stretch;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(38 43 54 / 1);
  overflow: hidden;
  flex-shrink: 0;
}

:root[data-theme="light"] .fontsize-toggle {
  border-color: #E3E5E9;
}

.fontsize-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1;
  width: 1.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(138 147 163 / 1);
  background: transparent;
  border: 0;
  border-left: 1px solid rgb(38 43 54 / 1);
  cursor: pointer;
}

.fontsize-btn:first-child {
  border-left: 0;
}

:root[data-theme="light"] .fontsize-btn {
  color: #454E5C;
  border-left-color: #E3E5E9;
}

:root[data-fontsize="sm"] .fontsize-btn[data-size="sm"],
:root[data-fontsize="md"] .fontsize-btn[data-size="md"],
:root[data-fontsize="lg"] .fontsize-btn[data-size="lg"] {
  background: #FFB454;
  color: #10131A;
}

/* Sort toggle (Newest / Signal) — same joined-segment look as the other
 * toggles, instead of two separate pills that read like independent
 * filters when they're really one either/or choice. */
.sort-toggle {
  display: inline-flex;
  border-radius: 0.375rem;
  border: 1px solid rgb(38 43 54 / 1);
  overflow: hidden;
}

:root[data-theme="light"] .sort-toggle {
  border-color: #E3E5E9;
}

.sort-toggle a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem;
  border-left: 1px solid rgb(38 43 54 / 1);
}

:root[data-theme="light"] .sort-toggle a {
  border-left-color: #E3E5E9;
}

.sort-toggle a:first-child {
  border-left: 0;
}
