/* ============================================
   Blog reactions, bookmark, series widgets, snippets, legal
   ============================================ */

/* ===== Reactions ===== */
.blog-reactions {
  margin: 2rem 0 1.5rem;
  padding: 1.2rem 1.4rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.04), rgba(245, 158, 11, 0.04));
}
body[data-theme="dark"] .blog-reactions {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(148, 163, 184, 0.18);
}

.blog-reactions__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
  color: #1e293b;
}
body[data-theme="dark"] .blog-reactions__title { color: #e2e8f0; }

.blog-reactions__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.blog-reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  transition: all 0.18s ease;
}
.blog-reaction-btn:hover {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(244, 63, 94, 0.05);
  color: #be123c;
  transform: translateY(-1px);
}
.blog-reaction-btn.is-active {
  border-color: #f43f5e;
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  color: #fff;
  box-shadow: 0 5px 14px rgba(244, 63, 94, 0.4);
}
.blog-reaction-btn.is-active:hover { color: #fff; }
.blog-reaction-btn.is-bumping { animation: rxBump 0.3s ease; }
@keyframes rxBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.blog-reaction-btn__emoji { font-size: 1.1rem; line-height: 1; }
.blog-reaction-btn__count {
  background: rgba(15, 23, 42, 0.06);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}
.blog-reaction-btn.is-active .blog-reaction-btn__count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
body[data-theme="dark"] .blog-reaction-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
body[data-theme="dark"] .blog-reaction-btn__count { background: rgba(148, 163, 184, 0.18); }

/* ===== Bookmark button on post ===== */
.blog-bookmark-btn { transition: all 0.18s ease; }
.blog-bookmark-btn.is-saved {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-color: transparent;
  color: #fff;
}
.blog-bookmark-btn.is-saved:hover { color: #fff; filter: brightness(1.05); }

/* ===== Floating bookmark panel ===== */
.bookmark-panel-trigger {
  position: fixed;
  right: 1.5rem;
  bottom: 10rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  z-index: 998;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bookmark-panel-trigger:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(37, 99, 235, 0.55); }
.bookmark-panel-trigger__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  border: 2px solid #fff;
}
.bookmark-panel-trigger.is-empty { display: none; }

@media (max-width: 575px) {
  .bookmark-panel-trigger { right: 0.75rem; bottom: 9rem; width: 42px; height: 42px; }
}

.bookmark-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.bookmark-panel-overlay.is-open { opacity: 1; pointer-events: all; }

.bookmark-panel {
  position: fixed;
  right: 0;
  top: 0;
  height: 100%;
  width: min(92vw, 380px);
  background: #fff;
  z-index: 1051;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.18);
}
body[data-theme="dark"] .bookmark-panel { background: #0f172a; color: #e2e8f0; }
.bookmark-panel.is-open { transform: translateX(0); }
.bookmark-panel__head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
body[data-theme="dark"] .bookmark-panel__head { border-color: rgba(148, 163, 184, 0.2); }
.bookmark-panel__head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.bookmark-panel__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
}
.bookmark-panel__close:hover { opacity: 1; }
.bookmark-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.bookmark-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: inherit;
}
.bookmark-item:hover { background: rgba(37, 99, 235, 0.05); color: inherit; }
body[data-theme="dark"] .bookmark-item { border-color: rgba(148, 163, 184, 0.16); }
body[data-theme="dark"] .bookmark-item:hover { background: rgba(37, 99, 235, 0.18); color: #fff; }
.bookmark-item__thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 0.55rem;
  background: rgba(15, 23, 42, 0.06);
  background-size: cover;
  background-position: center;
}
.bookmark-item__body { flex: 1; min-width: 0; }
.bookmark-item__cat { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #2563eb; font-weight: 700; }
.bookmark-item__title { font-size: 0.95rem; font-weight: 600; margin: 0.1rem 0 0.2rem; line-height: 1.35; color: #0f172a; }
body[data-theme="dark"] .bookmark-item__title { color: #f1f5f9; }
.bookmark-item__excerpt { font-size: 0.78rem; color: #64748b; margin: 0; }
body[data-theme="dark"] .bookmark-item__excerpt { color: #94a3b8; }
.bookmark-item__remove {
  border: 0;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.25rem;
  align-self: center;
}
.bookmark-item__remove:hover { color: #b91c1c; }
.bookmark-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #94a3b8;
}
.bookmark-empty i { font-size: 2.4rem; margin-bottom: 0.6rem; display: block; }

/* ===== Series widget on blog show ===== */
.blog-series-card {
  margin: 0 0 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.3);
}
.blog-series-card__head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.blog-series-card__head > i {
  font-size: 1.35rem;
  background: rgba(255,255,255,0.18);
  width: 38px; height: 38px; border-radius: 0.55rem;
  display: flex; align-items: center; justify-content: center;
}
.blog-series-card__counter {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.blog-series-card__list {
  list-style: decimal inside;
  margin: 0;
  padding: 0;
  font-size: 0.88rem;
}
.blog-series-card__list li {
  padding: 0.3rem 0;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.blog-series-card__list li:first-child { border-top: 0; }
.blog-series-card__list a {
  color: rgba(255,255,255,0.92);
  text-decoration: none;
}
.blog-series-card__list a:hover { color: #fff; text-decoration: underline; }
.blog-series-card__list li.is-current { color: #fde047; }

/* ===== Cookie banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  max-width: 540px;
  margin: 0 auto;
  z-index: 1100;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.2rem;
  border-radius: 0.9rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  display: none;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.cookie-banner.is-open { display: flex; }
.cookie-banner i {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #fff;
}
.cookie-banner__body { flex: 1; }
.cookie-banner__body a { color: #93c5fd; }
.cookie-banner__actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-top: 0.6rem;
}
.cookie-banner__actions button {
  border: 0;
  padding: 0.4rem 0.85rem;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.cookie-banner__actions .btn-accept {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
}
.cookie-banner__actions .btn-decline {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

/* ===== Snippets list ===== */
.snippet-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.snippet-search input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 0.95rem;
}
.snippet-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}
.snippet-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0.95rem;
  padding: 1.2rem 1.3rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  height: 100%;
}
.snippet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
  border-color: rgba(37, 99, 235, 0.25);
  color: inherit;
}
body[data-theme="dark"] .snippet-card {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}
.snippet-card__lang {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
body[data-theme="dark"] .snippet-card__lang { background: rgba(37, 99, 235, 0.25); color: #93c5fd; }
.snippet-card__title { font-size: 1rem; font-weight: 700; margin: 0 0 0.4rem 0; }
.snippet-card__desc { font-size: 0.85rem; color: #64748b; margin: 0; flex: 1; }
body[data-theme="dark"] .snippet-card__desc { color: #94a3b8; }
.snippet-card__meta {
  margin-top: 0.85rem;
  font-size: 0.72rem;
  color: #94a3b8;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Snippet detail ===== */
.snippet-detail {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1rem;
  padding: 1.6rem;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}
body[data-theme="dark"] .snippet-detail {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}
.snippet-detail__head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.snippet-detail__title {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
}
.snippet-code-wrap {
  position: relative;
  border-radius: 0.6rem;
  overflow: hidden;
}
.snippet-code-wrap pre {
  margin: 0;
  padding: 1.2rem;
  background: #0f172a !important;
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  border-radius: 0.6rem;
  max-height: 70vh;
}
.snippet-code-wrap pre code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.snippet-copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.snippet-copy-btn:hover { background: rgba(255, 255, 255, 0.25); }
.snippet-copy-btn.is-copied { background: #22c55e; }

/* ===== Legal page ===== */
.legal-content {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem 2.4rem;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 0.95rem;
  line-height: 1.75;
  color: #334155;
}
body[data-theme="dark"] .legal-content {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}
.legal-content h2 { font-size: 1.4rem; font-weight: 700; margin: 1.6rem 0 0.8rem; color: #0f172a; }
body[data-theme="dark"] .legal-content h2 { color: #f1f5f9; }
.legal-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.3rem 0 0.6rem; }
.legal-content p, .legal-content ul, .legal-content ol { margin-bottom: 0.85rem; }


/* ===== Paragraph Reactions ===== */
.blog-content {
  position: relative;
}

.para-react-tooltip {
  position: absolute;
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  background: #1e293b;
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 50;
  transition: opacity 0.15s, transform 0.15s;
}

.para-react-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}

.para-react-btn:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.1);
}

.para-react-btn.is-active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.para-react-btn.is-bumping {
  animation: paraBump 0.3s ease;
}

.para-react-btn.is-reacting {
  opacity: 0.5;
  pointer-events: none;
}

@keyframes paraBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1.1); }
}
