:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: #111;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
  font: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header,
.site-footer,
.site-nav,
.column-header,
.column-header > div,
.date-actions,
.lightbox-bar,
.lightbox-actions {
  display: flex;
  align-items: center;
}

.site-header,
.site-footer,
.column-header,
.lightbox-bar {
  justify-content: space-between;
}

.site-header,
.site-footer {
  gap: 16px;
  padding: 16px 0;
}

.site-header {
  border-bottom: 1px solid #ccc;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid #ccc;
}

.site-nav,
.column-header > div,
.date-actions,
.lightbox-actions {
  gap: 16px;
}

.index-intro,
.archive-hero,
.album-hero {
  margin: 32px 0;
}

.index-intro > *,
.archive-hero > div > *,
.album-hero > div > * {
  margin-bottom: 8px;
}

.browse-columns,
.chronology {
  border-top: 1px solid #111;
}

.browse-column {
  padding: 32px 0;
}

.browse-column + .browse-column {
  border-top: 1px solid #111;
}

.column-description {
  margin: 16px 0;
}

.date-index {
  border-top: 1px solid #ccc;
}

.date-year-label {
  padding: 12px 0;
}

.date-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #ccc;
}

.date-actions {
  flex-wrap: wrap;
  margin-top: 24px;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.archive-hero,
.album-hero {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
}

.chronology-year {
  padding: 24px 0;
}

.chronology-entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  margin-bottom: 48px;
  scroll-margin-top: 16px;
}

.entry-meta > * {
  display: block;
  margin-bottom: 4px;
}

.entry-gallery,
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.gallery-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #eee;
  cursor: zoom-in;
}

.gallery-item img {
  width: 100%;
  height: auto;
}

.theme-card,
.album-card {
  display: block;
  margin-top: 16px;
}

.theme-cover img,
.album-cover img {
  width: 100%;
  height: auto;
}

.theme-card-info,
.album-info {
  padding: 12px 0;
}

.album-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.lightbox-figure {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
}

.lightbox-bar {
  gap: 16px;
  padding-top: 12px;
}

.lightbox-button,
.lightbox-close {
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  cursor: pointer;
}

.lightbox-button {
  min-width: 36px;
  min-height: 36px;
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
}

@media (max-width: 800px) {
  .archive-hero,
  .album-hero,
  .chronology-entry {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .entry-gallery,
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-bar > span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-header,
  .site-footer,
  .column-header,
  .lightbox-bar {
    align-items: flex-start;
  }

  .date-row {
    grid-template-columns: 64px 1fr auto;
    gap: 8px;
  }

  .entry-gallery,
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
