/* ---- Workflows directory — wf-* class namespace ---- */

.wf-page {
  background: var(--color-neutral-200);
}

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

.wf-hero {
  padding-top: calc(var(--nav-bar-height) + 5em);
  padding-bottom: 0;
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  border-bottom: 1px solid #8898aa;
  background: linear-gradient(to top, #ffffff, #f4f4f4);
}

/* Two-column layout: title+desc left, categories right */
.wf-hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3em;
  align-items: start;
}

.wf-hero__left {
  display: flex;
  flex-direction: column;
}

.wf-hero__right {
  padding-top: 0.25em;
}

.wf-hero__title {
  font-size: 3em;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #0f1b2d;
  margin-top: 0;
  margin-bottom: 0.5em;
}

.wf-hero__description {
  font-size: 1em;
  line-height: 1.5;
  color: #4a5568;
  max-width: 52ch;
  margin: 0 0 1em;
}

.wf-hero__description code {
  background: #eef2ff;
  color: #4338ca;
  border-radius: 0.25em;
  padding: 0.1em 0.4em;
  font-size: 0.875em;
}

.wf-hero__divider {
  margin-top: 1.75em;
  margin-bottom: 0;
}

/* ---- Category tags ---- */

.wf-hero__categories-label {
  font-size: 0.6875em;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8898aa;
  margin: 0 0 0.875em;
}

.wf-category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
}

.wf-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35em 0.7em;
  background: #f0f4f8;
  border: 1px solid #d0d9e4;
  border-radius: 100em;
  font-size: 0.75em;
  font-weight: 500;
  color: #4a5568;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  letter-spacing: 0.01em;
}

.wf-category-tag:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

.wf-category-tag.is--active {
  background: #6961fe;
  border-color: #6961fe;
  color: #ffffff;
}

.wf-category-tag__count {
  font-weight: 400;
  opacity: 0.75;
}

.wf-category-tag.is--active .wf-category-tag__count {
  opacity: 0.85;
}

.wf-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 0.25em;
  padding: 0.6em 1.1em;
  background: #6961fe;
  color: #ffffff;
  font-size: 0.875em;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 0.375em;
  text-decoration: none;
  transition: opacity 0.2s ease;
  align-self: flex-start;
}

.wf-hero__cta:hover {
  opacity: 0.85;
}

/* ---- Breadcrumb ---- */

.wf-breadcrumb {
  display: inline-block;
  margin-bottom: 1em;
  font-size: 0.875em;
  color: #8898aa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.wf-breadcrumb:hover {
  color: #0f1b2d;
}

/* ---- Toolbar (search + count) ---- */

.wf-toolbar-wrap {
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  border-bottom: 1px solid #d0d9e4;
  padding-top: 1.25em;
  padding-bottom: 1.25em;
}

.wf-toolbar {
  display: flex;
  align-items: center;
  gap: 1em;
}

.wf-search-wrap {
  position: relative;
  flex: 1;
}

.wf-search__icon {
  position: absolute;
  left: 0.875em;
  top: 50%;
  transform: translateY(-50%);
  color: #8898aa;
  pointer-events: none;
}

.wf-search {
  width: 100%;
  padding: 0.6em 0.875em 0.6em 2.5em;
  background: #f0f4f8;
  border: 1px solid #d0d9e4;
  border-radius: 0.375em;
  font-size: 0.875em;
  color: #0f1b2d;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wf-search:focus {
  background: #ffffff;
  border-color: #6961fe;
}

.wf-search::placeholder {
  color: #8898aa;
}

/* Remove native search clear button */
.wf-search::-webkit-search-cancel-button { display: none; }

.wf-toolbar__count {
  font-size: 0.8125em;
  font-weight: 500;
  color: #8898aa;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ---- Collections wrap ---- */

.wf-collections-wrap {
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  padding-top: 0;
  padding-bottom: 6em;
}

/* ---- Empty state ---- */

.wf-empty {
  padding: 3em 0;
  font-size: 0.9375em;
  color: #8898aa;
  text-align: center;
}

/* ---- Card list ---- */

.wf-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wf-card {
  border-top: 1px solid #8898aa;
}

/* Drop the leading divider on the first card. */
.wf-card:first-child {
  border-top: none;
}

.wf-card__link {
  display: block;
  padding: 2em 0;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.wf-card__link:hover {
  opacity: 0.7;
}

/* Card header: tags left, repo path right */
.wf-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.5em;
}

.wf-card__repo {
  font-size: 0.75em;
  color: #8898aa;
  font-family: monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Meta row: kind badge + tags */
.wf-card__meta {
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}

.wf-card__badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 100em;
  padding: 0.2em 0.6em;
  font-size: 0.6875em;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

.wf-card__title {
  font-size: 1.75em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #0f1b2d;
  margin: 0.25em 0 0.5em;
}

.wf-card__description {
  font-size: 0.9375em;
  color: #4a5568;
  line-height: 1.55;
  margin: 0 0 0.75em;
  max-width: 60ch;
}

.wf-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75em;
  gap: 1em;
}

.wf-card__counts {
  font-size: 0.8125em;
  color: #8898aa;
  font-weight: 500;
}

.wf-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: #6961fe;
  font-size: 0.875em;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wf-card__more svg {
  width: 1em;
  height: 1em;
  transition: transform 0.2s ease;
}

.wf-card__link:hover .wf-card__more svg {
  transform: translateX(0.25em);
}

/* ---- Detail layout ---- */

.wf-detail-layout {
  padding-top: 3em;
  padding-bottom: 6em;
  position: relative;
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
}

.wf-detail__sidebar {
  grid-column-gap: 1em;
  grid-row-gap: 1em;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  display: flex;
  position: sticky;
  top: calc(var(--nav-bar-height) + 2em);
}

@media screen and (min-width: 992px) {
  .wf-detail__sidebar {
    top: 220px;
  }
}

.wf-detail__sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.375em;
  width: 100%;
}

.wf-detail__label {
  font-size: 0.6875em;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8898aa;
  margin: 0;
}

.wf-detail__value {
  font-size: 0.9375em;
  color: #0f1b2d;
  margin: 0;
}

/* ---- Detail prose ---- */

.wf-detail__prose {
  margin-bottom: 2em;
}

.wf-detail__prose h2 {
  scroll-margin-top: 160px;
  letter-spacing: -0.01em;
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-size: 2em;
  font-weight: 500;
  line-height: 1.2;
}

.wf-detail__prose > h2:first-child {
  margin-top: 0;
}

.wf-detail__prose p {
  margin-bottom: 1.5em;
  font-size: 0.9375em;
  line-height: 1.5;
}

.wf-detail__prose h3 {
  scroll-margin-top: 160px;
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-size: 1.25em;
  font-weight: 500;
}

@media screen and (min-width: 992px) {
  .wf-detail__prose h2,
  .wf-detail__prose h3 {
    scroll-margin-top: 210px;
  }
}

.wf-detail__prose blockquote {
  color: #30557a;
  border-left-width: 2px;
  border-left-color: #6961fe;
  font-size: 1.125em;
  font-weight: 400;
  line-height: 1.4;
}

.wf-detail__prose :not(pre) > code {
  background-color: #dae3ee;
  border-radius: 0.25em;
  padding: 0.1em 0.4em 0.15em;
  font-family: Haffer Mono, Arial, sans-serif;
  font-size: 0.9em;
  display: inline-block;
}

.wf-detail__prose ul {
  margin-bottom: 0;
  padding-left: 2em;
}

.wf-detail__prose li {
  margin-bottom: 1em;
  font-size: 0.9375em;
  line-height: 1.5;
}

/* ---- Author link ---- */

.wf-detail__author-link {
  font-size: 0.9375em;
  color: #6961fe;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.wf-detail__author-link:hover {
  opacity: 0.75;
}

/* ---- Detail tabs wrapper ---- */

.wf-detail-tabs {
  border-left: 1px solid #8898aa;
  border-right: 1px solid #8898aa;
  border-bottom: 1px solid #8898aa;
}

/* Tune StickyTab colors to match the page palette */
.wf-detail-tabs .sticky-tab-group--light {
  --st-section-bg: #f9fafc;
  --st-section-color: #0f1b2d;
  --st-header-bg: #ffffff;
  --st-header-border: #d0d9e4;
  --st-shadow: rgba(0, 0, 0, 0.06);
}

/* Tighten the section body padding */
.wf-detail-tabs .sticky-tab > .container {
  padding-top: 2em;
  padding-bottom: 2.5em;
}

/* ---- Collection items list ---- */

.wf-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wf-item {
  border-top: 1px solid #e2e8f0;
  padding: 1.375em 0;
}

.wf-item:first-child {
  border-top: none;
  padding-top: 0;
}

.wf-item__header {
  display: flex;
  align-items: center;
  gap: 0.75em;
  margin-bottom: 0.375em;
}

.wf-item__name {
  font-size: 1em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f1b2d;
  margin: 0;
}

.wf-item__description {
  font-size: 0.8125em;
  color: #4a5568;
  line-height: 1.55;
  margin: 0 0 0.625em;
  max-width: 72ch;
}

/* ---- Install chip ---- */

.wf-install-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: #f0f4f8;
  border: 1px solid #d0d9e4;
  border-radius: 0.375em;
  padding: 0.3em 0.4em 0.3em 0.7em;
}

.wf-install-chip__code {
  font-family: 'Haffer Mono', monospace;
  font-size: 0.8em;
  color: #1e293b;
  background: none;
  padding: 0;
  user-select: all;
}

.wf-install-chip__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8898aa;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25em;
  border-radius: 0.25em;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.wf-install-chip__copy:hover {
  color: #6961fe;
  background: #eef2ff;
}

.wf-install-chip__copy.is--copied {
  color: #16a34a;
}

/* ---- Tags ---- */

.wf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.25em;
}

.wf-tag {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  border-radius: 100em;
  padding: 0.35em 0.75em;
  font-size: 0.75em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* ---- Responsive ---- */

@media screen and (max-width: 900px) {
  .wf-hero__grid {
    grid-template-columns: 1fr;
    gap: 2em;
  }
}

@media screen and (max-width: 767px) {
  .wf-hero__title {
    font-size: 2.25em;
  }

  .wf-card__title {
    font-size: 1.5em;
  }

  .wf-card__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }

  .wf-detail__sidebar {
    display: none;
    position: relative;
    top: 0;
  }

  .wf-detail__prose h2 {
    font-size: 1.6em;
  }

  .wf-detail__prose h3 {
    font-size: 1.15em;
  }
}
