/* Yossy Tools — footer (sitewide) */

.yt-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(115deg, #e8f4ff 0%, #d9edfc 62%, #d0e9f9 100%);
  border-top: 1px solid #c3ddef;
  padding: 46px 36px 30px; /* 左右はヘッダー（yt-header.css）と揃える */
}

.yt-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image:
    linear-gradient(90deg, #9fc8e4 1px, transparent 1px),
    linear-gradient(#9fc8e4 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(90deg, transparent 45%, #000 100%);
}

.yt-footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  /* 右下固定（右は切らない）。幅を大きくして左だけはみ出す */
  right: 0;
  bottom: 0;
  top: auto;
  left: auto;
  width: min(1400px, 125%);
  height: clamp(200px, 42vw, 320px);
  pointer-events: none;
  background: url("../assets/yt-home/footer-voxel-scenery.webp") right bottom / auto 100% no-repeat;
  opacity: 0.92;
  /* 上部を長くフェードして地色へなじませる */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 12%,
    rgba(0, 0, 0, 0.2) 32%,
    rgba(0, 0, 0, 0.55) 48%,
    rgba(0, 0, 0, 0.85) 62%,
    #000 78%,
    #000 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 12%,
    rgba(0, 0, 0, 0.2) 32%,
    rgba(0, 0, 0, 0.55) 48%,
    rgba(0, 0, 0, 0.85) 62%,
    #000 78%,
    #000 100%
  );
}

.yt-footer-inner {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 30px;
  min-height: 160px;
}

.yt-footer-inner > div {
  min-width: 0;
}

.yt-footer-inner strong {
  font-size: 19px;
}

.yt-footer-inner p {
  max-width: 430px;
  font-size: 13px;
  line-height: 1.8;
  margin: 7px 0;
}

.yt-footer nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 13px;
  width: auto;
  max-width: none;
  margin-left: auto;
  text-align: right;
}

.yt-footer nav a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  line-height: 1.55;
  color: #1b3a5a;
  text-decoration: none;
  white-space: nowrap;
}


.yt-footer-triangle {
  display: inline-block;
  flex: none;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #28739f;
}

.yt-footer-bottom {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 42px 0 0;
  border-top: 1px solid #d0e0ed;
  padding-top: 17px;
  font-size: 12px;
  color: #62748a;
  text-align: left;
}

@media (max-width: 1024px) {
  .yt-footer {
    padding-inline: 22px;
  }

  .yt-footer::after {
    width: min(1200px, 135%);
    right: 0;
    bottom: 0;
    height: clamp(180px, 38vw, 260px);
    opacity: 0.85;
  }
}

@media (max-width: 768px) {
  .yt-footer::after {
    width: 165%;
    max-width: none;
    right: 0;
    left: auto;
    bottom: 0;
    height: 220px;
    opacity: 0.78;
    background-size: auto 100%;
    background-position: right bottom;
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 10%,
      rgba(0, 0, 0, 0.18) 30%,
      rgba(0, 0, 0, 0.5) 46%,
      rgba(0, 0, 0, 0.82) 62%,
      #000 78%,
      #000 100%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 10%,
      rgba(0, 0, 0, 0.18) 30%,
      rgba(0, 0, 0, 0.5) 46%,
      rgba(0, 0, 0, 0.82) 62%,
      #000 78%,
      #000 100%
    );
  }

  .yt-footer {
    padding: 36px 17px 30px;
  }

  .yt-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-height: 0;
  }

  .yt-footer nav {
    align-items: flex-end;
    margin-left: auto;
    text-align: right;
  }

  .yt-footer-bottom {
    margin-top: 38px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .yt-footer::after {
    opacity: 0.35;
  }
}

/* —— ページ先頭へ戻るボタン（右下固定）
 * 表示/非表示はスクロール量に連動する CSS だけで制御（JS なし）。
 * 非対応ブラウザでは常に表示。移動は html の scroll-behavior: smooth（yt-header.css）。 */
.yt-totop {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #1b5f8c;
  background: #fff;
  border: 2px solid #b5d9f0;
  border-radius: 50%;
  box-shadow: 3px 4px 0 #b6dff073, 0 8px 18px #1d5b8720;
  text-decoration: none;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.yt-totop svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.yt-totop:hover,
.yt-totop:focus-visible {
  color: #0b1b3b;
  background: #ffce0b;
  border-color: #ffce0b;
  transform: translateY(-4px);
  box-shadow: 3px 8px 0 #ffce0b55, 0 14px 22px #1d5b8726;
}

.yt-totop:hover svg,
.yt-totop:focus-visible svg {
  translate: 0 -2px;
}

.yt-totop:active {
  transform: translateY(-1px) scale(0.94);
  transition-duration: 0.12s;
}

.yt-totop:focus-visible {
  outline: 3px solid #0b1b3b;
  outline-offset: 3px;
}

@supports (animation-timeline: scroll()) {
  .yt-totop {
    animation: yt-totop-in linear both;
    animation-timeline: scroll(root block);
    animation-range: 220px 360px;
  }
}

@keyframes yt-totop-in {
  from {
    opacity: 0;
    visibility: hidden;
    translate: 0 16px;
    scale: 0.8;
  }

  to {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    scale: 1;
  }
}

@media (max-width: 768px) {
  .yt-totop {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .yt-totop,
  .yt-totop svg {
    transition: none;
  }

  .yt-totop:hover,
  .yt-totop:focus-visible,
  .yt-totop:active {
    transform: none;
  }

  .yt-totop:hover svg,
  .yt-totop:focus-visible svg {
    translate: none;
  }
}

@media print {
  .yt-totop {
    display: none;
  }
}
