/* NEXAのレスポンシブ。共通値→共通部品→18役割の順で編集する。 */

@media (max-width: 75rem) {
  /* 共通デザイン値 */
  [data-template="nexa"] {
    --space-inline: 48px;
    --space-grid: 48px;
    --space-card-gap: 32px;
    --font-size-card: 1.375rem;
    --font-size-heading: 2.25rem;
    --font-size-hero-title: 3.25rem;
    --space-header-inline: var(--space-stack);
  }
  /* NEXA共通部品（見出しを上、中身を下） */
  :where([data-section][data-ui="nexa"]) .side-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-heading);
  }
  :where([data-section][data-ui="nexa"]) .side-layout > .section-heading .button {
    margin-block-start: var(--space-stack);
  }
  /* ヘッダー */
  :where([data-section="header"][data-ui="nexa"]) .site-header__inner {
    column-gap: var(--space-stack);
  }
  :where([data-section="header"][data-ui="nexa"]) .site-nav {
    gap: var(--space-small);
  }
  /* ご利用の流れ */
  :where([data-section="steps"][data-ui="nexa"]) .steps__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where([data-section="steps"][data-ui="nexa"]) .steps__item::after {
    display: none;
  }
  /* スタッフ紹介 */
  :where([data-section="staff"][data-ui="nexa"]) .staff__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where([data-section="staff"][data-ui="nexa"]) .staff__layout > .section-heading {
    grid-column: 1 / -1;
  }
  /* お知らせ */
  :where([data-section="news"][data-ui="nexa"]) .news__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* アクセス */
  :where([data-section="access"][data-ui="nexa"]) .access__layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* お問い合わせ */
  :where([data-section="contact"][data-ui="nexa"]) .contact__layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 48rem) {
  html {
    scroll-padding-block-start: var(--size-scroll-offset);
  }
  /* 共通デザイン値 */
  [data-template="nexa"] {
    --space-inline: 24px;
    --space-section: 40px;
    --space-header-y: 10px;
    --space-header-inline: var(--space-inline);
    --space-footer-y: 40px;
    --space-hero: 40px;
    --space-card: 24px;
    /* スマホ表示でファーストビューの文字の部分に使う高さ */
    --size-hero-height: 560px;
    --size-logo: 28px;
    --font-size-brand: 1.25rem;
    --font-size-hero-title: 2.25rem;
    --space-page-top-x: 4px;
    --space-grid: 40px;
    --space-card-gap: 32px;
    --space-heading: 32px;
    --space-list: 20px;
    --font-size-heading: 1.75rem;
    --font-size-card: 1.375rem;
    --font-size-number: 1.875rem;
    --size-button-width: 256px;
    --space-button-padding: 28px;
  }
  /* NEXA共通部品 */
  :where([data-section][data-ui="nexa"]) .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  :where([data-section][data-ui="nexa"]) .section-heading--row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-stack);
  }
  /* リード文の改行はスマホでは使わず、行いっぱいまで流す */
  :where([data-section][data-ui="nexa"]) :is(.section-heading__lead, .hero__lead) br {
    display: none;
  }
  /* ボタン・リンクはスマホでは中央にそろえる（めぐ決定 2026-10-31）。ドロワー内のボタンは幅いっぱいのまま */
  :where([data-section][data-ui="nexa"]) :is(.button, .text-link) {
    display: flex;
    width: fit-content;
    margin-inline: auto;
  }
  /* スマホヘッダーと右側ドロワー */
  :where([data-section="header"][data-ui="nexa"]).site-header {
    position: sticky;
    top: 0;
    z-index: 6;
  }
  body.is-menu-open {
    overflow: hidden;
  }
  :where([data-section="header"][data-ui="nexa"]).site-header::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--color-shade);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--motion-duration) var(--motion-easing), visibility var(--motion-duration);
  }
  body.is-menu-open > :where([data-section="header"][data-ui="nexa"]).site-header::before {
    opacity: 1;
    visibility: visible;
  }
  /* ヘッダー */
  :where([data-section="header"][data-ui="nexa"]) .site-header__inner {
    grid-template-columns: 1fr auto;
  }
  :where([data-section="header"][data-ui="nexa"]) .site-header__toggle {
    position: relative;
    z-index: 2;
    display: block;
    grid-column: 2;
    grid-row: 1;
  }
  :where([data-section="header"][data-ui="nexa"]) .site-nav {
    position: fixed;
    z-index: 1;
    inset: 0 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--space-stack);
    width: 70%;
    height: 100dvh;
    padding: var(--space-drawer);
    overflow-y: auto;
    background: var(--color-background);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--motion-duration) var(--motion-easing), visibility var(--motion-duration);
  }
  :where([data-section="header"][data-ui="nexa"]) .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
  }
  :where([data-section="header"][data-ui="nexa"]) .site-nav .button {
    width: 100%;
    padding-inline: var(--space-offset);
  }
  /* ファーストビュー（写真を全面に敷き、文字を重ねる） */
  :where([data-section="hero"][data-ui="nexa"]) .hero__media {
    width: 100%;
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__media::after {
    background: linear-gradient(0deg, var(--color-background) 10%, var(--color-shade) 60%, var(--color-transparent));
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__inner {
    align-items: flex-end;
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__actions {
    flex-direction: column;
    align-items: center;
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__scroll {
    display: none;
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-stack);
    padding-block-start: var(--space-stack);
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__stat {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: var(--space-small);
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__stat:nth-child(odd) {
    border-inline-start: 0;
  }
  :where([data-section="hero"][data-ui="nexa"]) .hero__stat .icon {
    grid-row: auto;
  }
  /* お悩み */
  :where([data-section="worries"][data-ui="nexa"]) {
    --worries-columns: 1;
  }
  :where([data-section="worries"][data-ui="nexa"]) .worries__backdrop {
    width: 100%;
  }
  :where([data-section="worries"][data-ui="nexa"]) .worries__item {
    flex-direction: column-reverse;
  }
  :where([data-section="worries"][data-ui="nexa"]) .worries__photo {
    width: 100%;
    aspect-ratio: var(--worries-photo-ratio-sp);
    overflow: hidden;
  }
  /* コンセプト（写真を全面に敷き、暗くして文字を重ねる） */
  :where([data-section="concept"][data-ui="nexa"]) .concept__photo {
    width: 100%;
  }
  :where([data-section="concept"][data-ui="nexa"]) .concept__photo::after {
    background: var(--color-shade-strong);
  }
  :where([data-section="concept"][data-ui="nexa"]) .concept__layout {
    flex-direction: column;
    align-items: stretch;
  }
  /* 長いボタンの文字は2行にしてよい（画面からはみ出さないように） */
  :where([data-section="concept"][data-ui="nexa"]) .button {
    white-space: normal;
    text-align: center;
  }
  /* 選ばれる理由 */
  :where([data-section="reasons"][data-ui="nexa"]) .reasons__list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-card-gap);
  }
  :where([data-section="reasons"][data-ui="nexa"]) .reason {
    padding-inline: var(--space-small);
  }
  /* サービス案内 */
  :where([data-section="services"][data-ui="nexa"]) .services__layout {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-stack);
  }
  :where([data-section="services"][data-ui="nexa"]) .services__button {
    justify-self: center;
  }
  :where([data-section="services"][data-ui="nexa"]) .services__list {
    grid-column: auto;
    grid-row: auto;
  }
  :where([data-section="services"][data-ui="nexa"]) .services__list :is(.service, .service__link) {
    flex-direction: column-reverse;
  }
  :where([data-section="services"][data-ui="nexa"]) .services__list .service__photo {
    width: 100%;
    aspect-ratio: var(--services-photo-ratio-sp);
    overflow: hidden;
  }
  :where([data-section="services"][data-ui="nexa"]) .service--feature .service__photo::after {
    background: linear-gradient(0deg, var(--color-background) 40%, var(--color-shade));
  }
  :where([data-section="services"][data-ui="nexa"]) .service--feature .service__content {
    max-width: none;
  }
  /* 料金 */
  :where([data-section="prices"][data-ui="nexa"]) .plans {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-card-gap);
  }
  /* 導入実績 */
  :where([data-section="cases"][data-ui="nexa"]) .cases__list {
    grid-template-columns: minmax(0, 1fr);
  }
  /* ギャラリー */
  :where([data-section="gallery"][data-ui="nexa"]) .gallery__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where([data-section="gallery"][data-ui="nexa"]) .gallery__item:first-child {
    grid-column: 1 / -1;
  }
  /* お客様の声 */
  :where([data-section="voices"][data-ui="nexa"]) .voices__list {
    grid-template-columns: minmax(0, 1fr);
  }
  /* ご利用の流れ */
  :where([data-section="steps"][data-ui="nexa"]) .steps__list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-card-gap);
  }
  /* スタッフ紹介 */
  :where([data-section="staff"][data-ui="nexa"]) .staff__layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* お知らせ */
  :where([data-section="news"][data-ui="nexa"]) .news__list {
    grid-template-columns: minmax(0, 1fr);
  }
  /* アクセス */
  :where([data-section="access"][data-ui="nexa"]) .access__list > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-tiny);
    padding-block: var(--space-small);
  }
  :where([data-section="access"][data-ui="nexa"]) .access__map-row {
    grid-template-columns: minmax(0, 1fr);
  }
  :where([data-section="access"][data-ui="nexa"]) .access__catch {
    inset: 0;
    background: var(--color-shade);
  }
  /* お問い合わせ */
  :where([data-section="contact"][data-ui="nexa"]) .contact__main {
    padding: var(--space-stack);
  }
  :where([data-section="contact"][data-ui="nexa"]) .contact__form {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-stack) var(--space-small);
  }
  /* 連絡方法の写真は背景に敷き、白く透かして文字を読みやすくする */
  :where([data-section="contact"][data-ui="nexa"]) .contact__photo {
    width: 100%;
  }
  :where([data-section="contact"][data-ui="nexa"]) .contact__photo::after {
    background: var(--color-veil);
  }
  :where([data-section="contact"][data-ui="nexa"]) .contact__method {
    flex-direction: column;
    gap: var(--space-small);
  }
  :where([data-section="contact"][data-ui="nexa"]) .contact__text-block {
    justify-items: stretch;
    max-width: none;
  }
  /* CTA帯 */
  :where([data-section="cta"][data-ui="nexa"]) .cta-band__inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-stack);
  }
  :where([data-section="cta"][data-ui="nexa"]) .cta-band__title {
    font-size: var(--font-size-card);
  }
  :where([data-section="cta"][data-ui="nexa"]) .cta-band__actions {
    padding-block-start: 0;
  }
  /* フッター */
  :where([data-section="footer"][data-ui="nexa"]) .site-footer__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-stack);
  }
  :where([data-section="footer"][data-ui="nexa"]) .site-footer__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where([data-section="footer"][data-ui="nexa"]) .site-footer__policies {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* NEXA共通部品・ページ操作 */
  html:has(body[data-template="nexa"]) {
    scroll-behavior: auto;
  }
  .page-tools[data-ui="nexa"] .page-top {
    transition: none;
  }
  :where([data-section][data-ui="nexa"]),
  :where([data-section][data-ui="nexa"])::before,
  :where([data-section][data-ui="nexa"])::after {
    transition: none !important;
    animation: none !important;
  }
  :where([data-section][data-ui="nexa"]) * {
    transition: none !important;
    animation: none !important;
  }
  :where([data-section][data-ui="nexa"]) *::before {
    transition: none !important;
    animation: none !important;
  }
  :where([data-section][data-ui="nexa"]) *::after {
    transition: none !important;
    animation: none !important;
  }
  :where([data-section][data-ui="nexa"]) :is(.button, .text-link):is(:hover, :focus-visible)::after {
    transform: none !important;
  }
}
