/* Sprint 021: standardized edge tabs, sticky Help mastheads, and deletion discoverability polish. */

:root {
  --edge-tab-width: 34px;
  --category-edge-tab-length: 136px;
  --feedback-edge-tab-length: 110px;
  --edge-tab-gap: 16px;
  --edge-tab-top: calc(var(--site-header-height, 104px) + 86px);
}

.category-edge-tab,
.feedback-edge-tab {
  left: 0;
  width: var(--edge-tab-width);
  box-sizing: border-box;
}

.category-edge-tab {
  top: var(--edge-tab-top);
  bottom: auto;
  height: var(--category-edge-tab-length);
  padding: 10px 6px;
  background: rgba(255, 210, 26, .62);
  opacity: .78;
  overflow: hidden;
}
.category-edge-tab:hover,
.category-edge-tab:focus-visible,
.category-edge-tab[aria-expanded="true"] {
  background: var(--sun);
  opacity: 1;
}

.feedback-edge-tab {
  top: calc(var(--edge-tab-top) + var(--category-edge-tab-length) + var(--edge-tab-gap));
  bottom: auto;
  height: var(--feedback-edge-tab-length);
  transform: none;
}

.help-page,
.help-groups,
.help-group,
.help-group-heading,
.help-topic,
.help-topic-copy {
  min-width: 0;
}

.help-group {
  position: relative;
}
.help-group-heading {
  position: sticky;
  top: var(--site-header-height, 104px);
  z-index: 52;
  grid-template-columns: minmax(130px, .35fr) minmax(0, 1.65fr);
  background: var(--paper);
}
.help-group-heading h2 {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.help-topic-title,
.help-topic-summary {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Settings is a standalone destination, not an Administration subsection. */
main:has(.settings-tabs) .page-heading-row .eyebrow {
  display: none;
}

.admin-events-table .permanent-delete-link {
  display: inline-block;
  margin-top: 6px;
  color: #a31f18;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: .18em;
}

#danger-zone {
  scroll-margin-top: calc(var(--site-header-height, 104px) + 28px);
}

@media (max-width: 780px) {
  .help-group-heading {
    position: sticky;
    top: var(--site-header-height, 126px);
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px 0 12px;
  }
  .help-group-heading h2 {
    text-align: left;
    font-size: clamp(2.45rem, 10.5vw, 4rem);
    line-height: .84;
    letter-spacing: -.04em;
  }
}

@media (max-width: 720px) {
  :root {
    --edge-tab-top: calc(var(--site-header-height, 126px) + 58px);
    --category-edge-tab-length: 136px;
    --feedback-edge-tab-length: 110px;
    --edge-tab-gap: 14px;
  }

  .category-edge-tab {
    top: var(--edge-tab-top);
    bottom: auto;
    background: rgba(255, 210, 26, .7);
  }

  .feedback-edge-tab {
    top: calc(var(--edge-tab-top) + var(--category-edge-tab-length) + var(--edge-tab-gap));
    bottom: auto;
  }

  .category-filter-drawer {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 100svh;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(26px + env(safe-area-inset-bottom, 0px));
    border: 0;
    box-shadow: none;
    z-index: 1210;
  }

  .help-page {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .help-group,
  .help-topic-list,
  .help-topic {
    width: 100%;
    max-width: 100%;
  }
  .help-topic {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 430px) {
  .help-group-heading h2 {
    font-size: clamp(2.15rem, 10vw, 3.45rem);
  }
}
