/* ============================================================
   Homepage hub (3-card landing)
   ============================================================ */

/* Hide the markdown-rendered first h1 on all pages by default,
   but allow our custom hero title to show */
.md-content h1:first-of-type:not(.hub-hero-title) {
  display: none;
}

.hub-hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.hub-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
  margin: 0 0 2rem;
  max-width: 70ch;
}

.lead-intro {
  font-size: 1.15rem;
  line-height: 1.65;
  font-weight: 500;
  color: var(--md-default-fg-color);
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.10), rgba(124, 77, 255, 0.04));
  border-left: 4px solid var(--md-primary-fg-color);
  border-radius: 0.4rem;
  padding: 1.1rem 1.3rem;
  margin: 1.2rem 0 1.5rem;
}

.lead-intro + p {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem;
}

@media screen and (max-width: 960px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

.hub-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  background: var(--md-default-bg-color);
  color: inherit !important;
  text-decoration: none !important;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-card:hover,
.hub-card:focus-visible {
  border-color: var(--md-accent-fg-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.15);
  outline: none;
}

.hub-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.hub-icon svg {
  width: 22px;
  height: 22px;
}

/* Pastel icon variants — work in light & dark */
.hub-icon--blue {
  background: #dbeafe;
  color: #3b82f6;
}
.hub-icon--purple {
  background: #ede9fe;
  color: #8b5cf6;
}
.hub-icon--green {
  background: #d1fae5;
  color: #10b981;
}

[data-md-color-scheme="slate"] .hub-icon--blue {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}
[data-md-color-scheme="slate"] .hub-icon--purple {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}
[data-md-color-scheme="slate"] .hub-icon--green {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.hub-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--md-default-fg-color);
}

.hub-card-desc {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
  margin: 0;
}

/* ============================================================
   Back button (top of every non-home page)
   ============================================================ */
.back-bar {
  margin: 0 0 1.25rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem 0.35rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--md-default-fg-color--light);
  background: transparent;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-button:hover,
.back-button:focus-visible {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
  background: var(--md-accent-fg-color--transparent);
  outline: none;
}

.back-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* ============================================================
   AIoMetadata setup guide
   ============================================================ */
.setup-import-guide {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1.15fr);
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.setup-import-guide__steps > :first-child,
.setup-import-guide__image > :first-child {
  margin-top: 0;
}

.setup-import-guide__steps > :last-child,
.setup-import-guide__image > :last-child {
  margin-bottom: 0;
}

.setup-import-guide__image {
  margin: 0;
}

.setup-import-guide__image img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.45);
}

@media screen and (max-width: 760px) {
  .setup-import-guide {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Nuvio setup guide screenshots
   ============================================================ */
.nuvio-guide-image {
  margin: 1rem auto 1.25rem;
  text-align: center;
}

.nuvio-guide-image img {
  display: block;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.45);
}

.nuvio-guide-image--narrow {
  max-width: 240px;
}

.nuvio-guide-image--medium {
  max-width: 720px;
}

/* ============================================================
   Collections downloads page
   ============================================================ */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0 0 2rem;
}

@media screen and (max-width: 760px) {
  .dl-grid {
    grid-template-columns: 1fr;
  }
}

.dl-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 12px;
  background: var(--md-default-bg-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dl-card:hover {
  border-color: var(--md-default-fg-color--lighter);
  box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.18);
}

.dl-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dl-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--md-default-fg-color);
}

.dl-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 999px;
  color: #fff;
}

.dl-badge--main {
  background: #8b5cf6;
}

.dl-badge--horror {
  background: #ef4444;
}

.dl-badge--ultimate {
  background: #f59e0b;
  color: #1a1100;
}

.dl-card--soon {
  opacity: 0.72;
  position: relative;
}

.dl-card--soon:hover {
  border-color: var(--md-default-fg-color--lightest);
  box-shadow: none;
  transform: none;
}

.dl-card__soon {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
  border: 1px dashed var(--md-default-fg-color--lighter);
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  vertical-align: middle;
}

.dl-btn--disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.dl-card__desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--md-default-fg-color--light);
}

.dl-card__stats {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}

.dl-card__stats li {
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  padding: 0.1rem 0.55rem;
  background: var(--md-code-bg-color);
  border-radius: 999px;
  font-weight: 500;
}

.dl-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s, transform 0.1s, border-color 0.15s;
  white-space: nowrap;
}

.dl-btn svg {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  opacity: 0.85;
}

.dl-btn--primary {
  color: #fff !important;
  background: var(--md-accent-fg-color);
}

.dl-btn--primary:hover {
  background: var(--md-primary-fg-color);
  transform: translateY(-1px);
}

.dl-btn--outline {
  color: var(--md-accent-fg-color) !important;
  background: transparent;
  border-color: var(--md-accent-fg-color);
}

.dl-btn--outline:hover {
  background: var(--md-accent-fg-color);
  color: #fff !important;
}

.dl-card__pair {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--md-default-fg-color--lightest);
  font-size: 0.7rem;
  color: var(--md-default-fg-color--light);
  line-height: 1.5;
}

.dl-card__pair code {
  font-size: 0.7rem;
  padding: 0.05rem 0.3rem;
}

/* ============================================================
   Edit path bar (kept from original)
   ============================================================ */
.edit-path-bar {
  margin-top: 3rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.edit-path-label {
  white-space: nowrap;
  font-weight: 500;
}

.edit-path-code {
  background: var(--md-code-bg-color);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--md-code-fg-color);
  word-break: break-all;
}

/* ============================================================
   Video walkthrough embed
   ============================================================ */
.video-frame,
.video-hero {
  position: relative;
  /* Fill the actual browser viewport: 98% wide OR enough height that 16:9 fits in 94% of vh,
     whichever runs out first. Bigger than before across every monitor. */
  width: min(92vw, calc(85vh * 16 / 9));
  /* Anchor centering to the viewport, not the 61rem .md-grid column */
  margin-left: calc(50% - min(46vw, calc(42.5vh * 16 / 9)));
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 22px 60px -24px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--md-default-fg-color--lightest);
}

/* On the dedicated video pages, also nuke the column cap so nothing else fights us */
.md-typeset .video-frame,
.md-typeset .video-hero {
  max-width: none;
}
.video-frame iframe,
.video-hero iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Inline "Watch the video walkthrough" callout used on setup pages */
.video-callout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 1rem 0 1.5rem;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.15), rgba(124, 77, 255, 0.04));
  border: 1px solid rgba(124, 77, 255, 0.35);
  border-radius: 10px;
  font-size: 0.95rem;
}
.video-callout::before {
  content: "▶";
  font-size: 1.1rem;
  color: rgb(180, 150, 255);
}
.video-callout a {
  font-weight: 600;
}
