/* base */
html {
  scroll-behavior: smooth;
}

.journal {
  --color-red: #f00;
  --font-bold: "UD新ゴM", "UD Shin Go Medium", sans-serif;
}

/* screen reader */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* components */
.c-button {
  display: block;
  width: 100%;
  padding: .8em 1em .7em;
  border: none;
  border-block: 1px solid #333;
  background: none;
  font: inherit;
  font-family: var(--font-bold);
  font-weight: bold;
  color: #fff;
  cursor: pointer;

  @media (width >=640px) {
    font-size: 1.25rem;
    padding: 1em 1em .9em;
  }

  @media (width >=1000px) {
    transition: .3s;

    &:hover {
      color: var(--color-red);
    }
  }
}

.c-button__text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75em;

  &::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background: currentColor;
    mask: url(../images/icon_chevron.svg) no-repeat center center/cover;
    transform: translateY(-5%) rotate(90deg);
    transition: transform .15s ease;
  }
}

.c-title--bordered {
  margin-bottom: min(4vw, 2em);
  padding-bottom: .1em;
  border-bottom: 1px solid var(--color-red);
  color: var(--color-red);
  font-size: clamp(.8em, 3vw, 1rem);
  font-family: var(--font-bold);
  font-weight: bold;
}

.c-section {
  width: 90vw;
  max-width: 1000px;
  margin-inline: auto;
}

.c-article {
  container: article / inline-size;
  width: 90vw;
  max-width: 800px;
  margin-inline: auto;
  color: #fff;
}

.c-article-gutter {
  padding-block: 6vw;

  @media (width >=640px) {
    padding-block: 4vw;
  }

  @media (width >=1000px) {
    padding-block: 3vw;
  }
}


/* page header */
.journal-page-header {
  position: relative;
  display: block;
  text-decoration: none;
  background: #1c1c1c url(../images/bg_journal_title_sp.webp) no-repeat center top/cover;
  height: auto;
  aspect-ratio: 1180 / 520;
  overflow: hidden;

  @media (width >=640px) {
    aspect-ratio: 4 / 1;
  }

  @media (width >=1000px) {
    background-image: none;
    aspect-ratio: unset;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 50%;
      width: 100%;
      min-width: 1400px;
      height: 100%;
      background: url(../images/bg_journal_title_pc.webp) no-repeat right center/auto 100%;
      transform: translateX(-50%);
    }
  }

  .journal-page-header__title {
    position: absolute;
    bottom: 10vw;
    left: 10vw;
    width: 40vw;

    @media (width >=640px) {
      bottom: 5vw;
      left: 5vw;
      width: 30vw;
    }

    @media (width >=1000px) {
      position: relative;
      inset: unset;
      display: flex;
      align-items: center;
      width: 1000px;
      height: 200px;
      margin-inline: auto;
      padding-inline: 90px;
    }

    img {
      width: 100%;
      height: auto;

      @media (width >=1000px) {
        width: 230px;
      }
    }
  }

  body.--article & {
    background: #1c1c1c url(../images/bg_journal_title_narrow.webp) no-repeat center center/cover;
    aspect-ratio: 1180 / 250;

    @media (width >=768px) {
      aspect-ratio: 1180 / 200;
    }

    @media (width >=1000px) {
      aspect-ratio: unset;
      background-image: none;

      &::before {
        background: url(../images/bg_journal_title_pc.webp) no-repeat right center/auto 200px;
        transform: translateX(-50%);
      }
    }

    .journal-page-header__title {
      bottom: 5vw;
      left: 5vw;
      width: 30vw;

      @media (width >=640px) {
        bottom: 5vw;
        left: 5vw;
        width: 25vw;
      }

      @media (width >=1000px) {
        inset: unset;
        display: flex;
        align-items: center;
        width: 1000px;
        height: 100px;
        padding-inline: 90px;
      }

      img {
        @media (width >=1000px) {
          width: 170px;
        }
      }
    }
  }
}


/* category selector */
.journal-category {
  --current-color: #666;

  position: relative;
  z-index: 100;
  width: 100%;

  &.is-open .journal-category__button {
    background-color: #333;
    border-bottom-color: #484848;
  }

  &.is-open .journal-category__button-text {
    &::after {
      transform: translateY(-10%) rotate(-90deg);
    }
  }

  .journal-category__list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    background-color: #333;
    height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: height .3s ease-in-out, opacity .3s ease, padding .3s ease, visibility .3s;

    a {
      display: block;
      width: 90vw;
      max-width: 860px;
      margin-inline: auto;
      padding: .75rem 1rem;
      text-align: left;
      color: #fff;
      text-decoration: none;
      border-radius: .5rem;
      cursor: pointer;
      transition: .3s;

      &:hover {
        color: var(--color-red);
        background-color: #484848;
      }
    }
  }

  &.is-open .journal-category__list {
    opacity: 1;
    visibility: visible;
  }

  .--category-all & .as-all,
  .--category-pcm & .as-pcm,
  .--category-pca & .as-pca,
  .--category-fdj & .as-fdj,
  .--category-gr86brz & .as-gr86brz,
  .--category-product & .as-product,
  .--category-impression & .as-impression,
  .--category-others & .as-others {
    color: var(--current-color);
  }
}


/* journal list */
.journal-list {
  container: list / inline-size;

  .journal-list__title {
    padding: 5vw 0;
    text-align: center;
    color: #777;
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    font-family: var(--font-bold);
    font-weight: bold;

    @media (width >=640px) {
      padding: 4vw 0;
    }
  }

  .journal-list__inner {
    display: grid;
    gap: 7vw;
    width: 90vw;
    max-width: 1300px;
    margin-inline: auto;

    @media (width >=640px) {
      grid-template-columns: repeat(2, 1fr);
      gap: 3vw;
    }

    @media (width >=1000px) {
      grid-template-columns: repeat(3, 1fr);
      gap: min(40px, 3cqw);
    }
  }

  .journal-list__item {
    container: card / inline-size;
  }

  .journal-list__item-link {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: 6cqw;
    text-decoration: none;
    color: #fff;
    background: #1c1c1c;
    border-radius: .5rem;
    overflow: hidden;

    .journal-list__item-image {
      position: relative;
      width: 100%;
      height: auto;
      aspect-ratio: 3 / 2;
      overflow: hidden;

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: .3s;
      }

      &::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        width: 100%;
        height: 40%;
        background: linear-gradient(transparent, #1c1c1c);
      }
    }

    @media (width >=1000px) {
      &:hover .journal-list__item-image {
        img {
          transform: scale(1.05);
        }
      }
    }

    .journal-list__item-content {
      padding: 5cqw;
      margin-bottom: 1cqw;
    }

    .journal-list__item-category {
      padding: .25rem .5rem;
      margin-bottom: 5cqw;
      width: fit-content;
      background-color: #666;
      border-radius: .3rem;
      color: #000;
      line-height: 1.2;
      font-size: 3.5cqw;
      font-family: var(--font-bold);
      font-weight: bold;
    }

    .journal-list__item-title {
      margin-bottom: 2cqw;
      line-height: 1.4;
      font-size: 6cqw;
      font-family: var(--font-bold);
      font-weight: bold;

      @media (width >=640px) {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
      }
    }

    .journal-list__item-date {
      display: block;
      margin-bottom: 4cqw;
      color: var(--color-red);
      font-size: 3.2cqw;
      font-family: var(--font-bold);
      font-weight: bold;
    }

    .journal-list__item-description {
      line-height: 1.8;
      font-size: 3.2cqw;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      overflow: hidden;
    }

    .journal-list__item-readmore {
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      width: fit-content;
      margin-top: auto;
      margin-inline: auto;
      padding: .5rem 1rem;
      background-color: #fff;
      border-radius: 3em;
      color: #000;
      line-height: 1.2;
      font-size: 3.4cqw;
      font-family: var(--font-bold);
      font-weight: bold;
      transition: .3s;

      &::after {
        content: '';
        display: block;
        width: .8em;
        height: .8em;
        background-color: currentColor;
        mask: url(../images/icon_chevron.svg) no-repeat center center/cover;
        transform: translateX(60%);
        transition: .3s;
      }
    }

    @media (width >=1000px) {
      &:hover .journal-list__item-readmore {
        background-color: var(--color-red);

        &::after {
          transform: translateX(80%);
        }
      }
    }
  }

  .journal-list__loadmore {
    margin-top: 10vw;

    @media (width >=640px) {
      margin-top: 5vw;
    }
  }

  /* recommend */
  &.--recommend {
    .journal-list__inner {
      width: 100%;
      max-width: unset;

      @media (width < 1000px) {
        gap: 3vw;
      }
    }

    .journal-list__item-link {
      @media (width <=640px) {
        flex-direction: row;
        align-items: flex-start;
        gap: 4cqw;
        padding: 4cqw;
        padding-right: 10cqw;

        &::after {
          content: '';
          position: absolute;
          right: 3cqw;
          top: 50%;
          transform: translateY(-50%);
          width: 3.8cqw;
          height: auto;
          aspect-ratio: 1 / 1;
          background-color: currentColor;
          mask: url(../images/icon_chevron_circle.svg) no-repeat center center/cover;
        }

        .journal-list__item-image {
          width: 29cqw;
          flex-shrink: 0;
          aspect-ratio: 1 / 1;

          &::after {
            content: none;
          }

          img {
            border-radius: .3rem;
          }
        }

        .journal-list__item-content {
          padding: 0;
          margin-bottom: 0;
        }

        .journal-list__item-category {
          font-size: 2.8cqw;
          padding: .175rem .4rem .125rem;
          border-radius: .3em;
          margin-bottom: 4cqw;
        }

        .journal-list__item-title {
          font-size: 3.8cqw;
          line-height: 1.5;
          margin-bottom: 3.5cqw;
        }

        .journal-list__item-date {
          display: none;
        }

        .journal-list__item-description {
          font-size: 2.8cqw;
          line-height: 1.5;
          color: #ccc;
        }

        .journal-list__item-readmore {
          display: none;
        }
      }
    }
  }
}

/* article header */
.journal-article-header {
  background-color: #1c1c1c;
  margin-bottom: 6vw;

  @media (width >=640px) {
    margin-bottom: 4vw;
  }

  @media (width >=1000px) {
    margin-bottom: 3vw;
  }

  .journal-article-header__meta {
    padding-block: 8cqw;

    @media (width >=640px) {
      padding-block: 3cqw;
    }
  }

  .journal-article-header__category {
    padding: .25em .5em;
    margin-bottom: 5cqw;
    width: fit-content;
    background-color: #666;
    border-radius: .3em;
    color: #000;
    line-height: 1.2;
    font-size: min(3.5cqw, 1.25rem);
    font-family: var(--font-bold);
    font-weight: bold;

    @media (width >=640px) {
      margin-bottom: 3cqw;
    }
  }

  .journal-article-header__title {
    margin-bottom: 2cqw;
    font-size: min(6.2cqw, 2.5rem);
    font-family: var(--font-bold);
    font-weight: bold;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .journal-article-header__date {
    display: block;
    color: var(--color-red);
    font-size: min(3.2cqw, 1.2rem);
    font-family: var(--font-bold);
    font-weight: bold;
  }

  .journal-article-header__image {
    position: relative;
    width: 100%;
    height: auto;

    img {
      width: 100%;
      height: auto;
    }

    &::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      width: 100%;
      height: 40%;
      background: linear-gradient(transparent, #1c1c1c);
    }
  }

  .journal-article-header__lead {
    padding-block: 8cqw;
    line-height: 1.8;
    font-size: min(3.8cqw, 1.25rem);

    @media (width >=640px) {
      padding-block: 3cqw 6cqw;
    }
  }
}

/* toc */
.journal-article-toc {

  .journal-article-toc__list {
    display: grid;
    gap: 4cqw;

    @media (width >=640px) {
      gap: 3cqw;
    }

    a {
      position: relative;
      display: block;
      word-break: keep-all;
      overflow-wrap: anywhere;
      text-decoration: none;
      color: #fff;
      transition: .3s;
      padding-right: 1.75em;
      font-size: min(3.8cqw, 1.25rem);

      &::before {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%) rotate(90deg);
        flex-shrink: 0;
        display: block;
        margin-left: auto;
        width: 1em;
        height: 1em;
        background-color: currentColor;
        mask: url(../images/icon_chevron_circle.svg) no-repeat center center/cover;
        transition: .3s;
      }

      &:hover {
        color: var(--color-red);
      }

    }
  }
}

/* article image */
.journal-article-image {
  width: 90vw;
  max-width: 1200px;
  margin: 0 auto;

  img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: .5rem;
  }

  .journal-article-image__caption {
    margin-top: min(2cqw, .75em);
    color: #999;
    font-size: min(2.8cqw, .875rem);
  }

  &.--portrait {
    max-width: 100%;
    width: fit-content;

    img {
      width: auto;
      height: 85vh;
    }
  }
}

/* article section */
.journal-article-section {
  scroll-margin-top: 3rem;
}

/* article content */
.journal-article-content {

  p {
    line-height: 1.8;
    font-size: min(4cqw, 1.125rem);

    &:not(:first-child) {
      margin-top: 1.5em;
    }
  }

  .journal-article-content__title {
    scroll-margin-top: 3rem;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.5;
    font-size: min(6.2cqw, 1.8rem);
    font-family: var(--font-bold);
    font-weight: bold;
  }

  .journal-article-content__quote {
    position: relative;
    background-color: #1c1c1c;
    border-radius: .5rem;
    padding: min(15cqw, 6rem) 5cqw min(15cqw, 6rem);
    font-family: serif;
    font-style: italic;
    font-weight: 300;

    &:not(:first-child) {
      margin-top: min(10cqw, 3rem);
    }

    &::before,
    &::after {
      content: '';
      position: absolute;
      z-index: 0;
      width: 10cqw;
      height: auto;
      aspect-ratio: 1 / 1;
      background-color: #333;
      mask: url(../images/icon_quote.svg) no-repeat center center/cover;
    }

    &::before {
      top: min(4cqw, 1rem);
      left: min(4cqw, 1.5rem);
    }

    &::after {
      bottom: min(4cqw, 1rem);
      right: min(4cqw, 1.5rem);
      transform: rotate(180deg);
    }

    > :first-child {
      margin-top: 0;
    }

    p {
      position: relative;
      z-index: 1;
      font-size: min(5cqw, 1.25rem);
      max-width: 600px;
      margin-inline: auto;
      line-height: 1.9;
    }
  }
}

/* gallery */
.journal-gallery {
  .journal-gallery__inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;

    @media (width >=640px) {
      grid-template-columns: repeat(4, 1fr);
      gap: 2px;
    }

    @media (width >=1000px) {
      grid-template-columns: repeat(5, 1fr);
    }
  }

  .journal-gallery__button {
    border: 0;
    margin: 0;
    padding: 0;
    background: none;
    cursor: pointer;

    img {
      width: 100%;
      height: auto;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      border-radius: .4rem;
      transition: opacity .3s;
    }

    &:hover img {
      opacity: .66;
    }
  }
}

/* journal archives */
.journal-archives {
  width: 90vw;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8vw 0 12vw;

  @media (width >=640px) {
    padding: 3vw 0 5vw;
  }

  @media (width >=1000px) {
    padding: 60px 0;
  }

  .journal-archive__list {
    display: grid;
    gap: 3vw;

    @media (width >=640px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (width >=1000px) {
      gap: 40px;
    }
  }

  .journal-archive__item {
    container: banner / inline-size;
  }

  .journal-archive__item-link {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1060 / 300;
    text-decoration: none;
    color: #fff;
    font-size: 4cqw;
    font-family: var(--font-bold);
    font-weight: bold;
    background: #1c1c1c url() no-repeat center bottom/cover;
    border-radius: .5rem;
    overflow: hidden;

    &.--fdj2025 {
      background-image: url(../images/archive_fdj_2025.webp);
    }

    &.--fdj2024 {
      background-image: url(../images/archive_fdj_2024.webp);
    }

    &.--gr86brz2024 {
      background-image: url(../images/archive_gr86brz_2024.webp);
    }

    &.--gr86brz2023 {
      background-image: url(../images/archive_gr86brz_2023.webp);
    }

    &::before {
      content: '';
      position: absolute;
      inset: 0;
      z-index: 0;
      background-color: color-mix(in srgb, transparent, #000 50%);
    }

    >span {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      width: 100%;
      height: 100%;
      transition: .3s;
    }

    @media (width >=1000px) {
      &:hover>span {
        background-color: color-mix(in srgb, transparent, var(--color-red) 15%);
        backdrop-filter: blur(2px);
      }
    }
  }
}


/* related */
.journal-related {

  .journal-related__list {
    display: grid;
    gap: 3vw;

    @media (width >=640px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (width >=1000px) {
      gap: 40px;
    }
  }

  .journal-related__item {
    container: related / inline-size;
  }

  .journal-related__item-link {
    position: relative;
    z-index: 0;
    display: grid;
    grid-template-columns: 35% 1fr;
    height: 100%;
    gap: 5cqw;
    padding: 6cqw 5cqw;
    text-decoration: none;
    color: #fff;
    background-image: linear-gradient(0deg, #000 0%, #1c1c1c 100%);
    border-radius: .5rem;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      z-index: -1;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-image: linear-gradient(0deg, #000 0%, var(--color-red) 100%);
      opacity: 0;
      transition: .3s;
      pointer-events: none;
    }

    @media (width >=1000px) {
      &:hover::before {
        opacity: .2;
      }
    }

    .journal-related__item-image {
      img {
        width: 100%;
        height: auto;
      }
    }

    .journal-related__item-content {
      display: flex;
      flex-direction: column;
      gap: 4cqw;
      height: 100%;

      .journal-related__item-title {
        width: 48cqw;

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

      .journal-related__item-description {
        line-height: 1.7;
        font-size: 3.3cqw;
      }

      .journal-related__item-readmore {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: fit-content;
        margin-top: auto;
        padding: .5rem 1rem;
        background-color: #fff;
        border-radius: 3em;
        color: #000;
        line-height: 1.2;
        font-size: min(3.4cqw, .875rem);
        font-family: var(--font-bold);
        font-weight: bold;
        transition: .3s;

        &::after {
          content: '';
          display: block;
          width: .8em;
          height: .8em;
          background-color: currentColor;
          mask: url(../images/icon_chevron.svg) no-repeat center center/cover;
          transform: translateX(60%);
          transition: .3s;
        }
      }
    }

    @media (width >=1000px) {
      &:hover .journal-related__item-readmore {
        background-color: var(--color-red);

        &::after {
          transform: translateX(80%);
        }
      }
    }
  }
}