/* ===========================================================================
 * Modern Network Observability — hub theme
 *
 * Mirrors the AutoCon5 workshops site styling so the two read as one
 * ecosystem. Hero + book buy chips + podcast/video media cards + companion
 * lab card.
 * =========================================================================== */

:root {
  --hub-gradient-start: #00897b;
  --hub-gradient-mid: #009688;
  --hub-gradient-end: #00bcd4;
  --hub-accent: #00e5ff;
}

[data-md-color-scheme="slate"] {
  --hub-gradient-start: #004d40;
  --hub-gradient-mid: #00695c;
  --hub-gradient-end: #006064;
  --hub-accent: #4dd0e1;
}

/* ---------- Hero -------------------------------------------------------- */

.hub-hero {
  background: linear-gradient(
    135deg,
    var(--hub-gradient-start) 0%,
    var(--hub-gradient-mid) 50%,
    var(--hub-gradient-end) 100%
  );
  color: #fff;
  border-radius: 14px;
  padding: 3rem 2.25rem;
  margin: 0 0 2.5rem;
  box-shadow: 0 12px 32px rgba(0, 137, 123, 0.20);
}

.hub-hero__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hub-hero__title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 0.5rem;
  color: #fff;
}

.hub-hero__subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.95;
  margin: 0 0 1.5rem;
  max-width: 60rem;
}

.hub-hero a.md-button {
  background: #fff;
  color: var(--hub-gradient-start);
  border-color: #fff;
  font-weight: 600;
}

.hub-hero a.md-button--primary {
  background: var(--hub-accent);
  color: #002b30;
  border-color: var(--hub-accent);
}

.hub-hero a.md-button:hover,
.hub-hero a.md-button:focus {
  background: var(--hub-accent);
  color: #002b30;
  border-color: var(--hub-accent);
}

/* ---------- Book buy chips --------------------------------------------- */

.hub-buy {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1rem;
}

.hub-buy__chip {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  text-decoration: none;
  color: var(--md-default-fg-color);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-buy__chip:hover {
  transform: translateY(-1px);
  border-color: var(--hub-gradient-mid);
  box-shadow: 0 4px 14px rgba(0, 137, 123, 0.10);
}

.hub-buy__chip strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.hub-buy__chip span {
  font-size: 0.78rem;
  color: var(--md-default-fg-color--light);
}

.hub-buy__caption {
  font-size: 0.92rem;
  color: var(--md-default-fg-color--light);
  margin: 0.5rem 0 2rem;
}

/* ---------- Media cards (podcast / video) ------------------------------ */

.hub-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

/* Horizontal-scroll variant — for sections that grow over time (Watch).
 * Cards keep their width and the row scrolls; on touch this is a swipe
 * gesture, on desktop a mouse-wheel + drag. Snap-points centre cards as
 * the user scrolls. */
.hub-media--scroll {
  display: flex;
  grid-template-columns: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0.25rem;
  padding: 0.25rem 0.25rem 1rem;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  /* subtle right-edge fade hints there's more off-screen */
  -webkit-mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 32px),
    transparent 100%
  );
          mask-image: linear-gradient(
    to right,
    #000 0,
    #000 calc(100% - 32px),
    transparent 100%
  );
}

.hub-media--scroll > .hub-media__card {
  flex: 0 0 320px;
  max-width: 320px;
  scroll-snap-align: start;
}

/* When fully scrolled, drop the right-edge fade so the last card isn't
 * permanently dimmed. */
.hub-media--scroll:hover {
  -webkit-mask-image: none;
          mask-image: none;
}

/* Slim, themed scrollbar. */
.hub-media--scroll::-webkit-scrollbar {
  height: 8px;
}

.hub-media--scroll::-webkit-scrollbar-track {
  background: transparent;
}

.hub-media--scroll::-webkit-scrollbar-thumb {
  background: var(--md-default-fg-color--lightest);
  border-radius: 4px;
}

.hub-media--scroll::-webkit-scrollbar-thumb:hover {
  background: var(--hub-gradient-mid);
}

@media (max-width: 600px) {
  .hub-media--scroll > .hub-media__card {
    flex: 0 0 280px;
    max-width: 280px;
  }
}

.hub-media__card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 1.1rem;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 10px;
  text-decoration: none;
  color: var(--md-default-fg-color);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-media__card:hover {
  transform: translateY(-2px);
  border-color: var(--hub-gradient-mid);
  box-shadow: 0 6px 20px rgba(0, 137, 123, 0.12);
}

.hub-media__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hub-gradient-mid);
}

[data-md-color-scheme="slate"] .hub-media__eyebrow {
  color: var(--hub-accent);
}

.hub-media__title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.hub-media__body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
  flex-grow: 1;
}

.hub-media__cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hub-gradient-mid);
  margin-top: 0.25rem;
}

[data-md-color-scheme="slate"] .hub-media__cta {
  color: var(--hub-accent);
}

.hub-media__card:hover .hub-media__cta {
  text-decoration: underline;
}

/* ---------- Companion (single full-width card) ------------------------- */

.hub-companion-wrap {
  margin: 1rem 0 0;
}

.hub-companion {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(
    100deg,
    rgba(0, 188, 212, 0.06) 0%,
    rgba(0, 137, 123, 0.04) 100%
  );
  border-left: 4px solid var(--hub-gradient-mid);
  border-radius: 0 10px 10px 0;
  text-decoration: none;
  color: var(--md-default-fg-color);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

[data-md-color-scheme="slate"] .hub-companion {
  background: linear-gradient(
    100deg,
    rgba(77, 208, 225, 0.06) 0%,
    rgba(0, 137, 123, 0.04) 100%
  );
  border-left-color: var(--hub-accent);
}

.hub-companion:hover {
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(0, 137, 123, 0.10);
}

.hub-companion__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hub-gradient-mid);
}

[data-md-color-scheme="slate"] .hub-companion__eyebrow {
  color: var(--hub-accent);
}

.hub-companion__title {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
}

.hub-companion__body {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
  margin: 0.25rem 0;
}

.hub-companion__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hub-gradient-mid);
}

[data-md-color-scheme="slate"] .hub-companion__cta {
  color: var(--hub-accent);
}

.hub-companion:hover .hub-companion__cta {
  text-decoration: underline;
}

/* ---------- Reading polish --------------------------------------------- */

.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
}
