/*全体のCSS*/

:root {
   --bg-color: #111119;
    --tx-color: #f9f9f9;
    --link-color: #07ff79;
  --gr-color: linear-gradient(80deg, #9082f8, #f6c6ff 25%, #8be3fa 65%, #8db2f9 77%, #e2afec 99%);
}

@view-transition {
  navigation: auto;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--link-color);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

body {
  background-color: var(--bg-color);
  color: var(--tx-color);
  font-family: -apple-system, BlinkMacSystemFont, YuGothic, YuGothic Medium, Yu Gothic Medium, メイリオ, Meiryo, sans-serif;
  line-height: 1.8;
  overflow-wrap: break-word;
  font-feature-settings: "palt";
  letter-spacing: .04em;
  font-size: 0.8rem;
  font-weight: 400;
  margin: 40px;
  padding: 0;
}

.layout {
  display: grid;
  grid-template-columns: 2fr 5fr 2fr;
  grid-template-areas:
    "header main aside";
  gap: 24px;
  position: relative;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

header {
  grid-area: header;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  font-size: 12px;
  position: fixed;
  width: 100%;
  max-width: calc((100vw - 88px) * 2 / 9);
  overflow: hidden;
  box-sizing: border-box;
}

header a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

header a:hover {
  color: var(--link-color);
  transition: .2s ease;
}

.site-title {
  font-size: 1.2rem;
  color: var(--white);
  font-style: italic;
}

iframe {
  margin-top: 8px;
  height: 100px;
}

.nav-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-list {
  width: 100%;
  box-sizing: border-box;
}

.link-list ul {
  padding-left: 3px;
}

.link-list li {
  border-left: solid 1px var(--tx-color);
  padding-left: 1rem;
  position: relative;
}

.link-item {
  display: block;
  width: 100%;
  text-decoration: none;
}

.link-item:hover::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: -3px;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: var(--link-color);
}

.copyright {
  font-size: 10px;
  opacity: .7;
}

/* 右の目次エリア */

aside {
  grid-area: aside;
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: calc((100vw - 88px) * 2 / 9);
  overflow: hidden;
  box-sizing: border-box;
  
}

.tocWrap {
  position: fixed;
}

.tocWrap ul {
  padding-left: 3px;
  display: flex;
  flex-direction: column-reverse;
}

li.toc {
  list-style: none;
  cursor: pointer;
  padding-bottom: 8px;
  transition: color .2s;
  border-left: solid 1px var(--tx-color);
  padding-left: 1rem;
  position: relative;
  box-sizing: border-box;
}

li.toc:hover:not(.active)::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: -3px;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: var(--tx-color);
  transition: .3s ease;
}

li.toc.active {
  color: var(--link-color);
}

li.toc.active:before {
  content: '';
  position: absolute;
  top: 0.5rem;
  left: -3px;
  border-radius: 50%;
  width: 5px;
  height: 5px;
  background: var(--link-color);
}

/* main（真ん中エリア） */
main {
  grid-area: main;
  overflow-y: auto;
  width: 100%;
  max-width: calc((100vw - 88px) * 5 / 9);
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column-reverse;
  gap: 56px;
}

main img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.c-ttl, .c-img-1, .c-img-4 img, .c-caption {
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);

  opacity: 0;
  transform: translateY(13%);
  transition: opacity 0.8s var(--ease-out-cubic),
              transform 0.8s var(--ease-out-quint);
}

.c-ttl.isActive, .c-img-1.isActive, .c-img-4 img.isActive, .c-caption.isActive {
  opacity: 1;
  transform: translateY(0);
}

.c-ttl {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .1em;
}

#date {
  font-size: 10px;
  margin-bottom: 24px;
  font-weight: 400;
  opacity: .7;
}

/*画像が偶数の時は2列*/
.c-img-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /*direction: rtl;*/
  gap: 24px 8px;
}

/*画像が1枚の時は1列*/
.c-img-1 {
  width: 50%;
  height: auto;
}

.c-caption {
  margin-top: 24px;
}

@media screen and (max-width: 920px) {
  .layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  header {
    position: relative;
    width: 100%;
    max-width: 100%;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid;
    margin-bottom: 24px;
  }

  main {
    width: 100%;
    max-width: 100%;
  }

  .c-ttl {
    font-size: 18px;
  }

  #date {
    font-size: 10px;
    display: block;
  }

  .c-img-4 {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .c-img-1 {
    width: 100%;
    float: inherit;
    margin: 0;
  }

  aside {
    display: none;
  }
}