/* Quote of the Day (qotd-): the card on the home page and the Quotes page, its
   comments and the earlier quotes. */

.qotd {
  position: relative;
  padding: 2rem 2.25rem 1.4rem;
  border: 1px solid var(--bb-gold-100);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 100% 0, rgba(227, 193, 92, 0.22), transparent 45%),
    radial-gradient(circle at 0 100%, rgba(139, 160, 110, 0.16), transparent 50%),
    #fffdf7;
  box-shadow: 0 18px 44px rgba(125, 99, 24, 0.12);
  overflow: hidden;
}

/* A large opening quote mark behind the text. */
.qotd::before {
  content: "\201C";
  position: absolute;
  top: -1.6rem;
  left: 0.9rem;
  color: rgba(212, 175, 55, 0.18);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11rem;
  line-height: 1;
  pointer-events: none;
}

.qotd-top {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.qotd-kicker {
  color: var(--bb-gold-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qotd-top time {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--bb-sage-700);
  font-size: 0.78rem;
  font-weight: 700;
}

.qotd-text {
  position: relative;
  margin: 0;
}

.qotd-text p {
  margin: 0;
  color: #1f2937;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.9rem);
  font-style: italic;
  line-height: 1.45;
}

.qotd.is-urdu .qotd-text p {
  font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
  font-style: normal;
  line-height: 2.3;
}

.qotd-by {
  position: relative;
  margin: 0.9rem 0 0;
  color: var(--bb-sage-700);
  font-size: 1rem;
}

.qotd-by strong { color: #1f2937; }
.qotd-by cite { font-style: italic; }

.qotd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.qotd-links a {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--bb-blue-100);
  border-radius: 999px;
  background: #fff;
  color: var(--bb-blue-700);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.qotd-links a:hover { background: var(--bb-blue-50); }

.qotd-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.3rem 0 0;
}

.qotd-react {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.4rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid #ece3c4;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.qotd-react:hover { border-color: var(--bb-gold-400); transform: translateY(-1px); color: #374151; }
.qotd-react:disabled { opacity: 0.7; }

.qotd-react.is-mine {
  border-color: var(--bb-gold-500);
  background: var(--bb-gold-100);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.qotd-react.is-pop .qotd-emoji { animation: qotd-pop 0.35s ease-out; }

@keyframes qotd-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.qotd-emoji { font-size: 1.15rem; line-height: 1; }
.qotd-count:empty { display: none; }

.qotd-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed #ece3c4;
}

.qotd-discuss {
  color: var(--bb-blue-700);
  font-weight: 700;
  text-decoration: none;
}

.qotd-discuss:hover { text-decoration: underline; }

.qotd-share {
  display: flex;
  gap: 0.4rem;
}

.qotd-share-btn {
  padding: 0.25rem 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.qotd-share-btn:hover { border-color: var(--bb-sage-300); color: #1f2937; }

.qotd-credit {
  margin: 0.8rem 0 0;
  color: #9ca3af;
  font-size: 0.72rem;
}

.qotd-credit a { color: inherit; }

/* ---------- The Quotes page ---------- */

.qotd-page {
  max-width: 820px;
  margin: 1.75rem auto 3rem;
}

.qotd-page-head { margin-bottom: 1.25rem; }
.qotd-page-head h1 { margin: 0.25rem 0 0.35rem; font-size: 1.8rem; font-weight: 900; }
.qotd-page-head p { margin: 0; color: #6b7280; }

.qotd-back {
  color: var(--bb-blue-700);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.qotd-alert { margin-bottom: 1rem; }

.qotd-comments,
.qotd-archive {
  margin-top: 2.25rem;
}

.qotd-comments h2,
.qotd-archive h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.qotd-comments-count {
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  background: var(--bb-sage-100);
  color: var(--bb-sage-700);
  font-size: 0.8rem;
}

.qotd-comment-form {
  padding: 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
}

.qotd-comment-form textarea {
  width: 100%;
  padding: 0.4rem 0.2rem;
  border: 0;
  outline: none;
  resize: vertical;
}

.qotd-comment-form:focus-within {
  border-color: var(--bb-blue-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.qotd-comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.qotd-chars { color: #9ca3af; font-size: 0.75rem; }
.qotd-chars.is-low { color: #b45309; }

.qotd-signin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--bb-sage-300);
  border-radius: 1rem;
  background: var(--bb-sage-50);
  color: #4b5563;
}

.qotd-muted { margin-top: 1rem; color: #6b7280; }

.qotd-comment-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.qotd-comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #eef0f3;
  border-radius: 1rem;
  background: #fff;
}

.qotd-comment.is-hidden { background: #fffbeb; border-color: #fde68a; }

.qotd-avatar {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bb-sage-500), var(--bb-sage-700));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.qotd-comment-main { flex: 1; min-width: 0; }

.qotd-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.qotd-you {
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--bb-blue-50);
  color: var(--bb-blue-700);
  font-size: 0.7rem;
  font-weight: 800;
}

.qotd-when { color: #9ca3af; font-size: 0.75rem; }

.qotd-comment-body {
  margin: 0.3rem 0 0;
  color: #374151;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.qotd-comment-tools {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.qotd-tool {
  padding: 0;
  border: 0;
  background: none;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
}

.qotd-tool:hover { color: #b91c1c; }

.qotd-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.qotd-archive-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border: 1px solid #eef0f3;
  border-radius: 1rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.qotd-archive-card:hover {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.qotd-archive-card time { color: var(--bb-gold-700); font-size: 0.74rem; font-weight: 800; }

.qotd-archive-card blockquote {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #1f2937;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.qotd-archive-by { color: var(--bb-sage-700); font-size: 0.85rem; }
.qotd-archive-stats { margin-top: auto; color: #9ca3af; font-size: 0.78rem; }

/* ---------- The compact card beside the home page banner ---------- */

.qotd.is-compact {
  padding: 1.15rem 1.25rem 0.9rem;
  border-radius: 1.1rem;
  box-shadow: 0 14px 32px rgba(125, 99, 24, 0.12);
}

.qotd.is-compact::before {
  top: -1.1rem;
  left: 0.5rem;
  font-size: 7rem;
}

.qotd.is-compact .qotd-top { margin-bottom: 0.6rem; }
.qotd.is-compact .qotd-kicker { font-size: 0.7rem; }
.qotd.is-compact .qotd-top time { padding: 0.1rem 0.55rem; font-size: 0.7rem; }

.qotd.is-compact .qotd-text p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.12rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.qotd.is-compact.is-urdu .qotd-text p { font-size: 1.05rem; line-height: 2.1; -webkit-line-clamp: 3; }

.qotd-more {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--bb-blue-700);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.qotd.is-compact .qotd-by { margin-top: 0.5rem; font-size: 0.88rem; }
.qotd.is-compact .qotd-links { margin-top: 0.6rem; }
.qotd.is-compact .qotd-links a { padding: 0.2rem 0.6rem; font-size: 0.75rem; }

.qotd.is-compact .qotd-reactions { gap: 0.3rem; margin-top: 0.8rem; }

.qotd.is-compact .qotd-react {
  min-height: 2rem;
  padding: 0.15rem 0.55rem;
  font-size: 0.8rem;
}

.qotd.is-compact .qotd-emoji { font-size: 1rem; }

.qotd.is-compact .qotd-foot {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  font-size: 0.85rem;
}

.qotd.is-compact .qotd-share-btn { padding: 0.15rem 0.55rem; font-size: 0.75rem; }
.qotd.is-compact .qotd-credit { margin-top: 0.45rem; font-size: 0.66rem; }

@media (max-width: 575.98px) {
  .qotd { padding: 1.5rem 1.15rem 1.1rem; border-radius: 1.15rem; }
  .qotd::before { font-size: 8rem; }
  .qotd-react { padding: 0.25rem 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .qotd-react, .qotd-archive-card { transition: none; }
  .qotd-react.is-pop .qotd-emoji { animation: none; }
}

/* ---------- Night mode (Quotes page) ----------
   The blog's toggle (blog.css) sets data-blog-theme="dark" on <html>; only the
   Quotes page loads it, so the home page card stays light. */

.qotd-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qotd-toolbar .blog-theme-toggle {
  margin-left: auto;
}

[data-blog-theme="dark"] .qotd {
  border-color: var(--blog-night-border);
  background:
    radial-gradient(circle at 100% 0, rgba(227, 193, 92, 0.12), transparent 45%),
    radial-gradient(circle at 0 100%, rgba(139, 160, 110, 0.1), transparent 50%),
    var(--blog-night-surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

[data-blog-theme="dark"] .qotd::before {
  color: rgba(227, 193, 92, 0.12);
}

[data-blog-theme="dark"] .qotd-kicker,
[data-blog-theme="dark"] .qotd-archive-card time {
  color: #e3c15c;
}

[data-blog-theme="dark"] .qotd-top time {
  background: var(--blog-night-raised);
  color: var(--blog-night-muted);
}

[data-blog-theme="dark"] .qotd-text p,
[data-blog-theme="dark"] .qotd-by strong,
[data-blog-theme="dark"] .qotd-archive-card blockquote,
[data-blog-theme="dark"] .qotd-page-head h1,
[data-blog-theme="dark"] .qotd-comments h2,
[data-blog-theme="dark"] .qotd-archive h2 {
  color: var(--blog-night-heading);
}

[data-blog-theme="dark"] .qotd-by,
[data-blog-theme="dark"] .qotd-archive-by,
[data-blog-theme="dark"] .qotd-page-head p,
[data-blog-theme="dark"] .qotd-muted,
[data-blog-theme="dark"] .qotd-comment-body {
  color: var(--blog-night-text);
}

[data-blog-theme="dark"] .qotd-credit,
[data-blog-theme="dark"] .qotd-chars,
[data-blog-theme="dark"] .qotd-when,
[data-blog-theme="dark"] .qotd-tool,
[data-blog-theme="dark"] .qotd-archive-stats {
  color: var(--blog-night-muted);
}

[data-blog-theme="dark"] .qotd-tool:hover {
  color: #f87171;
}

[data-blog-theme="dark"] .qotd-back,
[data-blog-theme="dark"] .qotd-discuss,
[data-blog-theme="dark"] .qotd-more {
  color: var(--blog-night-link);
}

[data-blog-theme="dark"] .qotd-links a,
[data-blog-theme="dark"] .qotd-react,
[data-blog-theme="dark"] .qotd-share-btn {
  border-color: var(--blog-night-border);
  background: var(--blog-night-raised);
  color: var(--blog-night-text);
}

[data-blog-theme="dark"] .qotd-links a {
  color: var(--blog-night-link);
}

[data-blog-theme="dark"] .qotd-links a:hover,
[data-blog-theme="dark"] .qotd-share-btn:hover,
[data-blog-theme="dark"] .qotd-react:hover {
  border-color: #e3c15c;
  background: var(--blog-night-raised);
  color: var(--blog-night-heading);
}

[data-blog-theme="dark"] .qotd-react.is-mine {
  border-color: #e3c15c;
  background: #4a4127;
  color: var(--blog-night-heading);
}

[data-blog-theme="dark"] .qotd-foot {
  border-top-color: var(--blog-night-border);
}

[data-blog-theme="dark"] .qotd-comments-count {
  background: var(--blog-night-raised);
  color: var(--blog-night-muted);
}

[data-blog-theme="dark"] .qotd-comment-form,
[data-blog-theme="dark"] .qotd-comment,
[data-blog-theme="dark"] .qotd-archive-card {
  border-color: var(--blog-night-border);
  background: var(--blog-night-surface);
}

[data-blog-theme="dark"] .qotd-comment-form textarea {
  background: transparent;
  color: var(--blog-night-text);
}

[data-blog-theme="dark"] .qotd-comment-form textarea::placeholder {
  color: var(--blog-night-muted);
}

[data-blog-theme="dark"] .qotd-comment.is-hidden {
  border-color: #6b5a1f;
  background: #2c2714;
}

[data-blog-theme="dark"] .qotd-signin {
  border-color: var(--blog-night-border);
  background: var(--blog-night-surface);
  color: var(--blog-night-text);
}

[data-blog-theme="dark"] .qotd-you {
  background: rgba(143, 184, 255, 0.15);
  color: var(--blog-night-link);
}

[data-blog-theme="dark"] .qotd-archive-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}
