/* Port of blog/[slug].astro scoped styles */

.blog-detail-page {
  padding-top: calc(88px + env(safe-area-inset-top, 0px));
  padding-bottom: 40px;
  background-color: var(--background);
  position: relative;
}

@media (min-width: 768px) {
  .blog-detail-page {
    padding-top: calc(120px + env(safe-area-inset-top, 0px));
    padding-bottom: 96px;
  }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--divider);
  z-index: 1000;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  box-shadow: 0 0 8px var(--primary);
  transition: width 0.1s ease-out;
}

.blog-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.blog-breadcrumbs a { color: var(--muted); text-decoration: none; transition: color var(--motion-fast, 0.2s); }
.blog-breadcrumbs a:hover { color: var(--primary); }
.blog-breadcrumbs .separator { color: var(--border); display: inline-flex; align-items: center; }
.blog-breadcrumbs .current { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }

@media (max-width: 480px) {
  .blog-breadcrumbs .current { max-width: 120px; }
}

.blog-hero-section {
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .blog-hero-section { padding-bottom: 24px; margin-bottom: 24px; }
}

.blog-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

@media (min-width: 1024px) {
  .blog-hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 48px; }
}

.blog-hero-content { display: flex; flex-direction: column; align-items: flex-start; }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--primary); text-decoration: none; margin-bottom: 24px; transition: transform var(--motion-fast, 0.2s); }
.back-link:hover { transform: translateX(-4px); }

.article-category-badge {
  display: inline-block;
  background-color: var(--primary-light);
  border: 1px solid rgba(27, 84, 216, 0.18);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

[data-theme='dark'] .article-category-badge {
  background: rgba(75, 138, 245, 0.1);
  border-color: rgba(75, 138, 245, 0.22);
}

.article-title { font-size: clamp(2rem, 3.5vw + 0.5rem, 2.75rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; color: var(--heading); margin: 0 0 16px; }
.article-lead { font-size: clamp(1.05rem, 0.3vw + 1rem, 1.18rem); line-height: 1.6; color: var(--text); margin: 0 0 24px; font-weight: 500; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); }
.article-meta .meta-item { display: inline-flex; align-items: center; gap: 8px; }

.blog-hero-image-wrapper { position: relative; width: 100%; }
.blog-hero-image-wrapper::before { content: ''; position: absolute; inset: -10px; background: radial-gradient(circle, rgba(27, 84, 216, 0.08) 0%, transparent 70%); z-index: -1; filter: blur(10px); border-radius: 30px; }
.blog-hero-image-wrapper .image-inner-container { border-radius: 24px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); aspect-ratio: 16 / 11; background: var(--surface-2); }
.featured-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease-out); }
.featured-img:hover { transform: scale(1.03); }

.blog-main-layout { margin-bottom: 32px; }
@media (min-width: 768px) { .blog-main-layout { margin-bottom: 64px; } }

.blog-grid-layout { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 1024px) { .blog-grid-layout { grid-template-columns: 1fr 340px; gap: 48px; } }
@media (min-width: 1200px) { .blog-grid-layout { grid-template-columns: 1fr 380px; gap: 64px; } }
.blog-content-col { min-width: 0; }

/* ─── Article body ─────────────────────────────────────────── */
.article-body {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) { .article-body { padding: 40px; margin-bottom: 40px; } }

.article-content { font-size: clamp(1rem, 0.2vw + 0.95rem, 1.125rem); line-height: 1.85; color: var(--text); overflow-wrap: anywhere; word-break: break-word; }
.article-content p { margin: 0 0 24px; }
.article-content p:last-child { margin-bottom: 0; }
.article-content pre { overflow-x: auto; max-width: 100%; box-sizing: border-box; }
.article-content table { display: block; max-width: 100%; overflow-x: auto; }
.article-content img { max-width: 100%; height: auto; }

.article-content h2 { font-size: clamp(1.4rem, 1.5vw + 0.5rem, 1.75rem); font-weight: 800; color: var(--heading); margin: 48px 0 20px; letter-spacing: -0.02em; line-height: 1.3; border-left: 4px solid var(--primary); padding-left: 16px; margin-left: -40px; }
@media (max-width: 1200px) { .article-content h2 { margin-left: -24px; } }
@media (max-width: 767px) { .article-content h2 { margin-left: 0; padding-left: 12px; } }

.article-content h3 { font-size: clamp(1.2rem, 1vw + 0.5rem, 1.4rem); font-weight: 700; color: var(--heading); margin: 36px 0 16px; line-height: 1.4; }
.article-content ul { margin: 0 0 28px; padding-left: 0; list-style-type: none; }
.article-content ul li { position: relative; padding-left: 28px; margin-bottom: 12px; line-height: 1.6; }
.article-content ul li::before { content: '✓'; position: absolute; left: 4px; top: 0; color: var(--primary); font-weight: 700; font-size: 16px; }
.article-content ol { margin: 0 0 28px; padding-left: 20px; }
.article-content ol li { margin-bottom: 12px; line-height: 1.6; padding-left: 8px; }
.article-content ol li::marker { color: var(--primary); font-weight: 700; }
.article-content strong { color: var(--heading); font-weight: 700; }

.article-content blockquote {
  margin: 36px 0;
  padding: 24px 32px;
  border-left: 4px solid var(--accent);
  background-color: var(--surface-2);
  border-radius: 0 16px 16px 0;
  font-style: italic;
  color: var(--heading);
  font-size: 1.05em;
  position: relative;
}

.article-content blockquote::before { content: '"'; position: absolute; top: 8px; left: 12px; font-size: 60px; font-family: serif; color: rgba(212, 160, 18, 0.12); line-height: 1; }
.article-content blockquote p { margin: 0; position: relative; z-index: 1; }

/* ─── Feedback ──────────────────────────────────────────────── */
.article-feedback-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.feedback-title { font-size: 1.25rem; font-weight: 700; color: var(--heading); margin: 0 0 8px; }
.feedback-text { font-size: 0.95rem; color: var(--muted); margin: 0 0 24px; }
.feedback-buttons { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; }

.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.925rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  transition: all var(--motion-fast, 0.2s);
}

.feedback-btn:hover { transform: translateY(-2px); }
.feedback-btn.positive:hover { background-color: var(--primary-light); border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 12px rgba(27, 84, 216, 0.1); }
.feedback-btn.negative:hover { background-color: rgba(220, 38, 38, 0.05); border-color: var(--error); color: var(--error); box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1); }

.feedback-thanks { display: flex; flex-direction: column; align-items: center; padding: 12px 0; }
.thanks-icon-wrap { width: 48px; height: 48px; border-radius: 50%; background-color: rgba(22, 163, 74, 0.1); color: var(--success); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 24px; font-weight: bold; }
.hidden { display: none !important; }

@keyframes slideUpFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sticky-sidebar-wrapper { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1024px) { .sticky-sidebar-wrapper { gap: 32px; position: sticky; top: calc(88px + 32px); } }

.sidebar-widget { background-color: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm); transition: border-color var(--motion-fast, 0.2s); }
.sidebar-widget:hover { border-color: rgba(27, 84, 216, 0.22); }
.sidebar-widget .widget-title { font-size: 0.95rem; font-weight: 700; color: var(--heading); margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--divider); padding-bottom: 12px; }

/* TOC */
.toc-navigation { max-height: 350px; overflow-y: auto; padding-right: 4px; }
.toc-navigation::-webkit-scrollbar { width: 4px; }
.toc-navigation::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.toc-item { line-height: 1.4; }
.toc-item.toc-h3 { padding-left: 16px; font-size: 0.9em; }
.toc-link { color: var(--text); text-decoration: none; font-size: 14.5px; transition: all var(--motion-fast, 0.2s); display: block; border-left: 2px solid transparent; padding-left: 8px; }
.toc-link:hover { color: var(--primary); border-left-color: var(--border); }
.toc-link.active { color: var(--primary); font-weight: 600; border-left-color: var(--primary); }

/* Contact widget */
.contact-widget { background: var(--hero-gradient); border-color: var(--primary-light); position: relative; overflow: hidden; }
.contact-widget::after { content: ''; position: absolute; top: -50%; right: -50%; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(27, 84, 216, 0.05) 0%, transparent 70%); z-index: 0; }
.contact-badge { display: inline-block; background: var(--accent); color: #000; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 9999px; margin-bottom: 12px; z-index: 1; position: relative; }
.contact-widget .widget-desc { font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 20px; z-index: 1; position: relative; }
.contact-actions { display: flex; flex-direction: column; gap: 12px; z-index: 1; position: relative; }

.sidebar-contact-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; text-decoration: none; transition: all var(--motion-fast, 0.2s); }
.sidebar-contact-btn:hover { transform: translateY(-2px); }
.sidebar-contact-btn.phone-btn { background: var(--primary-gradient); color: #fff; box-shadow: 0 4px 12px rgba(27, 84, 216, 0.2); }
.sidebar-contact-btn.phone-btn:hover { box-shadow: 0 6px 16px rgba(27, 84, 216, 0.3); }
.sidebar-contact-btn.whatsapp-btn { background-color: #25D366; color: #fff; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2); }
.sidebar-contact-btn.whatsapp-btn:hover { background-color: #20ba59; box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3); }
.sidebar-contact-btn .btn-text-wrap { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-contact-btn .btn-label { font-size: 11px; opacity: 0.85; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.sidebar-contact-btn .btn-value { font-size: 14px; font-weight: 700; }
.widget-trust-footer { display: flex; justify-content: space-between; margin-top: 16px; font-size: 11px; color: var(--muted); font-weight: 600; border-top: 1px solid var(--divider); padding-top: 12px; z-index: 1; position: relative; }

/* Author widget */
.author-info-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.author-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; box-shadow: var(--shadow-sm); }
.author-details { display: flex; flex-direction: column; line-height: 1.3; }
.author-name { font-size: 15px; font-weight: 700; color: var(--heading); }
.author-role { font-size: 12px; color: var(--muted); font-weight: 500; }
.author-bio { font-size: 13.5px; line-height: 1.5; color: var(--text); margin: 0; }

/* Share widget */
.share-buttons-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.share-btn-action { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background-color: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; text-decoration: none; transition: all var(--motion-fast, 0.2s); }
.share-btn-action:hover { background-color: var(--surface-2); color: var(--primary); border-color: var(--primary-light); }
.share-btn-icon { display: inline-flex; align-items: center; width: 16px; height: 16px; color: var(--muted); }
.share-btn-action:hover .share-btn-icon { color: var(--primary); }

/* Related posts */
.related-posts-section { padding: 32px 0; background-color: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .related-posts-section { padding: 80px 0; } }
.related-posts-section .section-header { margin-bottom: 40px; text-align: center; }
.related-posts-section .section-subtitle { color: var(--primary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 8px; }
.related-posts-section .section-title { font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem); font-weight: 800; color: var(--heading); margin: 0; }

.related-posts-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 600px) { .related-posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related-posts-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }

.related-post-card { background-color: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; transition: all var(--motion-fast, 0.2s); height: 100%; }
.related-post-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: rgba(27, 84, 216, 0.18); }
.related-post-card .card-link-wrapper { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.related-post-card .card-image-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background-color: var(--surface-2); }
.related-post-card .card-badge { position: absolute; top: 12px; left: 12px; z-index: 2; background-color: var(--primary); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 8px; border-radius: 9999px; }
.related-post-card .card-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--motion-slow, 0.4s); }
.related-post-card:hover .card-img { transform: scale(1.05); }
.related-post-card .card-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.related-post-card .card-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.related-post-card .card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.related-post-card .card-title { font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--heading); margin: 0 0 8px; transition: color var(--motion-fast, 0.2s); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-post-card:hover .card-title { color: var(--primary); }
.related-post-card .card-excerpt { font-size: 13px; line-height: 1.5; color: var(--text); margin: 0 0 16px; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-post-card .card-read-more { font-size: 12.5px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; transition: gap var(--motion-fast, 0.2s); }
.related-post-card:hover .card-read-more { gap: 6px; }
