/* Copyright (C) 2024-2026 Advanced Micro Devices, Inc. */
/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */

/* Primary: charcoal header matching rocm.docs.amd.com (#27282b / #1a1a1b).
   Accent scheme: true-blue links, orange for interactive/hover accents. */
:root {
  --md-primary-fg-color:        #27282b;  /* ROCm second-level nav charcoal */
  --md-primary-fg-color--light: #3a3b3f;
  --md-primary-fg-color--dark:  #1a1a1b;  /* ROCm top nav near-black */
  --md-primary-bg-color:        #ffffff;
  --md-primary-bg-color--light: rgba(255,255,255,0.7);

  --md-typeset-a-color:               #1565d8;  /* true blue links */
  --md-accent-fg-color:               #e8710a;  /* orange interactive accent */
  --md-accent-fg-color--transparent:  rgba(232,113,10,0.12);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #27282b;
  --md-primary-fg-color--light: #3a3b3f;
  --md-primary-fg-color--dark:  #1a1a1b;

  --md-typeset-a-color:               #5b9bff;  /* lighter blue on dark bg */
  --md-accent-fg-color:               #ff9d42;  /* lighter orange on dark bg */
  --md-accent-fg-color--transparent:  rgba(255,157,66,0.14);

  /* Material's default slate is blue-tinted (hsla(232,15%,...)); ROCm's
     dark mode is neutral charcoal. Override the backgrounds to neutral
     greys so the body matches the charcoal header instead of clashing. */
  --md-default-bg-color:        #1b1b1d;   /* page background */
  --md-code-bg-color:           #242528;   /* code blocks / inline */
  --md-default-fg-color:              rgba(255,255,255,0.87);
  --md-default-fg-color--light:       rgba(255,255,255,0.60);
  --md-default-fg-color--lighter:     rgba(255,255,255,0.32);
  --md-default-fg-color--lightest:    rgba(255,255,255,0.12);
}

/* ── Code blocks ─────────────────────────────────────────────────────────── */
.highlight pre { border-radius: 6px; }
.md-typeset code { border-radius: 3px; }

/* ── Figures ─────────────────────────────────────────────────────────────── */
/* A <figure> shrinks to its image width, which cramps the caption. Let the
   caption stay comfortably readable while the image keeps its intrinsic size. */
.md-typeset figure { max-width: 100%; }
.md-typeset figure > figcaption { max-width: 32rem; margin-left: auto; margin-right: auto; }

/* Syntax highlighting uses Material's default (canonical) token palette —
   full color variety for keywords / functions / builtins / strings / numbers,
   matching what developers expect from GitHub/VSCode. The blue-link and
   orange-interactive accents are theme chrome and defined separately above. */

/* ── Landing page: quick-nav cards ──────────────────────────────────────── */
.iron-cards {
  display: grid;
  /* Always exactly 4 equal columns on desktop, wrap gracefully on mobile */
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

@media (max-width: 900px) {
  .iron-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .iron-cards { grid-template-columns: 1fr; }
}

.iron-card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.25rem 1rem 1rem;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  color: inherit;
  min-height: 120px;
}

.iron-card:hover {
  border-color: var(--md-accent-fg-color);
  box-shadow: 0 0 0 2px var(--md-accent-fg-color--transparent);
  color: inherit;
}

.iron-card-icon { font-size: 1.4rem; margin-bottom: 0.5rem; display: block; line-height: 1; }
.iron-card-title { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 0.3rem; color: var(--md-typeset-a-color); }
.iron-card-desc  { font-size: 0.78rem; opacity: 0.72; line-height: 1.4; }

/* ── Collapsible details ─────────────────────────────────────────────────── */
/* Material sizes <details> like an admonition (0.64rem ≈ 12.8px), which is too
   small for prose-heavy dropdowns like "More about the toolchain". Restore the
   normal body text size for the summary and the content. */
.md-typeset details { font-size: 0.8rem; }
.md-typeset details > summary { font-size: 0.8rem; }

/* ── Wider content area ──────────────────────────────────────────────────── */
/* Both sidebars are shown (left = section nav, right = page TOC); widen the
   grid a little so the middle content column still has room between them. */
.md-grid { max-width: 76rem !important; }

/* ── Dialect pages ───────────────────────────────────────────────────────── */
/* mlir-tblgen bakes a <div class="toc"> into generated dialect docs;
   mkdocs-material already renders the sidebar TOC, so hide the duplicate. */
.toc { display: none; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.md-footer { font-size: 0.8rem; }
