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

:root {
  --fg: #2a2a2a;
  --fg-2: #5a5a5a;
  --fg-3: #8a8a8a;
  --fg-4: #b8b8b8;
  --border: rgb(0 0 0 / 0.07);
  --bg: #f8f7f4;
  --bg-card: #fff;
  --bg-hover: rgb(0 0 0 / 0.015);
  --accent: #2d6a4f;
}

body {
  font-family: sans-serif;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* --- Header --- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;

  & h1 {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  & p {
    font-size: 0.75rem;
    color: var(--fg-3);
  }
}

.sr-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 4px;

  & label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.6875rem;
    color: var(--fg-3);
    user-select: none;
    letter-spacing: 0.02em;
  }

  & input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
  }
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.5625rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent);

  &[data-state="off"] {
    background: var(--fg-4);
  }
}

/* --- Hint --- */

.hint {
  margin-bottom: 32px;
  padding: 12px 16px;
  border-left: 2px solid var(--fg-4);
  font-size: 0.75rem;
  color: var(--fg-3);
  line-height: 1.6;
}

/* --- Card Grid --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
}

.card {
  & a {
    display: block;
    color: inherit;
    text-decoration: none;

    &:hover {
      & .card-thumb {
        opacity: 0.88;
      }

      & h2 {
        color: var(--fg-2);
      }
    }
  }

  & .card-thumb {
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    margin-bottom: 12px;
    transition: opacity 0.2s;
  }

  & h2 {
    font-size: 0.875rem;
    font-weight: bold;
    letter-spacing: -0.01em;
    line-height: 1.45;
    margin-bottom: 6px;
    transition: color 0.2s;
  }

  & p {
    font-size: 0.6875rem;
    color: var(--fg-3);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* --- Detail --- */

.detail-hero {
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  margin-bottom: 32px;
}

.detail-header {
  margin-bottom: 32px;

  & h1 {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.02em;
    line-height: 1.4;
    margin-bottom: 12px;
  }

  & time {
    font-size: 0.75rem;
    color: var(--fg-3);
    letter-spacing: 0.02em;
  }
}

.detail-body {
  & p {
    margin-bottom: 20px;
    font-size: 0.9375rem;
    line-height: 1.9;
  }
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--fg-3);
  font-size: 0.8125rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;

  &:hover {
    color: var(--fg);
  }

  &::before {
    content: "\2190\a0";
  }
}

/* --- View Transitions (Chrome 133+) --- */

@view-transition {
  navigation: auto;
}
