/* ============================================================
   Docs shared styles
   ============================================================ */

/* --- Imports must be first ---
   ============================================================ */

@import './partials/table.css';
@import './partials/code-example.css';
@import './reset.css';

/* --- Heading group spacing ---
   When h2 + h3 are siblings (title group), keep them close.
   When h3 stands alone after content, give it breathing room.
   ============================================================ */

h2.umd-sans-extralarge-bold {
  margin-bottom: 1em;
}

h3.umd-sans-larger {
  margin-bottom: 0.75em;
}

h3.umd-sans-larger-bold {
  margin-bottom: 0.75em;
}

h4.umd-sans-larger-bold {
  margin-bottom: 0.75em;
}

h4.umd-sans-medium {
  font-weight: bold;
  margin-bottom: 0.75em;
}

/* Eyebrow sub-headings */
h4.umd-sans-small,
h5.umd-sans-small {
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75em;
}

/* All umd-sans-larger headings in docs get uppercase */
.umd-sans-larger {
  text-transform: uppercase;
}

.umd-rich-text-simple ul,
.umd-rich-text-simple ol {
  padding-left: 1.5rem;
}

.umd-rich-text-simple a {
  text-decoration: none;
}

.umd-rich-text-simple li {
  + li {
    margin-top: 1em;
  }
}

.docs-track-heading-secondary {
  margin-top: 3rem;
}

/* --- Alert box ---
   ============================================================ */

.alert-custom {
  background-color: #fafafa;
  border: 1px solid #f1f1f1;
  padding: 1.5rem 2.5rem;
  border-radius: 2px;
}

.alert-custom h1,
.alert-custom h2,
.alert-custom h3,
.alert-custom h4,
.alert-custom h5,
.alert-custom h6 {
  color: #000000;
  text-transform: uppercase;
  font-weight: bold;
  margin-bottom: 0.75em;
}

.alert-custom li + li {
  margin-top: 0.75rem;
}

/* --- Code ---
   ============================================================ */

pre {
  background-color: #fafafa;
  border-radius: 2px;
  padding: 1rem;
  overflow-x: auto;
}

pre[class*='language-'] {
  background-color: #fafafa;
  border-radius: 2px;
  padding: 1rem;
  overflow-x: auto;
}

code {
  color: #e21833;
}
pre code {
  color: inherit;
}

/* --- Tier boxes ---
   ============================================================ */

.tier-box {
  background-color: #fafafa;
  border: 1px solid #f1f1f1;
  border-top: 3px solid transparent;
  border-radius: 2px;
  padding: 1.5rem 2.5rem;
}

.tier-box:has(+ .tier-box) {
  margin-bottom: 2em;
}

.tier-box[data-tier='application'] {
  border-top-color: #e21833;
}
.tier-box[data-tier='application'] .tier-label {
  color: #e21833;
}
.tier-box[data-tier='infrastructure'] {
  border-top-color: #ffd200;
}
.tier-box[data-tier='infrastructure'] .tier-label {
  color: #757575;
}
.tier-box[data-tier='foundation'] {
  border-top-color: #000000;
}
.tier-box[data-tier='foundation'] .tier-label {
  color: #000000;
}

.tier-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.tier-stack {
  display: flex;
  flex-direction: column;
}

/* --- Use case cards ---
   ============================================================ */

.use-case-card {
  padding-bottom: 2.5rem;
}

.use-case-card + .use-case-card::before {
  content: '';
  display: block;
  height: 1px;
  background-color: #000000;
  margin-bottom: 2.5rem;
}

.use-case-card h4 {
  margin-bottom: 0.75em;
}

.use-case-card h5 {
  margin-bottom: 0.75rem;
}

.use-case-card ul {
  padding-left: 1.5rem;
}

/* --- Example output ---
   ============================================================ */

.example-output {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

/* --- Color swatch (tokens page) ---
   ============================================================ */

.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 0.5rem;
  border: 1px solid #dee2e6;
}

/* --- Tier badges (table) ---
   ============================================================ */

.tier-badge-foundation,
.tier-badge-infrastructure,
.tier-badge-application {
  padding: 0.35em 0.75em;
  border-radius: 2px;
  font-size: 0.8rem;
}

.tier-badge-foundation {
  background-color: #454545;
  color: #ffffff;
}
.tier-badge-infrastructure {
  background-color: #ffd200;
  color: #242424;
}
.tier-badge-application {
  background-color: #e21833;
  color: #ffffff;
}

/* --- Package grid (architecture page) ---
   ============================================================ */

.pkg-inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.pkg-inline-item {
  background-color: #ffffff;
  border: 1px solid #f1f1f1;
  border-radius: 2px;
  padding: 1rem;
}

.pkg-inline-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.pkg-inline-item code {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.5rem;
}

.pkg-inline-item span {
  font-size: 0.9rem;
  color: #242424;
}

@media (max-width: 767px) {
  .pkg-inline {
    grid-template-columns: 1fr;
  }
}

/* --- Decision table (architecture page) ---
   ============================================================ */

.decision-table td,
.decision-table th {
  vertical-align: middle;
}

/* --- Type card ---
   ============================================================ */

.type-card {
  background-color: #f8f9fa;
  border-left: 4px solid #e21833;
  padding: 1rem;
  margin-bottom: 1rem;
}

.type-card code {
  color: #0066cc;
}

/* --- Alert / callout variants ---
   ============================================================ */

.alert-pro-tip,
.cm-callout-info {
  background-color: #e3f2fd;
  border: 1px solid #90caf9;
  color: #0d47a1;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* --- Feature badge ---
   ============================================================ */

.feature-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  background-color: #28a745;
  color: #ffffff;
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* --- Release note ---
   ============================================================ */

.release-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
}

/* --- Metric cards (advanced-bundling page) ---
   ============================================================ */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.metric-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.metric-card h4 {
  margin-bottom: 0.75em;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
}

/* --- Table of contents (advanced-usage page) ---
   ============================================================ */

.toc {
  position: sticky;
  top: 80px;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toc-link {
  display: block;
  padding: 0.5rem 0 0.5rem 1rem;
  color: #495057;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.toc-link:hover,
.toc-link.active {
  color: #e21833;
  border-left-color: #e21833;
}

/* --- Two column layout (advanced-usage page) ---
   ============================================================ */

.two-column-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

@media (max-width: 767px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }
}

/* --- Feature list ---
   ============================================================ */

.feature-list {
  list-style: none;
  padding-left: 0;
}

.feature-list li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
}

.feature-list li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #008000;
  font-weight: bold;
}

.checklist-do ul,
.checklist-dont ul {
  list-style: none;
  padding-left: 0;
}

.checklist-do li,
.checklist-dont li {
  padding: 0.5rem 0 0.5rem 1.5rem;
  position: relative;
}

.checklist-do li::before,
.checklist-dont li::before {
  position: absolute;
  left: 0;
  font-weight: bold;
}

.checklist-do li::before {
  content: '\2713';
  color: #008000;
}

.checklist-dont li::before {
  content: '\00D7';
  color: #e21833;
}

/* --- Integration card (tailwind page) ---
   ============================================================ */

.integration-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: #ffffff;
}

.integration-card h4 {
  color: #e21833;
  margin-bottom: 0.75em;
}

/* --- Example box (tailwind page) ---
   ============================================================ */

.example-box {
  background-color: #f8f9fa;
  border: 2px solid #e21833;
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}

/* --- Section heading reset ---
   ============================================================ */

section > h3:first-child {
  margin-top: 0;
}
