/* ======================================================================
   90_responsive.css
   - All media queries consolidated
   - Keep overrides here only
   - Breakpoints:
     <=1024  : tablet
     >=769   : PC layout overrides
     <=768   : SP layout overrides
     <=390   : small SP fine tune
======================================================================== */

/* =========================================================
   <=1024px (Tablet)
========================================================= */
@media (max-width: 1024px) {
  /* Header */
  .header-inner {
    padding: 12px 16px;
  }

  .header-right {
    gap: 16px;
  }

  .global-nav ul {
    gap: 20px;
  }

  .global-nav li {
    max-width: clamp(100px, 10vw, 160px);
    gap: 4px;
  }

  .nav-icon {
    height: 34px;
  }

  .global-nav a {
    font-size: 0.75rem;
  }

  /* Tel (header) */
  .header-tel {
    padding: 10px 12px;
    border-radius: var(--radius-20);
    gap: 2px;
  }

  .tel-note {
    font-size: 0.875rem;
  }

  .tel-number {
    font-size: 0.875rem;
  }

  .tel-label {
    font-size: 0.6875rem;
    padding: 2px 5px;
  }
}

/* =========================================================
   >=769px (PC)
========================================================= */
@media (min-width: 769px) {
  /* Global Nav (PC) */
  .global-nav {
    display: flex;
    align-items: flex-end;
    gap: 32px;
    background: transparent;
  }

  .global-nav ul {
    display: flex;
    align-items: flex-end;
  }

  /* Tel in menu (PC) */
  .header-tel.header-tel--inmenu {
    margin-top: 0;
    margin-inline: 0;
    align-items: stretch;
    text-align: left;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
  }

  .header-tel.header-tel--inmenu a {
    justify-content: flex-start;
  }

  /* Hero (PC) */
  .hero {
    position: relative;
    padding: 0 24px 120px;
  }

  .hero-inner {
    display: flex;
    align-items: center;
    gap: clamp(0px, 0vw, 64px);
  }

  .hero-image {
    flex: 1.3;
    max-width: clamp(520px, 60vw, 920px);
    margin-left: clamp(0px, -3vw, -16px);
  }

  .hero-image img {
    border-radius: 20px;
  }

  .hero-content {
    flex: 0.7;
    transform: translateY(-40px);
  }

  /* TOPIX (PC positioning) */
  .hero-topix {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 30px;

    transform: none;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    margin-left: 16px;
  }
}

/* =========================================================
   <=768px (SP)
========================================================= */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .pc-only {
    display: none;
  }

  .sp-only {
    display: block;
  }

  /* Utilities overrides */
  .px-40 {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mx-40 {
    margin-left: 16px;
    margin-right: 16px;
  }

  .area-outer {
    padding: 32px 16px;
    border-radius: var(--radius-20);
  }

  /* Headings */
  .h2-text {
    font-size: 1.875rem;
  }

  /* Header layout (SP) */
  h1.site-logo {
    width: clamp(70px, 20vw, 110px);
    justify-self: start;
    align-self: center;
    margin-top: -6px;
    margin-left: -6px;
  }

  h1.site-logo img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* h2タイトルのアイコンをSPで小さく */
  .h2-title .h2-icon img {
    width: 72px; /* ← お好み：38〜46px くらいが自然 */
    height: auto;
  }

  .header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
  }

  .header-right {
    display: block;
    justify-self: end;
  }

  .hamburger {
    display: block;
    z-index: 1001;
    justify-self: end;
    align-self: center;
    margin-left: 0;
  }

  /* Global nav (SP drawer) */
  .global-nav {
    position: fixed;
    inset: 0;
    padding: 120px 24px 40px;
    background: var(--gray-100);
    transform: translateX(100%);
    z-index: 1000;

    display: flex;
    flex-direction: column;
  }

  .global-nav.is-open {
    transform: translateX(0);
    background-color: #feeaea;
  }

  .global-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
    margin-bottom: 18px;
  }

  .global-nav li {
    width: auto;
    flex: none;
    max-width: none;
  }

  .global-nav a {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Tel in menu (SP) */
  .header-tel.header-tel--inmenu {
    margin-top: 16px;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
    align-items: center;
    text-align: center;
  }

  .header-tel.header-tel--inmenu a {
    justify-content: center;
  }

  /* Hero (SP) */
  .hero {
    padding: 0 0 48px;
    overflow: hidden;
    overflow-x: clip;
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 18px;
  }

  .hero::before {
    bottom: -25%;
    left: -10%;
    width: 140%;
    height: 100%;
    border-top-right-radius: 60% 55%;
  }

  .hero-image {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    max-width: none;
    margin-left: 0;
  }

  .hero-image img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 0;
  }

  .hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0;
    pointer-events: none;
    padding-top: clamp(0px, 0.5vh, 12px);
  }

  .hero-title {
    color: var(--white);
    margin-top: clamp(-72px, -10vh, -48px);
    font-size: clamp(1.25rem, 5vw, 1.75rem);

    margin-bottom: 12px;
    gap: 6px;
  }

  /* SPではタイトル内部も白固定（念押し） */
  .hero-title,
  .hero-title * {
    color: var(--white);
  }

  .hero-title > img {
    width: 120px; /* ← 旗アイコンを小さく */
    height: auto;
  }

  .hero-deco img {
    width: 92px;
  }

  .hero-deco--bottom-left {
    left: 12px;
    right: auto;
    bottom: 45px;
  }

  .hero-deco--top-right {
    top: 12px;
    right: 12px;
  }

  .hero-topix {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -18px;

    width: calc(100% - 32px);
    margin: 0 16px;

    padding: 14px 16px;
    max-width: 100%;

    border-radius: var(--radius-20);
    z-index: 5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .hero-topix li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* NEWS detail pager (SP) */
  .news-detail__pager {
    justify-content: center;
    gap: 60px;
  }

  .pager-circle {
    width: 44px;
    height: 44px;
  }

  /* Staff (SP) */
  .staff-list {
    gap: 50px;
  }

  .staff-item {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .staff-item__role {
    grid-template-columns: 46px 1fr;
    column-gap: 10px; /* 12 → 少し詰める */
  }

  .staff-item__icon {
    width: 36px; /* 46 → 36 に縮小 */
    height: auto;
  }

  .staff-item__title {
    font-size: 1.125rem;
    white-space: normal;
  }

  .staff-note {
    margin-top: 48px;
    text-align: left;
  }

  /* Guide (SP) */
  .guide-step {
    --step-col: 88px;
    --box-px: 18px;
  }

  .guide-flow__steps {
    gap: 20px;
  }

  .guide-step__box {
    padding: 18px var(--box-px);
    gap: 14px;
    align-items: start;
  }

  .guide-step__label {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }

  .guide-step__num {
    font-size: 2rem;
  }

  .guide-step__heading {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }

  .guide-step__text {
    font-size: 0.95rem;
    line-height: 1.85;
  }

  .guide-step__badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    white-space: normal;
  }

  .guide-step__tail {
    width: 26px;
    height: 14px;
  }

  /* Q&A (SP) */
  .qa-q {
    padding: 12px 0;
  }

  .qa-a {
    padding: 0 0 12px;
  }

  /* NEWS list (SP) */
  .news-item {
    grid-template-columns: 96px 1fr 26px;
    gap: 12px;
    padding: 12px 0;
  }

  .news-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-arrow {
    width: 26px;
    height: 26px;
  }

  /* News detail (SP) */
  .news-detail__layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .news-detail__meta {
    position: static;
  }

  .news-detail__title {
    font-size: 1.2rem;
  }

  /* =========================================================
     Floating CTA (SP) - FIXED BAR
     - 画面下に固定
     - 左右50%で並ぶ
     - ブラウザ幅を変えても巨大化しない
  ========================================================= */
  .floating-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 2500;

    display: flex;
    flex-direction: row;
    width: 100%;
    margin: 0;
    padding: 0 0 env(safe-area-inset-bottom) 0;

    transform: none;
    text-align: center;

    /* 巨大化防止（どこかでheight/100vh等が当たっても無効化） */
    height: auto !important;
    max-height: none;
    align-items: stretch;
  }

  .floating-cta__btn {
    flex: 1 1 50%;
    width: 50%;
    min-height: 72px; /* ← CTAの高さを固定（巨大化防止） */
    height: auto !important;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 14px 10px;
    box-sizing: border-box;

    text-align: center;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    line-height: 1.4;

    writing-mode: horizontal-tb;
    text-orientation: mixed;

    /* hover/アニメ等でズレない */
    transform: none !important;
  }

  /* CTA hide (SP) */
  .floating-cta {
    transition:
      opacity 0.25s ease,
      visibility 0.25s ease;
  }

  .floating-cta.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* =========================================================
     Footer contact / Button group / Backtop (SP) 追加分
  ========================================================= */

  /* Footer contact (SP) */
  .footer-contact {
    padding: 44px 16px;
  }

  .footer-contact__inner {
    padding: 34px 18px;
  }

  .footer-contact__actions {
    gap: 24px;
  }

  .footer-contact__icon {
    width: 54px;
    height: 54px;
  }

  .footer-contact__icon img {
    width: 40px;
  }

  .footer-contact__text {
    font-size: 0.95rem;
    line-height: 1.9;
  }

  /* Button group (SP) */
  @media (max-width: 768px) {
    .c-button-group {
      display: flex;
      flex-direction: row; /* ← 横並び固定 */
      flex-wrap: nowrap; /* ← 折り返さない */
      justify-content: center;
      gap: 12px; /* ← 少し距離 */
      margin-top: 64px;
      margin-bottom: 64px;
    }

    .c-button-group .c-button {
      width: auto; /* ← 100%を解除 */
      min-width: 0; /* ← 220px固定を解除して潰れ防止 */
      flex: 1 1 0; /* ← 2つなら左右均等になる */
      padding: 12px 10px; /* ← SP向けに少し詰める */
      white-space: normal; /* 折り返しOKにする場合 */
    }

    .c-button-group .c-button__icon {
      width: 18px; /* ← SPは少し小さめ */
    }

    /* Back to top (SP) */
    .c-backtop {
      display: none;
    }
  }

  /* Footer logo (SP) */
  .footer-logo img {
    width: clamp(120px, 45vw, 170px);
  }

  /* aboutus (SP) */
  .aboutus .area-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .aboutus .area-inner > p,
  .aboutus .area-inner > img {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: stretch;
  }

  .aboutus .area-inner > img {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    border-radius: var(--radius-20);
  }

  .aboutus .area-inner > p {
    text-align: center;
    line-height: 1.9;
  }

  /* Divider vars (SP) */
  section.content {
    gap: 64px;
  }

  /* Wave (SP) */
  .section-wave,
  .section-wave-top,
  .section-wave-bottom {
    --wave-size: 120px;
    --wave-height: 16px;

    --wave-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='16' viewBox='0 0 120 16'%3E%3Cpath fill='%23000' d='M0 16 C 30 15 30 1 60 1 C 90 1 90 15 120 16 L 120 0 L 0 0 Z'/%3E%3C/svg%3E");
  }

  .section-wave {
    padding-top: calc(var(--wave-height) + 32px);
    padding-bottom: calc(var(--wave-height) + 32px);
  }

  .section-wave-top {
    padding-top: calc(var(--wave-height) + 32px);
  }

  .section-wave-bottom {
    padding-bottom: calc(var(--wave-height) + 32px);
  }

  /* AsyCurve (SP) */
  .section-asycurve,
  .section-asycurve-top,
  .section-asycurve-bottom {
    --ac-height: 52px;

    --ac-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='52' viewBox='0 0 1000 52' preserveAspectRatio='none'%3E%3Cpath fill='%23000' d='M0 52 C 180 6 320 6 500 26 C 700 52 820 52 1000 26 L 1000 0 L 0 0 Z'/%3E%3C/svg%3E");
  }

  .section-asycurve {
    padding-top: calc(var(--ac-height) + 32px);
    padding-bottom: calc(var(--ac-height) + 32px);
  }

  .section-asycurve-top {
    padding-top: calc(var(--ac-height) + 32px);
  }

  .section-asycurve-bottom {
    padding-bottom: calc(var(--ac-height) + 32px);
  }

  /* =========================================================
   QUARITY (SP) layout fix
   - feature / consult を縦積みに戻す
========================================================= */
  /* 3カラム → 1カラム */
  .quarity-feature__grid,
  .quarity-consult__grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important; /* お好みで */
  }

  /* 子要素のはみ出し対策（長い見出し/改行など） */
  .quarity-feature__item,
  .quarity-consult__item {
    min-width: 0;
  }

  /* 相談リスト：中央寄せ由来のズレ防止（必要なら） */
  .quarity-consult__list {
    text-align: left;
    margin-inline: auto;
    width: fit-content; /* “中央に置きつつ左揃え” */
  }

  /* 相談タイトルの下線がある場合の見た目安定（任意） */
  .quarity-consult__title {
    text-align: center;
  }

  .quarity-feature,
  .quarity-consult {
    padding: 40px;
  }

  .site-footer {
    position: relative;
  }

  .site-footer .footer-deco {
    position: absolute;

    /* ★ここが本命 */
    top: -48%; /* あなたの理想値 */
    bottom: auto; /* 競合防止 */

    transform: scale(0.6);
    transform-origin: bottom center;
    pointer-events: none;
    z-index: 2;
  }

  .site-footer .footer-deco--left {
    left: -2em;
  }

  .site-footer .footer-deco--right {
    right: -2em;
  }
}

/* =========================================================
   <=390px (Small SP)
========================================================= */
@media (max-width: 390px) {
  .guide-step {
    --step-col: 78px;
    --box-px: 14px;
  }

  .guide-step__box {
    padding: 16px var(--box-px);
    gap: 12px;
  }

  .guide-step__num {
    font-size: 1.9rem;
  }
}
