/* Trendly AI Post - frontend share buttons.
   Scoped to .trendly-share-row so it never collides with theme styles. */

.trendly-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 24px 0;
  padding: 14px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.trendly-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 6px;
  background: #f5f6f7;
  color: #1d2327;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.trendly-share-btn:hover,
.trendly-share-btn:focus {
  background: #1d2327;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.trendly-share-btn:focus {
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

.trendly-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.trendly-share-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Brand tints on hover */
.trendly-share-btn--twitter:hover,
.trendly-share-btn--twitter:focus {
  background: #000000;
  color: #ffffff;
}
.trendly-share-btn--linkedin:hover,
.trendly-share-btn--linkedin:focus {
  background: #0a66c2;
  color: #ffffff;
}
.trendly-share-btn--facebook:hover,
.trendly-share-btn--facebook:focus {
  background: #1877f2;
  color: #ffffff;
}
.trendly-share-btn--whatsapp:hover,
.trendly-share-btn--whatsapp:focus {
  background: #25d366;
  color: #ffffff;
}
.trendly-share-btn--reddit:hover,
.trendly-share-btn--reddit:focus {
  background: #ff4500;
  color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .trendly-share-btn {
    transition: none;
  }
  .trendly-share-btn:hover,
  .trendly-share-btn:focus {
    transform: none;
  }
}

@media (max-width: 540px) {
  .trendly-share-row {
    gap: 6px;
  }
  .trendly-share-btn-label {
    /* keep labels visible - they're short */
  }
}

/* ==========================================================================
   Single-post enhancements (v1.9.0)
   Reading time, Table of Contents, FAQ accordion, Related articles.
   ========================================================================== */

/* Reading-time pill */
.trendly-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: #f5f6f7;
  color: #50575e;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 18px;
}
.trendly-reading-time-icon {
  font-size: 14px;
  line-height: 1;
}

/* Table of contents */
.trendly-toc {
  margin: 0 0 28px;
  padding: 16px 20px;
  background: #f9fafb;
  border: 1px solid #e2e5e8;
  border-radius: 8px;
}
.trendly-toc details > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trendly-toc details > summary::-webkit-details-marker { display: none; }
.trendly-toc-title {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}
.trendly-toc-title::after {
  content: "▾";
  margin-left: auto;
  font-size: 12px;
  color: #8c8f94;
  transition: transform 0.2s ease;
}
.trendly-toc details[open] .trendly-toc-title::after { transform: rotate(180deg); }
.trendly-toc-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: trendly-toc;
}
.trendly-toc-item {
  margin: 0;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.trendly-toc-item--lvl1 { counter-increment: trendly-toc; padding-left: 26px; }
.trendly-toc-item--lvl1::before {
  content: counter(trendly-toc) ".";
  position: absolute;
  left: 0;
  color: #8c8f94;
  font-variant-numeric: tabular-nums;
}
.trendly-toc-item--lvl2 { padding-left: 44px; font-size: 13px; }
.trendly-toc-item--lvl2::before {
  content: "-";
  position: absolute;
  left: 26px;
  color: #c3c4c7;
}
.trendly-toc a {
  color: #1d2327;
  text-decoration: none;
}
.trendly-toc a:hover,
.trendly-toc a:focus {
  color: #2271b1;
  text-decoration: underline;
}

/* FAQ accordion */
.trendly-faq {
  margin: 36px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #e2e5e8;
}
.trendly-faq-heading {
  font-size: 22px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 18px;
}
.trendly-faq-item {
  border: 1px solid #e2e5e8;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
}
.trendly-faq-item[open] {
  border-color: #c8d3e2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.trendly-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #1d2327;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.trendly-faq-q::-webkit-details-marker { display: none; }
.trendly-faq-q::after {
  content: "+";
  font-size: 22px;
  line-height: 1;
  color: #8c8f94;
  font-weight: 400;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.trendly-faq-item[open] .trendly-faq-q::after {
  content: "−";
  color: #2271b1;
}
.trendly-faq-a {
  padding: 0 18px 16px;
  color: #50575e;
  font-size: 15px;
  line-height: 1.6;
}
.trendly-faq-a p { margin: 0; }

/* Related articles */
.trendly-related {
  margin: 36px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid #e2e5e8;
}
.trendly-related-heading {
  font-size: 22px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 18px;
}
.trendly-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.trendly-related-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e5e8;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.trendly-related-card:hover,
.trendly-related-card:focus {
  transform: translateY(-2px);
  border-color: #2271b1;
  box-shadow: 0 4px 14px rgba(34, 113, 177, 0.12);
}
.trendly-related-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #f0f0f1;
}
.trendly-related-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 16px;
  flex: 1;
}
.trendly-related-title {
  font-size: 15px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trendly-related-cta {
  font-size: 12px;
  font-weight: 600;
  color: #2271b1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: auto;
}

@media (prefers-reduced-motion: reduce) {
  .trendly-related-card { transition: none; }
  .trendly-related-card:hover { transform: none; }
}
