/* Attributes page: compact intro, grouped sticky sidebar, hairline-separated sections.
   Builds on /home.css tokens; everything here is page-specific. */

body.attributes-view { --side: 16rem; }
.attributes-view main { display: block; }

.attributes-view main > section {
  background: var(--page);
  color: var(--ink);
}

/* ---------- Intro ---------- */

.attributes-intro {
  padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--rule);
}
.attributes-intro h1 {
  font-size: clamp(2.25rem, 1.65rem + 2.2vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.attributes-intro p { max-width: 46rem; margin-top: 1rem; font-size: 1.125rem; line-height: 1.55; color: var(--muted); }
.attributes-intro .hero-context { margin-top: 0.75rem; color: var(--ink); font-weight: 600; }

/* ---------- Layout ---------- */

.attributes-body { padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5.5rem); }
.attributes-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 60rem) {
  .attributes-layout { grid-template-columns: var(--side) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); }
}

/* ---------- Sidebar ---------- */

.attribute-sidebar { min-width: 0; font-size: 0.9375rem; }
.attribute-sidebar > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.attribute-sidebar > summary::-webkit-details-marker { display: none; }
.attribute-sidebar > summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.attribute-sidebar[open] > summary::after { transform: rotate(-135deg); }

.attribute-directory { padding-top: 0.75rem; }
.attribute-group { --tone: var(--accent); padding: 0.5rem 0 0.75rem; }
.attribute-group:nth-child(6n+1) { --tone: #82c9b5; }
.attribute-group:nth-child(6n+2) { --tone: #b5a0d0; }
.attribute-group:nth-child(6n+3) { --tone: #c8ef8b; }
.attribute-group:nth-child(6n+4) { --tone: #86badf; }
.attribute-group:nth-child(6n+5) { --tone: #e3a07c; }
.attribute-group:nth-child(6n+6) { --tone: #dc9cc4; }
@media (prefers-color-scheme: light) {
  .attribute-group:nth-child(6n+1) { --tone: #1f7a66; }
  .attribute-group:nth-child(6n+2) { --tone: #7b5a91; }
  .attribute-group:nth-child(6n+3) { --tone: #5f7a1d; }
  .attribute-group:nth-child(6n+4) { --tone: #326c91; }
  .attribute-group:nth-child(6n+5) { --tone: #a4572f; }
  .attribute-group:nth-child(6n+6) { --tone: #9a4f7b; }
}
.attribute-group h2 {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone);
}
.attribute-grid { display: block; }
.attribute-grid a {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.3rem 0 0.3rem 0.6rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  line-height: 1.35;
  text-decoration: none;
}
.attribute-grid a:hover { color: var(--ink); border-left-color: var(--tone); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.attribute-grid a[aria-current] { color: var(--ink); border-left-color: var(--tone); font-weight: 600; }
.attribute-grid .attribute-icon { width: 16px; height: 16px; flex: none; margin-top: 0.15rem; color: var(--tone); }

@media (min-width: 60rem) {
  .attribute-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 0.5rem;
  }
  .attribute-sidebar > summary { display: none; }
  .attribute-directory { padding-top: 0; }
}

/* ---------- Content ---------- */

.attributes-content { min-width: 0; }
.attribute-category { --tone: var(--accent); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.attribute-category + .attribute-category { padding-top: clamp(1.5rem, 3vw, 2.5rem); border-top: 1px solid var(--rule); }
.attribute-category:nth-child(6n+1) { --tone: #82c9b5; }
.attribute-category:nth-child(6n+2) { --tone: #b5a0d0; }
.attribute-category:nth-child(6n+3) { --tone: #c8ef8b; }
.attribute-category:nth-child(6n+4) { --tone: #86badf; }
.attribute-category:nth-child(6n+5) { --tone: #e3a07c; }
.attribute-category:nth-child(6n+6) { --tone: #dc9cc4; }
@media (prefers-color-scheme: light) {
  .attribute-category:nth-child(6n+1) { --tone: #1f7a66; }
  .attribute-category:nth-child(6n+2) { --tone: #7b5a91; }
  .attribute-category:nth-child(6n+3) { --tone: #5f7a1d; }
  .attribute-category:nth-child(6n+4) { --tone: #326c91; }
  .attribute-category:nth-child(6n+5) { --tone: #a4572f; }
  .attribute-category:nth-child(6n+6) { --tone: #9a4f7b; }
}
.attribute-category > h2 {
  font-size: 0.85rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone);
}

.attribute-detail { padding: 1.5rem 0; border-top: 1px solid var(--rule); scroll-margin-top: 1.25rem; }
.attribute-category > h2 + .attribute-detail { margin-top: 1rem; }
.attribute-detail:focus { outline: none; }
.attribute-detail:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 3px; }
.attribute-detail-heading { display: flex; align-items: flex-start; gap: 0.7rem; }
.attribute-detail-heading .attribute-icon { width: 26px; height: 26px; flex: none; margin-top: 0.1rem; color: var(--tone); }
.attribute-detail h3 { font-size: 1.1875rem; line-height: 1.3; font-weight: 650; color: var(--ink); }
.attribute-detail h3 a { color: inherit; text-decoration: none; }
.attribute-detail h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.attribute-detail p { max-width: 46rem; margin-top: 0.6rem; padding-left: calc(26px + 0.7rem); color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }

@media (max-width: 40rem) {
  .attribute-detail p { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .attribute-sidebar > summary::after { transition: none; }
}
