/* Layout and dark-mode theming layered on top of pure.css (v1.0.0).
   Colors follow the visitor's OS setting via prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --fg: #333333;
  --muted: #777777;
  --subtle: #cccccc;
  --border: #dddddd;
  --input-bg: #fafafa;
  --link: #1f8dd6;
  --button-bg: #e6e6e6;
  --button-fg: #444444;
  --button-hover: #d9d9d9;
  --primary-bg: #0078e7;
  --primary-fg: #ffffff;
  --primary-hover: #0069cc;
  --header-border: #eeeeee;
  --error: #c0392b;
  --shadow: rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181b;
    --fg: #e8e8e8;
    --muted: #a9a9b0;
    --subtle: #6a6a72;
    --border: #3a3a41;
    --input-bg: #232328;
    --link: #6cb6ff;
    --button-bg: #33333b;
    --button-fg: #e8e8e8;
    --button-hover: #3f3f49;
    --primary-bg: #2f6fb5;
    --primary-fg: #ffffff;
    --primary-hover: #3a7dc4;
    --header-border: #2c2c31;
    --error: #ff7b6b;
    --shadow: rgba(0, 0, 0, 0.4);
  }
}

html,
body {
  background-color: var(--bg);
  color: var(--fg);
}

a {
  color: var(--link);
}

.header {
  margin: 0;
  text-align: center;
  padding: 2.5em 1em 1.2em;
  border-bottom: 1px solid var(--header-border);
}

.header h1 {
  margin: 0.2em 0;
  font-size: 2.5em;
  font-weight: 300;
  color: var(--fg);
}

.header h2 {
  margin: 0;
  font-size: 1.1em;
  font-weight: 300;
  color: var(--subtle);
}

/* Hide translated nodes until i18n has run, so the wrong language never
   flashes on screen. JS removes .i18n-pending; <noscript> opts out. */
.i18n-pending [data-i18n],
.i18n-pending [data-i18n-html] {
  visibility: hidden;
}

.lang-switch {
  display: inline-flex;
  margin-top: 1em;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch button {
  padding: 0.3em 0.9em;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9em;
  cursor: pointer;
}

.lang-switch button + button {
  border-left: 1px solid var(--border);
}

.lang-switch button:hover {
  color: var(--fg);
}

.lang-switch button.is-active {
  background-color: var(--primary-bg);
  color: var(--primary-fg);
}

.content {
  margin: 0 auto 50px;
  padding: 0 1.5em;
  max-width: 640px;
  line-height: 1.7;
}

h3 {
  font-weight: 400;
}

label {
  display: block;
  padding: 10px 0 4px;
  font-size: 1em;
}

textarea,
input[type="text"],
input[type="email"],
.output {
  box-sizing: border-box;
  width: 100%;
  background-color: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-family: inherit;
  font-size: 1.05em;
}

textarea,
.output {
  min-height: 180px;
}

textarea {
  display: block;
  resize: vertical;
}

.ruby-output {
  min-height: 60px;
  overflow-wrap: anywhere;
}

ruby rt {
  font-size: 0.6em;
  color: var(--muted);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin: 0.4em 0 0.8em;
}

.status {
  min-height: 1.4em;
  margin: 0.2em 0 1em;
  color: var(--muted);
  font-size: 0.95em;
}

.status.error {
  color: var(--error);
}

.note {
  color: var(--muted);
  font-size: 0.95em;
}

.breadcrumb {
  margin: 1.2em 0 0;
  font-size: 0.95em;
}

/* Privacy policy */
.updated {
  margin-top: 2em;
  color: var(--muted);
  font-size: 0.95em;
}

/* Home page */
.tool-list {
  display: grid;
  gap: 1em;
  margin: 2em 0 1.5em;
}

.tool-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2em 1.4em;
  box-shadow: 0 1px 3px var(--shadow);
}

.tool-card h3 {
  margin: 0 0 0.3em;
  font-size: 1.3em;
}

.tool-card p {
  margin: 0 0 0.9em;
  color: var(--muted);
}

/* pure.css is light-only, so restate the themed colors here. */
.pure-button {
  background-color: var(--button-bg);
  color: var(--button-fg);
  border-radius: 4px;
}

.pure-button:hover,
.pure-button:focus {
  background-color: var(--button-hover);
  background-image: none;
}

.pure-button-primary,
a.pure-button-primary,
.pure-button-selected,
a.pure-button-selected {
  background-color: var(--primary-bg);
  color: var(--primary-fg);
}

.pure-button-primary:hover,
.pure-button-primary:focus,
a.pure-button-primary:hover,
a.pure-button-primary:focus {
  background-color: var(--primary-hover);
  background-image: none;
}

.pure-button-disabled,
.pure-button-disabled:hover,
.pure-button-disabled:focus,
.pure-button[disabled] {
  background-color: var(--button-bg);
  background-image: none;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}
