/* Showcase layout — used by content with `type: showcase` (e.g. Vigil).
 * Loaded conditionally from themes/ub/layouts/_default/baseof.html.
 * Builds on top of the site's main style.css; only adds showcase-specific
 * rules. Brand colours (cyan→violet on dark navy) are scoped to the hero
 * only — the rest of the page reuses the site's palette. */

/* Full-bleed hero: breaks out of any constrained parent (e.g. <main> with
 * max-width). Negative-margin trick. Width uses 100vw with a small safety
 * deduction to avoid the horizontal-scrollbar overflow on Windows. */
.showcase-hero {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -3.5rem;        /* cancels <main>'s padding-top */
  margin-bottom: 3rem;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(34, 211, 238, 0.18), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.18), transparent 60%),
    #0f172a;
  color: #f8fafc;
  padding: 4.5rem 1.5rem 3.5rem;
}

.showcase-hero__inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.showcase-hero__icon {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  display: block;
  border-radius: 22px;
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.5),
    0 2px 6px rgba(0, 0, 0, 0.2);
}

.showcase-hero__text {
  flex: 1 1 auto;
  min-width: 0;
}

.showcase-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.showcase-hero__tagline {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: #cbd5e1;
  margin: 0 0 1.5rem;
  max-width: 36rem;
  font-weight: 400;
  line-height: 1.4;
}

.showcase-hero__ctas {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0;
}

.showcase-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 1.3rem;
  border-radius: 23px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}

.showcase-hero__cta--primary {
  background: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.showcase-hero__cta--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.showcase-hero__cta--ghost {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.showcase-hero__cta--pending {
  background: transparent;
  color: #94a3b8;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  cursor: not-allowed;
  font-style: italic;
}

.showcase-hero__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.5);
}

.showcase-hero__cta--pending:hover {
  transform: none;
  box-shadow: none;
}

.showcase-hero__cta-logo {
  width: 22px;
  height: 22px;
  margin-right: 0.55rem;
  vertical-align: middle;
}

.showcase-hero__meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: #94a3b8;
}

.showcase-hero__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.showcase-hero__meta-item::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  display: inline-block;
}

/* ─── Screenshot carousel (Flathub-style, vanilla JS) ───────────────────
 * Full-bleed dark-backdrop section.
 * Single slide centred at ~70% viewport width, siblings peek from sides.
 * Arrows live OUTSIDE the slide on the dark backdrop.
 * Caption + dots stack below the stage, centred. */

.showcase-carousel {
  /* Break out of the body content column to span the viewport. */
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 2.75rem 0 1.5rem;
  background: #1c2333;             /* slightly darker than the hero gradient base */
}

.showcase-carousel:focus { outline: none; }

/* Stage = positioning context for the arrows; the viewport sits inside. */
.showcase-carousel__stage {
  position: relative;
  max-width: 88rem;
  margin: 0 auto;
  padding: 0 4rem;                 /* room for arrows on the dark backdrop */
}

.showcase-carousel__viewport {
  overflow: hidden;
}

.showcase-carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 15%;                  /* pseudo-scroll-padding so siblings peek */
}

.showcase-carousel__track::-webkit-scrollbar { display: none; }

.showcase-carousel__slide {
  flex: 0 0 70%;
  max-width: 60rem;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  margin: 0;
  padding: 0;
  background: #0f172a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0.55;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.showcase-carousel__slide.is-active {
  opacity: 1;
}

.showcase-carousel__slide img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 34rem;
  object-fit: contain;
}

/* Caption + dots row, on the dark backdrop, below the stage. */

.showcase-carousel__caption {
  margin: 1.5rem auto 0.75rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
  min-height: 1.3em;
}

.showcase-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.12s ease;
  z-index: 2;
}

.showcase-carousel__nav:hover,
.showcase-carousel__nav:focus-visible {
  background: rgba(139, 92, 246, 0.85);
  outline: none;
  transform: translateY(-50%) scale(1.06);
}

.showcase-carousel__nav--prev { left: 0.5rem; }
.showcase-carousel__nav--next { right: 0.5rem; }

.showcase-carousel__dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding-bottom: 0.25rem;
}

.showcase-carousel__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, width 0.2s ease;
}

.showcase-carousel__dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.showcase-carousel__dot.is-active {
  width: 26px;
  border-radius: 5px;
  background: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
}

.showcase-carousel--empty {
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .showcase-carousel__track { scroll-behavior: auto; }
  .showcase-carousel__nav,
  .showcase-carousel__dot,
  .showcase-carousel__slide { transition: none; }
}

@media (max-width: 768px) {
  .showcase-carousel__stage { padding: 0 0.75rem; }
  .showcase-carousel__track {
    gap: 0.5rem;
    padding: 0 8%;
  }
  .showcase-carousel__slide { flex-basis: 86%; }
  .showcase-carousel__nav  { display: none; }
}

/* ─── Feature grid ─────────────────────────────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 1rem;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1.25rem 1.1rem 1.1rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.feature-card:hover {
  border-color: #8b5cf6;
  transform: translateY(-2px);
}

.feature-card__icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.7rem;
  display: block;
}

.feature-card__title {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.feature-card__body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* ─── Info list (Flathub-style "Additional information") ───────────────── */

.info-list {
  margin: 3rem 0;
  padding: 1.5rem 1.5rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.info-list__title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  color: var(--text);
}

.info-list__rows {
  margin: 0;
  display: grid;
  gap: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-light);
}

.info-row:first-child {
  border-top: none;
  padding-top: 0;
}

.info-row__label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
}

.info-row__value {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-word;
}

.info-row__value a {
  color: var(--accent);
}

.info-row__value a:hover {
  color: var(--accent-hover);
}

.info-row__value code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

@media (max-width: 520px) {
  .info-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* ─── Tech stack pills ─────────────────────────────────────────────────── */

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tech-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ─── Article-body containment after the full-bleed hero ───────────────── */
/* Inherits typography (line-height, paragraph margins, code styling) from
 * the site's existing .article-content rules via the layout (the wrapper
 * carries both classes). Only layout-specific tweaks live here. */

.showcase-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0;
}

/* `.showcase-carousel` handles its own full-bleed breakout via 100vw
 * negative-margin; no extra rule needed here.
 * Empty-state stays within the body column. */
.showcase-body > .showcase-carousel--empty {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.showcase-body details {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0 1rem;
  margin: 2rem 0;
}

.showcase-body details summary {
  cursor: pointer;
  padding: 0.85rem 0;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
}

.showcase-body details[open] summary {
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.8rem;
}

/* ─── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .showcase-hero {
    margin-top: -2.5rem;          /* matches main's mobile padding-top */
    padding: 3rem 1.25rem 2.25rem;
  }
  .showcase-hero__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
  }
  .showcase-hero__icon {
    width: 88px;
    height: 88px;
  }
  .showcase-hero__tagline {
    margin: 0 auto 1.25rem;
  }
  .showcase-hero__ctas {
    justify-content: center;
  }
  .showcase-hero__meta {
    justify-content: center;
  }
  .showcase-body > .showcase-carousel,
  .showcase-body > .showcase-carousel--empty {
    margin-left: 0;
    margin-right: 0;
  }
}
