@layer base, components, utilities;

@layer base {
  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: var(--font-main);
    font-size: var(--fz-16);
    line-height: 1.6;
    color: var(--navy);
    font-optical-sizing: auto;
    font-feature-settings: "palt";
    -webkit-font-smoothing: antialiased;
    background: var(--blue-gray) url('../img/bg-border.webp') repeat center top;
    &.menu-open {
      overflow: hidden;
    }
  }
}

@layer components {
  .fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
  .title-section {
    @media (768px <= width) {
      display: flex;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 8px 24px;
    }
    span {
      color: var(--white);
      font-weight: 700;
      display: block;
    }
    .en {
      font-family: var(--font-en);
      display: block;
      line-height: 1;
      font-size: var(--fz-48);
      @media (768px <= width) {
        font-size: var(--fz-72);
      }
    }
    .jp {
      font-size: var(--fz-16);
    }
    + * {
      margin-top: 32px;
    }
  }
  .btn {
    display: block;
    span {
      position: relative;
      color: var(--gold);
      font-size: var(--fz-14);
      font-weight: 800;
      padding: 4px 0;
      display: flex;
      align-items: center;
      width: fit-content;
      &::before {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background: var(--gold);
        transform: scaleX(1);
        transform-origin: right;
        transition: transform .5s var(--ease);
      }
      &::after {
        content: "";
        width: 16px;
        height: 16px;
        background: url('../img/icon-arrow.svg') no-repeat center;
        display: inline-block;
        margin-left: 8px;
        right: 4px;
      }
    }
    &.download {
      span::after {
        content: "";
        width: 16px;
        height: 16px;
        background: url('../img/icon-download.svg') no-repeat center;
        display: inline-block;
        margin-left: 8px;
        right: 4px;
        transition: all .5s var(--ease);
      }
    }
    &:hover {
      span::before {
        transform: scaleX(0);
        transform-origin: right;
      }
    }
    &:not(:hover) {
      span::before {
        transform: scaleX(1);
        transform-origin: left;
      }
    }
  }
  .cols-media-2 {
    display: flex;
    @media (768px <= width) {
      gap: clamp(32px, 4vw, 80px);
    }
    > * {
      margin: 0;
    }
    @media (width < 768px) {
      flex-direction: column;
      gap: 32px;
    }
    .img-area {
      @media (768px <= width) {
        flex: 0 0 40%;
        max-width: 40%;
      }
    }
    .text-area {
      @media (768px <= width) {
        flex: 1 1 0;
        min-width: 0;
      }
    }
  }
  .cols-2 {
    > * {
      margin: 0;
    }
    @media (768px <= width) {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      > *:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        max-width: calc((100% - 24px) / 2);
      }
    }
    @media (width < 768px) {
      display: flex;
      flex-direction: column;
    }
  }
  .cols-3 {
    gap: 24px;
    > * {
      margin: 0;
    }
    @media (768px <= width) {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
    }
    @media (width < 768px) {
      display: flex;
      flex-direction: column;
    }
  }

  header {
    z-index: 100;
    transition: all .5s var(--ease);
    @media (768px <= width) {
      padding: 24px 0;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
    }
    .toggle-btn {
      position: fixed;
      top: 16px;
      right: 16px;
      width: 40px;
      height: 40px;
      border-radius: 40px;
      border: 1px solid var(--gold);
      cursor: pointer;
      z-index: 110;
      @media (768px <= width) {
        display: none;
      }
      span {
        width: 60%;
        height: 1px;
        background: var(--gold);
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        transition: all .5s var(--ease);
        &:nth-child(1) {
          margin-top: -4px;
        }
        &:nth-child(2) {
          margin-top: 4px;
        }
      }
      &.active {
        span {
          margin: 0;
          &:nth-child(1) {
            transform: translate(-50%, -50%) rotate(30deg);
          }
          &:nth-child(2) {
            transform: translate(-50%, -50%) rotate(-30deg);
          }
        }
      }
    }
    nav {
      @media (width < 768px) {
        background: var(--blue-gray) url('../img/bg-border.webp') repeat center top;
        position: fixed;
        inset: 0;
        z-index: 100;
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s var(--ease);
        &.active {
          opacity: 1;
          pointer-events: auto;
        }
      }
      ul {
        display: flex;
        @media (768px <= width) {
          justify-content: center;
          gap: 56px;
        }
        @media (width < 768px) {
          height: 100%;
          flex-direction: column;
          gap: 24px;
          justify-content: center;
          align-items: center;
          padding-bottom: 80px;
        }
      }
      li {
        @media (width < 768px) {
          opacity: 0;
          transform: translateY(20px);
          transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
        }
      }
      a {
        display: block;
        position: relative;
        font-family: var(--font-en);
        color: var(--gold);
        font-size: var(--fz-24);
        font-weight: 700;
        @media (768px <= width) {
          font-size: var(--fz-16);
        }
        &::after {
          content: "";
          position: absolute;
          left: 0;
          bottom: 0;
          width: 100%;
          height: 1px;
          background: var(--gold);
          transform: scaleX(0);
          transform-origin: left center;
          transition: transform .4s var(--ease);
        }
        &:hover {
          &::after {
            transform: scaleX(1);
            transform-origin: left center;
          }
        }
        &:not(:hover)::after {
          transform-origin: right center;
        }
      }
    }
    nav.active {
      @media (width < 768px) {
        li {
          opacity: 1;
          transform: translateY(0);

          &:nth-of-type(1) { transition-delay: 0.25s; }
          &:nth-of-type(2) { transition-delay: 0.3s; }
          &:nth-of-type(3) { transition-delay: 0.35s; }
          &:nth-of-type(4) { transition-delay: 0.4s; }
          &:nth-of-type(5) { transition-delay: 0.45s; }
          &:nth-of-type(6) { transition-delay: 0.5s; }
          &:nth-of-type(7) { transition-delay: 0.55s; }
        }
      }
    }
    &.is-past-mv {
      background: rgba(23, 38, 54, 0.56);
    }
  }
  .mv {
    position: relative;
    .text-area {
      position: absolute;
      width: 100%;
      bottom: 0;
      background: rgba(23, 38, 54, 0.56);
      color: var(--gold);
      font-weight: 700;
      padding: 40px 24px;
      @media (768px <= width) {
        padding: 80px 0;
      }
    }
    h1 {
      font-family: var(--font-en);
      font-size: var(--fz-48);
      line-height: 1.1;
      display: flex;
      gap: 0 .5em;
      justify-content: center;
      @media (768px <= width) {
        font-size: var(--fz-72);
        flex-wrap: wrap;
      }
      @media (width < 768px) {
        flex-direction: column;
        align-items: center;
      }
      span {
        display: block;
        &:last-child {
          flex-basis: 100%;
          text-align: center;
        }
      }
      + * {
        margin-top: 40px;
      }
    }
    p {
      font-size: var(--fz-24);
      @media (768px <= width) {
        text-align: center;
      }
    }
  }
  section {
    overflow-x: hidden;
    .inner {
      max-width: 90%;
      margin-inline: auto;
      @media (768px <= width) {
        padding: 120px 0;
        width: var(--w-site);
      }
      @media (width < 768px) {
        padding: 60px 0;
      }
    }
  }
  #anniversary-90th {
    background: var(--navy);
    color: #fff;
    .outline-box {
      @media (width < 768px) {
        flex-direction: column-reverse;
      }
    }
    .img-area {
      @media (width < 768px) {
        width: 70%;
        margin-inline: auto;
      }
    }
    .text-area {
      p {
        font-size: var(--fz-18);
        font-weight: 700;
        line-height: 2.2;
      }
      .img-box {
        margin-top: 24px;
      }
    }
  }

  #schedule,
  #photo {
    background: var(--gold);
    position: relative;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      width: 530px;
      max-width: 100%;
      height: 100%;
      background: url('../img/bg-logo.webp') no-repeat top right;
      pointer-events: none;
      z-index: 0;
      @media (768px <= width) {
        width: 1060px;
        right: -200px;
      }
      @media (width < 768px) {
        max-width: calc( 110% + 60px );
        background-size: 100% auto;
        right: -60px;
      }
    }
    .inner {
      position: relative;
      z-index: 1;
    }
  }

  #schedule {
    .schedule-list {
      @media (768px <= width) {
        display: grid;
        grid-template-columns: repeat( 3, 1fr);
        gap: 8px;
      }
      @media (width < 768px) {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      li {
        background: #fff;
        padding: 16px clamp(16px, 2vw, 32px);
        display: grid;
        grid-template-columns: 1fr 95px;
        align-items: center;
        gap: 10px;
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);

        &.is-visible {
          opacity: 1;
          transform: translateY(0);
        }
      }
      .detail-box {
        font-weight: 700;
        .date-box {
          font-family: var(--font-en);
          line-height: 1;
        }
        span {
          display: inline-block;
        }
        .date {
          font-size: var(--fz-48);
        }
        .week {
          font-size: var(--fz-12);
          &.sun {
            color: var(--red);
          }
        }
        .time {
          font-size: var(--fz-14);
        }
      }
      .logo-box {
        font-weight: 700;
        .logo-box-inner {
          display: flex;
          align-items: center;
          gap: 8px;
          p {
            font-size: var(--fz-12);
            font-family: var(--font-en);
          }
          img {
            width: 64px;
            height: 64px;
            object-fit: contain;
          }
        }
        .place {
          font-size: var(--fz-14);
          margin-top: 8px;
          text-align: center;
        }
      }
    }
    .ticket-box {
      background: var(--blue-gray);
      margin-top: 64px;
      padding: 40px 24px;
      @media (768px <= width) {
        margin-top: 120px;
        padding: 40px;
        gap: clamp(32px, 4vw, 80px);
      }
      p {
        margin-top: 10px;
        color: var(--gold, #B0A974);
        font-size: var(--fz-16);
        font-weight: 700;
      }
      a {
        transition: all .5s var(--ease);
        &:hover {
          opacity: .6;
        }
      }
      .btn-area {
        @media (width < 768px) {
          margin-top: 24px;
        }
      }
    }
  }

  #goods {
    .scroll-wrap {
      background: var(--navy, #000020);
      padding: 16px 0;
      overflow: hidden;
    }
    .scroll-logo {
      display: flex;
      gap: 24px;
      will-change: transform;
      li {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        @media (width < 768px) {
          width: 100px;
        }
      }
    }
    .goods-area {
      color: var(--white);
      @media (768px <= width) {
        display: flex;
        justify-content: space-between;
      }
      h3 {
        font-size: var(--fz-24);
        font-weight: 800;
      }
      .price {
        margin-top: 24px;
        font-size: var(--fz-24);
        font-weight: 700;
        font-family: var(--font-en);
        .tax {
          font-family: var(--font-main);
          font-size: var(--fz-12);
          margin-left: 4px;
          font-weight: 900;
        }
      }
      .btn {
        @media (768px <= width) {
          margin-top: 40px;
        }
      }
      .img-area {
        @media (width < 768px) {
          margin-top: 32px;
          display: flex;
          flex-direction: column;
        }
      }
    }
  }

  #photo {
    .photo-list {
      display: grid;
      gap: 8px;
      @media (768px <= width) {
        grid-template-columns: repeat( 5, 1fr );
      }
      @media (width < 768px) {
        grid-template-columns: repeat( 3, 1fr );
      }
      dl {
        display: contents;
        > * {
          aspect-ratio: 1 / 1;
          background: var(--blue-gray) url('../img/bg-border.webp') repeat center top;
          opacity: 0;
          transform: translateY(16px);
          transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);

          &.is-visible {
            opacity: 1;
            transform: translateY(0);
          }

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }
        }
        dt {
          color: var(--white);
          font-size: var(--fz-24);
          font-family: var(--font-en);
          font-weight: 700;
          display: flex;
          align-items: center;
          justify-content: center;
          @media (width < 768px) {
            font-size: var(--fz-14);
          }
        }
        dd {
          overflow: hidden;
          a {
            img {
              transition: all 1s var(--ease);
            }
            &:hover {
              img {
                transform: scale(1.1);
              }
            }
          }
        }
      }
    }
  }

  #wallpaper {
    .wallpaper-box {
      position: relative;
    }
    .wallpaper-area {
      gap: 24px;
      @media (768px <= width) {
        gap: clamp(24px, 3vw, 40px)
      }
      @media (width < 768px) {
        display: grid;
        grid-template-columns: 1fr 1fr;
      }
    }
    .wallpaper-box img {
      width: 100%;
      object-fit: cover;
      display: block;
    }
    .download-links {
      margin-top: 8px;
      position: relative;
      z-index: 1;
      @media (768px <= width) {
        display: flex;
        gap: 8px;
      }
    }
  }

  footer {
    .page-top {
      a {
        display: block;
        background: var(--white);
        display: grid;
        place-content: center;
        svg {
          @media (width < 768px) {
            width: 30px;
          }
        }
      }
    }
    .inner {
      background: var(--navy);
      color: var(--gold);
      font-size: var(--fz-12);
      font-weight: 800;
      padding: 16px 0;
      small {
        display: block;
        text-align: center;
      }
    }
  }
}

@layer utilities {
  /* ライトボックス */
  .lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    gap: 16px;
    animation: fadeIn 0.3s ease-in-out;
    backdrop-filter: blur(4px);

    &.active {
      display: flex;
    }
  }

  .lightbox-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: scaleIn 0.3s ease-in-out;
  }

  .lightbox-content {
    position: relative;
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;

    img {
      width: auto;
      height: auto;
      max-width: 80vw;
      max-height: 80vh;
      object-fit: contain;
      display: block;
    }
  }

  .lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--white);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;

    &:hover {
      opacity: 0.7;
    }
  }

  .lightbox-prev,
  .lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 12px 16px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    height: 60px;
    width: 60px;
    flex-shrink: 0;
    @media (width < 768px) {
      padding: 8px;
      height: 60px;
      width: 32px;
    }
    &:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.4);
    }
    &:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
  }

  .lightbox-counter {
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: var(--fz-12);
    font-weight: 700;
    text-align: center;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes scaleIn {
    from {
      transform: scale(0.9);
      opacity: 0;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }

  @media (768px <= width) {
    .sp { display: none !important; }
  }
  @media (width < 768px) {
    .pc { display: none !important; }
  }
}
