/* Screen-reader-only helper (used with back-to-top label) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Blog page: smooth anchor scroll under fixed header */
html.blog-page {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html.blog-page {
    scroll-behavior: auto;
  }
}

/* Section jump tags (Articles / Team) */
.blog-section-tags {
  row-gap: 0.5rem;
}

a.blog-section-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

a.blog-section-tag:hover {
  color: #fff;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

a.blog-section-tag:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.6);
  outline-offset: 2px;
}

/* Floating back-to-top */
.blog-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #9ca3af;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease,
    color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.blog-back-to-top--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.blog-back-to-top:hover {
  color: #fff;
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.blog-back-to-top:focus-visible {
  outline: 2px solid rgba(34, 197, 94, 0.6);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .blog-back-to-top {
    transition: none;
  }
}

/* Blog: preview & expand/collapse */
.blog-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
  word-break: break-word;
  max-height: 4.8em;
  font-weight: 500;
}

.blog-full[hidden],
.blog-preview[hidden] {
  display: none !important;
}

.blog-meta .blog-date {
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

/* Blog: Markdown content (dark theme) */
.blog-markdown {
  color: #9ca3af;
  line-height: 1.65;
  font-weight: 500;
}

.blog-markdown p {
  margin-bottom: 0.75rem;
}

.blog-markdown p:last-child {
  margin-bottom: 0;
}

.blog-markdown :last-child {
  padding-bottom: 0.125rem;
}

.blog-markdown h1, .blog-markdown h2, .blog-markdown h3 {
  color: #fff;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.blog-markdown h1 { font-size: 1.5rem; }
.blog-markdown h2 { font-size: 1.25rem; }
.blog-markdown h3 { font-size: 1.125rem; }

.blog-markdown ul, .blog-markdown ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.blog-markdown li {
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.blog-markdown a {
  color: #22c55e;
  text-decoration: none;
}

.blog-markdown a:hover {
  text-decoration: underline;
}

.blog-markdown code {
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.blog-markdown pre {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.blog-markdown pre code {
  background: none;
  padding: 0;
}

.blog-markdown blockquote {
  border-left: 4px solid rgba(34, 197, 94, 0.5);
  margin: 1rem 0;
  padding-left: 1rem;
  color: #d1d5db;
  font-weight: 500;
}

.blog-markdown strong {
  color: #fff;
  font-weight: 700;
}

/* Blog post modal */
.blog-post-modal.hidden {
  display: none !important;
}

.blog-post-modal:not(.hidden) {
  display: flex !important;
}

.blog-post-modal-panel {
  z-index: 1;
}

.blog-post-modal-content {
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.blog-post-modal-close {
  font-size: 1.5rem;
  line-height: 1;
}

.blog-full-modal .blog-meta {
  margin-bottom: 1rem;
}

/* Blog: card header — avatar right of title */
.blog-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

/* Blog: card footer — Read more left, tag+date right */
.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.blog-preview-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Blog: team photo in modal — profile card */
.blog-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blog-modal-photo {
  width: 180px;
  min-height: 220px;
  border-radius: 1rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.blog-modal-header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 220px;
}

.blog-modal-header h1 {
  margin-top: 0 !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.75rem !important;
}

.blog-modal-header h2 {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  color: #9ca3af !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}

@media (max-width: 640px) {
  .blog-modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .blog-modal-photo {
    width: 140px;
    min-height: 170px;
  }
  .blog-modal-header-text {
    min-height: auto;
  }
}

/*
 * Soro blog embed (app.trysoro.com): script injects light-theme CSS (#1a1a1a on transparent).
 * Our page is dark — override with #soro-blog (higher specificity than widget’s single-class rules).
 * List layout matches Team grid: 1 / 2 / 3 columns, card chrome = border-white/10 rounded-3xl p-6.
 */
#soro-blog .soro-blog {
  color: #e5e7eb;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100%;
}

#soro-blog .soro-blog-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  #soro-blog .soro-blog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #soro-blog .soro-blog-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#soro-blog .soro-blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 1.5rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#soro-blog .soro-blog-card:hover {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

#soro-blog .soro-blog-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin: 0 0 1rem 0;
  flex-shrink: 0;
}

#soro-blog .soro-blog-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#soro-blog .soro-blog-card-title,
#soro-blog h2.soro-blog-card-title {
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.5rem 0 !important;
}

#soro-blog .soro-blog-card-excerpt {
  color: #9ca3af;
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 1rem 0 !important;
}

#soro-blog .soro-blog-card-date {
  color: #6b7280;
  margin-top: auto;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#soro-blog .soro-blog-back {
  border-color: rgba(255, 255, 255, 0.15);
  color: #d1d5db;
}

#soro-blog .soro-blog-back:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

#soro-blog .soro-blog-article {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.5rem;
  padding: 1.5rem 1.5rem 2rem;
  max-width: 100%;
}

#soro-blog .soro-blog-article-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
}

#soro-blog .soro-blog-article-title {
  color: #fff;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
}

#soro-blog .soro-blog-article-date {
  color: #9ca3af;
}

#soro-blog .soro-blog-article-content {
  color: #9ca3af;
  font-weight: 500;
  line-height: 1.65;
}

#soro-blog .soro-blog-article-content p {
  margin: 0 0 0.75rem 0;
}

#soro-blog .soro-blog-article-content p:last-child {
  margin-bottom: 0;
}

#soro-blog .soro-blog-article-content h1,
#soro-blog .soro-blog-article-content h2,
#soro-blog .soro-blog-article-content h3 {
  color: #fff;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

#soro-blog .soro-blog-article-content h1:first-child,
#soro-blog .soro-blog-article-content h2:first-child,
#soro-blog .soro-blog-article-content h3:first-child {
  margin-top: 0;
}

#soro-blog .soro-blog-article-content a {
  color: #22c55e;
}

#soro-blog .soro-blog-article-content a:hover {
  text-decoration: underline;
}

#soro-blog .soro-blog-empty,
#soro-blog .soro-blog-loading {
  color: #9ca3af;
}

#soro-blog .soro-blog-error {
  color: #f87171;
}

#soro-blog .soro-blog-spinner {
  border-color: rgba(255, 255, 255, 0.12);
  border-top-color: #22c55e;
}

/* === Static Soro article cards === */
.blog-soro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
}

.blog-soro-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.25rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.blog-soro-card:hover {
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.blog-soro-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}
.blog-soro-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.blog-soro-card:hover .blog-soro-card-img img {
  transform: scale(1.03);
}

.blog-soro-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-soro-card-body time {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.blog-soro-card-body h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.blog-soro-card-body p {
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
