/* The plugin directory and plugin pages (/docs/plugins). */

.pd-page {
  --pd-bg: #0b0c0e;
  --pd-surface: #141518;
  --pd-border: #24262b;
  --pd-border-hover: #3a3d44;
  --pd-text: #f4f5f6;
  --pd-muted: #8a8f98;
  --pd-link: #8b9dff;
  --pd-icon-size: 18px;

  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  color: var(--pd-text);
  font-family: Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* On the root: the site's html rule has its own colour, which shows past the
   body's height on a long page. */
html:has(.pd-page) {
  background: #0b0c0e;
}

/* The site's header is fixed at 1000px; here it follows the page's column. */
body:has(.pd-page) > header {
  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-right: 24px;
  padding-left: 24px;
}

.pd-page h1,
.pd-page h2,
.pd-page h3 {
  width: auto;
  max-width: none;
  font-family: inherit;
}

.pd-page *,
.pd-page *::before {
  box-sizing: border-box;
}

/* An icon is a square of --pd-icon-size, with its glyph centred in it. */
.pd-page .material-symbols-outlined {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--pd-icon-size);
  height: var(--pd-icon-size);
  overflow: hidden;
  font-family: "Material Symbols Outlined";
  font-size: var(--pd-icon-size);
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

/* Directory */

.pd-index-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--pd-border);
}

.pd-index-header h1 {
  margin: 0;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pd-index-intro {
  margin: 8px 0 0;
  color: var(--pd-muted);
  font-size: 15px;
}

.pd-search {
  display: flex;
  flex: 0 1 240px;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--pd-border);
  border-radius: 20px;
  background: var(--pd-surface);
  color: var(--pd-muted);
}

.pd-search:focus-within {
  border-color: var(--pd-border-hover);
}

.pd-search .material-symbols-outlined {
  --pd-icon-size: 18px;
}

.pd-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pd-text);
  font-family: Roboto, system-ui, sans-serif;
  font-size: 14px;
}

.pd-search-input::-webkit-search-cancel-button {
  display: none;
}

.pd-search kbd {
  color: var(--pd-muted);
  font-family: inherit;
  font-size: 12px;
}

.pd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.pd-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 168px;
  padding: 20px;
  border: 1px solid var(--pd-border);
  border-radius: 12px;
  background: var(--pd-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease;
}

.pd-card[hidden] {
  display: none;
}

.pd-card:hover,
.pd-card:focus-visible {
  border-color: var(--pd-border-hover);
  outline: 0;
}

.pd-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--pd-accent) 16%, transparent);
  color: var(--pd-accent);
}

.pd-icon .material-symbols-outlined {
  --pd-icon-size: 22px;
}

.pd-card-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.pd-card-name strong {
  font-size: 15px;
  font-weight: 500;
}

.pd-publisher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--pd-muted);
  font-size: 12px;
  line-height: 14px;
}

.pd-publisher .material-symbols-outlined {
  --pd-icon-size: 14px;
}

.pd-card-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--pd-muted);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pd-empty {
  margin: 48px 0;
  color: var(--pd-muted);
  text-align: center;
}

.pd-empty[hidden] {
  display: none;
}

/* Plugin page */

.pd-breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--pd-muted);
  font-size: 14px;
}

.pd-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.pd-breadcrumb a:hover {
  color: var(--pd-text);
}

.pd-detail-layout {
  display: grid;
  grid-template-areas:
    "title sidebar"
    "content sidebar";
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: auto 1fr;
  column-gap: 72px;
}

.pd-detail-title {
  grid-area: title;
}

.pd-detail-title h1 {
  margin: 20px 0 0;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.pd-content {
  grid-area: content;
  min-width: 0;
  margin-top: 16px;
}

.pd-content h2 {
  margin: 40px 0 12px;
  font-size: 22px;
  font-weight: 500;
}

.pd-content h3 {
  margin: 28px 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.pd-content p,
.pd-content ul,
.pd-content ol {
  margin: 0 0 14px;
  color: #c9ccd1;
}

.pd-content ul,
.pd-content ol {
  padding-left: 20px;
}

.pd-content li {
  margin-bottom: 6px;
}

.pd-content strong {
  color: var(--pd-text);
  font-weight: 500;
}

.pd-content a {
  color: var(--pd-link);
  text-decoration: none;
}

.pd-content a:hover {
  text-decoration: underline;
}

.pd-content code,
.pd-content kbd {
  padding: 1px 6px;
  border: 1px solid var(--pd-border);
  border-radius: 4px;
  background: var(--pd-surface);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}

.pd-content pre {
  margin: 8px 0 16px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--pd-border);
  border-radius: 8px;
  background: var(--pd-surface);
}

.pd-content pre code {
  padding: 0;
  border: 0;
  background: none;
  color: #c9ccd1;
  font-size: 13px;
}

.pd-content table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 14px;
}

.pd-content th,
.pd-content td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--pd-border);
  color: #c9ccd1;
  text-align: left;
  vertical-align: top;
}

.pd-content th {
  color: var(--pd-muted);
  font-weight: 500;
}

.pd-sidebar {
  position: sticky;
  top: 24px;
  grid-area: sidebar;
  align-self: start;
}

.pd-enable {
  margin: 0 0 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--pd-border);
  color: #c9ccd1;
  font-size: 14px;
}

.pd-enable strong {
  color: var(--pd-text);
  font-weight: 500;
}

.pd-sidebar h2 {
  margin: 0 0 12px;
  color: var(--pd-muted);
  font-size: 14px;
  font-weight: 500;
}

.pd-sidebar dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 24px;
  margin: 0;
  font-size: 14px;
}

.pd-sidebar dt {
  color: var(--pd-muted);
}

.pd-sidebar dd {
  margin: 0;
  color: var(--pd-text);
}

.pd-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--pd-text);
  font-size: 14px;
  text-decoration: none;
}

.pd-github:hover {
  color: var(--pd-link);
}

@media (max-width: 960px) {
  .pd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pd-detail-layout {
    grid-template-areas:
      "title"
      "sidebar"
      "content";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .pd-sidebar {
    position: static;
    margin-top: 24px;
    padding: 20px;
    border: 1px solid var(--pd-border);
    border-radius: 12px;
    background: var(--pd-surface);
  }
}

@media (max-width: 620px) {
  .pd-page {
    padding: 32px 16px 64px;
  }

  body:has(.pd-page) > header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .pd-index-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pd-search {
    flex: none;
  }

  .pd-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pd-detail-title h1,
  .pd-index-header h1 {
    font-size: 30px;
  }
}
