@import url(/SRC/css/global/fonts.css);
@import url(/SRC/css/global/variables.css);
@import url(/SRC/css/element/btn-audio.css);
@import url(/SRC/css/element/btn-switch.css);

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

::-webkit-scrollbar {
  width: 2px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: light-dark(rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.3));
  border-radius: 2px;
  &:hover {
    background: light-dark(rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.5));
  }
}

::selection {
  background-color: var(--c-text);
  color: var(--c-page);
}

:focus-visible {
  outline: 2px solid orange;
  transition: outline 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background-color: var(--c-page);
  color: var(--c-text);
  font-size: var(--font-size);
  line-height: var(--line-height);
  padding: 10px;

  scrollbar-color: light-dark(rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.3))
    transparent;
  scrollbar-width: thin;
}

body {
  margin-inline: auto;
  max-inline-size: var(--page-width);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  ul {
    color: var(--c-text-d);
    font: var(--font-mono);
    list-style: none;

    *::selection {
      background-color: var(--c-text-d);
      color: var(--c-page);
    }

    &::before,
    &::after {
      content: "---";
    }

    li + li {
      margin-top: 1px;
    }
  }
}

header menu {
  padding: 0;
  display: flex;
  position: fixed;
  align-items: center;
  gap: 10px;
  top: 8.5px;
  right: 15px;
}

header ul li mark {
  background-color: oklch(from var(--tag-color) l c h / 0.15);
  border-radius: 999px;
  color: var(--tag-color) !important;
  line-height: var(--line-height);
  margin-inline: -0.25ch;
  cursor: pointer;
  padding: 0 0.5ch;

  &:first-of-type {
    margin-inline-start: -0.5ch;
  }

  & a::selection {
    color: var(--tag-color);
    background-color: oklch(from var(--tag-color) l c h / 0.2);
  }

  &:is(#adventure, #vampire, #psycho, ) {
    --tag-color: hsl(0, 75%, 50%);
  }
  &:is() {
    --tag-color: hsl(33, 75%, 50%);
  }
  &:is() {
    --tag-color: hsl(58, 75%, 50%);
  }
  &:is(#sci-fi, ) {
    --tag-color: hsl(129, 80%, 35%);
  }
  &:is(#poetry, #ballad, ) {
    --tag-color: hsl(208, 80%, 50%);
  }
  &:is(#fantasy, ) {
    --tag-color: hsl(257, 100%, 65%);
  }
  &:is(#horror, #dark-fantasy, ) {
    --tag-color: hsl(277, 80%, 50%);
  }

  a {
    color: var(--tag-color);
    padding: 0 0.5ch;
    text-decoration: none;

    &:hover {
      color: oklch(from var(--tag-color) 70% c h);
    }

    &:active {
      color: oklch(from var(--tag-color) 40% c h);
    }
  }
}

header ul li:not(:has(mark)) a,
review-reminder a {
  color: var(--c-text-a);
  text-decoration: none;

  &::selection {
    color: light-dark(
      hsl(from var(--c-text-a) h s l),
      hsl(from var(--c-text-a) h 100% calc(l - 25))
    );
  }

  &:hover,
  &:hover::selection {
    text-decoration: underline 1.2px;
    color: var(--c-text-a-hov);
  }

  &:active,
  &:active::selection {
    color: var(--c-text-a-act);
  }
}

img {
  margin-block: 1rem 0;
  max-width: 100%;

  &[src=""] {
    display: none;
  }
}

h1 {
  background-color: var(--c-page);
  box-sizing: content-box;
  font-size: clamp(1rem, 8vw, 2rem);
  font-weight: normal;
  letter-spacing: 0.18em;
  line-height: 0.8;
  margin-block: clamp(1rem, 8vw, 1.5rem);
  margin-left: -10px;
  padding: 15px 10px 7px 10px;
  position: sticky;
  text-align: center;
  text-transform: uppercase;
  top: 0;
  width: 100%;
}

article {
  p + p {
    text-indent: 1.5em;
  }

  p,
  blockquote {
    hyphens: auto;
    line-break: auto;
    text-align: justify;
    word-break: normal;

    &:first-of-type::first-letter {
      float: left;
      font-size: 2em;
      font-weight: bold;
      margin-right: 0.1em;
    }
  }

  blockquote {
    margin-bottom: 25px;
    margin-left: clamp(5px, 20%, 100px);
    text-align: left;
  }

  p-center {
    margin-left: 20%;
  }

  poetry-block {
    display: block;
    margin-inline: auto;
    width: fit-content;

    p {
      line-height: 2;
      margin-block: 20px;
      text-align: left;
      text-indent: 0;
    }
  }
}

hr {
  border: none;
  margin: 1em 0;
  position: relative;
  text-align: center;

  &::before {
    color: var(--c-text-d);
    content: "* * *";
    font-size: 1em;
    letter-spacing: 1em;
  }
}

footer {
  border-top: 1.5px dashed var(--c-text-d);
  color: var(--c-text-d);
  font: var(--font-mono);
  margin-block: 40% 0;
  padding-block: 15px;
  text-align: center;

  *::selection {
    background-color: var(--c-text-d);
    color: var(--c-page);
  }

  a:not(review-reminder a) {
    white-space: nowrap;
    color: light-dark(orangered, orange);
    text-decoration: none;

    &::selection {
      color: light-dark(orange, orangered);
    }

    &:hover,
    &:hover::selection {
      color: light-dark(orange, orangered);
      text-decoration: underline 1.2px;
      text-underline-offset: 2px;
    }

    &:active,
    &:active::selection {
      color: light-dark(orange, orangered);
      text-decoration: underline 1.2px;
      text-underline-offset: 2px;
    }
  }
}

img[src="/SRC/asset/svg/rss.svg"],
img[src="/SRC/asset/svg/ng.svg"] {
  display: inline-block;
  padding: 1px;
  padding-right: 5px;
  user-select: none;
  transform: translateY(4px);
}

@media (max-width: 500px) {
  article blockquote {
    margin-left: 15px;
  }
}

ul {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-left: 20px;
}

a {
  border-radius: 5px;
}

@media (min-width: 600px) {
  header menu {
    z-index: 99;
  }
}
