/* simply.fyi - matches the 2022 site's look without Bootstrap. */

:root {
  --bg: #333;
  --text: #fff;
  --muted: #c0c0c0;
  --link: #929292;
  --wait: 10s;              /* keep in step with WAIT_MS in app.js */
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-top: 75px;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

.masthead {
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}
.masthead .name { font-size: 85%; }
.masthead .by { font-size: 50%; }

.container {
  max-width: 990px;          /* 960px of content, as before */
  margin: 0 auto;
  padding: 48px 15px;
  cursor: pointer;           /* click or tap anywhere here for the next quote */
}

.output {
  text-align: left;
  /* The old site asked for Source Code Pro but never loaded it, so visitors
     have always seen their browser's monospace font. Kept that way. */
  font-family: "Source Code Pro", monospace;
  padding: 10px 75px;
  overflow-wrap: break-word;
}
.output h1 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 0.67em;
  white-space: pre-line;     /* keep a quote's own line breaks (verse, attributions) */
}
.output p {
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 1rem;
}

/* Blinking block cursor */
.cursor::after {
  content: "";
  display: inline-block;
  margin-left: 3px;
  background-color: var(--text);
  animation: blink 1s step-end infinite;
}
/* In em, so the cursor shrinks with a long quote's smaller text. */
h1.cursor::after { height: 0.67em; width: 0.43em; }
p.cursor::after  { height: 13px; width: 6px; }

@keyframes blink { 50% { opacity: 0; } }

/* Countdown ring shown while a finished quote waits */
#countdown {
  position: relative;
  margin: 100px auto 0;
  height: 40px;
  width: 40px;
}
#countdown svg {
  width: 40px;
  height: 40px;
  transform: rotateY(-180deg) rotateZ(-90deg);
}
#countdown circle {
  stroke-dasharray: 113px;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  stroke-width: 2px;
  stroke: var(--text);
  fill: none;
}
#countdown.running circle {
  animation: countdown var(--wait) linear forwards;
}
@keyframes countdown {
  from { stroke-dashoffset: 113px; }
  to   { stroke-dashoffset: 0; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  body { padding-top: 0; }
  .container { padding: 32px 16px; }
  .output { padding: 0; }
  .output h1 { font-size: 18px; }
  .output p { font-size: 12px; }
  h1.cursor::after { height: 0.83em; width: 0.5em; }
  p.cursor::after  { height: 12px; width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .cursor::after { animation: none; }
}

/* Mouse pointer hidden until the mouse moves, and again once it's still
   (app.js toggles the class). */
body.pointer-idle, body.pointer-idle * { cursor: none !important; }

/* ?preview (inside the admin app): just the quote. */
body.preview .toolbar, body.preview #countdown { display: none; }
body.preview, body.preview .container,
body.preview.pointer-idle, body.preview.pointer-idle * { cursor: default !important; }

/* Toolbar (pause, copy link, share) at the bottom of the screen.
   Shows with the mouse pointer; stays up faintly while paused (so "play" can
   be found) and always on touch screens, which have no pointer to move. */
.toolbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 4px;
  font-family: "Source Code Pro", monospace;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.toolbar button {
  font: inherit;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #555;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
}
.toolbar button:hover, .toolbar button:focus-visible {
  color: var(--text);
  border-color: #888;
  outline: none;
}
.toolbar button[hidden] { display: none; }

body:not(.pointer-idle) .toolbar,
.toolbar:focus-within {
  opacity: 1;
  pointer-events: auto;
}
body.paused.pointer-idle .toolbar {
  opacity: 0.5;
  pointer-events: auto;
}
@media (hover: none) {
  .toolbar, body.pointer-idle .toolbar {
    opacity: 0.6;
    pointer-events: auto;
  }
}

/* Image panel: save the quote on screen as a picture (quote-image.js). */
.img-panel {
  position: fixed; inset: 0; z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.img-panel[hidden] { display: none; }
.img-card {
  position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto;
  background: #262626; color: #e8e8e8; border: 1px solid #555; border-radius: 8px;
  padding: 18px 20px 16px;
  font-family: "Source Code Pro", monospace; font-size: 13px;
  cursor: default;
}
.img-card h2 { font-size: 15px; font-weight: 500; margin: 0 28px 12px 0; }
.img-close {
  position: absolute; top: 10px; right: 10px; padding: 4px 8px;
  background: none; border: 0; color: #aaa; font-size: 18px; cursor: pointer;
}
.img-close:hover, .img-close:focus-visible { color: #fff; outline: none; }
.img-preview { display: flex; justify-content: center; background: #1b1b1b; border-radius: 6px; padding: 12px; }
.img-preview canvas {
  max-width: 100%; max-height: 46vh; width: auto; height: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.img-cut { color: #c9b98f; font-size: 12px; margin: 8px 0 0; }
.img-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.img-row .lbl { width: 3.5em; color: #999; }
.img-row button {
  font: inherit; color: #c0c0c0; background: transparent; cursor: pointer;
  border: 1px solid #555; border-radius: 4px; padding: 5px 10px;
  display: inline-flex; align-items: center; gap: 6px;
}
.img-row button:hover, .img-row button:focus-visible { color: #fff; border-color: #888; outline: none; }
.img-row button[aria-checked="true"] { color: #fff; border-color: #ddd; background: #3a3a3a; }
.img-row .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; border: 1px solid #777; }
.img-row .shape { display: inline-block; border: 1.5px solid currentColor; border-radius: 1px; }
.img-row .shape.square { width: 10px; height: 10px; }
.img-row .shape.story  { width: 7px;  height: 12px; }
.img-row .shape.wide   { width: 14px; height: 7px; }
.img-actions { display: flex; gap: 8px; margin-top: 16px; }
.img-actions button {
  font: inherit; padding: 7px 16px; border-radius: 4px; cursor: pointer;
  border: 1px solid #ddd; background: #e8e8e8; color: #222;
}
.img-actions #img-share { background: transparent; color: #e8e8e8; border-color: #777; }
body.pointer-idle .img-panel, body.pointer-idle .img-panel * { cursor: auto !important; }
body.preview .img-panel { display: none; }

/* Filter panel (search, tags, Hide explicit); shares the image panel's frame. */
.filter-card { width: min(520px, 100%); }
.f-search { position: relative; }
.f-search input {
  width: 100%; box-sizing: border-box; font: inherit; color: #fff; background: #1b1b1b;
  border: 1px solid #555; border-radius: 4px; padding: 8px 10px;
}
.f-search input:focus { border-color: #999; outline: none; }
.f-suggest {                    /* in the panel's flow, so a long list scrolls with it */
  margin-top: 2px; background: #1f1f1f; border: 1px solid #555; border-radius: 4px; overflow: hidden;
}
.f-suggest[hidden] { display: none; }
.f-suggest button {
  display: block; width: 100%; text-align: left; font: inherit; color: #ddd; background: none;
  border: 0; border-bottom: 1px solid #333; padding: 7px 10px; cursor: pointer;
}
.f-suggest button:hover, .f-suggest button:focus-visible { background: #333; color: #fff; outline: none; }
.f-suggest .kind { color: #999; margin-right: 6px; }
.f-suggest .n { color: #888; float: right; }
.f-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.f-picks:empty { display: none; }
.f-chip, .f-tags button {
  font: inherit; font-size: 12px; color: #ddd; background: transparent; cursor: pointer;
  border: 1px solid #666; border-radius: 12px; padding: 3px 10px;
}
.f-chip .x { margin-left: 6px; color: #999; }
.f-tags-wrap { margin-top: 14px; }
.f-tags-wrap[hidden] { display: none; }
.f-label { color: #999; margin-bottom: 6px; }
.f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.f-tags button[aria-pressed="true"] { color: #222; background: #e8e8e8; border-color: #e8e8e8; }
.f-tags .n { color: #888; margin-left: 4px; }
.f-tags button[aria-pressed="true"] .n { color: #555; }
.f-switch { display: flex; align-items: center; gap: 8px; margin-top: 14px; cursor: pointer; }
.f-count { color: #c9b98f; margin: 12px 0 0; }
.img-actions button:disabled { opacity: 0.4; cursor: default; }
.toolbar .filter-label { color: #e8e8e8; border-color: #888; }
.toolbar .filter-label[hidden] { display: none; }
body.preview #filter-panel { display: none; }

/* Admin panel (only for a browser logged in to the admin): the admin's own
   page for the quote on screen. */
.admin-card {
  position: relative; width: min(1100px, 100%); height: min(92vh, 100%);
  background: #1e1e1e; border: 1px solid #555; border-radius: 8px; overflow: hidden;
}
.admin-card iframe { width: 100%; height: 100%; border: 0; display: block; background: #1e1e1e; }
.admin-card .img-close { z-index: 2; top: 4px; right: 6px; background: rgba(0, 0, 0, 0.5); border-radius: 4px; }
.toolbar #admin[hidden] { display: none; }
body.preview #admin-panel { display: none; }
