:root {
  --bg: #f6f0e5;
  --surface: #fffaf2;
  --surface-strong: #fffdf8;
  --border: rgba(53, 36, 21, 0.12);
  --text: #24180f;
  --muted: #7a6654;
  --accent: #a84a22;
  color-scheme: light;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(200, 141, 86, 0.14), transparent 32%),
    linear-gradient(180deg, #f9f3e9 0%, var(--bg) 100%);
}

button,
dialog {
  font: inherit;
}

.page-shell {
  width: min(680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.page-header {
  padding: 8px 2px 18px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  line-height: 1.05;
}

.cards-list {
  display: grid;
  gap: 10px;
}

.card-item,
.empty-state {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
  box-shadow: 0 10px 28px rgba(83, 53, 33, 0.08);
}

.card-item {
  appearance: none;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card-item:hover,
.card-item:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(83, 53, 33, 0.12);
}

.card-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

.card-created-at,
.empty-copy,
.detail-created-at {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.card-dialog {
  width: min(760px, calc(100vw - 20px));
  max-width: 100%;
  max-height: calc(100dvh - 20px);
  padding: 0;
  border: 0;
  background: transparent;
}

.card-dialog::backdrop {
  background: rgba(20, 12, 7, 0.58);
  backdrop-filter: blur(2px);
}

.dialog-card {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf5ea 100%);
  box-shadow: 0 24px 60px rgba(40, 25, 15, 0.22);
  overflow: auto;
  max-height: calc(100dvh - 20px);
}

.dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff8ef;
  color: var(--accent);
  cursor: pointer;
}

.detail-title {
  margin: 0;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.15;
}

.detail-description {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-photos {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.detail-photo-link {
  display: block;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.detail-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72dvh;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
}

@media (min-width: 700px) {
  .page-shell {
    padding-top: 28px;
  }

  .cards-list {
    gap: 12px;
  }

  .card-item,
  .empty-state {
    padding: 18px 20px;
  }

  .dialog-card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .page-header,
  .card-item,
  .empty-state,
  .dialog-card {
    animation: fade-up 260ms ease both;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
