.blog-page {
  padding-bottom: 72px;
}

.blog-header {
  padding: 58px 0 34px;
  border-bottom: 1px solid var(--color-line);
}

.blog-eyebrow {
  margin-bottom: 12px;
  color: var(--color-brand);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-header h1 {
  max-width: 780px;
  font-size: 2.45rem;
}

.blog-intro {
  margin-top: 12px;
  color: var(--color-ink-soft);
  font-size: 1rem;
}

.blog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
}

.blog-results {
  color: var(--color-ink-soft);
  font-size: .88rem;
}

.blog-search {
  display: flex;
  width: min(100%, 390px);
  height: 44px;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.blog-search:focus-within {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}

.blog-search input {
  min-width: 0;
  flex: 1;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-ink);
  font: inherit;
}

.blog-search-button {
  display: grid;
  width: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--color-brand);
}

.blog-search-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
  min-height: 240px;
}

.blog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  transition: border-color .18s ease, transform .18s ease;
}

.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-line-strong);
}

.blog-card-media {
  display: grid;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  place-items: center;
  background: var(--color-bg-soft);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-image-fallback {
  color: var(--color-ink-faint);
  font-size: .86rem;
}

.blog-card-body {
  display: flex;
  min-height: 148px;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 18px 20px;
}

.blog-card-title {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 14px;
  font-size: 1.08rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blog-card-creator {
  margin-top: auto;
  color: var(--color-ink);
  font-size: .84rem;
  font-weight: 600;
}

.blog-card-date {
  margin-top: 4px;
  color: var(--color-ink-soft);
  font-size: .78rem;
}

.blog-state {
  grid-column: 1 / -1;
  align-self: center;
  padding: 56px 16px;
  color: var(--color-ink-soft);
  text-align: center;
}

.blog-state-error {
  color: #a33125;
}

.blog-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 32px 0 8px;
}

.blog-page-button {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-ink);
  font-size: .86rem;
  font-weight: 600;
}

.blog-page-button:hover:not(:disabled),
.blog-page-button.active {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: #fff;
}

.blog-page-button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
  }
}

@media (max-width: 600px) {
  .blog-page {
    padding-bottom: 48px;
  }

  .blog-header {
    padding: 40px 0 26px;
  }

  .blog-header h1 {
    font-size: 1.9rem;
  }

  .blog-tools {
    align-items: stretch;
    flex-direction: column-reverse;
    gap: 14px;
  }

  .blog-search {
    width: 100%;
  }

  .blog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .blog-card-body {
    min-height: 132px;
  }
}

/* ============================================================
   DETALLE DE ARTÍCULO (blogs.php)
   ============================================================ */
.blog-article-page {
  padding-top: 24px;
  padding-bottom: 80px;
}

/* Breadcrumbs */
.blog-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .86rem;
  color: var(--color-ink-soft);
  margin-bottom: 28px;
}

.blog-breadcrumbs a {
  color: var(--color-ink-soft);
  transition: color .15s ease;
}

.blog-breadcrumbs a:hover {
  color: var(--color-brand);
}

.blog-breadcrumbs span.separator {
  color: var(--color-line-strong);
}

.blog-breadcrumbs span.current {
  color: var(--color-ink);
  font-weight: 500;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Article Container */
.article-container {
  max-width: 880px;
  margin: 0 auto;
}

/* Article Header */
.article-header {
  margin-bottom: 32px;
}

.article-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(23, 58, 138, 0.08);
  color: var(--color-brand);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 16px;
}

.article-header h1 {
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  margin-bottom: 16px;
}

.article-lead {
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--color-ink-soft);
  margin-bottom: 24px;
}

/* Meta Bar */
.article-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
}

.article-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .95rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(23, 58, 138, 0.2);
}

.article-meta-details {
  display: flex;
  flex-direction: column;
}

.article-author-name {
  font-size: .94rem;
  font-weight: 700;
  color: var(--color-ink);
}

.article-meta-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--color-ink-soft);
}

.article-meta-dot {
  color: var(--color-line-strong);
}

/* Quick Share (Top) */
.article-quick-share {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-share-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-ink-soft);
}

.share-btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-bg-soft);
  color: var(--color-ink);
  border: 1px solid var(--color-line);
  transition: all .2s ease;
}

.share-btn-mini svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.share-btn-mini:hover {
  transform: translateY(-2px);
  color: #fff;
}

.share-btn-mini.wa:hover { background: #25D366; border-color: #25D366; }
.share-btn-mini.fb:hover { background: #1877F2; border-color: #1877F2; }
.share-btn-mini.tw:hover { background: #111111; border-color: #111111; }
.share-btn-mini.in:hover { background: #0A66C2; border-color: #0A66C2; }
.share-btn-mini.tg:hover { background: #229ED9; border-color: #229ED9; }
.share-btn-mini.copy:hover { background: var(--color-brand); border-color: var(--color-brand); }

/* Featured Media */
.article-featured-media {
  margin: 32px 0 40px;
}

.article-media-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.article-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.article-video-wrapper iframe,
.article-video-wrapper video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Article Rich Content */
.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-ink);
}

.article-content p {
  margin-bottom: 24px;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 44px 0 18px;
  color: var(--color-ink);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 36px 0 14px;
  color: var(--color-ink);
}

.article-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 12px;
}

.article-content blockquote {
  margin: 32px 0;
  padding: 22px 28px;
  background: var(--color-bg-soft);
  border-left: 4px solid var(--color-brand);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-ink);
}

.article-content ul,
.article-content ol {
  margin: 0 0 24px 24px;
  padding: 0;
}

.article-content li {
  margin-bottom: 10px;
  padding-left: 6px;
}

.article-content ul li {
  list-style: disc;
}

.article-content ol li {
  list-style: decimal;
}

.article-content strong {
  font-weight: 700;
  color: var(--color-ink);
}

.article-content em {
  font-style: italic;
}

.article-content a {
  color: var(--color-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity .15s ease;
}

.article-content a:hover {
  opacity: .8;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 28px auto;
  display: block;
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
  background: var(--color-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-line);
}

.article-content pre {
  background: #1e2229;
  color: #f1f3f5;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 28px 0;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  border: 0;
  color: inherit;
}

.article-content hr {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 48px 0;
}

/* Article Share Box (Bottom) */
.article-share-box {
  margin: 52px 0 40px;
  padding: 32px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}

.share-box-header {
  text-align: center;
  margin-bottom: 24px;
}

.share-box-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--color-ink);
}

.share-box-header p {
  color: var(--color-ink-soft);
  font-size: .92rem;
}

.share-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.share-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.share-card-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.share-card-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.share-card-btn.wa { background: #25D366; }
.share-card-btn.fb { background: #1877F2; }
.share-card-btn.tw { background: #000000; }
.share-card-btn.in { background: #0A66C2; }
.share-card-btn.tg { background: #229ED9; }
.share-card-btn.email { background: #555B66; }

/* Copy Link Bar */
.share-copy-bar {
  display: flex;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 14px;
  align-items: center;
}

.share-copy-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--color-ink-soft);
  font-size: .86rem;
  outline: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-brand);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 600;
  transition: background .15s ease;
}

.share-copy-btn:hover {
  background: var(--color-brand-dark);
}

.share-copy-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Article Navigation (Previous / Next) */
.article-nav-footer {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 1px solid var(--color-line);
}

.article-nav-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
}

.article-nav-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  transition: all .2s ease;
  min-height: 90px;
  justify-content: center;
}

.article-nav-card:hover {
  border-color: var(--color-brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(23, 58, 138, 0.08);
}

.article-nav-card.prev {
  text-align: left;
}

.article-nav-card.next {
  text-align: right;
}

.nav-direction-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-brand);
  margin-bottom: 6px;
}

.article-nav-card.next .nav-direction-label {
  justify-content: flex-end;
}

.nav-article-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.article-nav-center {
  display: flex;
  justify-content: center;
}

.btn-all-blogs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  font-size: .86rem;
  font-weight: 600;
  transition: all .15s ease;
  white-space: nowrap;
}

.btn-all-blogs:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #fff;
}

.btn-all-blogs svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.article-nav-empty {
  visibility: hidden;
}

/* Toast Alert */
.blog-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

.blog-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.blog-toast svg {
  width: 18px;
  height: 18px;
  color: #10b981;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .article-quick-share {
    width: 100%;
    justify-content: flex-start;
  }

  .article-nav-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .article-nav-center {
    order: -1;
  }

  .article-nav-card.next {
    text-align: left;
  }

  .article-nav-card.next .nav-direction-label {
    justify-content: flex-start;
  }

  .share-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}