:root {
  /* --color--rain: #2980b9; */
  --color--rain: #2589d0;
  --color--font__content: #333;
  --sidebar-width: 320px;

  /* --color--legend__rain--lv01: #5adcdc;
  --color--legend__rain--lv02: #1e78dc;
  --color--legend__rain--lv03: #ff7800;
  --color--legend__rain--lv04: #dc1464; */
  --color--legend__rain--lv01: #9ff;
  --color--legend__rain--lv02: #6cf;
  --color--legend__rain--lv03: #2198ff;
  --color--legend__rain--lv04: #0038ff;
  --color--legend__rain--lv05: #faf500;
  --color--legend__rain--lv06: #f90;
  --color--legend__rain--lv07: #e72800;
  --color--legend__rain--lv08: #9a0079;

  --color--status__gray: rgb(150, 150, 150);
  --color--status__blue: rgb(100, 100, 255);
  --color--status__yellow: rgb(230, 230, 45);
  --color--status__orange: rgb(255, 150, 50);
  --color--status__red: rgb(255, 50, 50);
}

html,
body {
  width: 100%;
  height: 100%;

  /* font-family: roboto, Arial, sans-serif; */
  font-family: roboto, 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN',
    'Hiragino Sans', Meiryo, sans-serif;
}

html {
  font-size: 62.5%;
}

body {
  padding: 0;
  margin: 0;

  /* font-size: 1.6rem; */
  font-size: clamp(1.2rem, 0.062rem + 2.46vw, 1.6rem);
  font-feature-settings: 'plat';
  letter-spacing: 0.025em;
  background-color: #fff;
}

h1 {
  /* font-size: 2.2rem; */
  font-size: clamp(1.8rem, 0.662rem + 2.46vw, 2.2rem);
}

h2 {
  /* font-size: 1.8rem; */
  font-size: clamp(1.6rem, 1.031rem + 1.23vw, 1.8rem);
}

h3 {
  /* font-size: 1.6rem; */
  font-size: clamp(1.4rem, 0.831rem + 1.23vw, 1.6rem);
}

h4 {
  font-size: 1.4rem;
}

h5 {
  font-size: 1.3rem;
}

#appContainer {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-rows: 30px 60px 1fr;
  grid-template-columns: 1fr;
  grid-auto-flow: row;
  gap: 10px;
  justify-content: start;
  justify-items: start;
  width: 100%;
  height: 100%;
  padding: 10px 50px 45px 10px;
  overflow: hidden;
}

@media screen and (width >= 740px) {
  #appContainer {
    grid-template-rows: 60px 1fr;
    grid-template-columns: var(--sidebar-width) 1fr;
  }
}

#siteHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--sidebar-width);
  max-width: calc(100vw - 100px);
}

#timeslider {
  width: 100%;
  min-width: 350px;
  max-width: 450px;
  height: 60px;
  padding: 1rem;
}

#sidebar {
  align-self: start;
  width: var(--sidebar-width);
  max-height: 100%;
  padding: 1rem;
  opacity: 0.8;
}

#content-contaier {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.container {
  position: relative;
  z-index: 999;
  display: block;
  overflow: hidden;
  color: var(--color--font__content);
  background-color: white;
  border-radius: 3px;

  /* box-shadow: 1px 2px 4px 0px rgba(0, 0, 0, 0.3); */
  box-shadow: 2px 2px 4px -1px hsl(200deg 50% 20% / 40%);
}

.site-header__container {
  padding: 1rem;
  cursor: pointer;
}

/* .site-header__title {
  font-size: 1.8em;
} */

/* .lastupdate {
  font-size: 10px;
  font-weight: 400;
} */

/* stylelint-disable-next-line no-duplicate-selectors */
#timeslider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeslider__container {
  position: relative;
  top: 12px;
  width: 100%;
  padding: 0 0.5em;
  padding: 0 2rem;
}

#obsvtime {
  display: block;
}

#obsvtime .active-pip {
  color: #000;
}

#obsvtime.noUi-target {
  height: 2px;
  font-size: 12px;
  background: #aaa;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

#obsvtime .noUi-connect {
  background: var(--color--rain);
}

#obsvtime .noUi-handle {
  top: -8px;
  right: -8px; /* half the width */
  width: 16px;
  height: 16px;
  cursor: pointer;
  background: #fff;
  border: none;
  border: 2px solid var(--color--rain);
  border-radius: 50%;
  box-shadow: none;
}

#obsvtime .noUi-handle::before,
#obsvtime .noUi-handle::after {
  display: none;
}

#obsvtime .noUi-pips-horizontal {
  height: 40px;
  padding: 0;
}

#obsvtime .noUi-marker-horizontal.noUi-marker {
  top: -1px;
  width: 4px;
  height: 4px;
  cursor: pointer;
  background: var(--color--rain);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#obsvtime .noUi-marker-horizontal.noUi-marker-sub {
  width: 6px;
  height: 6px;
}

#obsvtime .noUi-marker-horizontal.noUi-marker-large {
  width: 10px;
  height: 10px;
}

#obsvtime .noUi-value-sub {
  padding-top: 5px;
  font-size: 9px;
}

#obsvtime .noUi-value-horizontal {
  transform: translate(-50%, -180%);
}

#obsvtime .noUi-tooltip {
  padding: 4px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  background: var(--color--rain);
  border: none;
}

#obsvtime .noUi-tooltip::before {
  position: absolute;
  top: 100%;
  left: 50%;
  content: '';
  border-color: var(--color--rain) transparent transparent transparent;
  border-style: solid;
  border-width: 3px;
  transform: translateX(-50%);
}

#obsvtime.noUi-horizontal .noUi-tooltip {
  bottom: 140%;
}

/*
 * sidebar
 */
.sidebar__container {
  display: flex;
}

.accordion {
  overflow: hidden;
}

.accordion summary {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  font-weight: 600;
  cursor: pointer;
}

.accordion summary::before {
  position: absolute;
  right: 0;
  width: 1.25em;
  height: 1.25em;
  content: '';
  background-color: var(--color--rain);
  border-radius: 50%;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  position: absolute;
  right: 0.375em;
  width: 0.5em;
  height: 0.5em;
  content: '';
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transition: transform 0.3s;
  transform: translateY(-25%) rotate(45deg);
}

.accordion[open] summary::after {
  transform: rotate(225deg);
}

.accordion[open] .accordion__content {
  opacity: 1;
  transform: none;
  animation: accordion 0.5s linear;
}

@-webkit-keyframes accordion {
  0% {
    height: 0;
    opacity: 0;
  }

  70% {
    height: auto;
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes accordion {
  0% {
    height: 0;
    opacity: 0;
  }

  70% {
    height: auto;
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes accordion {
  0% {
    height: 0;
    opacity: 0;
  }

  70% {
    height: auto;
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes accordion {
  0% {
    height: 0;
    opacity: 0;
  }

  70% {
    height: auto;
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.traffic-info {
  position: relative;
  flex: 1 1 auto;
  max-height: 100%;
}

.traffic-info__title {
  margin-bottom: 0.3em;
}

.traffic-info__title span + span {
  margin-left: 0.5em;
}

.traffic-info__title .count {
  margin-left: 0.2em;
  font-size: 80%;
  font-weight: 400;
}

.traffic-info__title .lastupdate {
  margin-left: 0.5em;
  font-size: 65%;
  font-weight: 400;
}

.traffic-info__content {
  height: calc(100% - 34px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(120 170 210) rgb(120 170 210 / 30%);
}

.traffic-info__content::-webkit-scrollbar {
  width: 8px;
}

.traffic-info__content::-webkit-scrollbar-track {
  background-color: rgb(120 170 210 / 30%);
  border-radius: 100px;
}

.traffic-info__content::-webkit-scrollbar-thumb {
  background: rgb(120 170 210);
  border-radius: 100px;
}

.traffic-info__content .title {
  padding-left: 3px;
  font-size: 80%;
  border-left: 3px solid;
}

.traffic-info__content .title.flood--start {
  border-color: var(--color--status__red);
}

.traffic-info__content .title.flood--continue {
  border-color: var(--color--status__red);
}

.traffic-info__content .title.flood--end {
  border-color: var(--color--status__yellow);
}

.traffic-info__content .title:not(:first-child) {
  margin-top: 0.5em;
}

.restriction__container {
  padding-left: 6px;
  width: 100%;
  font-size: clamp(1rem, 0.431rem + 1.23vw, 1.2rem);
}

.restriction__container .time,
.restriction__container .location {
  font-weight: 600;
}

.restriction__container .restriction {
  display: block;
  margin: 0;
}

.restriction__container .restriction .predict {
  display: block;
}

.restriction__container li {
  padding: 0.25em 0;
}

.restriction__container li:hover {
  cursor: pointer;
  background-color: #eee;
}

.restriction__container li .time + .location {
  margin: 0 5px;
}

/*****************
 * Header Menu *
 *****************/
#menuContainer {
  position: fixed;
  top: 8px;
  right: 48px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: flex-end;
  overflow: hidden;
}

/* Layer menu */
#layerMenu {
  position: relative;
  z-index: 2;
}

.menu-content {
  position: relative;
  display: flex;
  gap: 15px;
  align-items: baseline;
  justify-content: flex-end;
  font-size: clamp(1rem, 0.431rem + 1.23vw, 1.2rem);
  transition: all 0.5s ease;
}

.menu-content ul {
  padding: 1em;
}

/* stylelint-disable-next-line no-descending-specificity */
.menu-content ul li + li {
  margin-top: 0.25em;
}

.menu-content ul input {
  margin-right: 0.5em;
}

.menu-icon a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  color: var(--color--font__content);
  cursor: pointer;
  background: white;
  border-radius: 3px;
  box-shadow: 1px 2px 4px 0 rgb(0 0 0 / 30%);
}

.menu-icon a:hover {
  background: #eee;
}

.menu-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 2px;
}

/* クリック後の親要素 */
.menu-item.notshow {
  gap: 0;
}

/* クリック前の各メニュー */
.menu-item.notshow > .menu-content {
  gap: 0;
  margin-right: 0;
}

/* クリック前のテキスト */
.menu-item.notshow > .menu-content ul {
  display: none;
}

@media screen and (width >= 641px) {
  #menuContainer {
    top: 45px;
    right: 8px;
  }

  .menu-item {
    flex-direction: row-reverse;
    align-items: flex-start;
  }

  .menu-content {
    top: 0;
  }
}

/* 凡例 */
.legend-container {
  flex-direction: column;
  width: 24em;

  /* font-size: 1rem; */
  font-size: clamp(0.8rem, 0.231rem + 1.23vw, 1rem);
  background-color: white;
  opacity: 1;
}

.legend-container.floating-content {
  gap: 0;
}

.legend-container fieldset {
  padding: 1rem;
  border: none;
}

.legend-container legend {
  padding: 1rem 0 0;
  margin-left: -0.5rem;
}

/* 雨量の凡例 */
.legend-container .legend--rain {
  /* display: inline-block; */

  /* margin: 0 1em 0 0; */
  line-height: 1;
}

.legend-container .legend--rain li + li {
  margin-top: 0.25em;
}

.legend-container .legend--rain li::before {
  display: inline-block;
  width: 4em;
  height: 1em;
  margin: 0 1em 0 0;
  content: '';
  background-color: #999; /* 円の色 */
  border-radius: 0.5em;
}

/* .legend-container .legend--rain .lv01 {
  color: var(--color--legend__rain--lv01);
} */

.legend-container .legend--rain .lv01::before {
  background-color: var(--color--legend__rain--lv01);
}

/* .legend-container .legend--rain .lv02 {
  color: var(--color--legend__rain--lv02);
} */

.legend-container .legend--rain .lv02::before {
  background-color: var(--color--legend__rain--lv02);
}

/* .legend-container .legend--rain .lv03 {
  color: var(--color--legend__rain--lv03);
} */

.legend-container .legend--rain .lv03::before {
  background-color: var(--color--legend__rain--lv03);
}

/* .legend-container .legend--rain .lv04 {
  color: var(--color--legend__rain--lv04);
} */

.legend-container .legend--rain .lv04::before {
  background-color: var(--color--legend__rain--lv04);
}

/* .legend-container .legend--rain .lv05 {
  color: var(--color--legend__rain--lv05);
} */

.legend-container .legend--rain .lv05::before {
  background-color: var(--color--legend__rain--lv05);
}

/* .legend-container .legend--rain .lv06 {
  color: var(--color--legend__rain--lv06);
} */

.legend-container .legend--rain .lv06::before {
  background-color: var(--color--legend__rain--lv06);
}

/* .legend-container .legend--rain .lv07 {
  color: var(--color--legend__rain--lv07);
} */

.legend-container .legend--rain .lv07::before {
  background-color: var(--color--legend__rain--lv07);
}

/* .legend-container .legend--rain .lv08 {
  color: var(--color--legend__rain--lv08);
} */

.legend-container .legend--rain .lv08::before {
  background-color: var(--color--legend__rain--lv08);
}

/* センサの凡例 */
.legend-container dl.legend--sensor {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
}

.legend-container dl.legend--sensor dt {
  width: 4em;
  height: 1.2em;
  margin: 0 1em 0 0;
  font-size: 90%;
  color: white;
  text-align: center;
  background-color: #999; /* 円の色 */
  border-radius: 0.6em;
}

.legend-container dl.legend--sensor dd {
  width: calc(100% - 5em);
}

.legend-container .legend--sensor dt:not(:first-child) {
  margin-top: 0.25em;
}

.legend-container dl.legend--sensor dt.flood--alert {
  color: inherit;
  background-color: white;
  border: solid 1px var(--color--status__gray);
}

.legend-container dl.legend--sensor dt.flood--red {
  background-color: var(--color--status__red);
}

.legend-container dl.legend--sensor dt.flood--yellow {
  background-color: var(--color--status__yellow);
}

.legend-container dl.legend--sensor dt.flood--blue {
  background-color: var(--color--status__blue);
}

.legend-container dl.legend--sensor dt.flood--gray {
  background-color: var(--color--status__gray);
}

.legend-container .comment {
  margin-top: 0.25em;
}

/*****************
 * Floating menu *
 *****************/
#floatingMenu {
  position: fixed;
  right: 48px;
  bottom: 52px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}

@media screen and (width >= 641px) {
  #floatingMenu {
    right: 50px;
    bottom: 30px;
  }
}

.floating-content {
  position: relative;
  display: flex;
  gap: 15px;
  align-items: baseline;
  justify-content: flex-end;
  transition: all 0.5s ease;
}

/* 子要素のリンク */
/* stylelint-disable-next-line no-descending-specificity */
.floating-content a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  cursor: pointer;
  background: var(--color--rain);
  border-radius: 50%;
  box-shadow:
    0 0 6px 0 rgb(0 0 0 / 15%),
    0 4px 5px 0 rgb(0 0 0 / 22%);
}

/* aタグのhover時 */
.floating-content.legend-container a:hover {
  opacity: 0.8;
}

/* FontAwesomeアイコンのスタイル */
/* stylelint-disable-next-line no-descending-specificity */
.floating-content a,
.floating-content a i {
  color: #fff;
}

/* ＋アイコン */
.floating-content.bottom a::before,
.floating-content.bottom a::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: block;
  width: 10px;
  height: 2px;
  content: '';
  background-color: #fff;
  border-radius: 10px;
  transform: translate(-50%, -50%);
}

.floating-content.bottom a::before {
  width: 2px;
  height: 10px;
  visibility: hidden;
}

/* クリック後の親要素 */
#floatingMenu.notshow {
  gap: 0;
}

/* クリック前の各メニュー */
div#floatingMenu.notshow > .floating-content.legend-container {
  gap: 0;
  margin-bottom: -45px;
}

/* クリック前のテキスト */
div#floatingMenu.notshow > .floating-content.legend-container fieldset {
  display: none;
}

/* クリック前のメニューの影 */
div#floatingMenu.notshow > .floating-content.legend-container a {
  box-shadow:
    0 0 2px 0 rgb(0 0 0 / 15%),
    0 1px 2px 0 rgb(0 0 0 / 22%);
}

/* クリック前のFontawesomeアイコン */
div#floatingMenu.notshow .floating-content.bottom a::before {
  visibility: visible;
}

/*
#map canvas {
  cursor: crosshair;
}

#features {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  overflow: auto;
  background: rgba(255, 255, 255, 0.8);
}
*/

.mapboxgl-popup {
  max-width: 400px;
  font:
    12px/20px 'Helvetica Neue',
    Arial,
    Helvetica,
    sans-serif;
}

.mapboxgl-popup-content {
  color: var(--color--font__content);
  background: #fff;
}

/***************
 * Chart panel *
 ***************/
#chartPanel {
  position: fixed;
  top: 0;
  right: 10px;
  bottom: 0;
  z-index: 1000;
  width: 0;
  max-width: calc(100% - 20px);
  height: 400px;
  max-height: 80%;
  margin: auto;
  opacity: 0;
  transition: all 200ms ease-in-out;
}

.panel__close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: block;
  padding: 10px;
  cursor: pointer;
}

.panel__close .line {
  position: relative;
  display: inline-block;
  width: 2.5rem;
  height: 0.2rem;
  line-height: 1;
  color: #aaa;
  vertical-align: middle;
  background: currentcolor;
  border-radius: 0.1rem;
  transition: 0.2s;
  transform: rotate(45deg);
}

.panel__close .line::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: '';
  background: inherit;
  border-radius: inherit;
  transform: rotate(90deg);
}

/* stylelint-disable-next-line no-descending-specificity */
.panel__close > span {
  color: #ddd;
}

.panel__container {
  position: relative;
  display: grid;
  grid-template-areas:
    'header'
    'main'
    'footer';
  grid-template-rows: 50px 1fr 20px;
  /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
  grid-template-columns: 1fr;
  grid-gap: 0.5em;
  justify-items: stretch;
}

.panel__container .panel__header {
  grid-area: header;
  padding: 1em;
}

.panel__container .panel__sidebar {
  grid-area: sidebar;
}

.panel__container .panel__content {
  position: relative;
  grid-area: main;
  padding: 1em;
  overflow: hidden;
}

.panel__container .panel__footer {
  grid-area: footer;
}

.panel__container figure {
  width: 100%;
  height: 100%;
}

.panel__container .chart__location {
  width: 100%;
  height: 100%;
}

/**************************
 * Loading bar animation *
 **************************/
.loading-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #fff;
}

.loading-bar.loading::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: inherit;
  content: '';
  background-color: var(--color--rain);
  animation: loading-bar 2500ms linear infinite;
}

@-webkit-keyframes loading-bar {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}

@keyframes loading-bar {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}

@keyframes loading-bar {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}

@keyframes loading-bar {
  0% {
    width: 0;
  }

  100% {
    width: 100%;
  }
}
