/*
 * common.css
 * 基本設定 / ヘッダーとナビゲーション / 共通の表示アニメーション / SNSの案内と追従ボタン / 事務所案内とフッター
 * 各項目内に通常表示と、画面幅・動きに応じた調整をまとめています。
 */

/* ==================================================
   基本設定
   ================================================== */

@font-face {
  font-family: 'Noto Sans JP';
  src: url('assets/fonts/noto-sans-jp-400.f5a3e474e5be.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans JP';
  src: url('assets/fonts/noto-sans-jp-700.d538e19fcd04.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans JP';
  src: url('assets/fonts/noto-sans-jp-900.c457c470157e.woff2') format('woff2');
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

:root {
  /* 共通の横幅・見出しサイズ */
  --content-width: 92%;
  --content-max-width: 1600px;
  --section-heading-size: clamp(26px, 3vw, 44px);
  --section-heading-enter-duration: 520ms;
  /* 書体 */
  --hero-font: 'Noto Sans JP', sans-serif;
  --label-font: Arial, sans-serif;
  --section-font: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  /* 共通の色 */
  --navy-rgb: 0 51 153;
  --navy: rgb(var(--navy-rgb));
  --accent-blue: #2490e0;
  --accent-green: #99cc33;
  --divider-color: #c7c7c7;
  --page-background: #f3faff;
  /* 画面幅とヘッダーに連動する寸法 */
  --mobile-unit: max(1vw, 3.2px);
  --wind-blue-light: #f1f8fd;
  --wind-blue-dark: #208edf;
  --site-header-height: 84px;
  --page-scroll-padding-top: 100px;
}

html {
  background: #fffdf9;
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  scroll-padding-top: var(--page-scroll-padding-top);
}

img {
  display: block;
  max-width: 100%;
}

h3,
p {
  margin-top: 0;
}

* {
  box-sizing: border-box;
}

body {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.03em;
  margin: 0;
  min-width: 320px;
  color: var(--navy);
  background: var(--page-background);
  font-family: sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #f39800;
  outline-offset: 4px;
}

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

.skip-link {
  position: fixed;
  left: 15px;
  top: -100px;
  background: #fff;
  padding: 12px;
  z-index: 100;
}

.skip-link:focus {
  top: 10px;
}

.section-inner {
  width: var(--content-width);
  max-width: var(--content-max-width);
  margin-inline: auto;
}

/* 高さの低い画面の調整 */
@media (max-width: 767.98px), (max-width: 1023.98px) and (orientation: portrait), (max-width: 1023.98px) and (max-height: 600px) and (pointer: coarse) {
  :root {
    --site-header-height: 44px;
  }
}

/* 端末で「動きを減らす」が有効な場合 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==================================================
   ヘッダーとナビゲーション
   ================================================== */

.site-header a {
  border-radius: 4px;
}

.hbm-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.hbm-btn span {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.hbm-btn span:nth-child(1) {
  top: 14px;
}

.hbm-btn span:nth-child(2) {
  top: 21px;
}

.hbm-btn span:nth-child(3) {
  top: 28px;
}

.hbm-btn[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hbm-btn[aria-expanded='true'] span:nth-child(2) {
  transform: scaleX(0);
  opacity: 0;
}

.hbm-btn[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hbm-menu {
  margin: 0;
}

.hbm-menu a {
  line-height: 1;
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  width: 100%;
  height: var(--site-header-height);
  padding: 0 64px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: transparent;
  color: #fff;
  transition: background 0.3s,
    box-shadow 0.3s;
  font-family: var(--hero-font);
}

.site-header .site-title {
  color: var(--navy);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 46px;
}

.site-header .desktop-nav a {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  color: inherit;
  padding: 8px 0;
  letter-spacing: 0;
}

.desktop-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.site-header .hbm-btn {
  display: none;
}

.site-header .hbm-menu {
  display: none;
}

.site-header.is-stuck {
  position: fixed;
  background: rgb(255 255 255 / 97%);
  color: var(--navy);
  box-shadow: 0 3px 20px rgb(var(--navy-rgb) / 8%);
  animation: header-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes header-in {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.menu-open {
  overflow: hidden;
}

.menu-open :is(main, .site-footer)[aria-hidden='true'] {
  pointer-events: none;
}

/* マウス操作時の表示 */
@media (hover: hover) {
  .hbm-menu a:hover {
    background: #f2f2f4;
  }
}

/* パソコンの調整 */
@media (min-width: 1280px) {
  .site-header {
    --header-height-adjustment: clamp(0px, (100svh - 600px) * 0.08, 24px);
    --header-width-adjustment: clamp(0px, (100vw - 1280px) * 0.0453125, 29px);
    padding-inline: calc(64px - var(--header-height-adjustment) + var(--header-width-adjustment));
  }
}

/* 横向きタブレット・低い画面の調整 */
@media (min-width: 768px) and (max-width: 1023.98px) and (orientation: landscape) {
  .site-header {
    padding-inline: 32px;
  }
}

/* スマホ・タブレットの調整 */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .desktop-nav {
    gap: 24px;
  }
  .site-header .desktop-nav a {
    font-size: 14px;
  }
  .site-header .site-title {
    font-size: 22px;
  }
}

/* 高さの低い画面の調整 */
@media (max-width: 767.98px), (max-width: 1023.98px) and (orientation: portrait), (max-width: 1023.98px) and (max-height: 600px) and (pointer: coarse) {
  .site-header {
    padding: 0 0 0 16px;
    transition: none;
  }
  .site-header.is-stuck {
    animation: none;
  }
  .site-header .site-title {
    font-size: 16px;
    font-weight: 900;
    position: relative;
    z-index: 2;
  }
  .desktop-nav {
    display: none;
  }
  .site-header .hbm-btn {
    display: block;
    flex: none;
    border-radius: 0;
    width: 44px;
    height: 44px;
    margin: 0;
    color: #fff;
    z-index: 2;
  }
  .site-header.is-menu-open .hbm-btn,
  .site-header.is-stuck .hbm-btn {
    color: var(--navy);
  }
  .site-header .hbm-menu {
    flex-direction: column;
    overflow: auto;
    color: var(--navy);
    z-index: 1;
    border: 0;
    position: fixed;
    top: var(--site-header-height);
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 0;
    max-height: none;
    height: auto;
    /* vhとsvhの順で、ブラウザに合う表示領域の単位を適用。 */
  padding: clamp(32px, 7vh, 72px) 28px 48px;
    padding: clamp(32px, 7svh, 72px) 28px 48px;
    background: transparent;
    box-shadow: none;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
  .site-header .hbm-menu.is-open {
    display: flex;
  }
  .site-header .hbm-menu a {
    display: block;
    color: var(--navy);
    border-bottom: 1px solid rgb(var(--navy-rgb) / 14%);
    text-decoration: none;
    font-weight: 700;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 22px 0;
    font-size: 22px;
  }
  .site-header.is-menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgb(248 252 255 / 97%);
  }
  .site-header.is-menu-open {
    color: var(--navy);
    position: fixed;
    z-index: 100;
    background: transparent;
    box-shadow: none;
    animation: none;
    transform: none;
  }
}

/* 端末で「動きを減らす」が有効な場合 */
@media (prefers-reduced-motion: reduce) {
  .site-header {
    transition: none !important;
    animation: none !important;
  }
  .site-header::before {
    transition: none !important;
  }
}

/* 横向きタブレット・低い画面の調整 */
@media (min-width: 768px) and (max-width: 1023.98px) and (orientation: landscape) {
  .desktop-nav {
    gap: 16px;
  }
  .site-header .desktop-nav a {
    font-size: 13px;
    white-space: nowrap;
  }
  .site-header .site-title {
    font-size: 20px;
  }
}

/* スマホ・タブレットの調整 */
@media (max-width: 319.98px) {
  .site-header:not(.is-stuck):not(.is-menu-open) {
    min-width: 320px;
  }
}

/* ==================================================
   共通の表示アニメーション
   ================================================== */

@keyframes section-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 通常のアニメーション */
@media (prefers-reduced-motion: no-preference) {
  h2.is-awaiting-reveal {
    opacity: 0;
  }
  h2.is-revealed {
    animation: section-enter var(--section-heading-enter-duration) cubic-bezier(0.2, 0.7, 0.25, 1)
      both;
  }
}

/* 印刷時の表示 */
@media print {
  .is-awaiting-reveal,
  .is-revealed,
  .goal-list > li {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ==================================================
   SNSの案内と追従ボタン
   ================================================== */

.sns-section {
  padding-block-end: clamp(56px, 7.4vw, 96px);
  background: #fff;
  color: #333;
  text-align: center;
  font: 500 16px/1.8 var(--section-font);
}

.sns-section > .section-inner {
  padding-block-start: clamp(48px, 5.8vw, 80px);
  border-block-start: 1px solid var(--divider-color);
}

.sns-section h2 {
  margin: 0;
  color: var(--navy);
  font-size: var(--section-heading-size);
  line-height: 1.25;
  text-wrap: balance;
}

.sns-section h2 small {
  font-size: 0.8em;
}

.sns-heading-phrase {
  white-space: nowrap;
}

.sns-heading-label {
  display: block;
  margin-block-end: 12px;
  color: var(--accent-blue);
  font: 700 16px/1.2 var(--label-font);
}

.sns-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 32px);
  margin: clamp(32px, 5.5vw, 70px) 0 0;
  padding: 0;
  list-style: none;
}

.sns-icons a,
.sns-feature a {
  display: inline-grid;
  place-items: center;
  min-height: 52px;
  text-decoration: none;
}

.sns-icons a {
  width: 52px;
}

.sns-section img {
  display: block;
  width: auto;
  height: auto;
}

.sns-icons img {
  max-width: 45px;
  max-height: 45px;
}

.sns-features {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 800px;
  margin: clamp(36px, 5.2vw, 66px) auto 0;
}

.sns-features::before {
  position: absolute;
  inset-block-start: 5px;
  inset-inline-start: 50%;
  height: 128px;
  border-inline-start: 1px solid #ccc;
  content: "";
}

.sns-feature {
  padding-inline: 16px;
}

.sns-feature--note img {
  width: 140px;
}

.sns-feature--youtube img {
  width: 180px;
}

.sns-feature p {
  margin: 24px 0 0;
}

.sns-section a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}

.floating-sns {
  position: fixed;
  z-index: 10;
  inset-inline-end: 0;
  inset-block-end: 20px;
  display: flex;
  align-items: center;
  width: 90px;
  height: 70px;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 11px 0 0 11px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(var(--navy-rgb) / 12%);
  transition: width 240ms ease, opacity 280ms ease, visibility 0s;
}

.floating-sns.is-suppressed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition-delay: 0s, 0s, 280ms;
}

.floating-sns:has(.floating-sns-toggle[aria-expanded="true"]) {
  width: 320px;
}

.floating-sns-toggle {
  position: relative;
  z-index: 1;
  align-self: stretch;
  flex: 0 0 82px;
  padding: 0 22px 0 7px;
  border: 0;
  border-radius: 7px 0 0 7px;
  overflow: hidden;
  background: linear-gradient(45deg, var(--accent-blue), #93c93f);
  color: #fff;
  text-align: start;
  font: 700 12px/1.35 var(--section-font);
  cursor: pointer;
}

.floating-sns-pattern {
  position: absolute;
  inset-block-start: 2px;
  inset-inline-end: 0;
  color: rgb(29 113 107 / 42%);
}

.floating-sns-label {
  position: relative;
}

.floating-sns-arrow {
  position: absolute;
  inset-inline-end: -19px;
  inset-block-start: 50%;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-blue);
  transform: translateY(-50%);
}

.floating-sns-arrow::before {
  width: 6px;
  height: 6px;
  margin-inline-end: 15px;
  border: solid currentColor;
  border-width: 0 0 1px 1px;
  content: "";
  transform: translateX(1px) rotate(45deg);
}

.floating-sns-toggle[aria-expanded="true"] .floating-sns-arrow::before {
  transform: translateX(-2px) rotate(225deg);
}

.floating-sns-links,
.mobile-sns-links {
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-sns-links {
  flex: 0 0 230px;
  gap: 12px;
  padding-inline-start: 6px;
  visibility: hidden;
}

.floating-sns-toggle[aria-expanded="true"] + .floating-sns-links {
  visibility: visible;
}

.floating-sns-links a,
.site-header .hbm-menu .mobile-sns-links a {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
}

.floating-sns-links img,
.mobile-sns-links img {
  display: block;
  width: auto;
  height: auto;
  max-width: 44px;
  max-height: 44px;
}

.floating-sns-links img[alt="X"] {
  max-width: 40px;
  max-height: 40px;
}

.mobile-sns-links {
  flex: none;
  gap: 18px;
  margin-block-start: 24px;
}

.mobile-sns-links img {
  max-width: 34px;
  max-height: 34px;
}

.mobile-sns-links img[alt="Facebook"] {
  clip-path: circle(50%);
}

.floating-sns :is(a, button):focus-visible,
.mobile-sns-links a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

/* スマホ・タブレットの調整 */
@media (max-width: 600px) {
  .sns-features {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
  .sns-features::before {
    display: none;
  }
  .sns-feature--note {
    padding-block-start: 24px;
    border-block-start: 1px solid #ccc;
  }
  .sns-feature + .sns-feature {
    margin-block-start: 24px;
    padding-block-start: 24px;
    border-block-start: 1px solid #ccc;
  }
  .sns-feature p {
    margin-block-start: 12px;
  }
}

/* マウス操作時の表示 */
@media (hover: hover) {
  .sns-section a:hover {
    opacity: 0.72;
  }
  .floating-sns-links img,
    .mobile-sns-links img {
    transition: opacity 180ms ease;
  }
  .site-header .hbm-menu .mobile-sns-links a:hover {
    background: transparent;
  }
  :is(.floating-sns-links, .mobile-sns-links) a:hover img {
    opacity: 0.72;
  }
}

/* 高さの低い画面の調整 */
@media (max-width: 767.98px), (max-width: 1023.98px) and (orientation: portrait), (max-width: 1023.98px) and (max-height: 600px) and (pointer: coarse) {
  .sns-section > .section-inner {
    border-block-start: 0;
  }
  .floating-sns {
    display: none;
  }
}

/* 端末で「動きを減らす」が有効な場合 */
@media (prefers-reduced-motion: reduce) {
  .floating-sns,
    .floating-sns-links img,
    .mobile-sns-links img {
    transition: none;
  }
}

/* 印刷時の表示 */
@media print {
  .floating-sns {
    display: none;
  }
}

/* ==================================================
   事務所案内とフッター
   ================================================== */

.site-footer {
  padding-block: clamp(32px, 4vw, 56px) 16px;
  background: var(--navy);
  color: #fff;
  font: 500 16px/1.7 var(--section-font);
}

.footer-office {
  scroll-margin-top: calc(var(--site-header-height) - var(--page-scroll-padding-top));
}

.office-layout {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 52%);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.office-info h2 {
  margin: 0 0 20px;
  font-size: var(--section-heading-size);
  line-height: 1.3;
}

.office-label {
  display: block;
  margin-block-end: 8px;
  color: #86ceff;
  font: 700 16px/1.4 var(--label-font);
  letter-spacing: 0.08em;
}

.office-name {
  margin: 0 0 12px;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 700;
}

.office-address {
  font-style: normal;
}

.office-address p {
  margin: 0;
}

.office-contacts {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  margin-block-start: 10px;
}

.office-contacts span {
  font-family: var(--label-font);
}

.office-contacts a {
  color: inherit;
  text-decoration: none;
}

.office-map-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-block-start: 14px;
  padding-block: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.office-map-link svg {
  width: 17px;
  height: 17px;
}

.office-map {
  background: var(--page-background);
}

.office-map iframe {
  display: block;
  width: 100%;
  height: clamp(260px, 22vw, 340px);
  border: 0;
}

.footer-bottom {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-block-start: 32px;
  padding-block-start: 20px;
  padding-inline: 56px;
  border-block-start: 1px solid rgb(255 255 255 / 25%);
}

.footer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px 32px;
  font-size: 14px;
}

.footer-nav a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-to-top {
  position: absolute;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 50%;
  color: #fff;
}

.footer-to-top svg {
  width: 24px;
  height: 24px;
}

.footer-copyright {
  margin: 14px 0 0;
  text-align: center;
  font-family: var(--label-font);
}

.footer-copyright small {
  font-size: 12px;
}

.site-footer a {
  transition: color 0.25s ease, background-color 0.25s ease;
}

.site-footer a:focus-visible {
  color: var(--accent-blue);
}

/* 端末で「動きを減らす」が有効な場合 */
@media (prefers-reduced-motion: reduce) {
  .site-footer a {
    transition: none;
  }
}

/* マウス操作時の表示 */
@media (hover: hover) {
  .site-footer a:hover {
    color: var(--accent-blue);
  }
  .footer-nav a[href]:hover,
    .office-contacts a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .footer-to-top:hover {
    background: rgb(255 255 255 / 15%);
  }
}

/* スマホ・タブレットの調整 */
@media (max-width: 1023.98px) {
  .office-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .office-map iframe {
    height: 280px;
  }
}

/* スマホ・タブレットの調整 */
@media (max-width: 767.98px) {
  .office-info h2 {
    margin-block-end: 20px;
  }
  .office-contacts {
    gap: 4px 20px;
  }
  .office-map iframe {
    height: 240px;
  }
  .footer-bottom {
    justify-content: center;
    margin-block-start: 28px;
    padding-inline: 0;
    padding-block-start: 64px;
  }
  .footer-nav {
    gap: 16px;
    font-size: 14px;
  }
  .footer-to-top {
    inset-block-start: 12px;
  }
  .footer-copyright small {
    font-size: 11px;
  }
}

/* 印刷時の表示 */
@media print {
  .office-map,
    .footer-to-top {
    display: none;
  }
  .office-layout {
    display: block;
  }
  .site-footer {
    background: #fff;
    color: var(--navy);
  }
  .office-label {
    color: var(--navy);
  }
}
