/* ============ BLOG INDEX — page-specific ============ */

/* Fondo del page-hero del blog: imagen + overlay oscuro para legibilidad */
.page-hero::after {
  background: url('../imagenes/blog.jpg') center/cover no-repeat;
  z-index: -2;
}
.page-hero::before {
  background:
    linear-gradient(110deg, rgba(15,25,45,.85) 0%, rgba(15,25,45,.65) 55%, rgba(15,25,45,.45) 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 24px, transparent 24px 48px);
  z-index: -1;
}

/* Search bar inside page hero */
.blog-search { margin-top: 30px; display: flex; max-width: 520px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; backdrop-filter: blur(4px); }
.blog-search input { flex: 1; background: transparent; border: none; padding: 14px 18px; color: #fff; font: inherit; font-size: 15px; outline: none; }
.blog-search input::placeholder { color: rgba(255,255,255,.55); }
.blog-search button { background: var(--brand-accent); color: #fff; border: none; padding: 0 22px; font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .15s; }
.blog-search button:hover { background: var(--brand-accent-2); }

/* Featured article */
.blog-main { padding-top: 70px; padding-bottom: 80px; }
.featured { display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 64px; }
.featured .img { background: var(--bg-soft); position: relative; min-height: 360px; border-right: 1px solid var(--line); overflow: hidden; }
.featured .img img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
/* Placeholder pattern solo si no hay imagen */
.featured .img:not(:has(img)) { background-image: repeating-linear-gradient(135deg, transparent 0 16px, rgba(27,42,68,.06) 16px 32px); display: flex; align-items: center; justify-content: center; }
.featured .img:not(:has(img))::before { content: ""; position: absolute; inset: 18px; border: 1px solid var(--line); }
.featured .img .ph-label { font-family: ui-monospace, monospace; font-size: 11px; color: var(--text-mute); letter-spacing: .18em; text-transform: uppercase; background: var(--bg); padding: 8px 14px; border: 1px solid var(--line); }
.featured .body { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.featured .tag { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-accent); font-weight: 700; margin-bottom: 16px; }
.featured .tag::before { content: ""; width: 24px; height: 1px; background: var(--brand-accent); }
.featured h2 { font-size: clamp(26px, 2.4vw, 34px); margin-bottom: 16px; }
.featured .excerpt { font-size: 16.5px; color: var(--text-soft); margin-bottom: 22px; }
.featured .meta { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--text-mute); margin-bottom: 26px; }
.featured .meta .dot { width: 3px; height: 3px; background: var(--text-mute); border-radius: 50%; }
.featured .read-link { color: var(--brand-primary); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; border-bottom: 2px solid var(--brand-accent); padding-bottom: 4px; }
.featured .read-link:hover { color: var(--brand-accent); }

/* Listing grid: 3-up, with author meta on each card */
.list-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.list-head h2 { font-size: 24px; }
.list-head .sort { font-size: 13px; color: var(--text-mute); display: flex; align-items: center; gap: 10px; }
.list-head .sort select { font: inherit; font-size: 13px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: var(--text); cursor: pointer; }

.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 50px; }
.b-card { background: var(--white); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; transition: all .2s; display: flex; flex-direction: column; }
.b-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-accent); }
.b-card .img { aspect-ratio: 16/10; background: var(--bg-soft); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.b-card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Placeholder pattern solo si no hay imagen */
.b-card .img:not(:has(img)) { background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(27,42,68,.06) 14px 28px); display: flex; align-items: center; justify-content: center; }
.b-card .img:not(:has(img))::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--line); }
.b-card .img .ph-label { font-family: ui-monospace, monospace; font-size: 10px; color: var(--text-mute); letter-spacing: .18em; text-transform: uppercase; background: var(--bg); padding: 5px 10px; border: 1px solid var(--line); }
.b-card .body { padding: 24px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.b-card h3 { font-size: 19px; margin-bottom: 12px; line-height: 1.3; }
.b-card .excerpt { font-size: 14.5px; color: var(--text-soft); flex: 1; margin-bottom: 18px; }
.b-card .meta { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-mute); }
.b-card .meta .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-soft); color: var(--brand-primary); display: flex; align-items: center; justify-content: center; font-family: 'Spectral',serif; font-weight: 700; font-size: 13px; }
.b-card .meta .name { color: var(--text); font-weight: 600; }
.b-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-mute); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; }
.pagination a { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text); background: #fff; transition: all .15s; font-size: 14px; }
.pagination a:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.pagination a.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.pagination a.disabled { opacity: .35; pointer-events: none; }
.pagination .ellipsis { width: 42px; text-align: center; color: var(--text-mute); }

/* Responsive overrides */
@media (max-width: 980px) {
  .featured { grid-template-columns: 1fr; }
  .featured .img { min-height: 220px; border-right: none; border-bottom: 1px solid var(--line); }
  .featured .body { padding: 32px 28px; }
  .blog-grid { grid-template-columns: 1fr; gap: 24px; }
  .blog-main { padding-top: 44px; padding-bottom: 56px; }
}
@media (max-width: 640px) {
  .blog-search { margin-top: 22px; }
  .blog-search input { padding: 12px 14px; font-size: 14px; }
  .blog-search button { padding: 0 16px; font-size: 12px; }
  .featured h2 { font-size: 22px; }
  .featured .body { padding: 26px 22px; }
  .list-head { flex-direction: column; align-items: flex-start; gap: 10px; }
}
