/*
 * Archive (src/pages/archive.astro): one screen, no scrolling. The page is exactly the viewport
 * (header + framed grid + bottom gutter), with a card per past edition: side by side on desktop
 * and tablet, stacked on phones. The cards are cells of one divided grid (.is-divided,
 * atn-system.css) in a framed box, so their separators are the grid's single lines.
 *
 * Card: name and [index] over a faint dashed rule, the edition's photo (it fills what's left),
 * then the year (DM Sans ExtraBold with the last two digits in the pixel font) and the dates.
 * Hover: the photo brightens and eases in, the arrow turns (atn-custom.css, .cta-icon-image).
 */
.archive {
  --archive-header: 6.4em; /* the site header (site-nav.css) */
  color: var(--white);
  height: 100vh;
  height: 100svh;
  padding: var(--archive-header) var(--gutter) var(--gutter);
  position: relative;
  overflow: hidden;
}

/* Vertical title in the left gutter. */
.archive__title {
  z-index: 2;
  color: var(--neutral);
  white-space: nowrap;
  margin: 0;
  font-family: var(--font-label);
  font-size: 1.2em;
  font-weight: var(--font-label-weight);
  line-height: 1;
  position: absolute;
  top: 50%;
  left: calc(var(--gutter) / 2);
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* The framed grid: a gutter below the header, filling the rest of the screen. */
.archive__frame {
  margin-top: var(--gutter);
  height: calc(100% - var(--gutter));
}

.archive__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 100%;
}

/* ------------------------------------------------------------ card */
.archive-card {
  --card-pad: 3.2em;
  --card-rule: var(--line-width) dashed var(--line-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: var(--white);
  text-decoration: none;
  transition: background-color .3s ease;
}
.archive-card:hover { background-color: var(--darker-3); }
.archive-card:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--yellow);
}

.archive-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: 2em var(--card-pad);
  border-bottom: var(--card-rule);
}
.archive-card__name {
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-size: 1.6em;
  line-height: 1.2;
}
.archive-card__index {
  color: var(--neutral);
  font-family: cofo-sans-pixel, sans-serif;
  font-size: 1.6em;
  line-height: 1;
}

.archive-card__media {
  flex: 1;
  min-height: 0;
  margin: var(--card-pad) var(--card-pad) 0;
  overflow: hidden;
  background-color: var(--darker-2);
}
.archive-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.8);
  transform: scale(1.001);
  transition: filter .6s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
}
.archive-card:hover .archive-card__image {
  filter: brightness(1);
  transform: scale(1.04);
}

.archive-card__foot {
  padding: 2.4em var(--card-pad) 2.8em;
}

.archive-card__year {
  letter-spacing: -.03em;
  white-space: nowrap;
  font-family: "DM Sans", Bdogrotesk, Arial, sans-serif;
  font-size: 11em;
  font-weight: 800;
  line-height: .9;
}

/*
 * The year's last two digits in the pixel font (cofo-sans-pixel, Adobe Fonts, loaded site-wide),
 * matched by eye and measurement to the DM Sans ExtraBold digits beside them. At 100px, DM Sans
 * digits are 72px tall with 14px stems; the pixel digits 68px tall with ~7.5px stems. A stroke
 * thickens the pixel strokes (its square joins keep the pixels square) to within a hair of the
 * DM Sans weight; any more and the one-pixel gaps inside the 2 and 6 close up. The size drops
 * slightly so the stroke doesn't make them taller, they lift by half the stroke to sit on the
 * same baseline, and the letter spacing makes room for the extra width.
 */
.archive-card__year-pixel {
  font-family: cofo-sans-pixel, "DM Sans", sans-serif;
  font-weight: 400;
  font-size: .97em;
  letter-spacing: .04em;
  -webkit-text-stroke: .04em currentColor;
  position: relative;
  top: -.02em;
}

.archive-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2em;
  margin-top: 1.6em;
}
.archive-card__caption {
  color: var(--lighter-2);
  font-size: 1.6em;
  line-height: 1.3;
}
.archive-card__visit {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: .8em;
  font-family: var(--font-label);
  font-weight: var(--font-label-weight);
  font-size: 1.5em;
}
.archive-card__visit .cta-icon-image { height: 1.1em; }

/* ------------------------------------------------------------ tablet */
@media screen and (max-width: 991px) {
  .archive { --archive-header: calc(4.6em + var(--line-width)); }
  .archive-card { --card-pad: 2.4em; }
  .archive-card__year { font-size: 8em; }
  .archive-card__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
  }
}

/* ------------------------------------------------------------ mobile landscape and portrait */
@media screen and (max-width: 767px) {
  .archive__cards {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(0, 1fr);
  }
  .archive-card__head { padding: 1.4em var(--card-pad); }
  .archive-card__foot { padding: 1.6em var(--card-pad) 2em; }
  .archive-card__year { font-size: 6.4em; }
  .archive-card__meta {
    flex-direction: row;
    align-items: center;
    margin-top: 1em;
  }
  .archive-card__caption { font-size: 1.5em; }
}

@media screen and (max-width: 479px) {
  .archive { --archive-header: calc(5em + var(--line-width)); }
  .archive__title { display: none; }
  .archive-card { --card-pad: 1.6em; }
  .archive-card__media { margin-top: 1.6em; }
  .archive-card__year { font-size: 5.6em; }
  .archive-card__caption { font-size: 1.4em; }
  .archive-card__visit { font-size: 1.4em; }
}
