/* The classic archive (/poems): hero, one section per season folding in a
   <details>, each poem with its reading, original and source, and the
   closing call. */

/* the gutter sits outside the measure: vw padding inside a ch max-width
   would shrink the text column as the screen widens */
.archive { position: relative; z-index: var(--z-panel); width: min(64ch, 100% - 14vw); margin: 0 auto; padding-block: 24vh 18vh; }

.archive-hero { text-align: center; margin-bottom: 14vh; }
.archive-hero .glyph-big {
  display: block; font-family: var(--font-glyph);
  font-size: clamp(3rem, 9vw, 5rem); color: var(--accent); margin-bottom: 26px; line-height: 1;
}
.archive-hero .eyebrow {
  font-family: var(--font-label); font-weight: 300; font-size: var(--type-1);
  text-transform: uppercase; letter-spacing: 0.5em; color: var(--accent-quiet); margin-bottom: 30px;
}
.archive-hero h1 {
  font-family: var(--font-verse); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.45; color: var(--text); letter-spacing: 0.02em; max-width: 24ch; margin: 0 auto;
}
.archive-hero .lede {
  margin-top: 38px; font-style: italic; font-size: 1.12rem; line-height: 1.85;
  color: var(--paper-dim); max-width: 46ch; margin-left: auto; margin-right: auto;
}
.lede-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--ink-soft); }

.archive-season { margin-bottom: 8vh; }
/* the way into Ma for this season, above its fold so it shows while closed */
.as-read {
  display: block; width: fit-content; margin: 0 0 6px auto; padding: 12px 0 12px 0.3em; text-decoration: none;
  font-family: var(--font-label); font-weight: 300; font-size: var(--type-1);
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent-quiet);
  transition: color var(--dur-state) var(--ease-breath);
}
.as-read:hover, .as-read:focus-visible { color: var(--accent); }
/* the summary is the season's header; a quiet chevron stands for the native marker */
.as-head { display: flex; align-items: baseline; gap: 18px; cursor: pointer; list-style: none;
  padding-bottom: 22px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 16%, var(--ink-soft)); }
.as-head::-webkit-details-marker { display: none; }
.as-head::after {
  content: ''; flex: none; align-self: center; width: 7px; height: 7px; margin-right: 4px;
  border-right: 1px solid var(--paper-faint); border-bottom: 1px solid var(--paper-faint);
  transform: translateY(-3px) rotate(45deg);
}
.as-head:hover::after { border-color: var(--accent); }
.as-fold[open] > .as-head { margin-bottom: 6vh; }
.as-fold[open] > .as-head::after { transform: translateY(2px) rotate(-135deg); }
.as-glyph { font-family: var(--font-glyph); font-size: 2.4rem; color: var(--accent-quiet); line-height: 1; }
.as-head h2 { font-family: var(--font-verse); font-weight: 400; font-size: clamp(1.5rem, 4vw, 2rem); color: var(--text); margin: 0; }
.as-head .as-word {
  font-family: var(--font-label); font-weight: 300; font-size: var(--type-1); text-transform: uppercase;
  letter-spacing: 0.26em; color: var(--paper-faint); margin-left: 10px; white-space: nowrap;
}
.as-head .as-word [lang="ja"] { font-family: var(--font-glyph); font-size: 1.3em; line-height: 1; letter-spacing: 0.16em; }
.as-count {
  margin-left: auto; white-space: nowrap; font-family: var(--font-label); font-weight: 300; font-size: var(--type-1);
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-faint);
}

/* each section re-scopes --accent via its data-season, so the hairline
   carries the poem's season, the same cue as the gallery tiles */
.archive-poem { position: relative; margin: 0 0 7vh; padding-left: 26px; border-left: 1px solid color-mix(in srgb, var(--accent) 24%, var(--ink-soft)); }
.al-en { margin: 0; }
.al-en .al-line {
  display: block; font-family: var(--font-verse); font-style: italic; font-size: 1.3rem;
  line-height: 1.9; color: var(--text); letter-spacing: 0.02em;
}
.al-by {
  margin: 16px 0 0; font-family: var(--font-label); font-weight: 300; font-size: var(--type-1);
  letter-spacing: 0.26em; text-transform: uppercase; color: var(--accent-quiet);
}
.al-jp { margin: 20px 0 0; font-family: var(--font-glyph); font-size: 1.15rem; color: var(--paper-dim); letter-spacing: 0.06em; }
.al-romaji { margin: 8px 0 0; font-family: var(--font-verse); font-style: italic; font-size: 1rem; color: var(--paper-faint); }
.al-source { margin: 14px 0 0; font-family: var(--font-label); font-weight: 300; font-size: var(--type-1); line-height: 1.7; color: var(--paper-faint); }
.al-anchor {
  position: absolute; top: 0; left: -2px; transform: translateX(-100%); padding-right: 14px;
  font-family: var(--font-glyph); font-size: 0.95rem; color: var(--paper-faint);
  text-decoration: none; opacity: 0; transition: opacity var(--dur-hover) var(--ease-breath), color 0.5s;
}
.archive-poem:hover .al-anchor, .archive-poem:target .al-anchor,
.al-anchor:focus-visible { opacity: 1; }
.archive-poem:target { border-left-color: var(--accent); }
.al-anchor:hover, .al-anchor:focus-visible { color: var(--accent); }

.archive-close { text-align: center; margin-top: 14vh; padding-top: 12vh; border-top: 1px solid var(--ink-soft); }
.archive-close .glyph-seal { font-family: var(--font-glyph); font-size: 1.6rem; color: var(--accent-quiet); display: block; margin-bottom: 36px; }
.archive-close .close-line { font-family: var(--font-verse); font-style: italic; font-size: 1.3rem; line-height: 1.8; color: var(--paper-dim); max-width: 38ch; margin: 0 auto 44px; }

@media (max-width: 640px) {
  .archive { width: min(64ch, 100% - 16vw); padding-block: 18vh 14vh; }
  /* the header stacks beside its kanji: name, then season word, then count; the chevron stays on the name's row */
  .as-head { display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px; }
  .as-glyph { grid-row: 1 / span 2; align-self: start; }
  .as-head h2 { grid-column: 2; grid-row: 1; }
  .as-head .as-word { display: block; margin: 8px 0 0; }
  .as-count { grid-column: 2; grid-row: 2; margin: 6px 0 0; }
  .as-head::after { grid-column: 3; grid-row: 1; }
  .archive-poem { padding-left: 18px; }
  /* a linked poem or season lands clear of the fixed 間 */
  .archive-season, .archive-poem { scroll-margin-top: 80px; }
  .al-anchor { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .as-head::after { transition: transform var(--dur-state) var(--ease-breath), border-color var(--dur-hover) var(--ease-breath); }
  /* where the browser styles a fold's content, it breathes in and out; elsewhere it simply shows */
  .as-fold::details-content {
    opacity: 0;
    transition: opacity var(--dur-state) var(--ease-breath), content-visibility var(--dur-state) allow-discrete;
  }
  .as-fold[open]::details-content { opacity: 1; }
}
