:root {
  /* 2026-07-04: photo-first redesign */
  color-scheme: light;
  --brand-h: 188;
  --brand-950: hsl(var(--brand-h) 48% 15%);
  --brand-850: hsl(var(--brand-h) 46% 23%);
  --brand-700: hsl(var(--brand-h) 44% 33%);
  --brand-500: hsl(var(--brand-h) 40% 45%);
  --brand-240: hsl(var(--brand-h) 38% 78%);
  --brand-140: hsl(var(--brand-h) 54% 91%);
  --brand-80: hsl(var(--brand-h) 66% 96%);
  --paper: hsl(var(--brand-h) 38% 97%);
  --ink: hsl(220 22% 13%);
  --muted: hsl(214 12% 42%);
  --line: hsl(var(--brand-h) 16% 84%);
  --panel: hsl(var(--brand-h) 18% 99%);
  --panel-strong: hsl(0 0% 100%);
  --warn: hsl(36 48% 36%);
  --warn-soft: hsl(40 42% 95%);
  --danger: hsl(358 38% 39%);
  --danger-soft: hsl(358 40% 96%);
  --ok: hsl(var(--brand-h) 38% 30%);
  --ok-soft: hsl(var(--brand-h) 46% 94%);
  --shadow: 0 8px 24px hsl(var(--brand-h) 20% 30% / 0.07);
  --shadow-lg: 0 16px 48px hsl(var(--brand-h) 20% 30% / 0.12);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  font-feature-settings: "palt";
}

a { color: inherit; }

/* ── Loading ── */
.loading-state {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid hsl(var(--brand-h) 26% 80%);
  border-radius: 999px;
  background: hsl(var(--brand-h) 44% 98% / 0.95);
  color: var(--brand-850);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 7px 10px;
  box-shadow: var(--shadow);
}
.is-loading .loading-state { display: inline-flex; }
.loading-state[hidden] { display: none; }
.loading-mark {
  width: 14px; height: 14px;
  border: 2px solid hsl(var(--brand-h) 26% 80%);
  border-top-color: var(--brand-700);
  border-radius: 999px;
  animation: loading-spin 0.9s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

/* ── Topbar ── */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: hsl(var(--brand-h) 40% 99% / 0.92);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--brand-950);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  width: 26px; height: 26px;
  place-items: center;
  border: 1px solid hsl(var(--brand-h) 28% 74%);
  border-radius: 7px;
  background: #fff;
}
.brand-mark svg {
  width: 20px; height: 20px;
  color: var(--brand-700);
  fill: hsl(var(--brand-h) 52% 93%);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}
.topbar-period {
  flex: 1;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-align: right;
}
.filter-toggle {
  display: grid;
  width: 32px; height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.filter-toggle:hover { color: var(--brand-700); border-color: var(--brand-240); }

/* ── Main ── */
.site-main {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 10px 12px 80px;
}

/* ── Photo Grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1024px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* ── Photo Card ── */
.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.photo-card:focus-visible {
  outline: 3px solid hsl(var(--brand-h) 52% 70% / 0.64);
  outline-offset: 2px;
}

.photo-visual {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.photo-visual img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo-visual .visual-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: hsl(var(--brand-h) 40% 30% / 0.82);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.2;
  backdrop-filter: blur(6px);
}
.photo-visual .visual-venue-tag {
  position: absolute;
  bottom: 8px; right: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  background: hsl(0 0% 100% / 0.86);
  color: var(--brand-850);
  font-size: 0.7rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}
.photo-visual .visual-icon-lg {
  width: 52px; height: 52px;
  color: hsl(0 0% 100% / 0.38);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.photo-info {
  padding: 8px 10px 9px;
}
.photo-info h3 {
  margin: 0 0 3px;
  font-size: 0.86rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.photo-info .photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 600;
}

/* ── Visual gradient backgrounds ── */
.vis-sales     { background: linear-gradient(145deg, hsl(198 58% 44%), hsl(186 48% 32%)); }
.vis-stage     { background: linear-gradient(145deg, hsl(220 52% 46%), hsl(208 46% 34%)); }
.vis-exhibition{ background: linear-gradient(145deg, hsl(172 48% 36%), hsl(164 42% 26%)); }
.vis-industry  { background: linear-gradient(145deg, hsl(36 52% 40%), hsl(28 44% 30%)); }
.vis-community { background: linear-gradient(145deg, hsl(142 38% 38%), hsl(148 34% 28%)); }
.vis-family    { background: linear-gradient(145deg, hsl(310 38% 44%), hsl(320 34% 32%)); }
.vis-technology{ background: linear-gradient(145deg, hsl(258 44% 44%), hsl(268 40% 32%)); }
.vis-mixed     { background: linear-gradient(145deg, hsl(var(--brand-h) 44% 40%), hsl(var(--brand-h) 40% 28%)); }
.vis-otaku     { background: linear-gradient(145deg, hsl(280 46% 42%), hsl(270 42% 30%)); }

/* ── Chip bar ── */
.chip-bar {
  margin-top: 14px;
}
.chip-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.chip-scroll::-webkit-scrollbar { display: none; }

.date-chip {
  flex-shrink: 0;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.date-chip:hover { border-color: var(--brand-240); color: var(--ink); }
.date-chip[aria-pressed="true"] {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

/* ── Filter overlay ── */
.filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end stretch;
  background: hsl(0 0% 8% / 0.32);
  backdrop-filter: blur(4px);
}
.filter-overlay[hidden] { display: none; }

.filter-pane {
  width: 100%;
  max-height: 80vh;
  padding: 16px 18px 24px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--panel-strong);
  box-shadow: 0 -8px 32px hsl(0 0% 8% / 0.16);
  overflow-y: auto;
}
@media (min-width: 640px) {
  .filter-overlay { place-items: start end; }
  .filter-pane {
    width: 360px;
    max-height: 100vh;
    border-radius: 0;
  }
}

.filter-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.filter-pane-head h2 {
  margin: 0;
  font-size: 1rem;
}
.filter-close {
  display: grid;
  width: 32px; height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}

.filter-body { display: grid; gap: 16px; }
.filter-body fieldset {
  margin: 0;
  padding: 0;
  border: none;
}
.filter-body legend {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-700);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-group button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
}
.chip-group button:hover { border-color: var(--brand-240); }
.chip-group button[aria-pressed="true"] {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
}

.search-field {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-700);
}
.search-field input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 400;
  background: var(--panel-strong);
}

/* ── Empty ── */
.empty-state {
  margin: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Footer ── */
.site-footer {
  margin: 40px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}
.site-footer strong { color: var(--ink); }

/* ── Reader (dialog) ── */
.event-reader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  width: 100vw;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}
.event-reader::backdrop {
  background: hsl(0 0% 8% / 0.38);
  backdrop-filter: blur(4px);
}
.event-reader:not([open]) { display: none; }

.reader-panel {
  width: 100%;
  max-height: 100vh;
  padding: 20px 22px 40px;
  background: var(--panel-strong);
  box-shadow: 0 0 0 1px var(--line);
  overflow-y: auto;
}
@media (min-width: 640px) {
  .event-reader { place-items: center end; }
  .reader-panel {
    width: 480px;
    height: 100vh;
    max-height: 100vh;
  }
}

.reader-close {
  display: grid;
  width: 36px; height: 36px;
  place-items: center;
  margin: 0 0 12px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}

.reader-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}

.reader-panel h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.reader-summary {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.reader-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.reader-block {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--brand-80);
}
.reader-block h3 {
  margin: 0 0 3px;
  font-size: 0.8rem;
  color: var(--brand-700);
}
.reader-block p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.reader-warn { background: var(--warn-soft); }
.reader-warn h3 { color: var(--warn); }
.reader-condition { background: hsl(var(--brand-h) 20% 95%); }
.reader-condition h3 { color: var(--brand-500); }

.reader-source {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--muted);
}
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.source-links a {
  color: var(--brand-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
