.feed-page {
  --feed-stroke: 3px solid #000;
  --feed-shadow: 6px 6px 0 #000;
}

.feed-page__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.feed-page__header .lead {
  max-width: 620px;
  margin: 8px 0 0;
}

.feed-page__new {
  flex: 0 0 auto;
  max-width: 100%;
}

.feed-page__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  align-items: start;
  gap: 22px;
}

.feed-manage__summary {
  display: none;
}

.feed-timeline,
.feed-manage {
  min-width: 0;
}

.feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.feed-filter {
  min-height: 40px;
}

.feed-status,
.feed-manage__status {
  min-height: 1.4em;
  margin: 8px 0;
  font-weight: 800;
}

.feed-items,
.feed-search-results,
.feed-subscriptions {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-item {
  min-width: 0;
}

.feed-item__article,
.feed-manage {
  border: var(--feed-stroke);
  border-radius: var(--radius, 16px);
  background: #fff;
  box-shadow: var(--feed-shadow);
}

.feed-item__article {
  padding: 18px;
}

.feed-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.feed-item__kind {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  border: 2px solid #000;
  border-radius: 999px;
  background: #ff4a00;
  color: #fff;
}

.feed-item__date {
  opacity: 0.66;
}

.feed-item__title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.feed-item__title a {
  color: inherit;
  text-decoration-thickness: 3px;
  text-decoration-color: #ff4a00;
  text-underline-offset: 4px;
}

.feed-item__body {
  margin: 12px 0 0;
  font-weight: 650;
  line-height: 1.48;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.feed-item__details,
.feed-item__subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  font-weight: 850;
}

.feed-item__protocol {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px solid rgba(0, 0, 0, 0.2);
  font-weight: 800;
}

.feed-item__protocol-racers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0;
  padding-left: 20px;
}

.feed-item__protocol-more {
  opacity: 0.7;
}

.feed-item__protocol-link {
  margin-top: 2px;
}

.feed-item__details span,
.feed-item__subjects a {
  min-width: 0;
  overflow-wrap: anywhere;
}

.feed-item__subjects {
  padding-top: 10px;
  border-top: 2px solid rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
}

.feed-item__subjects-label {
  width: 100%;
  opacity: 0.65;
  font-size: 0.74rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.feed-page__more {
  width: 100%;
  margin-top: 18px;
}

.feed-empty,
.feed-guest,
.feed-error {
  margin-top: 18px;
  border: 2px dashed #000;
  border-radius: var(--radius, 16px);
  background: #fff;
  box-shadow: none;
}

.feed-empty p,
.feed-guest p,
.feed-error p {
  margin: 8px 0 16px;
  font-weight: 650;
  line-height: 1.45;
}

.feed-manage {
  padding: 18px;
}

.feed-manage__heading h2,
.feed-current h3 {
  margin: 0;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1.15;
}

.feed-manage__heading p {
  margin: 8px 0 16px;
  font-weight: 650;
  line-height: 1.45;
}

.feed-search {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.feed-search label:not(.sr-only) {
  font-weight: 900;
  line-height: 1.3;
}

.feed-search .input {
  width: 100%;
  min-width: 0;
}

.feed-current {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 3px solid #000;
}

.feed-current__empty {
  padding: 12px;
  border: 2px dashed #000;
  border-radius: var(--radius, 16px);
  font-weight: 700;
  line-height: 1.4;
}

.feed-search-result,
.feed-subscription-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.feed-search-result:last-child,
.feed-subscription-row:last-child {
  border-bottom: 0;
}

.feed-search-result__link,
.feed-subscription-row__name {
  min-width: 0;
  color: inherit;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.feed-subscribe {
  display: inline-grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
  vertical-align: middle;
}

.feed-subscribe--inline {
  display: inline-grid;
  margin: 4px 8px 4px 0;
}

.feed-subscribe__status {
  max-width: 100%;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}

.feed-subscribe [data-subscription][aria-pressed="true"] {
  background: #000;
  color: #fff;
}

.feed-subscribe [data-subscription]:disabled {
  cursor: progress;
  opacity: 0.68;
}

.feed-page [hidden] {
  display: none !important;
}

.events-organizer__header-actions,
.race-series__actions,
.race-results__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 14px;
  min-width: 0;
}

.events-organizer__header-actions > .feed-subscribe,
.race-series__actions > .feed-subscribe,
.race-results__actions > .feed-subscribe {
  flex: 0 0 auto;
}

.events-organizer__header-actions > .link,
.race-series__actions > .link,
.race-results__actions > .link {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .feed-page__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .feed-manage__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    font-weight: 950;
    cursor: pointer;
    list-style: none;
  }

  .feed-manage__summary::-webkit-details-marker {
    display: none;
  }

  .feed-manage__chevron {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 160ms ease;
  }

  .feed-manage[open] .feed-manage__chevron {
    transform: rotate(180deg);
  }

  .feed-manage__content {
    padding-top: 12px;
    border-top: 2px solid #000;
  }

  .feed-manage:not([open]) {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .feed-manage:not([open]) .feed-manage__summary {
    min-height: 36px;
  }
}

@media (max-width: 560px) {
  .feed-page__header {
    align-items: stretch;
    flex-direction: column;
  }

  .feed-page__new {
    align-self: flex-start;
  }

  .events-organizer__header-actions,
  .race-series__actions,
  .race-results__actions {
    justify-content: flex-start;
    width: 100%;
  }

  .feed-manage,
  .feed-item__article {
    padding: 14px;
    box-shadow: 4px 4px 0 #000;
  }

  .feed-search-result,
  .feed-subscription-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .feed-subscribe--inline {
    display: grid;
  }

  .feed-manage__summary:focus-visible {
    outline: 3px solid #ff4a00;
    outline-offset: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feed-page *,
  .feed-page *::before,
  .feed-page *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
