/* ==========================================================================
   BLOG STYLES — blog.css
   Modern Startup Aesthetic · Dark Hero · Borderless Cards · Blue Accents
   Matches main.css design tokens (v3.0)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BLOG LAYOUT — Main + Sidebar Grid
   -------------------------------------------------------------------------- */
.blog-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: start;
}

.blog-layout__main {
  min-width: 0;
}

.blog-layout__sidebar {
  position: sticky;
  top: calc(var(--nav-height-scrolled) + 2rem);
}

/* --------------------------------------------------------------------------
   2. BLOG FILTER BAR — Active Filters
   -------------------------------------------------------------------------- */
.blog-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--color-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.blog-filter-bar__info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.blog-filter-bar__info i {
  color: var(--color-accent);
  flex-shrink: 0;
}

.blog-filter-bar__info p {
  margin: 0;
}

.blog-filter-bar__clear {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.blog-filter-bar__clear:hover {
  background: var(--color-accent);
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. PAGINATION — Pill-Shaped Navigation
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
}

.pagination__numbers {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 40px;
  height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--color-text);
  background: var(--color-card-bg);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.pagination__link:hover {
  background: var(--color-bg-alt);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.pagination__link--active {
  background: var(--color-accent);
  color: var(--color-bg-dark);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-accent);
}

.pagination__link--active:hover {
  background: var(--color-accent-dark);
  color: var(--color-bg-dark);
}

.pagination__link--prev,
.pagination__link--next {
  padding: 0.5rem 1.25rem;
  font-weight: var(--fw-medium);
  gap: 0.5rem;
}

.pagination__link--prev i,
.pagination__link--next i {
  transition: transform var(--transition-fast);
}

.pagination__link--prev:hover i {
  transform: translateX(-2px);
}

.pagination__link--next:hover i {
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   4. SIDEBAR WIDGETS — Clean Cards, No Borders
   -------------------------------------------------------------------------- */
.sidebar-widget {
  background: var(--color-card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-widget__title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  position: relative;
}

.sidebar-widget__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2rem;
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-full);
}

/* Sidebar — Highlight (Newsletter) */
.sidebar-widget--highlight {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.sidebar-widget--highlight .sidebar-widget__title {
  color: var(--color-text-inverse);
}

.sidebar-widget--highlight p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   5. SIDEBAR SEARCH
   -------------------------------------------------------------------------- */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}

.sidebar-search:focus-within {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.sidebar-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
}

.sidebar-search input::placeholder {
  color: var(--color-text-muted);
}

.sidebar-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.sidebar-search button:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   6. SIDEBAR CATEGORIES
   -------------------------------------------------------------------------- */
.sidebar-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-categories li {
  margin-bottom: 0.25rem;
}

.sidebar-categories a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text);
  transition: all var(--transition-fast);
}

.sidebar-categories a:hover {
  background: var(--color-bg-alt);
  color: var(--color-accent);
}

.sidebar-categories a.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-accent);
  font-weight: var(--fw-medium);
}

.sidebar-categories__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.sidebar-categories__name {
  flex: 1;
}

.sidebar-categories__count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: var(--fw-medium);
}

.sidebar-categories a.active .sidebar-categories__count {
  background: rgba(37, 99, 235, 0.15);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   7. SIDEBAR NEWSLETTER
   -------------------------------------------------------------------------- */
.sidebar-newsletter {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-newsletter input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-inverse);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  outline: none;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
}

.sidebar-newsletter input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.sidebar-newsletter input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.sidebar-newsletter .btn {
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   8. BLOG EMPTY STATE
   -------------------------------------------------------------------------- */
.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
}

.blog-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--color-bg-alt);
  margin-bottom: 1.5rem;
}

.blog-empty__icon i,
.blog-empty i {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
}

.blog-empty h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: var(--fw-semibold);
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.blog-empty p {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.blog-empty__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--color-accent);
  transition: gap var(--transition-fast);
}

.blog-empty__action:hover {
  gap: 0.75rem;
}

/* ==========================================================================
   SINGLE POST STYLES
   ========================================================================== */

/* --------------------------------------------------------------------------
   9. POST HERO — Dark with Dot Grid
   -------------------------------------------------------------------------- */
.post__hero {
  padding: clamp(7rem, 14vw, 12rem) 0 clamp(3rem, 6vw, 5rem);
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Dot grid pattern */
.post__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Subtle radial glow */
.post__hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 50% at 50% 80%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 70% 20%, rgba(220, 38, 38, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.post__hero .container {
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   10. POST CATEGORY BADGE
   -------------------------------------------------------------------------- */
.post__category-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  transition: opacity var(--transition-fast);
}

.post__category-badge:hover {
  opacity: 0.85;
  color: #fff;
}

/* --------------------------------------------------------------------------
   11. POST TITLE
   -------------------------------------------------------------------------- */
.post__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--fw-extrabold);
  line-height: 1.15;
  letter-spacing: -0.04em;
  color: var(--color-text-inverse);
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* --------------------------------------------------------------------------
   12. POST META
   -------------------------------------------------------------------------- */
.post__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.post__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.post__meta-divider {
  color: rgba(255, 255, 255, 0.2);
  font-weight: var(--fw-bold);
}

/* --------------------------------------------------------------------------
   13. POST AUTHOR
   -------------------------------------------------------------------------- */
.post__author {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: var(--fw-medium);
}

.post__author-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.post__author-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
}

/* --------------------------------------------------------------------------
   14. POST FEATURED IMAGE
   -------------------------------------------------------------------------- */
.post__featured-image {
  position: relative;
  margin-top: -2rem;
  margin-bottom: 3rem;
  z-index: 3;
}

.post__featured-image img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   15. POST CONTENT — Article Body, Clean Markdown
   -------------------------------------------------------------------------- */
.container--narrow {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.post__content {
  padding: 2rem 0 3rem;
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-text);
}

/* Headings */
.post__content h2 {
  font-family: var(--font-heading);
  font-size: 1.625rem;
  font-weight: var(--fw-bold);
  margin-top: 3rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.post__content h3 {
  font-family: var(--font-heading);
  font-size: 1.3125rem;
  font-weight: var(--fw-semibold);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.post__content h4 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.post__content p {
  margin-bottom: 1.25rem;
}

/* Links */
.post__content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  transition: text-decoration-color var(--transition-fast);
}

.post__content a:hover {
  text-decoration-color: var(--color-accent);
}

.post__content strong {
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.post__content em {
  font-style: italic;
}

/* Images */
.post__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

/* Lists */
.post__content ul,
.post__content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.post__content ul {
  list-style: disc;
}

.post__content ol {
  list-style: decimal;
}

.post__content li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

.post__content li::marker {
  color: var(--color-accent);
}

.post__content hr {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 2.5rem 0;
}

/* Blockquotes */
.post__content blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  background: var(--color-bg-alt);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text);
}

.post__content blockquote p:last-child {
  margin-bottom: 0;
}

.post__content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  font-weight: var(--fw-medium);
  color: var(--color-text-light);
}

/* Code */
.post__content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.45em;
  background: var(--color-bg-alt);
  border-radius: var(--radius-xs);
  color: var(--color-accent-dark);
}

.post__content pre {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.6;
}

.post__content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.875rem;
}

/* Tables */
.post__content table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9375rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post__content thead {
  background: var(--color-bg-alt);
}

.post__content th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post__content td {
  padding: 0.75rem 1rem;
  color: var(--color-text);
  border-top: 1px solid var(--color-border);
}

.post__content tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

.post__content tbody tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

/* --------------------------------------------------------------------------
   16. POST TAGS
   -------------------------------------------------------------------------- */
.post__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.post__tag {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.post__tag:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   17. POST SHARE
   -------------------------------------------------------------------------- */
.post__share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.post__share-label {
  font-size: 0.875rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.post__share-buttons {
  display: flex;
  gap: 0.75rem;
}

.post__share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  transition: all var(--transition-fast);
}

.post__share-btn i {
  width: 18px;
  height: 18px;
}

.post__share-btn:hover {
  transform: translateY(-2px);
}

.post__share-btn--whatsapp:hover {
  background: #25D366;
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}

.post__share-btn--linkedin:hover {
  background: #0A66C2;
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 102, 194, 0.3);
}

.post__share-btn--twitter:hover {
  background: var(--color-bg-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   18. POST BACK LINK
   -------------------------------------------------------------------------- */
.post__back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--color-text-light);
  transition: color var(--transition-fast), gap var(--transition-fast);
}

.post__back-link:hover {
  color: var(--color-accent);
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   19. POST FOOTER
   -------------------------------------------------------------------------- */
.post__footer {
  padding: 2rem 0 3rem;
}

/* --------------------------------------------------------------------------
   20. AUTHOR CARD
   -------------------------------------------------------------------------- */
.author-card {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--color-card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  margin-top: 2rem;
}

.author-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.author-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card__info {
  flex: 1;
}

.author-card__label {
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.author-card__name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.author-card__bio {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.65;
}

/* ==========================================================================
   21. RESPONSIVE — Mobile-First Adjustments
   ========================================================================== */

/* ── Tablet ── */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .blog-layout__sidebar {
    position: static;
  }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  /* Filter bar stack */
  .blog-filter-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }

  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .pagination__link--prev span,
  .pagination__link--next span {
    display: none;
  }

  /* Post hero */
  .post__title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  .post__meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post__meta-divider {
    display: none;
  }

  /* Featured image */
  .post__featured-image {
    margin-top: -1rem;
    margin-bottom: 2rem;
  }

  .post__featured-image img {
    border-radius: var(--radius-lg);
  }

  /* Content */
  .post__content {
    font-size: 1rem;
    padding: 1.5rem 0 2rem;
  }

  .post__content h2 {
    font-size: 1.375rem;
  }

  .post__content h3 {
    font-size: 1.125rem;
  }

  .post__content pre {
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-size: 0.8125rem;
  }

  /* Share */
  .post__share {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Author card */
  .author-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
  .sidebar-widget {
    padding: 1.25rem;
  }

  .pagination__link {
    min-width: 36px;
    height: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}
