.c-blog-page {
  --blog-page-max: var(--container-max);
  --blog-toolbar-radius: 0.5rem;
  --blog-editorial-avatar-size: 2.625rem;
  --blog-editorial-text-primary: #242847;
  --blog-editorial-text-secondary: #646480;

  min-width: 0;
  padding-block-end: var(--space-20);
  background: var(--color-surface-page);
}

.c-blog-page__container {
  width: min(100% - (2 * var(--spacing-container-inline)), var(--blog-page-max));
  margin-inline: auto;
}

.c-blog-editorial {
  display: grid;
  align-items: stretch;
  gap: var(--space-2);
}

.c-blog-editorial__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
}

.c-blog-editorial__title {
  margin: 0 0 var(--space-3);
  color: var(--blog-editorial-text-primary);
  font-family: var(--font-family-title);
  font-size: var(--type-heading-md-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-heading-md-line-height);
}

.c-blog-editorial__description {
  margin: 0;
  color: var(--blog-editorial-text-secondary);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
}

.c-blog-editorial__meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  direction: ltr;
}

.c-blog-editorial__author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  direction: rtl;
}

.c-blog-editorial__author span {
  display: flex;
  min-width: 5.5rem;
  flex-direction: column;
  gap: var(--space-1);
}

.c-blog-editorial__author strong {
  color: var(--blog-editorial-text-primary);
  font-size: var(--type-body-md-size);
  line-height: var(--type-body-md-line-height);
}

.c-blog-editorial__author time {
  color: var(--blog-editorial-text-secondary);
  font-size: var(--type-caption-sm-size);
  line-height: var(--type-caption-sm-line-height);
}

.c-blog-editorial__author img {
  width: var(--blog-editorial-avatar-size);
  height: var(--blog-editorial-avatar-size);
  flex: 0 0 var(--blog-editorial-avatar-size);
  border: var(--border-width-default) solid var(--color-border-default);
  border-radius: var(--radius-circle);
  background: var(--color-surface-primary);
  object-fit: cover;
}

.c-blog-editorial__media {
  order: -1;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 398 / 185;
  border-radius: var(--radius-control);
  background: var(--color-brand-subtle);
}

.c-blog-editorial__image,
.c-blog-editorial__image-placeholder {
  display: block;
  width: 100%;
  height: 100%;
}

.c-blog-editorial__image {
  object-fit: cover;
}

.c-blog-editorial__image-placeholder {
  background: var(--color-brand-subtle);
}

.c-blog-catalog {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2);
  margin-block-start: var(--space-16);
}

.c-blog-toolbar__title {
  margin: 0 0 var(--space-4);
  color: var(--color-text-primary);
  font-family: var(--font-family-title);
  font-size: var(--type-heading-md-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-heading-md-line-height);
}

.c-blog-toolbar__surface {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.c-blog-toolbar__categories {
  display: flex;
  min-width: 0;
  min-height: var(--space-20);
  align-items: center;
  gap: var(--space-4);
  overflow-x: auto;
  margin-inline: calc(-1 * var(--spacing-container-inline));
  padding-inline: var(--space-4);
  border-radius: 0;
  background: var(--color-primary-800);
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-padding-inline: var(--space-4);
  scroll-snap-type: inline proximity;
}

.c-blog-toolbar__categories::-webkit-scrollbar,
.c-tutorial-grid::-webkit-scrollbar {
  display: none;
}

.c-blog-toolbar__category {
  display: inline-flex;
  min-height: var(--size-target-min);
  flex: 0 0 auto;
  align-items: center;
  color: var(--color-text-inverse);
  font-size: var(--type-caption-sm-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-caption-sm-line-height);
  scroll-snap-align: start;
  text-decoration: none;
  white-space: nowrap;
}

.c-blog-toolbar__category:hover,
.c-blog-toolbar__category.is-active {
  color: var(--color-accent);
}

.c-blog-toolbar__category.is-active {
  font-weight: var(--font-weight-bold);
}

.c-blog-search {
  display: flex;
  width: 100%;
  height: var(--size-control-lg);
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
  border: var(--border-width-default) solid var(--color-border-strong);
  border-radius: var(--radius-card);
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
}

.c-blog-search:focus-within {
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 var(--focus-ring-width) var(--focus-ring-color);
}

.c-blog-search__input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding-inline: var(--space-4) 0;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: start;
}

.c-blog-search__input::placeholder {
  color: var(--color-text-tertiary);
  opacity: 1;
}

.c-blog-search__button {
  display: grid;
  width: var(--size-target-min);
  height: var(--size-target-min);
  flex: 0 0 var(--size-target-min);
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.c-blog-search__button img {
  width: var(--size-icon-lg);
  height: var(--size-icon-lg);
}

.c-blog-page__error {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--color-status-error-surface);
  color: var(--color-status-error);
}

.c-blog-section {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-6);
  scroll-margin-block-start: var(--space-6);
}

.c-blog-section--tutorials {
  margin-block-start: var(--space-12);
}

.c-blog-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.c-blog-section__all[hidden] {
  display: none;
}

.c-blog-section__title {
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-family-title);
  font-size: var(--type-heading-md-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--type-heading-md-line-height);
}

.c-blog-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
}

.c-blog-grid[aria-busy="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.c-tutorial-grid {
  display: flex;
  min-width: 0;
  gap: var(--space-4);
  overflow-x: auto;
  padding-block-end: var(--space-1);
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: inline mandatory;
}

.c-tutorial-grid .c-tutorial-card {
  width: min(18.4375rem, calc(100vw - 3rem));
  flex: 0 0 min(18.4375rem, calc(100vw - 3rem));
  scroll-snap-align: start;
}

.c-blog-empty {
  margin: var(--space-6) auto;
  color: var(--color-text-secondary);
  text-align: center;
}

@media (min-width: 48rem) {
  .c-blog-editorial__media {
    max-height: 23.5625rem;
  }

  .c-blog-catalog {
    margin-block-start: var(--space-20);
  }

  .c-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .c-tutorial-grid {
    display: grid;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    scroll-snap-type: none;
  }

  .c-tutorial-grid .c-tutorial-card {
    width: auto;
    flex: initial;
  }
}

@media (min-width: 80rem) {
  .c-blog-page {
    --blog-editorial-avatar-size: 4.5rem;
  }

  .c-blog-editorial {
    min-height: 20rem;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) minmax(29rem, 37.75rem);
    gap: 3.125rem;
  }

  .c-blog-editorial__content {
    grid-column: 1;
    grid-row: 1;
    justify-content: space-between;
    gap: var(--space-8);
    padding-block: 0;
  }

  .c-blog-editorial__title {
    margin-block-end: var(--space-4);
  }

  .c-blog-editorial__description {
    font-size: var(--type-heading-xs-size);
    line-height: var(--type-heading-xs-line-height);
  }

  .c-blog-editorial__author strong {
    font-size: var(--type-body-xl-size);
    line-height: var(--type-body-xl-line-height);
  }

  .c-blog-editorial__author time {
    font-size: var(--type-body-lg-size);
    line-height: var(--type-body-lg-line-height);
  }

  .c-blog-editorial__media {
    grid-column: 2;
    grid-row: 1;
    order: initial;
    height: auto;
    min-height: 20rem;
    max-height: none;
    aspect-ratio: auto;
  }

  .c-blog-catalog {
    gap: var(--space-8);
    margin-block-start: var(--space-24);
  }

  .c-blog-toolbar__title {
    display: none;
  }

  .c-blog-toolbar__surface {
    min-height: 6.6875rem;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--blog-toolbar-radius);
    background: var(--color-primary-800);
  }

  .c-blog-toolbar__categories {
    min-height: var(--size-control-lg);
    flex: 1;
    justify-content: flex-start;
    gap: var(--space-5);
    margin-inline: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  .c-blog-toolbar__category {
    font-size: var(--type-label-lg-size);
    font-weight: var(--font-weight-medium);
    line-height: var(--type-label-lg-line-height);
  }

  .c-blog-toolbar__category.is-active {
    font-size: var(--type-body-xl-size);
  }

  .c-blog-search {
    width: 21.125rem;
    flex-basis: 21.125rem;
  }

  .c-blog-section__title {
    font-size: var(--type-heading-md-size);
    line-height: var(--type-heading-md-line-height);
  }

}

@media (min-width: 80rem) {
  .c-blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .c-tutorial-grid {
    grid-template-columns: repeat(3, minmax(0, 24.875rem));
    justify-content: space-between;
  }

  .c-blog-section--tutorials {
    margin-block-start: var(--space-10);
  }
}
