/*
 * STRUCTURE AUDIT — company-info layouts across Projects
 * Cross-project: Solar Construct stage (a97); Patchwork medallion; Foundry Codex spine; Almanac spread;
 *   Charter plaque; Gate Pass lanes; Harborline hero + zigzag; Overture score; Seed Log wall; Strata ledger bands;
 *   Slate Quarry editorial; ty-co stat ledge + process grid + values bento + team grid (a120 prior ty-co).
 * index.php (this store): hm-bento hero grid → hm-pills aisle track → hm-feature stagger → ds-section bands —
 *   vertical stacked sections, not sideways panels.
 * ci-folio (a119, a120 prior): pull-quote spread + offset figures · vertical journey path · values bento board ·
 *   horizontal aisle ribbon · registry appendix · contact foot.
 * CHOSEN (cy-*): SIDEWAYS_CHAPTERS — chapter index · horizontal snap track on desktop · each panel is a full chapter
 *   (intro / work lanes / record docket / pledge list / aisle directory / registry scroll / desk) — stacks on mobile.
 */

.page-company {
  overflow-x: clip;
  background: var(--at-canvas);
}

.cy-dossier {
  padding: var(--at-space-4) 0 var(--at-space-7);
  min-width: 0;
}

.cy-dossier__shell {
  min-width: 0;
  display: grid;
  gap: var(--at-space-4);
}

/* Chapter index */
.cy-dossier__index {
  min-width: 0;
}

.cy-dossier__index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cy-dossier__jump {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius-pill);
  background: var(--at-surface);
  font-family: var(--at-font-ui);
  font-size: var(--at-text-xs);
  font-weight: 700;
  color: var(--at-moss);
  text-decoration: none;
}

.cy-dossier__jump:hover {
  border-color: var(--at-moss);
}

.cy-dossier__jump.is-active {
  background: color-mix(in srgb, var(--at-moss) 10%, var(--at-surface));
  box-shadow: inset 0 -2px 0 var(--at-terra);
}

/* Track */
.cy-dossier__track {
  display: flex;
  flex-direction: column;
  gap: var(--at-space-5);
  min-width: 0;
}

@media (min-width: 1024px) {
  .cy-dossier__track {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--at-space-5);
    padding-bottom: var(--at-space-3);
    margin-inline: calc(-1 * var(--at-space-2));
    padding-inline: var(--at-space-2);
  }
}

.cy-chapter {
  min-width: 0;
  padding: var(--at-space-4);
  border: 1px solid var(--at-line);
  display: flex;
  flex-direction: column;
  gap: var(--at-space-3);
}

@media (min-width: 1024px) {
  .cy-chapter {
    flex: 0 0 min(92vw, 52rem);
    scroll-snap-align: start;
    max-height: min(88vh, 40rem);
    overflow-y: auto;
    padding: var(--at-space-5);
  }

  .cy-chapter--registry {
    flex-basis: min(94vw, 58rem);
    max-height: min(90vh, 44rem);
  }
}

.cy-chapter__label {
  margin: 0;
  font-family: var(--at-font-ui);
  font-size: var(--at-text-xs);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--at-ink-soft);
}

.cy-chapter__head .ds-title {
  font-size: var(--at-text-lg);
  margin: 0.25rem 0;
}

.cy-chapter__head .ds-lede {
  margin: 0;
  font-size: var(--at-text-sm);
  max-width: 48ch;
}

.cy-chapter__mission {
  margin: var(--at-space-2) 0 0;
  font-size: var(--at-text-md);
  line-height: 1.55;
  max-width: 52ch;
}

.cy-chapter--intro .ds-title {
  font-size: var(--at-text-xl);
}

.cy-chapter__quote {
  margin: 0;
  padding: var(--at-space-3) 0 var(--at-space-3) var(--at-space-4);
  border-left: 3px solid var(--at-terra);
}

.cy-chapter__quote p {
  margin: 0;
  font-family: var(--at-font-display);
  font-size: var(--at-text-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--at-ink);
  max-width: 28ch;
}

.cy-chapter__gallery {
  display: grid;
  gap: var(--at-space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  margin-top: var(--at-space-2);
}

.cy-chapter__figure {
  margin: 0;
  min-width: 0;
}

.cy-chapter__figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--at-radius-sm);
  border: 1px solid var(--at-line);
}

.cy-chapter__figure figcaption {
  margin-top: 0.35rem;
  font-size: var(--at-text-xs);
  color: var(--at-ink-soft);
  line-height: 1.35;
}

/* Work lanes */
.cy-chapter__lanes {
  list-style: none;
  margin: var(--at-space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--at-space-3);
}

@media (min-width: 768px) {
  .cy-chapter__lanes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cy-chapter__lane {
  padding: var(--at-space-3);
  border: 1px dashed var(--at-line);
  border-radius: var(--at-radius-sm);
  min-width: 0;
}

.cy-chapter__lane .ds-title {
  font-size: var(--at-text-md);
  margin: 0.35rem 0;
}

.cy-chapter__lane p {
  margin: 0;
  font-size: var(--at-text-sm);
  line-height: 1.5;
}

.cy-chapter__lane-num {
  font-family: var(--at-font-ui);
  font-size: var(--at-text-xs);
  font-weight: 800;
  color: var(--at-ink-soft);
}

/* Record docket */
.cy-chapter__docket {
  list-style: none;
  margin: var(--at-space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--at-space-2);
}

.cy-chapter__docket-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--at-space-3);
  padding: var(--at-space-3);
  border: 1px solid var(--at-line);
  border-radius: var(--at-radius-sm);
  min-width: 0;
}

.cy-chapter__docket-num {
  font-family: var(--at-font-ui);
  font-size: var(--at-text-sm);
  font-weight: 800;
  color: var(--at-moss);
}

.cy-chapter__docket-body .ds-title {
  font-size: var(--at-text-md);
  margin: 0 0 0.25rem;
}

.cy-chapter__docket-body p {
  margin: 0;
  font-size: var(--at-text-sm);
  line-height: 1.45;
}

/* Pledges */
.cy-chapter__pledges {
  list-style: none;
  margin: var(--at-space-2) 0 0;
  padding: 0;
  display: grid;
  gap: var(--at-space-2);
}

.cy-chapter__pledge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--at-space-3);
  align-items: start;
  padding: var(--at-space-3);
  border-top: 1px solid var(--at-line);
  min-width: 0;
}

.cy-chapter__pledge:first-child {
  border-top: none;
  padding-top: 0;
}

.cy-chapter__pledge-num {
  font-family: var(--at-font-ui);
  font-size: var(--at-text-xs);
  font-weight: 800;
  color: var(--at-terra);
}

.cy-chapter__pledge p {
  margin: 0;
  font-size: var(--at-text-sm);
  line-height: 1.5;
}

/* Aisle directory */
.cy-chapter__aisle-list {
  list-style: none;
  margin: var(--at-space-2) 0 0;
  padding: 0;
  columns: 2;
  column-gap: var(--at-space-4);
}

@media (min-width: 768px) {
  .cy-chapter__aisle-list {
    columns: 3;
  }
}

.cy-chapter__aisle-list li {
  break-inside: avoid;
  margin-bottom: var(--at-space-2);
}

.cy-chapter__aisle-link {
  display: flex;
  align-items: baseline;
  gap: var(--at-space-2);
  min-height: 2.75rem;
  padding: 0.35rem 0;
  font-family: var(--at-font-ui);
  font-size: var(--at-text-sm);
  font-weight: 600;
  color: var(--at-moss);
  text-decoration: none;
}

.cy-chapter__aisle-num {
  font-size: var(--at-text-xs);
  font-weight: 800;
  color: var(--at-ink-soft);
}

/* Registry */
.cy-registry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--at-space-3);
  margin-bottom: var(--at-space-3);
}

.cy-registry__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.cy-registry__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--at-text-sm);
  min-width: 36rem;
}

.cy-registry__table th,
.cy-registry__table td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--at-line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.cy-registry__table th {
  font-family: var(--at-font-ui);
  font-weight: 700;
  background: color-mix(in srgb, var(--at-moss) 6%, var(--at-surface));
  width: 38%;
}

.cy-registry__section {
  font-size: var(--at-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Desk chapter */
.cy-desk__contact {
  display: grid;
  gap: var(--at-space-3);
  margin: var(--at-space-2) 0 var(--at-space-4);
}

@media (min-width: 768px) {
  .cy-desk__contact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cy-desk__contact-item p {
  margin: 0.25rem 0 0;
  font-size: var(--at-text-sm);
  overflow-wrap: anywhere;
}

.cy-desk__contact-item a {
  color: var(--at-moss);
  font-weight: 700;
}

.cy-desk__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cy-desk__actions .ds-btn {
  flex: 1 1 10rem;
  min-height: 2.75rem;
  justify-content: center;
}

@media (max-width: 359px) {
  .cy-desk__actions {
    flex-direction: column;
  }

  .cy-desk__actions .ds-btn {
    width: 100%;
  }
}
