/* ════════════════════════════════════════════
   HOMQI Blog Widget v1.0
   Dark theme — matches HOMQI design system
   ════════════════════════════════════════════ */

.hb-wrap {
  background: #000;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  box-sizing: border-box;
  padding: 60px 24px;
}

/* ── Header ── */
.hb-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 48px;
}

.hb-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: #F5C518;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hb-header-title {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.1;
}

.hb-header-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.6;
}

/* ── Carousel outer ── */
.hb-carousel-wrap {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: block; /* block so track fills full width */
}

/* Arrows overlaid on top of the track at all sizes */
.hb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  flex-shrink: 0;
}

.hb-arrow--prev { left: 8px; }
.hb-arrow--next { right: 8px; }

.hb-arrow:hover         { transform: translateY(-50%) scale(1.08); }
.hb-arrow:disabled      { transform: translateY(-50%); opacity: 0.25; cursor: not-allowed; }

/* Track outer fills the wrap */
.hb-track-outer {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  padding: 0 56px; /* leave space for arrows */
  box-sizing: border-box;
}

.hb-track-outer {
  flex: 1;
  overflow: hidden;
  border-radius: 4px;
}

.hb-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  gap: 24px; /* overridden by JS */
  align-items: stretch;
}

/* ── Arrow buttons ── */
.hb-arrow {
  flex-shrink: 0;
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(245,197,24,0.3);
  color: #F5C518;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
  z-index: 2;
  padding: 0;
  line-height: 1;
}
.hb-arrow svg {
  fill: #F5C518;
  display: block;
  flex-shrink: 0;
}
.hb-arrow:hover {
  background: rgba(245,197,24,0.15);
  border-color: rgba(245,197,24,0.8);
  transform: scale(1.08);
}
.hb-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Dots ── */
.hb-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.hb-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background .25s, transform .25s;
}
.hb-dot.active {
  background: #F5C518;
  border-radius: 999px;
  transform: scale(1.35);
}

/* ── Dot visibility by device ── */
.hb-dots[data-hide-desktop="1"]   { display: none; }
.hb-dots[data-hide-tablet="1"]    { display: none; }

@media (max-width: 900px) {
  .hb-dots[data-hide-desktop="1"] { display: flex; }
  .hb-dots[data-hide-tablet="1"]  { display: none; }
}
@media (max-width: 600px) {
  .hb-dots[data-hide-desktop="1"] { display: flex; }
  .hb-dots[data-hide-tablet="1"]  { display: flex; }
  .hb-dots[data-hide-mobile="1"]  { display: none; }
}

/* ── Card ── */
.hb-card {
  flex-shrink: 0;
  background: #111827;
  border: 1px solid rgba(245,197,24,0.15);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .3s, transform .3s, box-shadow .3s;
  text-decoration: none;
}
.hb-card:hover {
  border-color: rgba(245,197,24,0.5);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(245,197,24,0.08);
}

/* ── Card image ── */
.hb-card-img-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #1a1f2e;
  position: relative;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}
.hb-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
  display: block;
}
.hb-card:hover .hb-card-img-wrap img {
  transform: scale(1.05);
}

/* Placeholder when no image */
.hb-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1f2e 0%, #0d1117 100%);
  color: rgba(245,197,24,0.25);
}
.hb-card-img-placeholder svg {
  width: 56px;
  height: 56px;
}

/* ── Card body ── */
.hb-card-body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

/* ── Category badge ── */
.hb-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hb-cat-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #F5C518;
  border: 1px solid rgba(245,197,24,0.3);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.hb-card-date {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Card title ── */
.hb-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Card excerpt ── */
.hb-card-excerpt {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Read more ── */
.hb-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #F5C518;
  text-decoration: none;
  margin-top: auto;
  padding-top: 4px;
  transition: gap .2s;
}
.hb-read-more svg { fill: #F5C518; transition: transform .2s; }
.hb-read-more:hover { gap: 10px; }
.hb-read-more:hover svg { transform: translateX(3px); }

/* ── States ── */
.hb-loader,
.hb-empty,
.hb-error {
  width: 100%;
  padding: 48px 24px;
  text-align: center;
  color: rgba(255,255,255,0.4);
  font-size: 15px;
}
.hb-loader::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(245,197,24,0.2);
  border-top-color: #F5C518;
  border-radius: 50%;
  animation: hb-spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes hb-spin { to { transform: rotate(360deg); } }

.hb-error { color: #f87171; }

/* ── Fade in animation for cards ── */
@keyframes hb-cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hb-card {
  animation: hb-cardIn .4s ease both;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hb-header-title { font-size: 36px; }
  .hb-arrow { width: 36px; height: 36px; }
}

@media (max-width: 600px) {
  .hb-header-title { font-size: 28px; }
  .hb-header-sub   { font-size: 15px; }
  .hb-wrap         { padding: 40px 16px; }

  /* En móvil las flechas quedan sobre el track (position:absolute del padre)
     Solo ajustamos tamaño y padding del track para que no tape las cards */
  .hb-arrow { width: 36px; height: 36px; }
  .hb-track-outer { padding: 0 48px; }
}
