/* ══════════════════════════════════════════════════════════════════════════════
   MIA Tech – Blog Styles
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Blog Navbar extras ──────────────────────────────────────────────────────── */
.navbar__blog-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.navbar__blog-link:hover,
.navbar__blog-link[aria-current="page"] {
  color: var(--brand);
  border-color: var(--brand);
}

/* ── Blog Hero ────────────────────────────────────────────────────────────────── */
.blog-hero {
  padding: 6rem 0 3rem;
  text-align: center;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(241,136,0,.12), transparent);
}
.blog-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: .75rem 0 1rem;
  color: var(--text-primary);
}
.blog-hero__badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cat-color, var(--brand));
  background: rgba(241,136,0,.1);
  border: 1px solid rgba(241,136,0,.25);
  padding: .35rem 1rem;
  border-radius: 99px;
}
.blog-hero__desc {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}
.blog-hero__back {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  transition: color var(--t-fast);
}
.blog-hero__back:hover { color: var(--brand); }

/* ── Category Filter ─────────────────────────────────────────────────────────── */
.blog-filters {
  padding: 1rem 0 2rem;
  border-bottom: 1px solid var(--border-subtle);
}
.blog-filters__inner {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
}
.blog-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .9rem;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--t-fast);
  background: transparent;
}
.blog-filter-tag:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-dim);
}
.blog-filter-tag--active {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-dim);
  font-weight: 600;
}
.blog-filter-tag__count {
  font-size: .75rem;
  background: var(--border-subtle);
  padding: .1rem .4rem;
  border-radius: 99px;
}

/* ── Blog Grid Section ───────────────────────────────────────────────────────── */
.blog-section { padding: 3rem 0 5rem; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}
.blog-grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ── Blog Card ───────────────────────────────────────────────────────────────── */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-brand);
}
.blog-card--featured {
  grid-column: span 2;
  flex-direction: row;
}
@media (max-width: 768px) {
  .blog-card--featured { flex-direction: column; grid-column: span 1; }
}
.blog-card__img-wrap {
  display: block;
  overflow: hidden;
  flex-shrink: 0;
}
.blog-card--featured .blog-card__img-wrap { width: 45%; max-height: 280px; }
.blog-card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform var(--t-slow);
}
.blog-card--featured .blog-card__img { height: 100%; }
.blog-card:hover .blog-card__img { transform: scale(1.04); }
.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1.5rem;
  flex: 1;
}
.blog-card__cat {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cat-color, var(--brand));
  text-decoration: none;
  font-family: var(--font-mono);
}
.blog-card__cat:hover { text-decoration: underline; }
.blog-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}
.blog-card--featured .blog-card__title { font-size: 1.4rem; }
.blog-card__title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
.blog-card__title a:hover { color: var(--brand); }
.blog-card__excerpt {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-top: auto;
}
.blog-card__read, .blog-card__views {
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* ── Pagination ──────────────────────────────────────────────────────────────── */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}
.blog-pagination__btn {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--t-fast);
}
.blog-pagination__btn:hover { background: var(--brand); color: #fff; }
.blog-pagination__info { color: var(--text-muted); font-size: .9rem; }
.blog-empty { text-align: center; padding: 5rem 2rem; color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════════════════════
   SINGLE POST
   ══════════════════════════════════════════════════════════════════════════════ */

.post-breadcrumb { padding: 5.5rem 0 1rem; border-bottom: 1px solid var(--border-subtle); }
.post-breadcrumb__list {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  list-style: none; font-size: .82rem; color: var(--text-muted);
}
.post-breadcrumb__list li::after { content: '›'; margin-left: .4rem; }
.post-breadcrumb__list li:last-child::after { content: ''; }
.post-breadcrumb__list a { color: var(--text-secondary); text-decoration: none; }
.post-breadcrumb__list a:hover { color: var(--brand); }

.post__header {
  padding: 4rem 0 2rem;
  background: radial-gradient(ellipse 90% 60% at 50% 0%, rgba(241,136,0,.08), transparent);
}
.post__header-inner {
  max-width: 800px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.post__cat {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cat-color, var(--brand)); text-decoration: none; align-self: flex-start;
}
.post__cat:hover { text-decoration: underline; }
.post__title {
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800;
  line-height: 1.2; color: var(--text-primary);
}
.post__excerpt {
  font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; max-width: 720px;
}
.post__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem;
  font-size: .85rem; color: var(--text-muted);
  padding-top: .5rem; border-top: 1px solid var(--border-subtle);
}
.post__author, .post__date, .post__read, .post__views, .post__updated {
  display: flex; align-items: center; gap: .4rem;
}
.post__author { color: var(--brand); font-weight: 600; }

.post__cover { margin: 2rem 0; }
.post__cover-img {
  width: 100%; max-height: 480px; object-fit: cover;
  border-radius: var(--radius-lg); display: block;
}

.post__layout {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 3rem; padding: 2rem 0 4rem; align-items: start;
}

/* Prose */
.prose {
  color: var(--text-secondary); line-height: 1.85;
  font-size: 1.05rem; max-width: 720px;
}
.prose h2 {
  font-size: 1.7rem; font-weight: 700; color: var(--text-primary);
  margin: 2.5rem 0 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}
.prose h3 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin: 2rem 0 .75rem; }
.prose h4 { font-size: 1.05rem; font-weight: 700; color: var(--brand); margin: 1.5rem 0 .5rem; }
.prose p { margin-bottom: 1.25rem; }
.prose strong { color: var(--text-primary); }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { text-decoration: none; }
.prose ul, .prose ol { margin: 1rem 0 1.5rem 1.5rem; }
.prose li { margin-bottom: .5rem; }
.prose blockquote {
  border-left: 4px solid var(--brand); margin: 1.5rem 0; padding: .75rem 1.25rem;
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--surface); padding: .15em .4em;
  border-radius: 4px; color: var(--brand);
}
.prose pre {
  background: var(--bg-3); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0;
}
.prose pre code { background: none; padding: 0; color: var(--text-primary); font-size: .875rem; }
.prose img { max-width: 100%; border-radius: var(--radius); margin: 1.5rem 0; display: block; }
.post__content .prose figure,
.post__content .prose img,
.post__content .prose picture,
.post__content .prose svg,
.post__content .prose object,
.post__content .prose embed {
  display: none !important;
}
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}
.prose th {
  background: var(--surface); color: var(--text-primary);
  padding: .6rem 1rem; text-align: left; border-bottom: 2px solid var(--border);
}
.prose td { padding: .55rem 1rem; border-bottom: 1px solid var(--border-subtle); }
.prose .callout {
  display: flex; gap: .75rem; padding: 1rem 1.25rem;
  border-radius: var(--radius); margin: 1.5rem 0;
  border-left: 4px solid var(--brand); background: var(--brand-dim);
}
.prose .callout--info  { border-color: #3b82f6; background: rgba(59,130,246,.1); }
.prose .callout--warn  { border-color: #f59e0b; background: rgba(245,158,11,.1); }
.prose .callout--tip   { border-color: #10b981; background: rgba(16,185,129,.1); }

/* Sidebar */
.post__sidebar {
  position: sticky; top: 100px;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.post-widget {
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.post-widget__title {
  font-size: .85rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 1rem; font-family: var(--font-mono);
}
.post-widget--cta {
  border-color: var(--border);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(241,136,0,.08) 100%);
}
.post-widget--cta p { font-size: .9rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.post-widget__rss {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .85rem; color: var(--brand); text-decoration: none; font-weight: 600;
}
.post-widget__rss:hover { text-decoration: underline; }
.post-widget p { font-size: .9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: .75rem; }

.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.post-tag {
  display: inline-block; font-size: .8rem; padding: .25rem .7rem;
  border-radius: 99px; border: 1px solid var(--border-subtle);
  color: var(--text-secondary); text-decoration: none; transition: all var(--t-fast);
  font-family: var(--font-mono);
}
.post-tag:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-dim); }

/* Share */
.post-share {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem 0; flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle);
  margin: 1rem 0 2rem;
}
.post-share__label {
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono);
}
.post-share__btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-radius: var(--radius); font-size: .85rem;
  font-weight: 600; text-decoration: none; border: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-secondary); cursor: pointer;
  transition: all var(--t-fast); font-family: var(--font-sans);
}
.post-share__btn:hover { border-color: var(--border); color: var(--text-primary); }
.post-share__btn--twitter:hover  { border-color: #1da1f2; color: #1da1f2; }
.post-share__btn--linkedin:hover { border-color: #0a66c2; color: #0a66c2; }
.post-share__btn--copy:hover     { border-color: var(--brand); color: var(--brand); }

/* Related */
.related-posts { padding: 3rem 0; border-top: 1px solid var(--border-subtle); }
.related-posts__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 2rem; color: var(--text-primary); }

/* CTA */
.post-cta {
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--bg-2) 0%, rgba(241,136,0,.06) 100%);
}
.post-cta__inner {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(241,136,0,.12) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 3.5rem; text-align: center; box-shadow: var(--shadow-brand);
}
.post-cta__inner h2 { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; color: var(--text-primary); }
.post-cta__inner p { color: var(--text-secondary); max-width: 540px; margin: 0 auto 2rem; font-size: 1.05rem; line-height: 1.7; }

/* Utilities */
.btn--full { width: 100%; justify-content: center; }
.btn--lg   { padding: .9rem 2rem; font-size: 1rem; }
.brand-text { color: var(--brand); }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 960px) {
  /* ── Post layout: stack sidebar below content ── */
  .post__layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .post__content {
    order: 1;
  }
  .post__sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    order: 2;
  }

  /* ── Blog hero padding ── */
  .blog-hero {
    padding: 4rem 0 2rem;
  }

  /* ── Post header ── */
  .post__header {
    padding: 3rem 0 1.75rem;
  }

  /* ── Post CTA ── */
  .post-cta__inner {
    padding: 2.5rem 2rem;
  }
  .post-cta__inner h2 {
    font-size: 1.6rem;
  }

  /* ── Related posts grid ── */
  .related-posts { padding: 2rem 0; }
}

@media (max-width: 768px) {
  .post-breadcrumb { padding-top: 4.5rem; }
  /* ── Featured card: already handled, but ensure image fills ── */
  .blog-card--featured .blog-card__img-wrap {
    width: 100%;
    max-height: 220px;
  }
  .blog-card--featured .blog-card__img {
    height: 220px;
  }

  /* ── Breadcrumb tighter ── */
  .post-breadcrumb__list {
    font-size: .78rem;
  }

  /* ── Post meta wrap tighter ── */
  .post__meta {
    gap: .85rem;
    font-size: .82rem;
  }

  /* ── Post header smaller title already via clamp, but add padding ── */
  .post__header-inner {
    padding: 0 1.25rem;
  }

  /* ── Post cover image height ── */
  .post__cover-img {
    max-height: 320px;
  }

  /* ── Share buttons ── */
  .post-share {
    gap: .6rem;
  }
  .post-share__btn {
    padding: .45rem .85rem;
    font-size: .82rem;
  }

  /* ── Sidebar widgets stacked ── */
  .post__sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  /* ── Mobile side padding for blog content ── */
  .blog-hero .container,
  .blog-filters .container,
  .blog-section .container,
  .post-breadcrumb .container,
  .post__cover .container,
  .post__layout {
    padding-inline: 1.25rem;
  }

  /* ── Blog grid: single column ── */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  /* ── Blog hero ── */
  .blog-hero {
    padding: 3rem 0 1.5rem;
  }
  .blog-hero h1 {
    font-size: 2rem;
  }
  .blog-hero__desc {
    font-size: .95rem;
  }

  /* ── Category filter: horizontal scroll ── */
  .blog-filters__inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: .5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .blog-filters__inner::-webkit-scrollbar { display: none; }
  .blog-filter-tag {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── Blog section padding ── */
  .blog-section {
    padding: 2rem 0 3.5rem;
  }

  /* ── Blog cards typography ── */
  .blog-card__title {
    font-size: 1.05rem;
  }
  .blog-card--featured .blog-card__title {
    font-size: 1.25rem;
  }
  .blog-card__excerpt {
    font-size: .85rem;
  }

  /* ── Post header ── */
  .post__header {
    padding: 2rem 0 1.25rem;
  }
  .post__meta {
    gap: .6rem;
    font-size: .78rem;
  }
  .post__excerpt {
    font-size: .98rem;
  }
  .post__title {
    font-size: 1.8rem;
  }

  /* ── Post content ── */
  .prose {
    font-size: .98rem;
  }
  .prose h2 {
    font-size: 1.35rem;
    margin: 2rem 0 .75rem;
  }
  .prose h3 {
    font-size: 1.1rem;
  }
  .prose .callout {
    flex-direction: column;
    gap: .5rem;
  }

  /* ── Post share wrap ── */
  .post-share {
    flex-wrap: wrap;
    gap: .5rem;
  }
  .post-share__btn {
    font-size: .8rem;
    padding: .4rem .75rem;
  }

  /* ── Post CTA ── */
  .post-cta__inner {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
  }
  .post-cta__inner h2 {
    font-size: 1.35rem;
  }
  .post-cta__inner p {
    font-size: .95rem;
  }

  /* ── Post cover height ── */
  .post__cover-img {
    max-height: 240px;
    border-radius: var(--radius);
  }

  /* ── Pagination ── */
  .blog-pagination {
    gap: .6rem;
    margin-top: 2rem;
  }
  .blog-pagination__btn {
    padding: .5rem 1rem;
    font-size: .85rem;
  }

  /* ── Related posts title ── */
  .related-posts__title {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 480px) {
  .blog-hero h1 {
    font-size: 1.75rem;
  }
  .post__title {
    font-size: 1.65rem;
  }
  .post__excerpt,
  .prose {
    font-size: .93rem;
  }
  .prose h2 {
    font-size: 1.2rem;
  }
  .prose h3 {
    font-size: 1rem;
  }
}
