/* ācta insights: the register and the filed article.
   The index is one bond sheet that works as a register book: every post is a
   ledger row, and the categories are folder tabs along the sheet's top edge.
   An article is filed in the guide binder (guide.css loads first on article
   pages). Loads after marketing.css. */

/* ---------- Index ---------- */

.ins-page {
  width: var(--wrap);
  margin-inline: auto;
  padding: clamp(48px, 6vw, 88px) 0 clamp(72px, 8vw, 120px);
}

.ins-title {
  font-size: clamp(2.25rem, 1.3rem + 2.9vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
.ins-lede {
  margin-top: 14px;
  max-width: 60ch;
  font-size: 1.1875rem;
  color: var(--ink-2);
}

/* The tools need script. Without it every row still shows. */
html:not(.ins-js) .ins-needs-js { display: none; }

.ins-register { margin-top: clamp(48px, 5vw, 72px); }

/* Folder tabs: flush left and touching. The pressed tab is bond and joins
   the sheet. Tabs align to the bottom, and one tab is always pressed, so the
   row never changes height. */
.ins-tabs {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  margin-left: -1px;
}
.ins-tab {
  position: relative;
  margin-right: -1px;
  padding: 8px 16px 7px;
  background: var(--manila-deep);
  border: 1px solid var(--folder-edge);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.ins-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--manila-deep) 70%, var(--bond)); }
.ins-tab:focus-visible { outline-offset: -3px; z-index: 2; }
.ins-tab[aria-pressed='true'] {
  z-index: 1;
  margin-bottom: -1px;
  padding: 11px 16px 9px;
  background: var(--bond);
  border-color: var(--sheet-edge);
  color: var(--ink);
}

.ins-sheet {
  position: relative;
  padding: clamp(20px, 3vw, 40px);
  background: var(--bond);
  border: 1px solid var(--sheet-edge);
  border-radius: 2px;
  box-shadow: 0 2px 0 rgba(90, 70, 20, 0.08), 0 40px 80px -40px rgba(60, 45, 10, 0.5);
}
html.ins-js .ins-register .ins-sheet { border-top-left-radius: 0; }

/* Tools row: search, sort, count. The category select is for phones. */
.ins-tools {
  display: grid;
  grid-template-columns: minmax(0, 420px) auto minmax(0, 1fr);
  align-items: end;
  column-gap: 20px;
}
.ins-tool { display: grid; gap: 6px; }
.ins-tool--category { display: none; }
.ins-sort { display: flex; gap: 8px; }
.ins-sort .rec-btn { min-height: 48px; padding: 0 16px; font-size: 0.9375rem; }
.ins-count {
  justify-self: end;
  padding-bottom: 12px;
  font-size: 0.875rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* The ledger */
.ins-ledger { position: relative; margin-top: 32px; }
html:not(.ins-js) .ins-ledger { margin-top: 0; }

.ins-ledger__head,
.ins-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 176px 112px 92px;
  column-gap: 24px;
}
.ins-ledger__head {
  padding-bottom: 8px;
  border-bottom: 3px double var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.ins-ledger__rows { display: flex; flex-direction: column; }

.ins-row {
  position: relative;
  align-items: baseline;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--bond-rule);
  transition: background-color 160ms var(--ease-out);
}
.ins-row:hover { background: color-mix(in srgb, var(--manila) 16%, var(--bond)); }
.ins-row.is-out { visibility: hidden; }

.ins-row__no,
.ins-row__date {
  font-family: var(--font-type);
  font-size: 0.875rem;
  color: var(--stamp);
  font-variant-numeric: tabular-nums;
}
.ins-row__no { padding-left: 4px; }

.ins-row__title {
  font-size: 1.1875rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  text-wrap: balance;
}
/* The whole row opens the post. */
.ins-row__title::after { content: ''; position: absolute; inset: 0; }
.ins-row:hover .ins-row__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

.ins-row__pinned {
  display: inline-block;
  margin-left: 10px;
  padding: 1px 7px;
  border: 1px solid var(--ink-2);
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  vertical-align: 0.2em;
}

.ins-row__sub {
  margin-top: 6px;
  max-width: 64ch;
  font-family: var(--font-doc);
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-2);
  text-wrap: pretty;
}

.ins-row__meta { display: contents; }
.ins-row__cat,
.ins-row__read {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.ins-row__cat { font-weight: 600; }
.ins-row__date,
.ins-row__read { white-space: nowrap; }

.ins-none {
  position: absolute;
  inset: 48px 0 auto;
  padding: 24px 4px;
  font-family: var(--font-doc);
  font-size: 1.125rem;
  color: var(--ink-2);
}
.ins-sheet--empty .ins-none { position: static; }

/* ---------- Article (on the guide binder) ---------- */

.ins-binder--no-index { grid-template-columns: minmax(0, 1fr) 188px; }
.ins-binder--no-index.g-binder--no-toc { grid-template-columns: minmax(0, 1fr); }

.ins-sub {
  margin-top: 14px;
  max-width: 52ch;
  font-family: var(--font-doc);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
}

.ins-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.ins-byline > span { white-space: nowrap; }
.ins-byline__sep { margin-right: 6px; }
.ins-byline time {
  font-family: var(--font-type);
  color: var(--stamp);
  font-variant-numeric: tabular-nums;
}

.ins-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.ins-tags li {
  padding: 2px 8px;
  border: 1px solid var(--sheet-edge);
  border-radius: 3px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}

.ins-body a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ins-body a:hover { text-decoration-thickness: 2px; }

.ins-h3 {
  margin: 1.7em 0 0;
  font-family: var(--font-forms);
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.008em;
}
.ins-h3 + .g-p { margin-top: 0.4em; }

/* A statement set off between two ink rules. */
.ins-statement {
  margin: 1.8em 0;
  padding: 18px 0 20px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 1.3125rem;
  line-height: 1.45;
  text-wrap: pretty;
}
.ins-statement strong { font-weight: 650; }

.ins-quote {
  margin: 1.8em 0;
  padding-left: 22px;
  border-left: 1px solid var(--ink);
}
.ins-quote p { font-size: 1.1875rem; line-height: 1.55; font-style: italic; }
.ins-quote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-forms);
  font-size: 0.875rem;
  font-style: normal;
  color: var(--ink-2);
}

.ins-figure {
  margin: 2.2em 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--bond-rule);
  border-radius: 2px;
}
.ins-figure svg,
.ins-figure img { display: block; width: 100%; height: auto; }
.ins-figure__scroll { scrollbar-width: thin; }
.ins-figure__scroll:focus-visible { outline-offset: 2px; }
.ins-figure figcaption {
  margin-top: 12px;
  text-align: center;
  text-wrap: balance;
  padding-top: 10px;
  border-top: 1px solid var(--bond-rule);
  font-family: var(--font-forms);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.ins-disclaimer:first-child { margin-top: 2.4em; }

.ins-sources {
  margin-top: 2.6em;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}
.ins-sources__title {
  font-family: var(--font-forms);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.ins-sources ol {
  margin-top: 10px;
  padding-left: 1.7em;
  list-style: decimal;
  font-family: var(--font-forms);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.ins-sources li { margin-top: 8px; padding-left: 4px; }
.ins-sources li::marker { font-weight: 700; font-variant-numeric: tabular-nums; }

.ins-author {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--bond-rule);
  max-width: 68ch;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.ins-author a,
.ins-author span { font-weight: 700; color: var(--ink); }

/* More insights: other posts as ruled rows, closed off by a double rule. */
.ins-related {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 3px double var(--ink);
  max-width: 68ch;
}
.ins-related__title {
  font-size: 1.1875rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ins-related .g-links a { align-items: center; font-weight: 400; }
.ins-related__text { display: grid; gap: 4px; }
.ins-related__name { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.ins-related__sub {
  font-family: var(--font-doc);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.ins-related .g-links a:hover { text-decoration: none; }
.ins-related .g-links a:hover .ins-related__name { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .ins-ledger__head,
  .ins-row { grid-template-columns: 44px minmax(0, 1fr) 150px 108px 84px; column-gap: 18px; }
  .ins-binder--no-index { grid-template-columns: minmax(0, 1fr); }
}

/* Rows put category, date, and reading time on one line under the title. */
@media (max-width: 900px) {
  .ins-tools { grid-template-columns: minmax(0, 1fr) auto; row-gap: 16px; }
  .ins-tool--search { grid-column: 1 / -1; }
  .ins-count { padding-bottom: 14px; }
  .ins-ledger__head { display: none; }
  .ins-ledger__rows { border-top: 3px double var(--ink); }
  .ins-row { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
  .ins-row__meta {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 10px;
  }
  .ins-none { inset: 0 0 auto; }
}

/* The category tabs become one labeled select. */
@media (max-width: 640px) {
  .ins-tabs { display: none; }
  html.ins-js .ins-register .ins-sheet { border-top-left-radius: 2px; }
  .ins-sheet { padding: 20px 16px; }
  .ins-tools { grid-template-columns: minmax(0, 1fr) auto; }
  .ins-tool--category { display: grid; grid-column: 1 / -1; }
  .ins-sort .rec-btn { min-height: 44px; padding: 0 12px; }
  .ins-row { grid-template-columns: 32px minmax(0, 1fr); column-gap: 10px; }
  .ins-row__meta { column-gap: 12px; }
  /* A diagram keeps about 540px, so its smallest labels stay near 12px. */
  .ins-figure__scroll { overflow-x: auto; }
  .ins-figure__scroll svg { min-width: 540px; }
  .ins-row__title { font-size: 1.125rem; }
  .ins-row__sub { font-size: 1rem; }
  .ins-row__cat, .ins-row__date, .ins-row__read { font-size: 0.8125rem; }
  .ins-sub { font-size: 1.125rem; }
  .ins-byline { column-gap: 14px; }
  .ins-byline__sep { display: none; }
  .ins-statement { font-size: 1.1875rem; }
  .ins-figure { margin-inline: -4px; padding: 10px; }
}


@media print {
  .ins-tabs, .ins-tools { display: none; }
  .ins-sheet { box-shadow: none; border: 0; padding: 0; }
}
