/* Branch-native information architecture and page-flow enhancements. */

.community-local-nav {
  position: sticky;
  top: 88px;
  z-index: 85;
  display: flex;
  gap: 20px;
  align-items: center;
  overflow-x: auto;
  padding: 10px 4px 12px;
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
  background: color-mix(in srgb, var(--color-canvas, #f6f1e7) 94%, transparent);
  backdrop-filter: blur(10px);
  scrollbar-width: thin;
}
.community-local-nav a {
  flex: 0 0 auto;
  color: var(--color-muted, #66636b);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
}
.community-local-nav a:hover,
.community-local-nav a[aria-current="page"] {
  color: var(--color-action, #c44926);
}

/* Long reference pages should read like reference material rather than stacked dashboards. */
.reference-page-hero {
  grid-template-columns: minmax(0, 1fr) !important;
}
.reference-page-hero .hero-copy {
  max-width: 920px;
}
.reference-page-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 42px);
  align-items: start;
}
.reference-page-rail {
  position: sticky;
  top: 142px;
  max-height: calc(100vh - 164px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.reference-rail-panel {
  display: grid;
  gap: 14px;
}
.reference-rail-panel > .panel {
  box-shadow: none;
}
.reference-page-content {
  min-width: 0;
  display: grid;
  gap: 24px;
}
body[data-flow-page="rules"] .reference-page-content > section,
body[data-flow-page="scryfall"] .reference-page-content > section {
  scroll-margin-top: 150px;
}
body[data-flow-page="rules"] .reference-page-content .rules-section > p,
body[data-flow-page="rules"] .reference-page-content .section-head > p,
body[data-flow-page="scryfall"] .reference-page-content .section-head > p {
  max-width: 80ch;
}
.command-copy {
  margin-left: 7px;
  border: 1px solid rgba(23,106,107,.24);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(23,106,107,.07);
  color: var(--color-progress, #176a6b);
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}
.command-copy:hover { background: rgba(23,106,107,.12); }

/* Home tells one story: what the run is, how it flows, how you participate, then what is current. */
body[data-flow-page="index"] .flow-secondary-features { display: none; }
body[data-flow-page="index"] .home-session-flow,
body[data-flow-page="index"] .flow-role-choice > article,
body[data-flow-page="index"] .home-community-band {
  box-shadow: none;
}
body[data-flow-page="index"] .home-session-flow,
body[data-flow-page="index"] .home-community-band {
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
body[data-flow-page="index"] .flow-role-choice > article {
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
body[data-flow-page="index"] .seasonal-announcement .seasonal-metrics { display: none; }
body[data-flow-page="index"] .home-community-band .discord-inner {
  grid-template-columns: minmax(0, 1fr) auto;
}

/* Community: community objects can be cards; whole page chapters should not all be cards. */
body[data-flow-page="community"] .community-discussions,
body[data-flow-page="community"] .community-directory,
body[data-flow-page="community"] #runs,
body[data-flow-page="community"] .community-pulse {
  box-shadow: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}
body[data-flow-page="community"] .community-discussions {
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
}
body[data-flow-page="community"] .community-directory {
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
}
body[data-flow-page="community"] .community-profile-card,
body[data-flow-page="community"] .community-host-card,
body[data-flow-page="community"] .community-run-card {
  box-shadow: none;
}
.community-person-link {
  color: inherit;
  text-decoration-color: rgba(196,73,38,.32);
  text-underline-offset: 3px;
}
.community-person-link:hover { color: var(--color-action, #c44926); }

/* Rankings is a people/data task. Show the standings before teaching the formula. */
body[data-flow-page="leaderboard"] .hero .badge-row { display: none; }
body[data-flow-page="leaderboard"] .table-card,
body[data-flow-page="leaderboard"] section.card:has(.podium) {
  box-shadow: none;
}
.ranking-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.ranking-search-label {
  display: grid;
  gap: 6px;
  width: min(100%, 340px);
  color: var(--color-muted, #66636b);
  font-size: .78rem;
  font-weight: 700;
}
.ranking-player-link {
  color: inherit;
  font-weight: 700;
  text-decoration-color: rgba(196,73,38,.34);
  text-underline-offset: 3px;
}
.ranking-player-link:hover { color: var(--color-action, #c44926); }
.ranking-search-empty { padding: 18px 0; }
.ranking-explainer { margin-top: 0; }
.ranking-explainer .card {
  box-shadow: none;
  background: transparent;
}

/* Hosts is public discovery first. Personal/session administration stays available on demand. */
body[data-flow-page="hosts"] .host-directory-hero {
  grid-template-columns: minmax(0, 1fr);
}
body[data-flow-page="hosts"] .host-directory-hero .hero-panel { display: none; }
body[data-flow-page="hosts"] .host-directory-flow {
  box-shadow: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}
body[data-flow-page="hosts"] .host-directory-flow .registry-layout { grid-template-columns: 1fr; }
body[data-flow-page="hosts"] .host-directory-flow .registry-standings { display: none; }
body[data-flow-page="hosts"] .host-directory-flow .host-row {
  box-shadow: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
.host-tools-disclosure {
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.host-tools-disclosure > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 2px;
  cursor: pointer;
}
.host-tools-disclosure > summary::-webkit-details-marker { display: none; }
.host-tools-disclosure > summary span:first-child { display: grid; gap: 3px; }
.host-tools-disclosure > summary small {
  color: var(--color-muted, #66636b);
  font-size: .78rem;
  font-weight: 400;
}
.host-tools-plus {
  font-size: 1.35rem;
  color: var(--color-action, #c44926);
  transition: transform .2s ease;
}
.host-tools-disclosure[open] .host-tools-plus { transform: rotate(45deg); }
.host-tools-body {
  display: grid;
  gap: 16px;
  padding: 2px 0 24px;
}
.host-tools-body .table-card {
  box-shadow: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0 0;
}

/* Status pages show the signal first; procedural help is secondary. */
body[data-flow-page="api-status"] .hero .badge-row { display: none; }
.status-help {
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.status-help > summary {
  cursor: pointer;
  padding: 16px 2px;
  font-weight: 700;
}
.status-help-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 20px;
}
.status-help-body article {
  box-shadow: none;
  background: transparent;
}

/* Seasonal page: goal and reward are visible early, catalog content remains modular. */
.seasonal-local-nav {
  position: sticky;
  top: 88px;
  z-index: 84;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
  padding: 10px 12px;
  border: 1px solid rgba(23,106,107,.14);
  border-radius: 14px;
  background: rgba(246,241,231,.94);
  backdrop-filter: blur(9px);
}
.seasonal-local-nav a {
  color: #144f55;
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .8rem;
  font-weight: 700;
}
.seasonal-local-nav a:hover { background: rgba(23,106,107,.08); }
.seasonal-hero-nav-redundant { display: none; }
body[data-flow-page="high-tide-hijinks"] main.page > section.card:not(.seasonal-hero) {
  box-shadow: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}
body[data-flow-page="high-tide-hijinks"] #completion-reward {
  border-top: 1px solid rgba(23,106,107,.18);
  border-bottom: 1px solid rgba(23,106,107,.18);
}

/* Public profiles summarize identity first and disclose collection detail progressively. */
.community-profile-back {
  width: fit-content;
  color: var(--color-muted, #66636b);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 700;
}
.community-profile-back:hover { color: var(--color-action, #c44926); }
body[data-flow-page="community-profile"] #community-profile,
body[data-flow-page="community-profile"] main.page > section:not(#community-profile) {
  box-shadow: none;
}
body[data-flow-page="community-profile"] #community-profile {
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}
body[data-flow-page="community-profile"] #profile-collection {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.community-collection-disclosure {
  border-top: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.community-collection-disclosure:last-child {
  border-bottom: 1px solid var(--color-border, rgba(25,24,29,.14));
}
.community-collection-disclosure > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 2px;
  cursor: pointer;
}
.community-collection-disclosure > summary::-webkit-details-marker { display: none; }
.community-collection-disclosure > .community-token-list { padding: 0 2px 18px; }

@media (max-width: 1040px) {
  .community-local-nav,
  .seasonal-local-nav { position: static; }
  .reference-page-shell { grid-template-columns: 1fr; }
  .reference-page-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .reference-rail-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-flow-page="scryfall"] .reference-rail-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .reference-rail-panel,
  .status-help-body { grid-template-columns: 1fr; }
  .ranking-tools {
    align-items: stretch;
    flex-direction: column;
  }
  .ranking-search-label { width: 100%; }
  body[data-flow-page="index"] .home-community-band .discord-inner { grid-template-columns: 1fr; }
}
