/* ===========================================================================
 * AutoCon5 theme — Modern Network Observability workshop
 *
 * Layered on top of Material's teal/cyan palette. Three additions:
 *   1. AutoCon5 hero block (gradient banner + wordmark + tagline).
 *   2. Color refinement — slightly more vivid teal/cyan than Material defaults.
 *   3. AutoCon5 wordmark utility class for inline use in markdown.
 * =========================================================================== */

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

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

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

.autocon5-hero {
  background: linear-gradient(
    135deg,
    var(--autocon5-gradient-start) 0%,
    var(--autocon5-gradient-mid) 50%,
    var(--autocon5-gradient-end) 100%
  );
  color: #fff;
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin: 1rem 0 2rem;
  box-shadow: 0 8px 24px rgba(0, 137, 123, 0.18);
}

.autocon5-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;
}

.autocon5-hero__title {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  color: #fff;
}

.autocon5-hero__subtitle {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.95;
  margin: 0 0 1rem;
}

.autocon5-hero__lead {
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  max-width: 56rem;
}

.autocon5-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 1.25rem;
}

.autocon5-hero__meta span::before {
  content: "› ";
  opacity: 0.6;
  margin-right: 0.25rem;
}

/* CTAs sit below the hero (markdown-rendered .md-button) — keep as-is.
   On the hero itself we use a lighter button variant. */
.autocon5-hero a.md-button {
  background: #fff;
  color: var(--autocon5-gradient-start);
  border-color: #fff;
  font-weight: 600;
}

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

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

/* ---------- Inline AutoCon5 wordmark --------------------------------------- */

.autocon5-mark {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(
    90deg,
    var(--autocon5-gradient-start),
    var(--autocon5-gradient-end)
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Section hero (per-part) ---------------------------------------- */
/* Smaller, lower-key hero used at the top of each part guide. Tinted
 * background + left border accent so it reads as part-of-the-page rather
 * than a slab. */

.autocon5-section-hero {
  background: linear-gradient(
    100deg,
    rgba(0, 188, 212, 0.10) 0%,
    rgba(0, 137, 123, 0.06) 100%
  );
  border-left: 4px solid var(--autocon5-gradient-mid);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem 1.75rem;
  margin: 0.5rem 0 2rem;
}

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

.autocon5-section-hero__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  background: var(--autocon5-gradient-mid);
  color: #fff;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.autocon5-section-hero__title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

.autocon5-section-hero__subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  margin: 0 0 0.85rem;
  color: var(--md-default-fg-color--light);
}

.autocon5-section-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  margin-top: 0.5rem;
}

.autocon5-section-hero__meta span::before {
  content: "› ";
  opacity: 0.5;
  margin-right: 0.2rem;
}

/* ---------- Cross-part navigation footer ----------------------------------- */
/* Two-card row that sits at the bottom of each part: previous on the left,
 * next on the right. Visually echoes Material's grid cards but with directional
 * arrows. */

.autocon5-nav-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0 1rem;
}

/* The markdown processor wraps anchors in <p>; flatten so the grid sees
 * one cell per nav link. */
.autocon5-nav-footer > p {
  margin: 0;
}

.autocon5-nav-footer a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  text-decoration: none;
  color: var(--md-default-fg-color);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.autocon5-nav-footer a:hover {
  border-color: var(--autocon5-gradient-mid);
  background: rgba(0, 188, 212, 0.06);
  transform: translateY(-1px);
}

.autocon5-nav-footer__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.25rem;
}

.autocon5-nav-footer__title {
  font-size: 1.05rem;
  font-weight: 600;
}

.autocon5-nav-footer__next {
  text-align: right;
}

.autocon5-nav-footer__placeholder {
  visibility: hidden;
}

@media (max-width: 600px) {
  .autocon5-nav-footer {
    grid-template-columns: 1fr;
  }
  .autocon5-nav-footer__next {
    text-align: left;
  }
}

/* ---------- Material polish ------------------------------------------------- */
/* Subtle reading-experience refinements that ride on top of Material's
 * defaults — softer admonitions, code blocks that lift on hover, and
 * blockquotes that read as senior-engineer voice rather than dead quote. */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.md-typeset .admonition-title,
.md-typeset summary {
  font-weight: 600;
}

.md-typeset pre > code {
  border-radius: 8px;
  transition: box-shadow 0.15s ease;
}

.md-typeset .highlight:hover pre > code {
  box-shadow: 0 4px 12px rgba(0, 137, 123, 0.10);
}

.md-typeset blockquote {
  border-left-width: 4px;
  border-left-color: var(--autocon5-gradient-mid);
  background: rgba(0, 188, 212, 0.04);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
}

[data-md-color-scheme="slate"] .md-typeset blockquote {
  background: rgba(77, 208, 225, 0.05);
  border-left-color: var(--autocon5-accent);
}

/* Slightly tighter table styling for the many comparison tables in the
 * guides (vendor-A vs vendor-B, gNMI-raw vs canonical, etc.) */
.md-typeset table:not([class]) th {
  background: rgba(0, 137, 123, 0.06);
  font-weight: 600;
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background: rgba(77, 208, 225, 0.06);
}

/* ---------- Subtle palette tightening -------------------------------------- */

[data-md-color-scheme="default"] {
  /* slightly punchier accent on the light scheme */
  --md-accent-fg-color: #00bcd4;
}

/* ---------- Screenshots ---------------------------------------------------- */
/* Rounded-corner Grafana shots used in the visual reference gallery and at
 * the top of each part page. Click-to-zoom behavior comes from wrapping the
 * <img> in an <a> that points at the same image. */

.md-typeset img.screenshot {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--md-default-fg-color--lightest);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.md-typeset a:hover img.screenshot {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 137, 123, 0.18);
}

[data-md-color-scheme="slate"] .md-typeset img.screenshot {
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.40);
}

/* Per-part section preview — a single screenshot right after the section
 * hero, tighter caption, full width of the content area. */
.md-typeset figure.section-preview {
  margin: 0 0 2rem;
  text-align: center;
}

.md-typeset figure.section-preview figcaption {
  font-size: 0.85rem;
  color: var(--md-default-fg-color--light);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---------- Wider layout ---------------------------------------------------- */
/* Material's default content max-width is ~61rem (~976px). On modern displays
 * that leaves a lot of whitespace on either side and shrinks screenshots to
 * unreadable. Bump to 1400px while keeping body line-length comfortable via
 * a tighter inner `.md-content` max-width. */

.md-grid {
  max-width: 1400px;
}

/* Keep the prose readable by capping inner content width while letting the
 * shell (nav rails, header, footer) use the full grid. */
.md-content {
  max-width: 60rem;
  margin-right: auto;
}

/* On very wide viewports, push the TOC against the right gutter so the
 * content sits naturally between the two rails. */
@media screen and (min-width: 1400px) {
  .md-sidebar--secondary {
    margin-left: auto;
  }
}

/* ---------- Search bar polish ---------------------------------------------- */
/* Make the header search input feel more like a discrete control (rounded
 * pill, subtle border, hover affordance) rather than a barely-there strip. */

.md-search__form {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.md-search__form:hover {
  background: rgba(255, 255, 255, 0.18);
}

[dir="ltr"] .md-search__input {
  padding-left: 2.6rem;
}

.md-search__icon[for="__search"] {
  opacity: 0.9;
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form,
.md-search__form:focus-within {
  background: #fff;
  color: var(--md-default-fg-color);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.md-search__form:focus-within .md-search__input::placeholder {
  color: var(--md-default-fg-color--light);
}

/* ---------- Header logo (book cover) -------------------------------------- */
/* The book cover is portrait (406x500); Material's header is 2.4rem tall.
 * Constrain to a square so the cover doesn't stretch the header bar. */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.8rem;
  width: 1.8rem;
  object-fit: contain;
  border-radius: 2px;
}
