/* Blog index. Posts come from the blog list API. */

:root {
  --bg: #000000;
  --fg: #f8fafc;
  --body: #e0c8be;
  --muted: #94a3b8;
  --gold: #e09100;
  --on-gold: #000000;
  --line: rgba(255, 255, 255, 0.14);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  --page: 72rem;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--gold);
  color: var(--on-gold);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  z-index: 2;
}

.skip:focus {
  transform: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand img {
  width: 4rem;
  height: 4rem;
  border-radius: 1.15rem;
  display: block;
}

.brand img:not([src]) {
  visibility: hidden;
}

.index {
  flex: 1 0 auto;
  max-width: var(--page);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4.5rem;
  display: grid;
  gap: 2rem;
  width: 100%;
}

footer-component {
  margin-top: auto;
}

.index-intro h1 {
  margin: 0;
  color: var(--fg);
  font-size: 1.75rem;
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.index-intro p {
  margin: 0.55rem 0 0;
  max-width: 16rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.list-status {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post {
  margin: 0;
}

.post-link {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.post-link time {
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-title {
  color: var(--body);
  font-size: 1.05rem;
  line-height: 1.35;
}

.post-latest .post-title {
  color: var(--fg);
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.post-link:hover .post-title {
  color: var(--gold);
}

.load-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.15rem;
}

.load-row[hidden] {
  display: none;
}

#load-more {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 0.75rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

#load-more:hover {
  color: var(--gold);
}

.load-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (min-width: 720px) {
  .site,
  .index {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

@media (min-width: 960px) {
  .index {
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
    padding-top: 3.5rem;
  }

  .index-intro {
    position: sticky;
    top: 1.5rem;
  }
}

@media (max-width: 640px) {
  .post-link {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .load-hint {
    display: none;
  }
}
