:root {
  --color-bg: #f9f9f9;
  --color-surface: #f5f6f7;
  --color-border: #d8dbde;
  --color-text: #1a1c1e;
  --color-text-weak: #5a6066;
  --color-accent: #b3261e;
  --color-accent-text: #ffffff;
  --color-focus: #0b57d0;
  --color-pending: #8a5000;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;

  --font-size-s: 0.8125rem;
  --font-size-m: 0.9375rem;
  --font-size-l: 1.125rem;
  --font-size-xl: 1.25rem;
  --line-height: 1.7;

  --radius: 0.5rem;
  --max-width: 44rem;

  --detail-panel-width: calc(100% / 3);

  --map-height: clamp(20rem, 68svh, 45rem);
}

@font-face {
  font-family: "Noto Sans JP Local";
  src: url("/assets/vendor/noto-sans-jp/NotoSansJP-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans JP Local";
  src: url("/assets/vendor/noto-sans-jp/NotoSansJP-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Noto Sans JP Local", system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: var(--font-size-m);
  line-height: var(--line-height);
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  transition: opacity 0.4s ease;
}

.splash--hide {
  opacity: 0;
  pointer-events: none;
}

.splash__photos {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.splash__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: splash-photo-in 3s linear forwards;
}

.splash__photo:first-of-type {
  opacity: 1;
  animation: splash-photo-zoom 3s linear forwards;
}

.splash__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #afacac;
  mix-blend-mode: multiply;
}

@keyframes splash-photo-in {
  0% {
    opacity: 0;
    transform: scale(1);
  }

  60% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes splash-photo-zoom {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.05);
  }
}

.splash__content {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.splash__headline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  padding: 0 var(--space-4);
  opacity: 0;
}

.splash__headline--ready {
  animation: splash-headline-in 0.8s ease forwards;
}

@keyframes splash-headline-in {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 0.5rem));
  }

  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

.splash__title {
  margin: 0;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.splash__title br {
  display: block;
}

@media (min-width: 48rem) {
  .splash__title {
    font-size: 2rem;
  }

  .splash__title br {
    display: none;
  }
}

.splash__summary {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0;
  column-gap: 1rem;
  width: fit-content;
  margin: var(--space-6) auto 0;
  padding: 1.5rem;
  background: rgb(255 255 255 / 70%);
}

.splash__summary:empty {
  margin: 0;
  padding: 0;
  background: none;
}

@media (min-width: 48rem) {
  .splash__summary {
    grid-template-columns: max-content 1fr;
    row-gap: 1rem;
    padding: 2.5rem;
  }
}

.splash__summary dt,
.splash__summary dd {
  margin: 0;
  color: var(--color-text);
  font-size: 1rem;
  text-align: center;
  line-height: 1.3;
}

.splash__summary dt {
  font-weight: 700;
  margin-top: 1.5rem;
}

.splash__summary dt:first-of-type {
  margin-top: 0;
}

.splash__summary dd {
  font-weight: 400;
  margin-top: 0.5rem;
}

@media (min-width: 48rem) {
  .splash__summary dt,
  .splash__summary dd {
    text-align: left;
    line-height: normal;
    margin-top: 0;
  }
}

.splash__enter {
  display: block;
  margin: 2.5rem auto 0;
  padding: var(--space-2) var(--space-4);
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  background: none;
  color: #ffffff;
  font: inherit;
  font-size: var(--font-size-m);
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
}

.splash__enter--visible {
  visibility: visible;
  animation: splash-enter-in 0.8s ease forwards;
}

@keyframes splash-enter-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }

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

.splash__enter:hover {
  background: rgb(255 255 255 / 15%);
}

@media (prefers-reduced-motion: reduce) {
  .splash__photo,
  .splash__enter {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .splash__headline {
    animation: none;
    opacity: 1;
    transform: translateY(-50%);
  }
}

.header {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.header__title {
  margin: 0;
  font-size: var(--font-size-xl);
  line-height: 1.35;
  word-break: auto-phrase;
}

.header__updated {
  margin: var(--space-1) 0 0;
  color: var(--color-text-weak);
  font-size: var(--font-size-s);
}

.banner {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 700;
}

.notice {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

[hidden] {
  display: none !important;
}

.views {
  display: flex;
  flex: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.views__button {
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: var(--color-surface);
  color: var(--color-text-weak);
  font: inherit;
  font-size: var(--font-size-s);
  cursor: pointer;
}

.views__button[aria-pressed="true"] {
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 700;
}

.views__button:disabled {
  opacity: 0.45;
  cursor: default;
}

.map-area {
  position: relative;
}

.map {
  height: var(--map-height);
  background: var(--color-surface);
}

.maplibregl-ctrl-attrib {
  font-size: var(--font-size-s);
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list__item + .list__item {
  border-top: 1px solid var(--color-border);
}

.list__button {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.list__thumb {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius);
  background: var(--color-surface);
  object-fit: cover;
}

.list__body {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.list__place {
  font-weight: 700;
}

.list__meta {
  color: var(--color-text-weak);
  font-size: var(--font-size-s);
}

.status {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-weak);
  font-size: var(--font-size-s);
}

.status:empty {
  display: none;
}

.status[data-tone="error"] {
  color: var(--color-accent);
}

.pin {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.pin::before {
  content: "";
  display: block;
  width: 0.98rem;
  height: 0.98rem;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #ff500a;
}

.pin__ripple {
  display: none;
}

@media (min-width: 48rem) {
  .pin--selected .pin__ripple {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.98rem;
    height: 0.98rem;
    margin: -0.49rem 0 0 -0.49rem;
    border-radius: 50%;
    background: #ff500a;
    opacity: 0.6;
    pointer-events: none;
    animation: pin-ripple 1.6s ease-out infinite;
  }
}

@keyframes pin-ripple {
  from {
    transform: scale(1);
    opacity: 0.6;
  }

  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pin--selected .pin__ripple {
    animation: none;
    transform: scale(1.9);
    opacity: 0.25;
  }
}

@media (hover: hover) and (min-width: 48rem) {
  .pin[data-place]::after {
    content: attr(data-place);
    position: absolute;
    bottom: calc(100% + 0.375rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.5rem;
    border: 1px solid #d8dbde;
    border-radius: var(--radius);
    background: #ffffff;
    color: #1a1c1e;
    width: max-content;
    max-width: 12rem;
    font-size: var(--font-size-s);
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
    pointer-events: none;
    opacity: 0;
  }

  .pin[data-place]:hover::after,
  .pin[data-place]:focus-visible::after {
    opacity: 1;
  }

  .pin[data-place]:hover,
  .pin[data-place]:focus-visible {
    z-index: 1;
  }

  .pin[data-place]:hover::before,
  .pin[data-place]:focus-visible::before {
    filter: brightness(0.85);
  }
}

.epicenter {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.epicenter::before {
  content: "";
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #ff500a;
  box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
}

.epicenter__mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.8rem;
  height: 2px;
  margin: -1px 0 0 -0.4rem;
  background: #ffffff;
  pointer-events: none;
}

.epicenter__mark--a {
  transform: rotate(45deg);
}

.epicenter__mark--b {
  transform: rotate(-45deg);
}

.epicenter[data-place]::after {
  content: attr(data-place);
  position: absolute;
  bottom: calc(100% + 0.375rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.5rem;
  border: 1px solid #d8dbde;
  border-radius: var(--radius);
  background: #ffffff;
  color: #1a1c1e;
  width: max-content;
  max-width: 12rem;
  font-size: var(--font-size-s);
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
  pointer-events: none;
  opacity: 0;
}

.epicenter[data-open="true"] {
  z-index: 1;
}

.epicenter[data-open="true"]::after {
  opacity: 1;
}

.detail {
  width: min(calc(100% - var(--space-4) * 2), var(--max-width));
  max-height: 85svh;
  margin: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail::backdrop {
  background: rgb(0 0 0 / 55%);
}

.detail__bar {
  position: sticky;
  top: 0;
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.detail__title {
  margin: 0;
  font-size: var(--font-size-l);
  line-height: 1.4;
}

.detail__close {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-weak);
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.detail__close:hover {
  opacity: 0.6;
}

.detail__title:focus-visible,
.lightbox__caption:focus-visible {
  outline: none;
}

.detail__close::after {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.detail__meta,
.detail__note {
  margin: 0;
  padding: var(--space-2) var(--space-4) 0;
  color: var(--color-text-weak);
  font-size: var(--font-size-s);
}

.detail__note {
  padding-bottom: var(--space-3);
}

.detail__photos {
  padding: 0 var(--space-4) var(--space-6);
}

.post + .post {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.post > .flag {
  margin-top: 0;
}

.photo {
  margin: 0;
}

.photo__image {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-surface);
}

.photo__image[data-state="missing"] {
  min-height: 8rem;
  border: 1px dashed var(--color-border);
}

.photo__caption {
  margin: var(--space-2) 0 0;
  font-size: var(--font-size-m);
}

.lightbox {
  width: min(90vw, 90svh);
  max-width: none;
  max-height: 90svh;
  margin: auto;
  padding: 0;
  border: none;
  background: none;
  overflow: hidden;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 80%);
}

.lightbox__image {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #4d4d4d;
  object-fit: contain;
}

.lightbox__caption {
  flex: none;
  max-height: 40%;
  padding: var(--space-3) var(--space-4);
  background: #ffffff;
  color: #1a1c1e;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox__caption:empty {
  display: none;
}

.lightbox__caption > :first-child {
  margin-top: 0;
}

.lightbox__caption > :last-child {
  margin-bottom: 0;
}

.lightbox__close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  color: #ffffff;
  font: inherit;
  font-size: 1.75rem;
  line-height: 1;
  text-shadow: 0 1px 4px rgb(0 0 0 / 55%);
  cursor: pointer;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__nav--prev {
  left: var(--space-4);
}

.lightbox__nav--next {
  right: var(--space-4);
}

.lightbox__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (min-width: 48rem) {
  .photo__image {
    cursor: pointer;
  }

  .photo__image[data-state="missing"] {
    cursor: default;
  }
}

.flag {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-weak);
  font-size: var(--font-size-s);
}

.photo > .flag {
  margin-bottom: 0;
}

.flag__badge {
  flex: none;
  color: var(--color-accent);
  font-weight: 700;
}

.flag__body {
  margin: 0;
}

.flag--retracted {
  border-style: dashed;
}

.footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
  background: #f2f2f2;
}

.facts-panel {
  margin: 0;
}

.facts-panel__summary {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-m);
  font-weight: 700;
  list-style: none;
  pointer-events: none;
}

.facts-panel__summary::-webkit-details-marker {
  display: none;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  font-size: var(--font-size-s);
}

.facts dt {
  color: var(--color-text-weak);
}

.facts dd {
  margin: 0;
}

.disclaimer {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
  text-align: left;
}

.disclaimer__break {
  display: none;
}

@media (min-width: 48rem) {
  body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100svh;
  }

  main {
    display: grid;
    grid-template-rows: auto auto 1fr auto auto;
    min-height: 0;
  }

  main > .banner {
    grid-row: 1;
  }

  main > .notice {
    grid-row: 2;
  }

  main > .map-area {
    grid-row: 3;
    min-height: 0;
  }

  body[data-view="list"] main {
    grid-template-rows: auto auto auto auto 1fr;
  }

  body[data-view="list"] main > .status {
    grid-row: 3;
  }

  body[data-view="list"] main > .map-area {
    grid-row: 4;
  }

  body[data-view="list"] main > .list {
    grid-row: 5;
  }

  body[data-view="list"] .map-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  body[data-view="list"] .map-area > .disclaimer,
  body[data-view="list"] .map-area > .facts-panel {
    position: static;
    width: auto;
    max-width: none;
  }

  main > .list {
    grid-row: 4;
  }

  main > .status {
    grid-row: 5;
  }

  .map {
    height: 100%;
  }

  .detail[data-mode="panel"] {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--detail-panel-width);
    max-width: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    border-right: 1px solid var(--color-border);
    z-index: 2;
  }

  body.has-detail-panel .map {
    margin-left: var(--detail-panel-width);
  }

  .footer {
    border-top: none;
  }

  .map-area .maplibregl-ctrl-bottom-right {
    bottom: 1.75rem;
  }

  .map-area > .disclaimer {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: max-content;
    max-width: calc(100% - 2 * var(--space-3));
    margin: 0;
    padding: var(--space-1) var(--space-3);
    border-top: none;
    background: rgba(255, 255, 255, 0.6);
    font-size: clamp(0.5rem, 1.2vw, 0.75rem);
    white-space: nowrap;
    overflow-x: auto;
    text-align: left;
  }

  .map-area > .facts-panel {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    z-index: 1;
  }

  .map-area > .facts-panel .facts-panel__summary {
    margin: 0;
    padding: var(--space-2) var(--space-4);
    pointer-events: auto;
    cursor: pointer;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
  }

  .map-area > .facts-panel .facts-panel__summary:hover {
    background: #f2f2f2;
  }

  .map-area > .facts-panel:not([open]) .facts-panel__body {
    display: none;
    opacity: 0;
    transform: translateY(-0.25rem);
  }

  .map-area > .facts-panel .facts-panel__body {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: max-content;
    max-width: 20rem;
    max-height: 60svh;
    padding: var(--space-4);
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      display 0.2s allow-discrete;
  }

  @starting-style {
    .map-area > .facts-panel[open] .facts-panel__body {
      opacity: 0;
      transform: translateY(-0.25rem);
    }
  }
}

@media (min-width: 48rem) and (max-width: 84.375rem) {
  .map-area .maplibregl-ctrl-bottom-right {
    bottom: 3rem;
  }

  .map-area > .disclaimer {
    max-width: 34rem;
    margin: 0;
    font-size: var(--font-size-s);
    white-space: normal;
    overflow-x: visible;
  }

  .map-area > .disclaimer .disclaimer__break {
    display: block;
  }
}
