/* ===================
ベース
====================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 50px;
  /* ダブルタップによる拡大防止 */
  touch-action: manipulation;
}

body {
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  /* overflow-x: clip; */
}

a {
  transition: opacity .3s;

  @media (any-hover: hover) {
    &:hover {
      opacity: .7;
    }
  }
}

/* ===================
共通
====================== */
section {
  overflow: clip;
}

/* コンテンツ高さ */
.wp-site-blocks {
  display: flex !important;
  flex-direction: column;
  min-height: 100svh;

  &> :has(+ footer) {
    margin-block-end: auto;
  }
}

/* フッター */
footer.wp-block-template-part {
  margin-block-start: 0;
}

/* パンくずリスト */
.wp-block-breadcrumbs li,
.wp-block-breadcrumbs ol {
  display: inline;
}

/* ===================
ブレイクポイント変更
====================== */
/* デフォルト無効化. */
@media (min-width: 600px) {
  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none;
  }

  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
}

/* 新しいブレークポイント設定. */
@media (min-width: 1080px) {
  .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    background-color: inherit;
    display: block;
    position: relative;
    width: 100%;
    z-index: auto;
  }

  .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: none;
  }
}

/* ===================
ヘッダー
====================== */
/* お問い合わせボタン（PC） */
@media (min-width: 1080px) {
  header .wp-block-navigation-item:last-child a {
    padding: .75em 1em;
    color: #fff !important;
    background-color: var(--wp--preset--color--accent);
  }
}

/* 固定 */
header.wp-block-template-part {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  left: 0;
  z-index: 100;
}

/* ナビリンク */
header .wp-block-navigation .wp-block-navigation-item__content {
  min-height: 44px;
  place-content: center;
}

/* ===================
ホーム
====================== */
/* ヒーロー */
.hero h1 span {
  display: inline-block;
}

@media (min-width: 1080px) {
  .hero h1 {
    scale: 1.333;
    transform-origin: left;
  }
}

/* プロフィール画像 */
.profile-media .wp-block-image {
  position: relative;

  &::before {
    position: absolute;
    content: '';
    background-color: #e3e5e9ff;
    inset: 0;
    transform: translate(10%, 7%);
    z-index: -1;
  }
}

.profile-media {
  container-type: inline-size;
  position: relative;

  & .profile-name-en {
    position: absolute;
    right: 10%;
    top: 0;
    white-space: nowrap;
    writing-mode: vertical-lr;
    font-size: 12cqw;
    right: -7%;
    color: #1f1f1f;
    mix-blend-mode: difference;
  }
}

/* プロフィールテーブル */
.profile-table td {
  padding-inline: 0;
  padding-block: .25em;

  &:first-child {
    width: 6.5em;
    vertical-align: top;
    padding-inline-end: .5em;
    white-space: nowrap;
  }
}

/* インスタセクション */
.instagram-subtitle {
  position: absolute;
  top: -.9em;
  white-space: nowrap;
}

/* サイン画像 */
.message-cover .wp-block-cover__inner-container {
  mix-blend-mode: screen;
}

/* スポンサーロゴ */
.sponsor {

  & .wp-block-gallery {
    justify-content: center;
  }

  & .wp-block-image {
    width: 100% !important;
    max-width: 112px !important;
    max-height: 56px !important;
    flex-direction: row !important;
    align-items: stretch !important;
    margin: 0 !important;

    @media (min-width: 600px) {
      & {
        max-width: 120px !important;
        max-height: 64px !important;
      }
    }
  }

  & img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }
}

/* ===================
お問い合わせページ
====================== */
/* 項目間の余白 */
.smf-form--simple-table .smf-item {
  margin-bottom: 16px;
}

/* ラベルの位置調整_PC */
@media (min-width: 640px) {
  .smf-form--simple-table .smf-item__col--label {
    padding-top: 8px;
  }
}

/* 必須ラベル */
.smf-item:has([data-validations~="required"]) .smf-item__label::after {
  content: "必須";
  display: inline-block;
  padding: 4px 8px;
  color: var(--wp--preset--color--white);
  background-color: var(--wp--preset--color--accent);
  font-size: .8em;
  font-weight: 700;
  line-height: 1;
  margin-left: 1em;
  border-radius: 4px;
}

/* 入力欄 */
.smf-form .smf-item .smf-text-control__control,
.smf-form .smf-item .smf-textarea-control__control {
  background-color: var(--wp--preset--color--off-white);
}

.smf-form .smf-text-control__control {
  padding: 1em;
}

.smf-form ::placeholder {
  color: #aaa;
}

/* 個人情報保護方針リンク */
.smf-item__controls a {
  color: var(--_color-text);
  text-decoration: underline;
}

/* 送信ボタン */
.snow-monkey-form .smf-button-control__control {
  background-color: var(--wp--preset--color--accent);
  background-image: none;
  color: var(--wp--preset--color--white);
  transition: opacity .3s;

  @media (any-hover: hover) {
    &:hover {
      opacity: .7;
    }
  }

  &:focus-visible {
    outline: 2px solid #2563eb !important;
    outline-offset: 2px;
  }
}

/* ===================
投稿
====================== */
/* カテゴリラベル */
.taxonomy-category a {
  border-radius: 99rem;
  border: 1px solid;
  padding: .25em .5em;
  text-decoration: none;
}

/* ===================
アーカイブページ
====================== */
/* 投稿リスト */
.simple-post-list article {
  grid-template-columns: auto;

  @media (min-width: 780px) {
    & {
      grid-template-columns: auto 1fr;
    }
  }
}

/* 投稿リストのクリック領域 */
.simple-post-list .wp-block-post {
  position: relative;
  transition: background-color .3s;

  & a::after {
    content: '';
    position: absolute;
    inset: 0;
  }

  @media (any-hover: hover) {
    &:hover {
      background-color: var(--wp--preset--color--off-white);
    }

    & a {
      opacity: 1;
    }
  }
}

/* ページネーション */
.wp-block-query-pagination {
  gap: .5em 1em;
}

.page-numbers {
  margin-inline: 2px;
  padding: 2px 12px;

  &.dots {
    margin-inline: 0;
    padding-inline: 0;
  }

  &.current {
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--off-white);
  }
}

/* ===================
アニメーション
====================== */
/*  パララックス（ブロックスタイルで選択可能）
---------------------- */
@keyframes parallax {
  from {
    translate: 0 calc(var(--translate) * -1);
  }

  to {
    /* 少し上側を表示(高さが足りなくなるため大きくし過ぎない) */
    translate: 0 calc(var(--translate) / 3);
  }
}

@supports (animation-timeline: view()) {
  .is-style-parallax .wp-block-cover__image-background {
    --translate: 150px;
    block-size: calc(100% + var(--translate));
    animation: parallax linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
}

/*  フェードイン（要素の親にクラスを指定する）
---------------------- */
/* 親:画面に入ったら --in-view を true にするスイッチ */
@keyframes in-view {
  from {
    --in-view: false;
  }

  to {
    --in-view: true;
  }
}

/* 子:実際の動き */
@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    translate: 0 30px;
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .fade-in {
      animation: in-view linear both;
      animation-timeline: view(block 0 10%);
      animation-range: entry 0% entry 1%;
    }

    .fade-in>* {
      /* --delayは個別指定 */
      animation: fade-in 1s ease var(--delay, 0s) both;
      animation-play-state: paused;
    }

    .fade-in.up>* {
      animation-name: fade-in-up;
    }

    @container style(--in-view: true) {
      .fade-in>* {
        animation-play-state: running;
      }
    }
  }
}