@charset "utf-8";

:root {
  --header-height: 56px;
}

.invisible,
.loaded .loading,
.loaded .loading-img {
  visibility: hidden;
  opacity: 0;
}

header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--brand-bg);
  color: var(--brand-text);
  transition: all 0.5s;
  border-bottom: 1px solid var(--gray1);
  display: flex;
  align-items: center;
  gap: 32px;
  padding-inline: 16px;

  @media (width < 960px) {
    z-index: 0;
  }

  @media (960px <= width) {
    z-index: 30;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-icon {
  height: calc(var(--header-height) / 1.5);
  aspect-ratio: 1 / 1;
}

.logo-text {
  font-size: 28px;
  line-height: calc(var(--header-height) - 1px);
}

.loading {
  display: flex;
  align-items: center;
  transition: inherit;
  gap: 0.5rem;
}

.loading-icon {
  width: 1.414rem;
  height: 1.414rem;
  border: calc(1rem / 6) solid var(--brand-text);
  border-right: calc(1rem / 6) solid transparent;
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

main {
  @media (width < 960px) {
    padding-bottom: 55px;
  }

  @media (960px <= width) {
    margin-top: var(--header-height);
    margin-bottom: 84px;
    display: grid;
    align-items: start;
    grid-template-rows: calc((100vw / 2.414 - 24px) / 16 * 9) auto;
    grid-template-columns: 1fr 1.414fr;
    padding: 16px;
    gap: 16px;
  }
}

.youtube {
  position: sticky;
  z-index: 10;

  @media (width < 960px) {
    top: 0;
    margin-top: var(--header-height);
  }

  @media (960px <= width) {
    top: 72px;
    grid-row: 1 / 2;
    grid-column: 1 / 2;
  }
}

.player,
.loading-img {
  width: 100%;

  @media (width < 960px) {
    height: min(56.25dvw, 43dvh);
  }

  @media (960px <= width) {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

.loading-img {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #f9faef;
  transition: 0.7s;
  object-fit: contain;
}

.message {
  @media (width < 640px) {
    margin: 1.5rem;
  }

  @media (640px <= width < 960px) {
    margin: 1.5rem 10%;
  }

  @media (960px <= width) {
    grid-row: 2 / 3;
    grid-column: 1 / 2;
    position: sticky;
    top: calc(88px + ((100vw / 2.414 - 24px) / 16 * 9));
  }
}

summary {
  font-size: 1.414rem;
  font-weight: bold;
  cursor: pointer;
}

.lead {
  text-align: justify;
}

.lead-link {
  &:hover,
  &:focus {
    text-decoration: none;
    background-image: linear-gradient(transparent 80%, var(--brand-color) 80%);
  }
}

.song-table {
  @media (960px <= width) {
    grid-row: 1 / 3;
    grid-column: 2 / 3;
    overflow: hidden;
  }
}

.search {
  position: relative;
  transition: all 0.5s;
  border-radius: 6px;
  background-color: var(--main-bg);

  @media (width < 640px) {
    margin: 1.5rem;
  }

  @media (640px <= width < 960px) {
    margin: 1.5rem 10%;
  }

  @media (960px <= width) {
    width: min(100vw / 2.414 * 1.414 - 40px, 640px);
    margin-top: 8px;
    position: fixed;
    top: 0;
    z-index: 30;
  }

  &:where(*:not(.loaded *)) {
    background-color: var(--gray1);
    cursor: wait;
  }
}

.search-input {
  border-radius: 6px;
  border-width: 1px;
  border-style: solid;

  @media (width < 960px) {
    padding: 8px 45px;
    width: 100%;
    height: 45px;
    border-color: var(--gray2);
  }

  @media (960px <= width) {
    padding: 8px 40px;
    width: 100%;
    height: 40px;
    background-color: inherit;
    border-color: var(--gray1);

    &:where(.search:focus-within > *),
    &:has(~ .search-option:hover) {
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }
  }

  &:disabled {
    cursor: wait;
  }
}

.search-icon {
  position: absolute;
  top: 0;
  display: grid;
  place-content: center;

  @media (width < 960px) {
    width: 45px;
    height: 45px;
  }

  @media (960px <= width) {
    width: 40px;
    height: 40px;
  }
}

.search-loupe {
  left: 0;
}

.search-clear {
  right: 0;
}

.search-option {
  padding: 1rem;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: baseline;

  @media (width < 960px) {
    border: 1px solid var(--gray2);
    border-top: 0;
  }

  @media (960px <= width) {
    background-color: var(--main-bg);
    box-shadow: 0px 10px 16px -6px var(--gray2);
    visibility: hidden;
    position: absolute;

    &:where(.search:focus-within > *),
    &:hover {
      visibility: visible;
      border-top: 1px solid var(--gray1);
    }
  }
}

.search-option-share {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  background-color: #0f1419;
  height: 2rem;
  line-height: 2rem;
  border-radius: 1rem;
  padding-inline: 1rem;
  font-size: 0.8rem;
  border: 1px solid var(--gray1);

  &::after {
    margin-left: 0.5rem;
    vertical-align: top;
    content: attr(title);
  }
}

.search-option-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.search-option-label {
  white-space: nowrap;
}

.table-information {
  @media (width < 640px) {
    margin: 1.5rem;
  }

  @media (640px <= width < 960px) {
    margin: 1.5rem 10%;
  }

  @media (960px <= width) {
    margin-inline: 0.5rem;
  }
}

.table-information-number {
  padding: 0 0.25rem;
}

.tracks {
  margin-top: 1rem;
}

.track {
  height: 56px;
  padding-inline: 1.5rem;
  display: grid;
  grid-template-columns: auto max-content max-content;
  align-items: center;
  gap: 0.75rem;
  color: var(--gray3);
  font-size: 0.875rem;

  &:hover {
    background-color: var(--gray0);
  }

  @media (640px <= width) {
    grid-template-columns: 1.414fr 1fr max-content;
  }

  @media (960px <= width) {
    padding-inline: 0.5rem;
    border-radius: 8px;
  }

  &.current {
    background-color: var(--gray1);
  }
}

.track-button {
  display: grid;
  grid-template-columns: min-content auto;
  align-items: center;
  gap: 0.5rem;
  text-align: unset;
  order: 1;
}

.track-button-video-thumb {
  object-fit: cover;
  width: 45px;
  height: 56px;
  clip-path: inset(7px 0);
}

.track-button-info {
  display: grid;
}

.track-button-info-text,
.track-videoinfo-text {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.track-button-info-title {
  color: var(--main-text);
  font-size: 1rem;
}

.track-duration {
  order: 2;

  @media (640px <= width) {
    order: 3;
  }
}

.track-videoinfo {
  display: grid;
  order: 3;

  @media (640px <= width) {
    order: 2;
  }
}

.track-videoinfo-ytlink {
  color: inherit;

  @media (width < 640px) {
    text-decoration: none;
    width: 1.5rem;
    display: grid;
    justify-content: end;
    border-left: 1px solid var(--gray2);

    &::before {
      content: "\f167";
      font-family: "Font Awesome 6 Brands";
    }
  }

  @media (640px <= width) {
    &::before {
      content: attr(title);
    }
  }
}

.track-videoinfo-postdate {
  @media (width < 640px) {
    display: none;
  }
}

address {
  font-style: normal;
  font-size: 0.7rem;

  @media (width < 640px) {
    margin: 1.5rem;
  }

  @media (640px <= width < 960px) {
    margin: 1.5rem 10%;
  }

  @media (960px <= width) {
    margin-top: 1rem;
  }
}

.to-page-top {
  position: absolute;
  right: 0;
  width: 54px;
  height: 54px;
  margin: 1rem;
  background: var(--brand-color);
  border-radius: 50%;
  transition: all 0.3s;
  box-shadow: 0px 0px 5px 3px var(--gray1);
  display: grid;
  place-content: center;

  @media (width < 960px) {
    bottom: 55px;
  }

  @media (960px <= width) {
    bottom: 84px;
  }
}

.to-page-top .fa-chevron-up {
  font-size: 1.4em;
  color: var(--white);
}

.playing-bar {
  position: fixed;
  bottom: 0;
  background-color: var(--main-bg);
  width: 100%;
  display: grid;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);

  @media (width < 960px) {
    grid-template-columns: auto min-content min-content;
    height: 55px;
    border-top: 1px solid var(--gray1);
  }

  @media (960px <= width) {
    grid-template-columns: 1fr 2fr;
    height: 84px;
    padding: 4px 16px 0;
  }
}

.playing-bar-information {
  display: grid;
  grid-template-columns: min-content auto;
  align-items: center;
  gap: 1rem;
}

.playing-bar-thumb-button {
  display: flex;
}

.playing-bar-thumb-button-img {
  object-fit: cover;
  width: 96px;
  height: 54px;
}

.playing-bar-text {
  display: grid;
}

.playing-bar-text-top,
.playing-bar-text-bottom,
.playing-bar-song-title,
.playing-bar-artist {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.playing-bar-text-top {
  @media (width < 960px) {
    display: grid;
  }

  @media (960px <= width) {
    display: flex;
  }
}

.playing-bar-song-title {
  @media (960px <= width) {
    flex: 0 1 max-content;
  }
}

.playing-bar-artist {
  @media (width < 960px) {
    color: var(--gray3);
    font-size: 0.875rem;
  }

  @media (960px <= width) {
    flex: 0 1 max-content;

    &::before {
      content: "/";
      margin-inline: 0.5rem;
    }
  }
}

.playing-bar-text-bottom {
  color: var(--gray3);
  font-size: 0.875rem;

  @media (width < 960px) {
    display: none;
  }
}

.playing-bar-post-date {
  &::after {
    content: "配信";
    margin-left: 0.25em;
  }
}

.playing-bar-video-title {
  &::before {
    content: "・";
  }
}

.playing-bar-button {
  width: 54px;
  display: grid;
  place-content: center;
  place-items: center;

  @media (960px <= width) {
    display: none;
  }
}

@media (width < 960px) {
  .playing-bar-status {
    font-size: 16px;
  }

  .menu-btn {
    font-size: 10px;
  }

  .menu-btn[aria-expanded="true"] .menu-btn-open,
  .menu-btn-close {
    display: none;
  }

  .menu-btn[aria-expanded="true"] .menu-btn-close {
    display: block;
  }

  .menu-btn li {
    display: block;
    height: 2px;
    width: 27px;
    margin: 5px 0;
    background-color: var(--main-text);
    transition: all 0.4s;
  }

  .menu-btn[aria-expanded="true"] li:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-btn[aria-expanded="true"] li:nth-child(2) {
    opacity: 0;
  }

  .menu-btn[aria-expanded="true"] li:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

.menu-content {
  @media (width < 960px) {
    display: flex;
    width: 100%;
    position: fixed;
    left: 100%;
    bottom: 55px;
    transition: all 0.5s;
    opacity: 0;
    flex-direction: column-reverse;

    &:where(.open-nav *) {
      left: 0;
      opacity: 1;
    }
  }

  @media (960px <= width) {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
  }
}

.menu-controller {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: calc(16px * 1.414);

  @media (width < 960px) {
    padding: 6px 24px;
    background-color: var(--main-bg);
  }
}

.menu-controller-button {
  display: grid;
  place-content: center;
  position: relative;
  width: 45px;
  height: 45px;
}

.to-hide {
  display: none !important;
}

.menu-controller-repeat-text {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 16px;
  background-color: var(--main-text);
  font-size: 10px;
  font-weight: bold;
  display: grid;
  place-content: center;
  bottom: 5px;
  right: 2px;
  border: 2px solid var(--main-bg);
  color: var(--main-bg);

  &:where(.disabled *) {
    background-color: var(--gray2);
  }
}

.disabled {
  color: var(--gray2);
}

.menu-controller-status {
  font-size: 2em;
  width: 60px;
  height: 60px;
}

.menu-time {
  @media (width < 960px) {
    background-color: var(--main-bg);
    padding: 12px 24px 0;
    border-top: 1px solid var(--gray1);
  }

  @media (960px <= width) {
    display: flex;
    align-items: center;
  }
}

.menu-time-seek-bar {
  height: 5px;
  width: 100%;
  background-color: var(--gray1);
  cursor: pointer;

  @media (960px <= width) {
    height: 4px;
    position: absolute;
    left: 0;
    top: 0;
  }
}

.menu-time-seek-bar::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--gray3);
  cursor: pointer;
  border: none;
  display: block;
  border-radius: 50%;
}

/* ↑まとめると適用されない↓ */

.menu-time-seek-bar::-moz-range-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  background-color: var(--gray3);
  cursor: pointer;
  border: none;
  display: block;
  border-radius: 50%;
}

.menu-time-text {
  color: var(--gray3);

  @media (width < 960px) {
    display: flex;
    justify-content: space-between;
  }
}

@media (960px <= width) {
  .menu-time-text-whole::before {
    content: "/";
    margin: 0 0.5rem;
  }
}

.menu-share {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  list-style: none;

  @media (960px <= width) {
    align-items: center;
    gap: 1rem;
  }
}

.menu-share-item {
  height: 45px;
  line-height: 45px;
  text-align: center;

  @media (960px <= width) {
    aspect-ratio: 1 / 1;
  }
}

.icon {
  display: block;
  color: #fff;
  text-decoration: none;

  @media (width < 960px) {
    padding: 0 20px;

    &::after {
      margin-left: 8px;
      font-weight: 700;
      vertical-align: top;
      content: attr(title);
    }
  }

  @media (960px <= width) {
    border-radius: 5px;
  }

  &::before {
    font-size: 16px;
  }
}

.icon-twitter {
  background: #55acee;
}
