:root {
  --c-font: #3C3C43;
  --c-beige30: #FCF8F0;
  --c-grey20: #DEDEDE;
  --c-red: #7F0019;
  --c-red20: #E5CCD1;
  --f-helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

/* ヘッダー 固定リンクを非表示 */
.ie21-header__sub {
  display: none;
}

.glossary {
  background-color: var(--c-beige30);
  padding-top: 180px;
  padding-bottom: 120px;

  @media (min-width: 1127px) {
    padding-top: 200px;
  }

  @media(max-width: 480px) {
    padding-top: 120px;
    padding-bottom: 60px;
  }
}

.glossary__title {
  text-align: center;
}

.glossary__title__text {
  svg {
    display: block;
    height: 32px;
    margin: 0 auto;
    width: 340px;

    @media(max-width: 480px) {
      height: 24px;
      width: 255px;
    }
  }
}

.glossary__title__desc {
  color: var(--c-red);
  font-size: 1.6rem;
  font-weight: 300;
  margin-top: 36px;
  position: relative;
  z-index: 3;

  @media(max-width: 480px) {
    padding: 0 24px;
  }

  br {
    @media (min-width: 481px) {
      display: none;
    }
  }
}

.glossary__content {
  align-items: start;
  display: flex;
  margin: 90px auto 0;
  max-width: 1248px;
  padding: 0 60px;

  @media(max-width: 480px) {
    flex-wrap: wrap;
    margin-top: 40px;
    padding: 0 24px;
  }
}

.glossary__aside {
  position: sticky;
  top: 90px;

  @media (min-width: 1127px) {
    top: 128px;
  }

  @media(max-width: 480px) {
    order: -1;
    z-index: 2;

    &::before{
      background-color: var(--c-beige30);
      border-bottom: 1px solid var(--c-red);
      content: '';
      display: block;
      height: 90px;
      left: calc(100% - 1px);
      pointer-events: none;
      position: absolute;
      top: -89px;
      width: calc(100vw - 48px - 55px);
    }
  }

  @media(max-width: 480px) and (max-height: 615px) {
    height: calc(100vh - 120px);
  }
}

.glossary__aside_bottom {
  @media(max-width: 480px) {
    border-left: 1px solid var(--c-red);
    bottom: 30px;
    height: calc(100vh - 120px - 496px);
    left: 0;
    margin-left: auto;
    position: sticky;
    pointer-events: none;
    width: calc(100vw - 48px - 55px);
    z-index: 1;

    &::after {
      background-color: var(--c-beige30);
      border-top: 1px solid var(--c-red);
      content: '';
      display: block;
      height: 31px;
      left: -1px;
      position: absolute;
      top: calc(100% - 1px);
      width: calc(100% + 1px);
    }

  }
}

.glossary__nav {
  @media(max-width: 480px) and (max-height: 615px) {
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
  }

  li {
    @media (max-width: 480px) {
      scroll-snap-align: start;
    }

    &:not(:first-child) {
      margin-top: 4px;

      @media(max-width: 480px) {
        margin-top: -1px;
      }
    }
  }

  a {
    border: 1px solid var(--c-red20);
    border-radius: 4px;
    color: var(--c-red20);
    display: block;
    font-size: 2rem;
    font-weight: 600;
    padding: 4px;
    text-align: center;
    width: 40px;

    @media(max-width: 480px) {
      border-color: var(--c-red);
      border-radius: 4px 0 0 4px;
      color: var(--c-red);
      font-size: 2.4rem;
      padding: 9px;
      width: 56px;
    }
  }

  a.is-active {
    background-color: var(--c-red);
    border-color: var(--c-red);
    color: var(--c-beige30);
  }
}

.glossary__article {
  flex-grow: 1;
  margin-left: auto;
  margin-right: 56px;
  max-width: 936px;

  @media (max-width: 768px) {
    margin-right: 48px;
  }
  @media(max-width: 480px) {
    margin-right: 0;
  }
}

.glossary__section {
  border-top: 1px solid var(--c-red);
  display: flex;
  padding-top: 24px;
  scroll-margin-top: 90px;

  @media (min-width: 1127px) {
    scroll-margin-top: 128px;
  }

  @media(max-width: 480px) {
    padding-top: 0;
  }

  &:not(:first-child) {
    margin-top: 20px;

    @media (max-width: 480px) {
      margin-top: 0;
    }
  }

  &.is-loading {
    width: 100%;

    &::before {
      display: none;
    }
  }
}

.glossary__section_heading {
  color: var(--c-red);
  font-size: 2.4rem;
  font-weight: 600;
  margin-top: 10px;
  width: 96px;

  @media (max-width: 768px) {
    width: 88px;
  }
  @media (max-width: 480px) {
    display: none;
  }
}

.glossary__list {
  /* column-gap: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr); */
  columns: 3;
  flex-grow: 1;
  gap: 24px;
  position: relative;

  @media (max-width: 768px) {
    columns: 2;
  }
  @media (max-width: 640px) {
    columns: auto;
  }
  @media (max-width: 480px) {
    margin-left: 30px;
  }

  li {
    border-top: 1px solid var(--c-grey20);
    font-size: 1.6rem;
    font-weight: 600;
    padding: 16px 0;

    @media(max-width: 480px) {
      padding: 15px 0;

      &:first-child {
        border-top: none;
      }
    }
  }
}

.glossary__list::before {
  background-color: var(--c-beige30);
  content: "";
  display: block;
  height: 1px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1;

  @media(max-width: 480px) {
    display: none;
  }
}

.is-loading .glossary__list li {
  border-top-color: var(--c-beige30);
  height: 56px;
  position: relative;

  @media(max-width: 480px) {
    height: 55px;
  }

  &::before {
    background-color: var(--c-grey20);
    content: "";
    display: block;
    height: 32px;
    left: 0;
    position: absolute;
    top: calc(50% - 16px);
    width: 100%;
    z-index: 1;

    @media(max-width: 480px) {
      height: 24px;
      top: calc(50% - 12px);
    }
  }
}

.glossary__note {
  border-top: 1px solid var(--c-red);
  font-size: 1.2rem;
  font-weight: 300;
  margin-top: 20px;
  padding-top: 17px;
  text-align: right;

  @media(max-width: 480px) {
    border-top-color: var(--c-grey20);
    margin-top: 0;
    margin-left: 30px;
    padding: 18px 0;
  }
}

.glossary__root-margin-rect {
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
}

.glossary__detail {
  margin: 100px auto 0;
  max-width: 1248px;
  padding: 0 60px;

  @media(max-width: 480px) {
    margin-top: 0;
    padding: 0 24px;
  }
}

.glossary__detail_header {
  align-items: center;
  border-top: 1px solid var(--c-red);
  border-bottom: 1px solid var(--c-red);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  padding-top: 40px;
  padding-bottom: 75px;
  position: relative;

  @media(max-width: 480px) {
    display: block;
    padding: 25px 10px 17px;
  }
}

.glossary__detail_header::before {
  background-color: var(--c-red);
  content: "";
  display: block;
  height: 1px;
  left: 0;
  position: absolute;
  top: 5px;
  width: 100%;
}

.glossary__detail_title {
  font-size: 3.2rem;
  font-weight: 600;

  @media(max-width: 480px) {
    font-size: 2rem;
  }

  &.is-loading {
    grid-column: 1 / 3;
  }
}

.glossary__detail_ruby {
  font-size: 2rem;
  font-weight: 300;
  margin-left: 12px;

  @media(max-width: 480px) {
    font-size: 1.4rem;
  }

  &.is-loading {
    display: none;
  }
}

.glossary__detail_title_en {
  grid-column: 1 / 3;
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 17px;

  @media(max-width: 480px) {
    font-size: 1.2rem;
    margin-top: 50px;
    text-align: right;
  }

  span {
    font-family: var(--f-helvetica);
    font-size: 1.8rem;
    font-weight: 400;

    @media(max-width: 480px) {
      font-size: 1.4rem;
    }
  }
}


.glossary__detail_content {
  font-size: 1.6rem;
  margin: 78px auto 0;
  max-width: 744px;

  @media(max-width: 480px) {
    font-size: 1.4rem;
    margin-top: 35px;
  }

  &.is-loading {
    height: 500px;
    width: 100%;
  }

  p, li{
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1.8;

    @media(max-width: 480px) {
      font-size: 1.4rem;
    }
  }

  p {
    margin-top: 1em;
  }

  img, figure, .wp-caption, iframe, .wp-video {
    margin: 60px 0;
    max-width: 100%;

    @media(max-width: 480px) {
      margin: 30px 0;
    }
  }

  img {
    display: block;
    height: auto;
    max-width: 100%;
  }

  .wp-video {
    margin-left: auto;
    margin-right: auto;
  }

  iframe, video {
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
    height: auto;
    width: 100%;
  }

  figure > img,
  .wp-caption > img {
    margin: 0;
  }

  figcaption,
  .wp-caption-text {
    font-size: 1.2rem;
    font-weight: 300;
    margin-top: 9px;

    @media(max-width: 480px) {
      margin-top: 4px;
    }
  }

  .aligncenter {
    text-align: center;
  }

  img.aligncenter {
    margin-left: auto;
    margin-right: auto;
  }

  a {
    text-decoration: underline;
  }

  h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5em;
  }

  h2 {
    font-size: 2rem;

    @media(max-width: 480px) {
      font-size: 1.8rem;
    }
  }

  h3 {
    font-size: 1.8rem;

    @media(max-width: 480px) {
      font-size: 1.6rem;
    }
  }
}

.glossary__detail_section {
  max-width: 936px;
  margin: 120px auto 0;

  @media(max-width: 480px) {
    margin-top: 50px;
  }

  &.is-hidden {
    display: none;
  }
}

.glossary__detail_heading {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 40px;

  @media(max-width: 480px) {
    font-size: 1.2rem;
    margin-top: 20px;
  }
}

.glossary__feature_list {
  align-items: center;
  border-top: 1px solid var(--c-grey20);
  border-bottom: 1px solid var(--c-grey20);
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  margin-top: 8px;
  padding: 40px 0;

  @media(max-width: 480px) {
    justify-content: flex-start;
    padding: 20px 0;
  }

  &.is-loading {
    height: 105px;
    width: 100%;

    &::before, &::after {
      height: 23px;
      top: 40px;
    }
  }

  li {
    display: none;

    @media(max-width: 480px) {
      flex-shrink: 0;
    }

    &.is-active {
      display: block;
    }
  }

  a {
    font-size: 1.4rem;
    font-weight: 600;

    @media(max-width: 480px) {
      font-size: 1.2rem;
    }
  }

  span {
    border: 1px solid var(--c-font);
    border-radius: 50%;
    display: inline-block;
    font-family: var(--f-helvetica);
    font-weight: 500;
    height: 24px;
    margin-top: -1px;
    margin-right: 8px;
    text-align: center;
    vertical-align: top;
    width: 24px;

    @media(max-width: 480px) {
      padding-top: 2px;
    }
  }
}

.glossary__detail_aside {
  margin-top: 75px;

  a {
    background-color: white;
  }
}

/* 関連するコラム */
.c-thumbnailList {
  margin-top: 30px;
  margin-bottom: -15px;
  overflow-x: scroll;
  padding-bottom: 15px;

  @media(min-width: 1057px) {
    &:has(>ul>li:nth-child(-n+3):last-child) {
      overflow-x: hidden;
    }
  }

  @media(max-width: 1056px) {
    margin-left: -60px;
    margin-right: -60px;
  }

  @media(max-width: 480px) {
    margin-top: 15px;
    margin-left: -24px;
    margin-right: -24px;
    -ms-overflow-style: none;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }
}

.c-thumbnailList__list {
  display: flex;

  &.is-loading {
    height: 413px;
    width: 100%;
  }

  @media(min-width: 1057px) {
    padding: 5px 0;
    margin-left: -7px;
    margin-right: -7px;
  }

  @media(max-width: 1056px) {
    padding: 5px 48px;
  }

  @media(max-width: 480px) {
    padding: 5px 18px;
  }

  &:after {
    content: " ";
    height: 48px;
    width: 48px;
    flex-shrink: 0;

    @media(min-width: 1057px) {
      width: 1px;
    }

    @media(max-width: 480px) {
      width: 18px;
    }
  }
}

.c-thumbnailList__item {
  flex-shrink: 0;
  margin: 0 6px;

  @media(min-width: 481px) {
    margin: 0 12px;
  }

  &:last-child {
    @media(min-width: 1057px) {
      margin-right: 5px;
    }
  }
}


.c-thumbnail {
  background: #FFF;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  height: 100%;
  position: relative;
  width: 264px;

  @media(max-width: 481px) {
    width: 240px;
  }

  a {
    border-radius: 5px;
    display: block;
    height: 100%;
    overflow: hidden;
    text-decoration: none;
  }
}

.c-thumbnail__image {
  height: 264px;

  @media(max-width: 481px) {
    height: 240px;
  }

  img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
  }
}

.c-thumbnail__content {
  display: flex;
  flex-direction: column;
  height: calc(100% - 264px);
  padding: 14px 20px 18px;

  @media(max-width: 481px) {
    height: calc(100% - 240px);
  }

  &:after {
    background-image: url(/renovation/assets/img/icon_blank_light.svg);
    bottom: 20px;
    content: " ";
    height: 16px;
    position: absolute;
    right: 20px;
    width: 16px;
  }
}

.c-thumbnail__title {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: calc(20 / 14);
  margin-bottom: 22px;

  @media(min-width: 481px) {
    font-size: 16px;
  }
}

.c-thumbnail__cat {
  display: block;
  font-size: 1.2rem;
  line-height: 1;
  margin-top: auto;
}

@keyframes skeleton-animation {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.is-loading {
  overflow: hidden;
  position: relative;
  pointer-events: none;
  width: fit-content;

  &::before {
    background-color: var(--c-grey20);
    content: "";
    display: block;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1;
  }
  &::after {
    animation: skeleton-animation 1.2s linear infinite;
    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.25),
      transparent
    );
    content: "";
    display: block;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1;
  }
}

.ie21-footer {
  position: relative;
  z-index: 1;
}