:root {
  --bg: #f4f4f2;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --ink: #222222;
  --ink-soft: #6a6a6a;
  --line: rgba(34, 34, 34, 0.1);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.05);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow Semi Condensed", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.page-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.page-nav a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.76rem;
}

.page-nav a.is-active {
  color: var(--ink);
  background: #ececeb;
}

.eyebrow,
.toolbar-label,
.section-label {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.filters-inner,
.results {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: none;
}

.filters-inner {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.search-block input {
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid rgba(24, 34, 41, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-size: 0.88rem;
}

.search-block input:focus-visible,
.chip.is-active,
.reset-button:focus-visible,
.card-hitarea:focus-visible,
.lightbox-close:focus-visible {
  outline: 3px solid rgba(34, 34, 34, 0.12);
  outline-offset: 2px;
}

.filter-group {
  display: grid;
  gap: 8px;
}

.chip-row,
.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(34, 34, 34, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.78rem;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.chip {
  cursor: pointer;
}

.chip:hover,
.card-hitarea:hover {
  transform: translateY(-1px);
}

.chip.is-active {
  background: #ececeb;
  border-color: rgba(34, 34, 34, 0.14);
  color: var(--ink);
}

.tag {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.tag.accent {
  background: #f0f0ef;
  border-color: rgba(34, 34, 34, 0.08);
}

.reset-button {
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  background: #efefee;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.82rem;
}

.results {
  padding: 18px;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.result-count {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  min-width: 0;
}

.card-hitarea {
  display: grid;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(24, 34, 41, 0.08);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface-strong);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.card-media {
  aspect-ratio: 1.91 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
  background: #ededeb;
}

.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.card h3,
.lightbox h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.45;
}

.card-source,
.lightbox-reason {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: 0.76rem;
}

.empty-state {
  margin-top: 18px;
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed rgba(24, 34, 41, 0.18);
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

.lightbox {
  width: min(1120px, calc(100% - 32px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 60px rgba(24, 34, 41, 0.22);
}

.lightbox::backdrop {
  background: rgba(12, 19, 23, 0.6);
  backdrop-filter: blur(6px);
}

.lightbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 0;
}

.lightbox img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #f0ece5;
}

.lightbox-meta {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-left: 1px solid var(--line);
}

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 34, 41, 0.06);
  cursor: pointer;
}

.lightbox a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.8rem;
  text-decoration-thickness: 1px;
}

@media (max-width: 1080px) {
  .hero,
  .layout,
  .lightbox-layout {
    grid-template-columns: 1fr;
  }

  .filters-inner {
    position: static;
  }

  .lightbox-meta {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

  .filters-inner,
  .results {
    padding: 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}
