/* Shared blog sidebar widgets — used by /blog/ and article pages */

.blog-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
}

.blog-sidebar .widget {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 22px;
}

.blog-sidebar .widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.blog-sidebar .widget-head h3 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  color: var(--ink);
  line-height: 1.4;
}

.blog-sidebar .widget-head h3 .dot-ico {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sun);
  flex-shrink: 0;
}

.blog-sidebar .widget-head .dot-ico--sky { background: var(--sky); }
.blog-sidebar .widget-head .dot-ico--berry { background: var(--berry); }

.blog-sidebar .widget-head .see-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--sky);
  white-space: nowrap;
  text-decoration: none;
}

.blog-sidebar .widget-head .see-all:hover { color: var(--sun-deep); }

.blog-sidebar .mini-post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.blog-sidebar .mini-post:first-child { padding-top: 0; }
.blog-sidebar .mini-post:last-child { border-bottom: none; padding-bottom: 0; }
.blog-sidebar .mini-post:hover { box-shadow: none; transform: none; }

.blog-sidebar .mini-post .thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sky-100);
}

.blog-sidebar .mini-post .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-sidebar .mini-post .rank {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-sidebar .mini-post .info { flex: 1; min-width: 0; }

.blog-sidebar .mini-post .info h4,
.blog-sidebar .mini-post h4 {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-sidebar .mini-post .info .sub,
.blog-sidebar .mini-post .sub {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-sidebar .mini-post .info .sub .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line);
  flex-shrink: 0;
}

.blog-sidebar .mini-post.video .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.blog-sidebar .mini-post.video .thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
  z-index: 1;
  pointer-events: none;
}

/* Ad widget */
.blog-sidebar .ad-widget { padding: 0; overflow: hidden; }

.blog-sidebar .ad-widget .ad-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  padding: 10px 10px 0;
}

.blog-sidebar .ad-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 300 / 250;
  margin-top: 8px;
}

.blog-sidebar .ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  color: #fff;
  text-decoration: none;
}

.blog-sidebar .ad-slide.is-active { opacity: 1; pointer-events: auto; }
.blog-sidebar .ad-slide.s1,
.blog-sidebar .ad-slide--blue { background: linear-gradient(135deg, var(--sun), var(--berry)); }
.blog-sidebar .ad-slide.s2,
.blog-sidebar .ad-slide--grape { background: linear-gradient(135deg, var(--grape), var(--sky)); }
.blog-sidebar .ad-slide.s3,
.blog-sidebar .ad-slide--leaf { background: linear-gradient(135deg, var(--leaf), var(--sky)); }
.blog-sidebar .ad-slide strong { font-size: 16px; font-weight: 800; }
.blog-sidebar .ad-slide p { font-size: 12.5px; opacity: 0.9; max-width: 220px; margin: 0; }
.blog-sidebar .ad-slide span.cta { font-size: 12px; font-weight: 700; text-decoration: underline; }

.blog-sidebar .ad-slide__media,
.blog-sidebar .ad-slide__media img {
  width: 100%;
  height: 100%;
  display: block;
}

.blog-sidebar .ad-slide__html {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.blog-sidebar .ad-static {
  display: block;
  margin: 10px;
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  color: #fff;
  text-decoration: none;
}

.blog-sidebar .ad-static img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.blog-sidebar .ad-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 10px 0;
}

.blog-sidebar .ad-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line);
  transition: all 0.25s var(--ease);
  border: none;
  padding: 0;
  cursor: pointer;
}

.blog-sidebar .ad-dots button.is-active {
  background: var(--sun);
  width: 16px;
  border-radius: 100px;
}

.blog-sidebar .ad-foot {
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
  padding: 0 10px 14px;
}

.blog-sidebar .ad-foot a {
  color: var(--sky);
  font-weight: 700;
}

@media (max-width: 1024px) {
  .blog-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}
