/* ==========================================================================
   TOPS SAFETY CONTROL — Blog Stylesheet
   Depends on mains.css: reuses tokens (--c-*, --f-*, --ease-*), utility
   classes (.container-tops, .eyebrow, .section-title, .section-lead,
   .section-pad, .btn-tops, .link-flame, .reveal/.reveal-scale, .cut-*,
   .service-hero / .svc-breadcrumb for the page header, .side-deco).
   This file ONLY contains rules specific to the blog listing + single post.
   Load AFTER mains.css.
   ========================================================================== */

/* ============================== BLOG HERO ================================
   Editorial-style header — light, left-aligned, no big background image.
   Reuses tokens/utility classes from mains.css (.eyebrow, .section-title,
   .section-lead) but is otherwise scoped entirely to this file so the blog
   doesn't read like a service page.
   ========================================================================== */
.blog-hero { padding: 62px 0 0; position: relative; }

.blog-hero-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px;
}

.blog-breadcrumb {
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--c-steel);
  display: flex; align-items: center; gap: 8px;
}
.blog-breadcrumb a { color: var(--c-steel); transition: color 0.25s ease; }
.blog-breadcrumb a:hover { color: var(--c-red); }
.blog-breadcrumb span.sep { color: var(--c-line-light); }
.blog-breadcrumb span.current { color: var(--c-ink); }

.blog-hero-head { max-width: 720px; margin-bottom: 36px; }
.blog-hero-head h1 { margin: 0 0 16px; }
.blog-hero-head p { margin: 0; }

.blog-hero-filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-bottom: 32px; border-bottom: 1px solid var(--c-line-light);
}
.blog-hero-filters a {
  font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--c-steel);
  padding: 9px 18px; border: 1px solid var(--c-line-light); border-radius: 30px;
  white-space: nowrap; transition: all 0.25s ease;
}
.blog-hero-filters a:hover { border-color: var(--c-red); color: var(--c-red); }
.blog-hero-filters a.is-active { background: var(--c-red); border-color: var(--c-red); color: var(--c-white); }

@media (max-width: 767px) {
  .blog-hero { padding-top: 44px; }
  .blog-hero-filters {
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 22px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .blog-hero-filters::-webkit-scrollbar { display: none; }
}

/* ============================== BLOG LAYOUT =============================== */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 64px;
  align-items: start;
}

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

.blog-toolbar {
  display: flex; justify-content: flex-end; margin-bottom: 22px;
  color: var(--c-steel); font-family: var(--f-mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}


.blog-empty {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: -6px 0 22px; padding: 10px 14px; border-left: 3px solid var(--c-red);
  background: var(--c-off-white); color: var(--c-steel); font-family: var(--f-mono);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em;
  grid-column: 1 / -1;
  width: 100%;
  grid-column: 1 / -1; min-height: 300px; padding: 58px 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: var(--c-off-white); border: 1px solid var(--c-line-light);
  clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px);
}
.blog-empty i { color: var(--c-red); font-size: 2rem; margin-bottom: 18px; }
.blog-empty h3 { margin: 0 0 10px; font-size: 1.25rem; }
.blog-empty p { max-width: 430px; margin: 0; color: var(--c-steel); line-height: 1.7; text-transform: none; }

/* ============================= FEATURED POST =============================== */
.blog-featured {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--c-white);
  border: 1px solid var(--c-line-light);
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 50px;
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.blog-featured:hover { box-shadow: 0 34px 64px -30px rgba(10,10,11,0.25); transform: translateY(-4px); }
.blog-featured__media { position: relative; min-height: 340px; overflow: hidden; }
.blog-featured__media img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out);
}
.blog-featured:hover .blog-featured__media img { transform: scale(1.05); }
.blog-featured__tag {
  position: absolute; top: 18px; left: 18px; z-index: 2;
  background: var(--c-red); color: var(--c-white);
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 7px 16px;
  border-radius: 30px;
}
.blog-featured__body {
  padding: 40px 40px 36px;
  display: flex; flex-direction: column; justify-content: center;
}
.blog-featured__body h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.2; margin: 14px 0 16px; }
.blog-featured__body p { color: var(--c-steel); font-size: 0.95rem; line-height: 1.7; margin-bottom: 22px; text-transform: none; }

/* ================================ META ROW ================================= */
.blog-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--c-steel);
}
.blog-meta span { display: inline-flex; align-items: center; gap: 7px; }
.blog-meta i { color: var(--c-red); font-size: 0.78rem; }
.blog-meta .blog-category { color: var(--c-red); font-weight: 500; }

/* ================================ BLOG GRID ================================
   Clean, fluid card grid — no jagged corners, no per-card stagger delay.
   auto-fill keeps cards a comfortable width and reflows naturally instead
   of a rigid 2-up block. ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px;
}

.blog-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-line-light);
  border-radius: 18px;
  height: 100%;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s ease;
}
.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px -26px rgba(10,10,11,0.22);
  border-color: transparent;
}
.blog-card__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card__media img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-out);
}
.blog-card:hover .blog-card__media img { transform: scale(1.06); }
.blog-card__tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(10,10,11,0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--c-white); font-family: var(--f-mono); font-size: 0.62rem;
  letter-spacing: 0.05em; text-transform: uppercase; padding: 6px 12px;
  border-radius: 30px;
}
.blog-card__body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.blog-card__body .blog-meta { margin-bottom: 12px; font-size: 0.66rem; gap: 14px; }
.blog-card h3 {
  font-family: var(--f-body); text-transform: none; letter-spacing: 0;
  font-weight: 700; font-size: 1.03rem; line-height: 1.4; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card h3 a { color: var(--c-ink); transition: color 0.25s ease; }
.blog-card:hover h3 a { color: var(--c-red); }
.blog-card p {
  color: var(--c-steel); font-size: 0.86rem; line-height: 1.6; margin-bottom: 16px; text-transform: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.blog-card .link-flame { margin-top: auto; }

/* ================================ PAGINATION ================================ */
.blog-pagination {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 54px;
}
.blog-pagination a, .blog-pagination span {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 0.8rem; color: var(--c-ink);
  border: 1px solid var(--c-line-light); border-radius: 50%;
  transition: all 0.3s ease;
}
.blog-pagination a:hover { background: var(--c-off-white); }
.blog-pagination .is-active { background: var(--c-red); border-color: var(--c-red); color: var(--c-white); }
.blog-pagination .blog-pg-next, .blog-pagination .blog-pg-prev {
  width: auto; padding: 0 18px; border-radius: 30px; gap: 8px;
}

/* ================================= SIDEBAR =================================== */
.blog-sidebar { display: flex; flex-direction: column; gap: 34px; position: sticky; top: 120px; }

.blog-widget {
  background: var(--c-white); border: 1px solid var(--c-line-light);
  padding: 30px 26px;
  
}
.blog-widget h4 {
  font-size: 0.92rem; letter-spacing: 0.03em; margin-bottom: 22px;
  padding-bottom: 16px; border-bottom: 1px solid var(--c-line-light);
  display: flex; align-items: center; gap: 10px;
}
.blog-widget h4 i { color: var(--c-red); font-size: 0.85rem; }

/* Search */
.blog-search { position: relative; }
.blog-search input {
  width: 100%; border: 1px solid var(--c-line-light); background: var(--c-off-white);
  padding: 13px 46px 13px 16px; font-size: 0.88rem; font-family: var(--f-body);
  color: var(--c-ink); transition: border-color 0.3s ease;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}
.blog-search input:focus { outline: none; border-color: var(--c-red); }
.blog-search button {
  position: absolute; right: 0; top: 0; bottom: 0; width: 44px;
  background: var(--c-red); border: none; color: var(--c-white); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s ease;
}
.blog-search button:hover { background: var(--c-red-dark); }
.blog-search-suggestions {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; right: 0;
  padding: 8px; background: var(--c-white); border: 1px solid var(--c-line-light);
  box-shadow: 0 18px 34px -22px rgba(10,10,11,0.45);
}
.blog-search-suggestion { display: flex; align-items: center; gap: 10px; padding: 9px; color: var(--c-ink); }
.blog-search-suggestion:hover { background: var(--c-off-white); }
.blog-search-suggestion img { width: 44px; height: 38px; object-fit: cover; flex: none; }
.blog-search-suggestion span { min-width: 0; }
.blog-search-suggestion strong, .blog-search-suggestion small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-search-suggestion strong { font-size: 0.78rem; }
.blog-search-suggestion small { margin-top: 3px; color: var(--c-steel); font-family: var(--f-mono); font-size: 0.62rem; text-transform: uppercase; }
.blog-search-no-results { margin: 0; padding: 12px; color: var(--c-steel); font-size: 0.78rem; text-transform: none; }

/* Categories */
.blog-categories { display: flex; flex-direction: column; gap: 2px; }
.blog-categories li a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; font-size: 0.88rem; color: var(--c-ink);
  border-bottom: 1px solid var(--c-line-light);
  transition: color 0.25s ease, padding-left 0.25s ease;
}
.blog-categories li:last-child a { border-bottom: none; }
.blog-categories li a:hover { color: var(--c-red); padding-left: 6px; }
.blog-categories li a span.count {
  font-family: var(--f-mono); font-size: 0.7rem; color: var(--c-steel);
  background: var(--c-off-white); padding: 2px 8px; border-radius: 20px;
}

/* Recent posts */
.blog-recent-list { display: flex; flex-direction: column; gap: 18px; }
.blog-recent-item { display: flex; gap: 14px; align-items: flex-start; }
.blog-recent-item__thumb {
  width: 66px; height: 66px; flex: none; overflow: hidden;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.blog-recent-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-recent-item h5 {
  font-family: var(--f-body); text-transform: none; letter-spacing: 0;
  font-weight: 600; font-size: 0.86rem; line-height: 1.4; margin-bottom: 6px;
}
.blog-recent-item h5 a { color: var(--c-ink); transition: color 0.25s ease; }
.blog-recent-item h5 a:hover { color: var(--c-red); }
.blog-recent-item span {
  font-family: var(--f-mono); font-size: 0.66rem; color: var(--c-steel);
  text-transform: uppercase; letter-spacing: 0.03em;
}

/* Tags */
.blog-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.blog-tags a {
  font-size: 0.76rem; padding: 8px 14px; background: var(--c-off-white); color: var(--c-ink);
  border-radius: 30px; transition: all 0.25s ease;
}
.blog-tags a:hover { background: var(--c-red); color: var(--c-white); }

/* Newsletter widget (dark) */
.blog-widget--dark {
  background: var(--c-black); border-color: var(--c-line-dark); color: var(--c-white); position: relative; overflow: hidden;
}
.blog-widget--dark h4 { color: var(--c-white); border-color: var(--c-line-dark); }
.blog-widget--dark p { color: var(--c-steel-light); font-size: 0.85rem; line-height: 1.6; margin-bottom: 18px; text-transform: none; }
.blog-widget--dark input {
  width: 100%; border: 1px solid var(--c-line-dark); background: rgba(255,255,255,0.06);
  padding: 12px 14px; font-size: 0.85rem; color: var(--c-white); margin-bottom: 12px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.blog-widget--dark input::placeholder { color: var(--c-steel); }
.blog-widget--dark input:focus { outline: none; border-color: var(--c-red); }
.blog-widget--dark .btn-tops { width: 100%; justify-content: center; }

/* ============================== SINGLE POST ================================= */
.blog-post-head { max-width: 820px; margin: 0 auto; text-align: center; }
.blog-post-head .blog-meta { justify-content: center; margin-bottom: 20px; }
.blog-post-head h1 {
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; color: var(--c-white); margin-bottom: 22px;
}
.blog-post-author-row {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 26px;
}
.blog-post-author-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.blog-post-author-row div { text-align: left; }
.blog-post-author-row strong { display: block; color: var(--c-white); font-size: 0.85rem; }
.blog-post-author-row span { font-family: var(--f-mono); font-size: 0.68rem; color: var(--c-steel-light); text-transform: uppercase; }

.blog-post-cover {
  width: 100%; max-height: 520px; overflow: hidden; margin: -70px auto 54px; position: relative; z-index: 3;
  max-width: 1080px; box-shadow: 0 40px 80px -30px rgba(10,10,11,0.4);
  clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px);
}
.blog-post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.blog-post-body {
  max-width: 760px; margin: 0 auto;
  color: var(--c-ink); font-size: 1.02rem; line-height: 1.85;
}
.blog-post-body p { margin: 0 0 22px; text-transform: none; }
.blog-post-body h2, .blog-post-body h3 {
  margin: 44px 0 18px; text-transform: none; letter-spacing: 0; line-height: 1.3;
}
.blog-post-body h2 { font-size: 1.5rem; }
.blog-post-body h3 { font-size: 1.2rem; }
.blog-post-body ul, .blog-post-body ol { margin: 0 0 24px; padding-left: 22px; }
.blog-post-body li { margin-bottom: 10px; line-height: 1.7; }
.blog-post-body img {
  width: 100%; margin: 32px 0; clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}
.blog-post-body blockquote {
  margin: 32px 0; padding: 26px 30px; background: var(--c-off-white);
  border-left: 3px solid var(--c-red); font-family: var(--f-display);
  font-size: 1.15rem; line-height: 1.5; color: var(--c-ink);
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px);
}
.blog-post-body a { color: var(--c-red); text-decoration: underline; text-underline-offset: 3px; }

.blog-post-tags {
  max-width: 760px; margin: 40px auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding-top: 28px; border-top: 1px solid var(--c-line-light);
}

.blog-post-share {
  max-width: 760px; margin: 26px auto 0; display: flex; align-items: center; gap: 14px;
}
.blog-post-share span {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-steel);
}
.blog-post-share a {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--c-line-light);
  display: flex; align-items: center; justify-content: center; color: var(--c-ink); transition: all 0.3s ease;
}
.blog-post-share a:hover { background: var(--c-red); border-color: var(--c-red); color: var(--c-white); }

/* Author box */
.blog-author-box {
  max-width: 760px; margin: 54px auto 0; background: var(--c-off-white);
  padding: 32px; display: flex; gap: 22px; align-items: flex-start;
  clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
}
.blog-author-box img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; }
.blog-author-box h5 { font-size: 0.98rem; text-transform: none; letter-spacing: 0; margin-bottom: 6px; }
.blog-author-box p { color: var(--c-steel); font-size: 0.86rem; line-height: 1.65; margin: 0; text-transform: none; }

/* Related posts */
.blog-related-grid {
  max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
}

/* ================================ RESPONSIVE ================================= */
@media (max-width: 1199px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
}

@media (max-width: 767px) {
  .blog-featured { grid-template-columns: 1fr; border-radius: 18px; }
  .blog-featured__media { min-height: 220px; }
  .blog-featured__body { padding: 28px 24px; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-related-grid { grid-template-columns: 1fr; }
  .blog-post-cover { margin-top: -40px; margin-bottom: 36px; }
  .blog-author-box { flex-direction: column; text-align: center; align-items: center; }
}




/* ==========================================================================
   Blog Empty State (Sin artículos publicados)
   ========================================================================== */
.blog-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4.5rem 2rem;
    margin: 2.5rem auto;
    max-width: 580px;
    width: 100%;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1.5px dashed #cbd5e1;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Efecto hover suave */
.blog-empty:hover {
    border-color: #ff5722; /* Color de acento / Flame */
    box-shadow: 0 15px 35px -10px rgba(255, 87, 34, 0.12);
    transform: translateY(-3px);
}

/* Icono contenedor con animación flotante y resplandor */
.blog-empty i {
    font-size: 2.25rem;
    color: #ff5722;
    background: rgba(255, 87, 34, 0.08);
    width: 84px;
    height: 84px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 0 25px rgba(255, 87, 34, 0.15);
    animation: floatIcon 3.5s ease-in-out infinite;
}

/* Título */
.blog-empty h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
}

/* Descripción */
.blog-empty p {
    font-size: 0.975rem;
    color: #64748b;
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
}

/* Animación sutil de elevación para el icono */
@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}



/* ==========================================================================
   Blog Active Filter Badge (Filtro Activo)
   ========================================================================== */
.blog-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 1rem;
    background-color: #fff4f0; /* Fondo con tono suave de acento */
    border: 1px solid rgba(255, 87, 34, 0.25);
    border-radius: 50px; /* Estilo píldora */
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.06);
    animation: fadeInFilter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Texto de la categoría */
.blog-active-filter span {
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
}

.blog-active-filter span strong {
    color: #ff5722; /* Color de acento / Flame */
    font-weight: 700;
}

/* Botón de limpiar filtro */
.blog-active-filter button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

/* Icono X dentro del botón */
.blog-active-filter button i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* Estados Hover y Focus del Botón */
.blog-active-filter button:hover {
    background-color: #ef4444; /* Rojo para acción de eliminar */
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.blog-active-filter button:hover i {
    transform: rotate(90deg);
}

.blog-active-filter button:focus-visible {
    outline: 2px solid #ff5722;
    outline-offset: 1px;
}

/* Animación de entrada */
@keyframes fadeInFilter {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}