/* ==========================================================================
   seang.org - Tech Insights & Blog Stylesheet
   Consistent with premium Golang-cyan engineering light theme
   ========================================================================== */

/* Reading Progress Bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--golang-cyan), #38bdf8);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--golang-cyan);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
  color: #006882;
}

.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Category Badge & Tags */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-golang {
  background: var(--golang-cyan-light);
  color: var(--golang-cyan);
  border: 1px solid rgba(0, 135, 168, 0.25);
}

.category-distributed {
  background: var(--accent-indigo-light);
  color: var(--accent-indigo);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.category-microservices {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.category-caching {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* Blog Index Layout */
.blog-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.blog-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.blog-header p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Search & Filter Toolbar */
.blog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.search-box-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.blog-search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.blog-search-input:focus {
  outline: none;
  border-color: var(--golang-cyan);
  box-shadow: 0 0 0 3px var(--golang-cyan-glow);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--golang-cyan);
  color: #ffffff;
  border-color: var(--golang-cyan);
  box-shadow: 0 2px 8px var(--golang-cyan-glow);
}

/* Blog Cards Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3.5rem;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-card-hover);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  transition: var(--transition-smooth);
}

.blog-card:hover .blog-card-title {
  color: var(--golang-cyan);
}

.blog-card-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.blog-card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--golang-cyan);
  font-weight: 600;
}

.blog-card-readmore svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.blog-card:hover .blog-card-readmore svg {
  transform: translateX(4px);
}

/* ==========================================================================
   Article Detail Page Layout
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 992px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.article-main {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 3rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
}

@media (max-width: 640px) {
  .article-main {
    padding: 1.75rem 1.25rem;
  }
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-title {
  font-size: 2.35rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  .article-title {
    font-size: 1.75rem;
  }
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--golang-cyan);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Article Body Typography */
.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.article-body h2::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--golang-cyan);
  border-radius: 2px;
}

.article-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.75rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Code Blocks */
.code-block-wrapper {
  margin: 1.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #1e293b;
  background: #0f172a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.article-body pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.65;
  color: #e2e8f0;
  background: #0b1120;
}

.article-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface-subtle);
  color: var(--golang-cyan);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

/* Callout Box */
.callout-box {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  background: var(--golang-cyan-light);
  border-left: 4px solid var(--golang-cyan);
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.callout-title {
  font-weight: 700;
  color: var(--golang-cyan);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Table Styling */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.comparison-table th,
.comparison-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-weight: 600;
}

.comparison-table tr:hover td {
  background: rgba(0, 135, 168, 0.03);
}

/* AdSense Slot Layouts */
.adsense-slot-container {
  margin: 2.5rem 0;
  padding: 1.25rem;
  background: var(--bg-surface-subtle);
  border: 1px dashed var(--border-medium);
  border-radius: 12px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.adsense-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Sticky Sidebar */
.article-sidebar {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  display: block;
  line-height: 1.4;
}

.toc-link:hover,
.toc-link.active {
  color: var(--golang-cyan);
  padding-left: 4px;
}

.author-bio-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.author-bio-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
