/* Link pills (yaroslavkibysh.com .link-pill) */
.cerf-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 1.6rem 0 0;
}

/* Markdown mode wraps the pills in a <p>; dissolve it so the pills are direct
   flex items and .cerf-links' gap applies between rows when they wrap. */
.md-typeset .cerf-links p {
  display: contents;
}

.md-typeset .cerf-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  background: var(--cerf-glass-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--cerf-glass-border-strong);
  box-shadow: var(--cerf-glass-shadow);
  color: var(--cerf-text);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.md-typeset .cerf-pill:hover {
  background: var(--cerf-glass-bg-hover);
  color: var(--cerf-text);
  transform: translateY(-2px);
  box-shadow: var(--cerf-lift-shadow);
}

.md-typeset .cerf-pill .twemoji {
  width: 1.05rem;
  height: 1.05rem;
}

.md-typeset .cerf-pill .twemoji svg {
  fill: currentColor;
}

.md-typeset .cerf-pill--support {
  border-color: rgba(233, 102, 160, 0.35);
  background: rgba(233, 102, 160, 0.1);
}

.md-typeset .cerf-pill--support:hover {
  border-color: var(--cerf-secondary);
  background: rgba(233, 102, 160, 0.2);
  box-shadow: 0 4px 20px rgba(233, 102, 160, 0.2);
}

/* Glass surfaces */
.md-typeset .cerf-card,
.cerf-banner,
.cerf-video img {
  background: var(--cerf-glass-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--cerf-glass-border);
  box-shadow: var(--cerf-glass-shadow);
  border-radius: 16px;
}

/* Stats strip */
.cerf-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.8rem;
  margin: 3rem 0 0;
}

.cerf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 auto;
  min-width: 10rem;
  padding: 0.2rem 1.4rem;
}

/* Vertical dividers only read correctly on one row; once the strip wraps, the
   first stat of each new row would carry a stray left border. Show them at the
   width where all four fit on one line; below that, row-gap does the spacing. */
@media (min-width: 60rem) {
  .cerf-stat + .cerf-stat {
    border-left: 1px solid var(--cerf-glass-border);
  }
}

.cerf-stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  color: var(--cerf-text);
  text-shadow: var(--cerf-hero-shadow);
}

.cerf-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.5;
}

/* Card wall */
/* auto-fit, not auto-fill: empty tracks collapse, so a row with fewer cards
   than columns stretches them instead of leaving gaps. */
.cerf-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--cerf-wall-min, 17rem), 1fr));
  gap: 1.2rem;
}

.cerf-wall--pair {
  --cerf-wall-min: 12rem;
}

.md-typeset .cerf-card:hover {
  transform: translateY(-4px);
  background: var(--cerf-glass-bg-hover);
  border-color: var(--cerf-border-hover);
  color: var(--cerf-text);
}

/* Guest aspect ratios run from 640x240 to 240x320, so the preview is a fixed
   box the screenshot is fitted into: without it a portrait shot sets the grid
   row height and every landscape tile in that row grows a slab of dead space. */
.md-typeset .cerf-card img {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: contain;
  background: var(--cerf-media-bg);
}

/* Slideshow chrome: the click stage (left half = prev, right half = next) and
   the dot indicator row. Built by slideshow.js only for tiles with 2+ shots. */
.cerf-slideshow {
  position: relative;
  cursor: pointer;
}

.cerf-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.7rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  pointer-events: none;
}

.md-typeset .cerf-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease, transform 0.2s ease;
}

.md-typeset .cerf-dot:hover {
  background: rgba(255, 255, 255, 0.65);
}

.md-typeset .cerf-dot--active {
  background: #fff;
  transform: scale(1.15);
}

/* Feature / guide cards - same surface as the device tiles */
.md-typeset .cerf-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--cerf-text);
  text-decoration: none;
  transition: all 0.3s ease;
}

.cerf-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.4rem 1.4rem 1.5rem;
}

.md-typeset .cerf-card-body b {
  font-size: 1rem;
  font-weight: 700;
}

.md-typeset .cerf-card-body span {
  font-size: 0.76rem;
  line-height: 1.5;
  opacity: 0.6;
}

/* Banners and video */
.cerf-banner,
.cerf-video img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
}

.cerf-video img {
  transition: all 0.3s ease;
}

.cerf-video img:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
