/* ================================================
   LEVEL TECH — BLOG LISTING
================================================ */

/* ── Paleta de tema claro — solo aplica en páginas del blog ── */
:root {
    --blog-bg:           #f0f1f4;  /* fondo de página */
    --blog-surface:      #ffffff;  /* cards, hero, barras */
    --blog-input-bg:     #f5f6f8;  /* fondo del buscador */
    --blog-img-ph:       #eef0f3;  /* placeholder de imagen */
    --blog-img-ph-hover: #e8edf1;  /* placeholder hover */
    --blog-text:         #1a1d2e;  /* títulos y texto principal */
    --blog-text-dim:     #767676;  /* subtítulo del hero */
    --blog-text-icon:    #b0b4bc;  /* íconos sutiles */
    --blog-placeholder:  #c0c4cc;  /* placeholder e ícono limpiar */
    --blog-text-action:  #555555;  /* texto interactivo apagado */
    --blog-text-muted:   #666666;  /* excerpts, tags */
    --blog-text-subtle:  #888888;  /* texto de tarjeta */
    --blog-text-faint:   #aaaaaa;  /* texto de meta */
    --blog-text-ghost:   #bbbbbb;  /* meta, flechas */
    --blog-separator:    #cccccc;  /* puntos separadores */
}

.lt-blog-page {
    background: var(--blog-bg);
    color: var(--blog-text);
    font-family: var(--font-body);
    min-height: 100svh;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ────────────────────────────────────────
   HERO
──────────────────────────────────────── */
.blog-hero {
    background: var(--blog-surface);
    padding-top: calc(var(--navbar-h) + 3rem);
    border-bottom: 1px solid rgba(0,0,0,.07);
}

.blog-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.8rem clamp(1.2rem, 3vw, 2.5rem) 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.blog-hero-top {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.blog-hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 5rem);
    color: var(--blog-text);
    line-height: 1;
    letter-spacing: .03em;
}

.blog-hero-sub {
    font-size: clamp(.88rem, 1.1vw, 1rem);
    color: var(--blog-text-dim);
    max-width: 52ch;
    line-height: 1.6;
}

/* Search */
.blog-search-wrap { width: 100%; }

.blog-search-inner {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 560px;
}

.blog-search-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--blog-text-icon);
    font-size: .9rem;
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    padding: .9rem 2.8rem .9rem 2.9rem;
    border: 1.5px solid rgba(0,0,0,.1);
    border-radius: 12px;
    background: var(--blog-input-bg);
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--blog-text);
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.blog-search-input::placeholder { color: var(--blog-placeholder); }
.blog-search-input:focus {
    border-color: var(--color-green);
    background: var(--blog-surface);
    box-shadow: 0 0 0 3px rgba(57,181,74,.09);
}

.blog-search-clear {
    position: absolute; right: .6rem;
    background: none; border: none; color: var(--blog-placeholder);
    cursor: pointer; font-size: .8rem; padding: .3rem;
    min-width: 24px; min-height: 24px;
    display: flex; align-items: center; justify-content: center;
    transition: color .2s;
}
.blog-search-clear:hover { color: var(--blog-text-action); }

/* ────────────────────────────────────────
   TAG PILLS BAR
──────────────────────────────────────── */
.blog-tags-bar {
    background: var(--blog-surface);
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.blog-tags-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: .9rem clamp(1.2rem, 3vw, 2.5rem);
    overflow-x: auto;
    scrollbar-width: none;
}
.blog-tags-inner::-webkit-scrollbar { display: none; }

.blog-tags {
    display: flex;
    gap: .5rem;
    white-space: nowrap;
}

.blog-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .38rem .9rem;
    border-radius: 999px;
    border: 1.5px solid rgba(0,0,0,.1);
    background: var(--blog-surface);
    font-size: .75rem;
    font-weight: 700;
    color: var(--blog-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .18s, background .18s, color .18s;
    flex-shrink: 0;
}
.blog-tag-pill:hover { border-color: rgba(57,181,74,.5); color: var(--color-green); }
.blog-tag-pill.is-active {
    background: var(--color-green);
    border-color: var(--color-green);
    color: var(--color-white);
}

.blog-tag-pill-count {
    font-size: .68rem;
    opacity: .75;
    font-weight: 600;
}

/* ────────────────────────────────────────
   CONTENT
──────────────────────────────────────── */
.blog-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.4rem clamp(1.2rem, 3vw, 2.5rem) clamp(3rem, 6vw, 6rem);
}

/* ── Featured article ── */
.blog-featured {
    background: var(--blog-surface);
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,.055);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 2rem;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    transition: box-shadow .3s, transform .3s;
    position: relative;
}
.blog-featured::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 20px;
    border: 2px solid transparent;
    transition: border-color .3s;
    pointer-events: none; z-index: 1;
}
.blog-featured:hover { box-shadow: 0 16px 48px rgba(0,0,0,.1); transform: translateY(-3px); }
.blog-featured:hover::before { border-color: rgba(57,181,74,.3); }

.blog-featured-img {
    background: var(--blog-img-ph);
    min-height: 320px;
    position: relative;
    overflow: hidden;
    transition: background .3s;
}
.blog-featured:hover .blog-featured-img { background: var(--blog-img-ph-hover); }

.blog-featured-badge {
    position: absolute;
    top: 1.2rem; left: 1.2rem;
    background: var(--color-navy);
    color: var(--color-white);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: .3rem .75rem;
    border-radius: 999px;
    z-index: 1;
}

.blog-featured-body {
    padding: clamp(1.8rem, 3vw, 2.8rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
}

.blog-featured-tags {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.blog-article-tag {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-green);
    background: rgba(57,181,74,.08);
    padding: .22rem .65rem;
    border-radius: 999px;
}

.blog-featured-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.5vw, 2.6rem);
    color: var(--blog-text);
    line-height: 1.1;
    letter-spacing: .02em;
}

.blog-featured-excerpt {
    font-size: .92rem;
    line-height: 1.7;
    color: var(--blog-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-featured-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(0,0,0,.06);
    margin-top: auto;
}

.blog-meta-info {
    font-size: .75rem;
    color: var(--blog-text-faint);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.blog-meta-info span { display: flex; align-items: center; gap: .3rem; }
.blog-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--blog-separator); flex-shrink: 0; }

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-green);
    transition: gap .2s;
}
.blog-featured:hover .blog-read-more { gap: .75rem; }

/* ── Article grid ── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
}

/* ── Article card ── */
.blog-card {
    background: var(--blog-surface);
    border-radius: 18px;
    border: 1px solid rgba(0,0,0,.055);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: box-shadow .3s, transform .3s, border-color .3s;
    position: relative;
}
.blog-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 18px;
    border: 2px solid transparent;
    transition: border-color .3s;
    pointer-events: none; z-index: 1;
}
.blog-card:hover { box-shadow: 0 18px 44px rgba(0,0,0,.1); transform: translateY(-4px); }
.blog-card:hover::before { border-color: rgba(57,181,74,.3); }

.blog-card-img {
    width: 100%;
    height: clamp(150px, 16vw, 190px);
    background: var(--blog-img-ph);
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,.055);
    transition: background .3s;
}
.blog-card:hover .blog-card-img { background: var(--blog-img-ph-hover); }

.blog-card-body {
    padding: 1.2rem 1.4rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    flex: 1;
}

.blog-card-tags {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.blog-card-title {
    font-family: var(--font-body);
    font-size: clamp(.92rem, 1.1vw, 1.02rem);
    font-weight: 700;
    color: var(--blog-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: .82rem;
    line-height: 1.6;
    color: var(--blog-text-subtle);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid rgba(0,0,0,.05);
}

.blog-card-meta {
    font-size: .72rem;
    color: var(--blog-text-ghost);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.blog-card-arrow {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.04);
    color: var(--blog-text-ghost); font-size: .72rem;
    transition: background .2s, color .2s, transform .2s;
}
.blog-card:hover .blog-card-arrow {
    background: var(--color-green); color: var(--color-white); transform: translateX(2px);
}

/* ── Empty state ── */
.blog-empty[hidden] { display: none !important; }
.blog-empty {
    display: flex; flex-direction: column; align-items: center;
    gap: 1rem; padding: 5rem 2rem; text-align: center; color: var(--blog-separator);
}
.blog-empty i  { font-size: 2rem; }
.blog-empty p  { font-size: .9rem; color: var(--blog-text-faint); }
.blog-empty-reset {
    padding: .6rem 1.5rem;
    border: 1.5px solid rgba(57,181,74,.4); border-radius: 10px;
    background: none; color: var(--color-green);
    font-size: .84rem; font-weight: 700; cursor: pointer;
    transition: background .2s, color .2s;
}
.blog-empty-reset:hover { background: var(--color-green); color: var(--color-white); }

/* ── Pagination ── */
.blog-pagination {
    display: flex; align-items: center; justify-content: center;
    gap: .4rem; margin-top: 3rem; flex-wrap: wrap;
}
.blog-page-btn {
    min-width: 38px; height: 38px; padding: 0 .65rem;
    border: 1.5px solid rgba(0,0,0,.1); border-radius: 9px;
    background: var(--blog-surface); font-family: var(--font-body);
    font-size: .84rem; color: var(--blog-text-action); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: border-color .2s, background .2s, color .2s;
}
.blog-page-btn:hover   { border-color: var(--color-green); color: var(--color-green); }
.blog-page-btn.active  { background: var(--color-green); border-color: var(--color-green); color: var(--color-white); font-weight: 700; }
.blog-page-btn:disabled { opacity: .3; cursor: default; }

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media not all and (min-width: 1200px) and (orientation: landscape) and (min-height: 500px) {
    .blog-featured { grid-template-columns: 1fr; }
    .blog-featured-img { min-height: 220px; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); gap: .9rem; }
    .blog-search-inner { max-width: 100%; }
}

@media (orientation: portrait) and (max-width: 767px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-featured-img { min-height: 180px; }
}

@media (max-width: 480px) {
    .blog-card-excerpt { display: none; }
}
