/* 既存の文字・罫線・余白を引き継ぎ、メッセージ入りロゴを追加する。 */
.footer .footer__logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
}

.footer .footer__logo img {
  display: block;
  width: 100%;
  height: auto;
}

.footer .footer__logo:focus-visible {
  outline: 2px solid #082057;
  outline-offset: 4px;
}

@media (min-width: 768px) {
  /* 縦並びでも画面全体を基準に中央揃えする。 */
  .footer.footer--with-floating {
    padding-right: 40px;
    /* ページ最下部で固定バナー2枚（約154px）+ 下端20px + 間隔24pxを確保。 */
    padding-bottom: 200px;
  }

  .footer .footer-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  /* タブレットもSPと同じ「リンク → ロゴ → コピーライト」の順にする。 */
  .footer .footer__logo {
    order: 0;
    flex: none;
    margin: 2rem auto 0;
  }

  .footer .footer-list {
    flex: none;
    min-width: 0;
    max-width: 100%;
    justify-content: flex-start;
    margin: 0;
  }

  .footer .footer__copyright {
    flex: none;
    min-width: 0;
    max-width: 100%;
    margin: 1rem 0 0;
    overflow-wrap: break-word;
  }

  .footer .footer__page-top-wrapper {
    display: none;
  }
}

@media (min-width: 1440px) {
  /* 横並びは右列でバナーを避けられるため、通常の下余白に戻す。 */
  .footer.footer--with-floating {
    padding-bottom: 13px;
  }

  .footer .footer-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px minmax(0, 1fr);
    grid-template-areas:
      "links logo ."
      "copyright copyright copyright";
    align-items: center;
    gap: 12px 24px;
  }

  .footer .footer__logo {
    grid-area: logo;
    justify-self: center;
    margin: 0;
  }

  .footer .footer-list {
    grid-area: links;
    justify-self: start;
  }

  .footer .footer__copyright {
    grid-area: copyright;
    justify-self: center;
    margin: 0;
  }

  /* 中央揃えを維持し、コピーライトも固定バナーの左24pxまでに収める。 */
  .footer.footer--with-floating .footer__copyright {
    max-width: calc(100% - 568px);
  }
}
