/* ericfreeburg.com — the Tag page grammar.

   The delivery law, applied to the second public page type: every Tag page
   derives its default state from this one root-delivered stylesheet, exactly
   as every Article derives its own from /assets/article.css. site.css keeps
   what all three page types share — the faces, the tokens, the reset, the
   Main measure — and this file owns everything that makes a Tag page a Tag
   page, including what its opening projection reveals. */

.tag-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.6rem;
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-cypress);
}

.tag-kicker::before {
  width: 1.8rem;
  height: 1px;
  content: "";
  background: currentColor;
}

/* Tag pages: one matter becomes a typographic field. */
.tag-page .atlas-main {
  padding-top: clamp(9rem, 14vw, 12rem);
  counter-reset: articles;
}

.tag-title {
  padding-bottom: clamp(2.25rem, 4vw, 3.75rem);
  border-bottom: 1px solid var(--hairline-strong);
}

.tag-title .tag-kicker {
  margin-bottom: 0.6rem;
}

.tag-title h1 {
  max-width: 10ch;
}

/* Ownership sits with the name: the peak this matter belongs to, or the
   statement that it is one. */
.tag-owner {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1.35rem;
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.tag-owner > span {
  color: var(--ink-muted);
}

.tag-owner > a {
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--hairline-strong);
  transition: color 180ms ease, border-color 180ms ease;
}

.tag-owner > a:hover {
  border-color: currentColor;
  color: var(--c-cypress);
}

.tag-article {
  counter-increment: articles;
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 7rem;
  border-bottom: 1px solid var(--hairline);
}

.tag-article::before {
  content: counter(articles, decimal-leading-zero);
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-label);
}

.tag-article::after {
  width: 0.58rem;
  height: 0.58rem;
  content: "";
  color: var(--c-artifact);
  background: var(--atlas-open-marker);
  transition: transform 350ms var(--ease-out);
}

.tag-article:hover::after {
  transform: translate(0.25rem, -0.25rem);
}

.tag-article__title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.3rem);
  line-height: 1.12;
  text-wrap: balance;
}

.tag-article__subtitle {
  display: block;
  max-width: 65ch;
  margin-top: 0.28rem;
  font-family: var(--serif);
  font-size: clamp(0.82rem, 0.79rem + 0.12vw, 0.92rem);
  font-style: italic;
  line-height: 1.2;
  text-wrap: pretty;
  color: var(--ink-muted);
}

.tag-article__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}

.tag-article__meta i {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: currentColor;
}

.tag-article[data-article-format="essay"] .tag-article__meta i {
  background: var(--c-cypress);
}

.tag-article[data-article-format="research"] .tag-article__meta i {
  background: var(--c-research);
}

.tag-article[data-article-format="thought"] .tag-article__meta i {
  background: var(--c-artifact);
}

.tag-empty {
  min-height: 12rem;
  padding: clamp(2rem, 5vw, 5rem) 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--serif);
  font-size: var(--type-lead);
  font-style: italic;
  line-height: var(--leading-lead);
  color: var(--ink-muted);
}

.related-label,
.section-label {
  margin: 4rem 0 1rem;
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.7rem;
  margin: 0 0.35rem 0.4rem 0;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--hairline-strong);
  font-size: var(--type-label);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 180ms ease, background 180ms ease;
}

.pill:hover {
  color: var(--paper);
  background: var(--ink);
}

@media (max-width: 820px) {
  .tag-title {
    padding-bottom: 2.25rem;
  }

  .tag-title h1[data-title-length="long"] {
    font-size: clamp(3.45rem, 18vw, 6.75rem);
  }

  .tag-title h1[data-title-length="very-long"] {
    font-size: clamp(3.1rem, 16vw, 6.2rem);
  }

  .tag-article {
    grid-template-columns: 2.25rem minmax(0, 1fr) 1rem;
    gap: 0.65rem;
    align-items: start;
    min-height: 0;
    padding-block: 0.95rem 1.05rem;
  }

  .tag-article::before,
  .tag-article::after {
    margin-top: 0.15rem;
  }

  .tag-article__subtitle {
    margin-top: 0.35rem;
  }

  .tag-article__meta {
    margin-top: 0.65rem;
  }
}

/* ---------------------------------------------------------------------------
   Projection

   The console projects a Tag page the same way it projects an Article: the
   generated artifact's own bytes, re-served with data-atlas-projection
   stamped on the document element. These rules are deliberately not shared
   with article.css — a page grammar decides how its own page projects, and
   an Article's opening and a Tag's opening are different claims about what
   the top of the page is.
   --------------------------------------------------------------------------- */

html[data-atlas-projection] {
  overflow: hidden;
}

html[data-atlas-projection] body {
  display: block;
  min-height: 0;
  overflow: hidden;
}

/* Narrow projections are the page 1:1, paper edge included; wide ones
   surrender the edge so the instrument can hug the visual column. */
@media (min-width: 921px) {
  html[data-atlas-projection] body {
    width: 100%;
    margin: 0;
  }
}

/* The instrument's own chrome carries identity and return: the projected
   page's corner and footer yield. */
html[data-atlas-projection] .atlas-header,
html[data-atlas-projection] .atlas-footer {
  display: none;
}

html[data-atlas-projection] .atlas-main {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding-block-end: 0;
  flex: none;
}

@media (min-width: 921px) {
  html[data-atlas-projection] .atlas-main {
    padding-inline: 0.25rem;
  }
}

@media (max-width: 920px) {
  html[data-atlas-projection] body {
    margin-block-start: 0;
  }
}

/* A Tag's opening is its claim on the matter — the kicker, the word itself,
   and the first works filed under it. The rest of the field and the adjacent
   matters stay out of frame; a reader who wants the whole listing opens the
   page. */
html[data-atlas-projection="opening"] .tag-article:nth-of-type(n + 5),
html[data-atlas-projection="opening"] .tag-adjacent {
  display: none;
}
