/* MkDocs Material-Grade GitHub Callout & Repo Widget */

/* 1. Top Announcement Bar */
.github-callout {
  max-height: 52px;
  opacity: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              padding 0.3s ease;
  position: relative;
  z-index: 6;
}

.github-callout.dismissed {
  max-height: 0;
  opacity: 0;
  padding: 0;
  border-bottom-color: transparent;
  pointer-events: none;
  margin: 0;
}

.github-callout-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 6px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
}

.github-callout-message {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 12px/1.4 "Manrope", system-ui, sans-serif;
  color: var(--ink);
  min-width: 0;
}

.github-callout-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(217, 154, 34, 0.12);
  color: var(--amber);
  border: 1px solid rgba(217, 154, 34, 0.3);
  font: 600 10px/1.3 "DM Mono", monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.github-callout-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.github-callout-mobile-text { display: none; }

.github-callout-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.github-callout-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--ink);
  color: var(--panel);
  font: 600 11px/1.2 "DM Mono", monospace;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.github-callout-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.github-callout-cta .github-octocat-svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.github-callout-counter {
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 6px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 10px;
}

.github-callout-arrow {
  color: var(--green);
  font-size: 11px;
}

.github-callout-dismiss {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.github-callout-dismiss:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.07);
}

/* 2. MkDocs Material-Style Header Repository Widget */
.github-repo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease,
              background-color 0.15s ease,
              box-shadow 0.15s ease,
              transform 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.github-repo:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.github-repo:focus-visible {
  outline: 3px solid rgba(22, 127, 91, 0.28);
  outline-offset: 2px;
}

.github-repo-icon {
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}

.github-repo-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.9;
  transition: transform 0.18s ease;
}

.github-repo:hover .github-repo-icon svg {
  transform: scale(1.08);
}

.github-repo-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  min-width: 0;
}

.github-repo-title {
  font: 600 11.5px/1.2 "DM Mono", monospace;
  color: var(--ink);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.github-repo-facts {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 10px/1 "DM Mono", monospace;
  color: var(--muted);
}

.github-repo-fact {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
}

.github-repo-fact svg {
  width: 10.5px;
  height: 10.5px;
  fill: currentColor;
  opacity: 0.75;
  transition: color 0.15s ease, fill 0.15s ease, opacity 0.15s ease;
}

.github-repo-fact-count {
  color: var(--ink);
  font-weight: 600;
}

.github-repo:hover .github-repo-fact--stars svg {
  color: #eab308;
  fill: #eab308;
  opacity: 1;
}

.github-repo:hover .github-repo-fact--forks svg {
  color: var(--green);
  fill: var(--green);
  opacity: 1;
}

/* 3. In-Page Community Support Banner / Card */
.github-community-section {
  width: 100%;
  margin: 40px auto 20px;
}

.github-community-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.github-community-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.github-community-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.github-community-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}

.github-community-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.github-community-body {
  min-width: 0;
}

.github-community-eyebrow {
  display: inline-block;
  font: 600 10px/1 "DM Mono", monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 5px;
}

.github-community-title {
  margin: 0 0 5px;
  font: 700 16px/1.3 "Manrope", sans-serif;
  color: var(--ink);
}

.github-community-desc {
  margin: 0;
  font: 400 13px/1.5 "Manrope", sans-serif;
  color: var(--muted);
  max-width: 660px;
}

.github-community-actions {
  flex-shrink: 0;
}

.github-community-star-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font: 600 12.5px/1.2 "DM Mono", monospace;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.github-community-star-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.github-community-star-btn svg {
  width: 14px;
  height: 14px;
  fill: #eab308;
}

.github-community-star-pill {
  background: rgba(255, 255, 255, 0.22);
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 11px;
}

.github-community-star-arrow {
  color: var(--green);
  font-size: 12px;
}

/* 4. Footer Styling */
.lab-footer {
  width: 100%;
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 24px 28px;
  margin-top: 30px;
}

.lab-footer-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font: 400 12px/1.5 "Manrope", sans-serif;
}

.lab-footer-inner p {
  margin: 0;
}

.lab-footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font: 500 11px "DM Mono", monospace;
  white-space: nowrap;
}

.lab-footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.lab-footer-links a:hover {
  color: var(--ink);
}

/* 5. Dark Theme Overrides */
html[data-theme="dark"] .github-callout {
  background: #171a17;
}

html[data-theme="dark"] .github-callout-cta {
  background: var(--ink);
  color: var(--paper);
}

html[data-theme="dark"] .github-callout-counter {
  background: rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .github-callout-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .github-repo {
  background: #1c211d;
}

html[data-theme="dark"] .github-repo:hover {
  background: #232924;
}

html[data-theme="dark"] .github-community-card {
  background: #1a1e1b;
}

html[data-theme="dark"] .github-community-icon {
  background: #222823;
}

html[data-theme="dark"] .github-community-star-btn {
  background: var(--ink);
  color: var(--paper);
}

html[data-theme="dark"] .github-community-star-pill {
  background: rgba(0, 0, 0, 0.35);
}

/* 6. Responsive Rules */
@media (max-width: 1120px) {
  .github-repo-title {
    max-width: 160px;
  }
}

@media (max-width: 860px) {
  .github-callout-inner {
    padding: 5px 12px;
    gap: 8px;
  }
  .github-callout-message { flex: 1; }
  .github-callout-text {
    max-width: none;
  }
  .github-community-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .github-community-actions {
    width: 100%;
  }
  .github-community-star-btn {
    width: 100%;
    justify-content: center;
  }
  .lab-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 680px) {
  .github-callout-inner {
    justify-content: center;
    min-height: 32px;
  }
  .github-callout-pill {
    display: none;
  }
  .github-callout-text {
    display: none;
  }
  .github-callout-mobile-text {
    display: inline;
    white-space: nowrap;
    font: 500 10px/1.2 "DM Mono", monospace;
  }
  .github-callout-cta {
    padding: 3px 9px;
    font-size: 10px;
  }
  .github-callout-cta span:not(.github-callout-counter) {
    display: none;
  }
  .github-repo {
    padding: 5px 9px;
    gap: 6px;
  }
  .github-repo-facts .github-repo-fact-label,
  .github-repo-fact--forks {
    display: none;
  }
  .github-repo-title {
    max-width: 110px;
    font-size: 10.5px;
  }
}

@media (max-width: 900px) {
  .topbar .github-repo,
  .docs-topbar nav .github-repo {
    display: none;
  }
}
