/* RainbowQuotes Header v18 — external stylesheet (was ~9KB inlined on every page) */

html, body { overflow-x: clip; }
body { padding-top: 68px; }
@media (max-width: 860px) { body { padding-top: 60px; } }

.rqh {
  --ink:#1c1410; --muted:#78716c; --faint:#a8a29e;
  --line:#ece3d2; --bg:#FFFBF0; --accent:#f59e0b;
}
html.rqh-dark .rqh {
  --ink:#f0ebe0; --muted:#a8a29e; --faint:#78716c;
  --line:#2e2821; --bg:#1a1410;
}
.rqh * { box-sizing: border-box; }
.rqh a { text-decoration: none; color: inherit; }

/* AUDIT FIX: was z-index 99999, which floated the bar ABOVE the scrim (10000),
   panel (10001) and language popup (10002). Now it sits correctly beneath them. */
.rqh-bar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 9999;
  height: 68px; overflow: visible;
  background: rgba(255,251,240,.95);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
html.rqh-dark .rqh-bar { background: rgba(20,15,10,.92); }

.rqh-in { max-width:1200px; margin:0 auto; padding:0 24px; height:68px; display:flex; align-items:center; gap:20px; }
.rqh-logo { flex:none; line-height:0; display:flex; align-items:center; margin-right:auto; }
.rqh-logo img { height:40px; width:auto; display:block; }

.rqh-nav { display:flex; align-items:center; gap:24px; flex:none; }
.rqh-nav a { font-size:14.5px; font-weight:500; color:var(--muted); white-space:nowrap; font-family:-apple-system,system-ui,sans-serif; }
.rqh-nav a:hover, .rqh-nav a.active { color:var(--ink); }
.rqh-nav a.active { font-weight:600; }

.rqh-right { display:flex; align-items:center; gap:8px; flex:none; margin-left:auto; }

.rqh-dm, .rqh-search-btn, .rqh-lang, .rqh-ic, .rqh-google-btn {
  width:40px; height:40px; border-radius:12px;
  background:#fff; border:1.5px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all .2s cubic-bezier(.4,0,.2,1);
  flex:none; color:#78716c; overflow:visible; padding:0; text-decoration:none;
}
.rqh-dm:hover, .rqh-search-btn:hover, .rqh-lang:hover, .rqh-google-btn:hover {
  background:#f5f0e6; border-color:#f59e0b; color:#1c1410;
  transform:translateY(-1px); box-shadow:0 4px 12px rgba(245,158,11,.15);
}
.rqh-dm.on, .rqh-search-btn.on, .rqh-lang.on {
  background:linear-gradient(135deg,#f59e0b 0%,#fbbf24 100%);
  border-color:#f59e0b; color:#fff; box-shadow:0 4px 16px rgba(245,158,11,.35);
}
html.rqh-dark .rqh-dm, html.rqh-dark .rqh-search-btn, html.rqh-dark .rqh-lang,
html.rqh-dark .rqh-ic, html.rqh-dark .rqh-px, html.rqh-dark .rqh-google-btn {
  background:#2a2118; border-color:#3a2f24; color:#a8a29e;
}
html.rqh-dark .rqh-dm:hover, html.rqh-dark .rqh-search-btn:hover,
html.rqh-dark .rqh-lang:hover, html.rqh-dark .rqh-google-btn:hover {
  background:#3a2c15; color:#fbbf24;
}

.rqh-hb { flex-direction:column; gap:5px; }
.rqh-hb span { display:block; width:18px; height:2px; border-radius:2px; background:var(--ink); margin:0; }

.rqh-google-btn:hover { border-color:#4285F4; box-shadow:0 4px 12px rgba(66,133,244,.2); }
.rqh-google-btn:hover svg { transform:scale(1.1); }

/* ── AUDIT FIX: responsive button visibility is pure CSS now ──────────────────
   The old build shipped inline style="display:flex !important" on the search
   and language buttons and style="display:none !important" on the hamburger,
   then flipped all three in JS on every load. On mobile that meant painting the
   wrong set of controls and swapping them after script execution — a guaranteed
   layout shift on every page load, on the device where all the real traffic is.
   Same result, no JS, no shift.                                              */
.rqh-hb { display:none; }
.rqh-search-btn, .rqh-lang { display:flex; }

@media (max-width: 860px) {
  .rqh-nav { display:none; }
  .rqh-search-btn, .rqh-lang { display:none; }
  .rqh-hb { display:flex; }
  .rqh-in { gap:8px; padding:0 16px; height:60px; }
  .rqh-bar { height:60px; }
  .rqh-logo img { height:32px; }
  .rqh-dm, .rqh-search-btn, .rqh-lang, .rqh-ic, .rqh-google-btn { width:38px; height:38px; }
  .rqh-search-sheet { top:60px; }
  .rqh-search-inner { padding:16px; }
  .rqh-search-input { height:50px; font-size:15px; border-radius:14px; }
  .rqh-lang-pop { top:68px; right:16px; width:calc(100vw - 32px); }
}
@media (max-width: 480px) {
  .rqh-lang-pop { top:auto; bottom:0; right:0; left:0; width:100%; max-width:100%; max-height:70vh; border-radius:20px 20px 0 0; transform:translateY(100%); }
  .rqh-lang-pop.on { transform:translateY(0); }
  .rqh-lang-grid { grid-template-columns:repeat(4,1fr); }
}
@media (max-width: 380px) {
  .rqh-google-btn, .rqh-dm, .rqh-ic { width:34px; height:34px; }
}

/* ── Overlay, panel ── */
.rqh-scrim { position:fixed; inset:0; background:rgba(0,0,0,.4); opacity:0; visibility:hidden; transition:opacity .25s; z-index:10000; }
.rqh-scrim.on { opacity:1; visibility:visible; }

.rqh-panel {
  position:fixed; top:0; right:0; width:84%; max-width:320px; height:100%;
  background:var(--bg); z-index:10001;
  transform:translateX(100%); transition:transform .28s cubic-bezier(.4,0,.2,1);
  display:flex; flex-direction:column; box-shadow:-16px 0 40px rgba(0,0,0,.15);
}
.rqh-panel.on { transform:none; }
html.rqh-dark .rqh-panel { background:#1a1410; }

.rqh-ph { display:flex; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid var(--line); }
.rqh-px { width:36px; height:36px; border-radius:9px; background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:16px; color:var(--muted); cursor:pointer; }
.rqh-pn { padding:8px 12px; display:flex; flex-direction:column; gap:2px; }
.rqh-pn a { display:flex; align-items:center; justify-content:space-between; padding:14px 12px; border-radius:12px; font-size:15px; font-weight:500; color:var(--ink); font-family:-apple-system,system-ui,sans-serif; }
.rqh-pn a:hover { background:#fff; }
html.rqh-dark .rqh-pn a:hover { background:#241c14; }
.rqh-pn a span { display:flex; align-items:center; gap:12px; }
.rqh-pn a i { width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:15px; font-style:normal; }

/* ── Search sheet ── */
.rqh-search-sheet {
  position:fixed; top:68px; left:0; right:0; z-index:10001;
  background:rgba(255,251,240,.98);
  backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid rgba(232,222,206,.5);
  box-shadow:0 20px 60px rgba(28,20,16,.12);
  transform:translateY(-20px) scale(.98); opacity:0; visibility:hidden;
  transition:transform .3s cubic-bezier(.4,0,.2,1), opacity .3s, visibility .3s;
}
.rqh-search-sheet.on { transform:translateY(0) scale(1); opacity:1; visibility:visible; }
html.rqh-dark .rqh-search-sheet { background:rgba(26,20,16,.98); border-bottom-color:#2e2821; }

.rqh-search-inner { max-width:720px; margin:0 auto; padding:24px; }
.rqh-search-field { position:relative; display:flex; align-items:center; }
.rqh-search-field > svg { position:absolute; left:20px; width:22px; height:22px; fill:#a8a29e; pointer-events:none; }
.rqh-search-input { width:100%; height:56px; background:#fff; border:2px solid #e8dece; border-radius:16px; padding:0 56px; font-size:16px; font-weight:500; color:#1c1410; outline:none; font-family:-apple-system,system-ui,sans-serif; box-shadow:0 2px 8px rgba(28,20,16,.04); }
.rqh-search-input::placeholder { color:#a8a29e; font-weight:400; }
.rqh-search-input:focus { border-color:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.12); }
html.rqh-dark .rqh-search-input { background:#2a2118; border-color:#3a2f24; color:#f0ebe0; }
html.rqh-dark .rqh-search-input::placeholder { color:#78716c; }
.rqh-search-x { position:absolute; right:16px; width:32px; height:32px; border:none; background:#f5f0e6; font-size:18px; color:#78716c; cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:50%; transition:all .2s; }
.rqh-search-x:hover { background:#f59e0b; color:#fff; transform:rotate(90deg); }
html.rqh-dark .rqh-search-x { background:#3a2f24; color:#a8a29e; }
.rqh-search-results { margin-top:16px; max-height:60vh; overflow-y:auto; }
.rqh-search-results:empty { display:none; }
.rqh-search-hint { font-size:14px; color:#a8a29e; text-align:center; padding:24px; }
html.rqh-dark .rqh-search-results .rq-search-row-item { color:#f0ebe0; }
html.rqh-dark .rqh-search-results .rq-search-row-item:hover { background:rgba(245,158,11,.14); color:#fbbf24; }
html.rqh-dark .rqh-search-results .rq-search-group-title { color:#78716c; }
html.rqh-dark .rqh-search-results .rq-search-row-icon { fill:#a8a29e; }
html.rqh-dark .rqh-search-results .rq-search-no-result { color:#a8a29e; }

/* ── Language popup ── */
.rqh-lang-pop {
  position:fixed; top:76px; right:24px; z-index:10002;
  width:360px; max-width:calc(100vw - 32px); max-height:480px;
  background:#fffbf0; border:1px solid #e7dcc8; border-radius:20px;
  box-shadow:0 24px 60px rgba(28,20,16,.18); padding:0;
  opacity:0; visibility:hidden; transform:translateY(-12px) scale(.96);
  transition:all .25s cubic-bezier(.4,0,.2,1);
  overflow:hidden; display:none; flex-direction:column;
}
.rqh-lang-pop.on { display:flex; opacity:1; visibility:visible; transform:translateY(0) scale(1); }
html.rqh-dark .rqh-lang-pop { background:#211a13; border-color:#3a2f24; }
.rqh-lang-pop-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:1.4px; color:#a8a29e; text-align:center; padding:18px 20px 14px; border-bottom:1px solid #f0e8d6; font-family:-apple-system,system-ui,sans-serif; }
html.rqh-dark .rqh-lang-pop-title { color:#78716c; border-bottom-color:#2e2821; }
.rqh-lang-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:14px; overflow-y:auto; max-height:380px; }
.rqh-lang-grid button { border:1px solid #e7dcc8; background:#fff; color:#1c1410; padding:12px 8px; border-radius:12px; font-weight:600; font-size:13px; cursor:pointer; transition:all .18s; font-family:-apple-system,system-ui,sans-serif; text-align:center; }
.rqh-lang-grid button:hover { border-color:#f59e0b; color:#f59e0b; background:#fff8e1; transform:translateY(-2px); }
html.rqh-dark .rqh-lang-grid button { background:#2a2118; border-color:#3a2f24; color:#f0ebe0; }
html.rqh-dark .rqh-lang-grid button:hover { background:#3a2c15; color:#fbbf24; border-color:#f59e0b; }

body.rqh-lock { overflow:hidden; }

/* Visible keyboard focus — the old build had none anywhere. */
.rqh a:focus-visible, .rqh button:focus-visible {
  outline:2px solid var(--accent); outline-offset:2px; border-radius:8px;
}

@media (prefers-reduced-motion: reduce) {
  .rqh *, .rqh-panel, .rqh-scrim, .rqh-search-sheet, .rqh-lang-pop {
    transition-duration:.01ms !important; animation-duration:.01ms !important;
  }
}

/* ============ SITE-WIDE DARK THEME ============ */
html.rqh-dark body { background:#171310; color:#e8e0d2; }
html.rqh-dark h1, html.rqh-dark h2, html.rqh-dark h3, html.rqh-dark h4, html.rqh-dark h5 { color:#f0ebe0; }
html.rqh-dark p { color:#c9c2b4; }
html.rqh-dark .rq-main-txt { color:#f0ebe0; }
html.rqh-dark .rq-btn-s, html.rqh-dark .rq-topic-idx-btn, html.rqh-dark .rq-author-idx-btn,
html.rqh-dark .rq-letter-more-btn, html.rqh-dark .rq-pill-s { background:#241e17; border-color:#3a2f24; color:#e8e0d2; }
html.rqh-dark .rqqb-list-item { background:#241e17; border-color:#3a2f24; color:#e8e0d2; }
html.rqh-dark .rqqb-list-auth, html.rqh-dark .rqqb-compound-auth { color:#fbbf24; }
html.rqh-dark .rq-grid-info h4, html.rqh-dark .rq-grid-info span { color:#c9c2b4; }
html.rqh-dark .rq-topic-bio-card, html.rqh-dark .rq-profile-card-container { background:#241e17; border-color:#3a2f24; }
html.rqh-dark .rq-profile-title-name { color:#f0ebe0; }
html.rqh-dark .rq-profile-bio-text, html.rqh-dark .rq-profile-bio-text p { color:#c9c2b4; }
html.rqh-dark .rq-topic-related-links a { color:#fbbf24; }
html.rqh-dark .rq-idx-t { color:#f0ebe0; }
html.rqh-dark .rq-live-search-dropdown-box { background:#241e17; border-color:#3a2f24; }
html.rqh-dark .rq-search-row-item { color:#e8e0d2; }
html.rqh-dark .rq-search-group-title { color:#78716c; }
html.rqh-dark .rq-auth-wrapper a, html.rqh-dark .rq-auth-link { color:#fbbf24; }
html.rqh-dark .rq-seo-grid-item .rq-grid-info { color:#c9c2b4; }
