/**
 * トップページ（レガシー置き換え） — レイアウトはテーブル不使用・モバイルファースト
 */

:root {
    --home-text: #1c2d42;
    --home-muted: #5a6b7d;
    --home-border: #e2e6ec;
    --home-accent: #b50400;
    --home-bg: #ffffff;
    /* 画面幅いっぱい（旧レガシー 900px 固定を廃止） */
    --home-shell-pad: 12px;
    --home-max: 100%;
    --home-sidebar-width: 200px;
    /* スライダー：レガシー 570×300（中央）＋左右チラ見せ */
    --home-scroll-slide-w: 570px;
    --home-scroll-ratio-w: 570;
    --home-scroll-ratio-h: 300;
    --home-scroll-stage-max: 900px;
    --site-gap-sm: 8px;
    --site-gap-md: 16px;
    --site-gap-lg: 24px;
    --site-gap-xl: 32px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.page-site-rebuild,
body.page-home-rebuild {
    margin: 0;
    font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--home-text);
    background: #fff;
}

@media (max-width: 767px) {
    :root {
        --home-shell-pad: 10px;
    }
}

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

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 10000;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

.shell {
    width: 100%;
    max-width: var(--home-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--home-shell-pad);
    padding-right: var(--home-shell-pad);
    box-sizing: border-box;
}

/* ヘッダー・スクロール・ボディの横幅を shell で統一 */
.site-brand-header > .shell,
.home-primary-nav__icons.shell,
.home-scroll-banner > .shell,
.home-body > .shell {
    width: 100%;
    max-width: var(--home-max);
}

/* ----- ブランドヘッダ（レガシーTOP準拠） ----- */
.site-brand-header {
    border-bottom: 1px solid #ccc;
    background: #fff;
}

.site-brand-header__inner {
    padding: 10px;
}

.site-brand-header__utility {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.site-brand-header__utility-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 6px;
    font-size: 0.72rem;
    color: #555;
}

.site-brand-header__utility-nav a {
    color: #333;
    text-decoration: none;
}

.site-brand-header__utility-nav a:hover {
    color: var(--home-accent);
    text-decoration: underline;
}

.site-brand-header__sep {
    color: #aaa;
    user-select: none;
}

.site-brand-header__main {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
}

.site-brand-header__brand {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    min-width: 0;
}

.site-brand-header__tagline {
    margin: 0 0 2px;
    font-size: 0.75rem;
    line-height: 1.35;
    font-weight: 600;
    color: var(--home-accent);
}

.brand-logo {
    margin: 0;
}

.brand-logo a {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.site-brand-header__logo-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 63px;
    object-fit: contain;
    object-position: left center;
}

.site-brand-header__quick {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 12px;
    justify-content: center;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 24px);
}

.site-brand-header__quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
    text-decoration: none;
    color: #333;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.site-brand-header__quick-btn img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 50%;
    background: #c41200;
    padding: 4px;
    box-sizing: border-box;
}

.site-brand-header__quick-btn:hover {
    color: var(--home-accent);
}

.site-brand-header__contact-block {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-left: auto;
    max-width: min(280px, 38vw);
    text-align: right;
}

.site-brand-header__contact {
    padding: 8px 10px;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #444;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 2px;
}

.site-brand-header__contact-lead {
    margin: 0 0 4px;
}

.site-brand-header__contact-mail {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1a1a1a;
    word-break: break-all;
}

@media (max-width: 899px) {
    .site-brand-header__utility {
        justify-content: flex-start;
    }

    .site-brand-header__utility-nav {
        justify-content: flex-start;
    }

    .site-brand-header__main {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
    }

    .site-brand-header__quick {
        position: static;
        transform: none;
        order: 2;
        margin: 10px auto 0;
        max-width: 100%;
    }

    .site-brand-header__brand {
        order: 1;
        width: 100%;
    }

    .site-brand-header__contact-block {
        order: 3;
        margin: 10px auto 0;
        text-align: center;
        max-width: none;
    }
}

/* ----- プライマリナビ（参考：カテゴリ帯・上下ボーダー） ----- */
.home-primary-nav {
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    background: #fff;
}

.home-primary-nav__icons {
    padding: 10px;
}

.home-primary-nav__icon-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
}

.home-primary-nav__icon-link {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    max-width: none;
    text-decoration: none;
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.home-primary-nav__icon-img-wrap {
    position: relative;
    width: 60px;
    height: 60px;
    line-height: 0;
}

.home-primary-nav__icon-img {
    display: block;
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.home-primary-nav__icon-img--hover {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.home-primary-nav__icon-link:hover .home-primary-nav__icon-img--default,
.home-primary-nav__icon-link:focus-visible .home-primary-nav__icon-img--default {
    opacity: 0;
}

.home-primary-nav__icon-link:hover .home-primary-nav__icon-img--hover,
.home-primary-nav__icon-link:focus-visible .home-primary-nav__icon-img--hover {
    opacity: 1;
}

.home-primary-nav__icon-link.is-current {
    color: var(--home-accent);
}

.home-primary-nav__icon-label {
    display: block;
}

@media (max-width: 599px) {
    .home-primary-nav__icon-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 6px;
    }

    .home-primary-nav__icon-link {
        flex: 0 1 auto;
        min-width: 64px;
        max-width: 88px;
        font-size: 0.65rem;
    }

    .home-primary-nav__icon-img-wrap,
    .home-primary-nav__icon-img {
        width: 48px;
        height: 48px;
    }
}

/* ----- スクロールバナー（570×300 中央・左右チラ見せ・矢印は中央枠の端） ----- */
.home-scroll-banner {
    --home-scroll-gap: 8px;
    --home-scroll-slide: min(var(--home-scroll-slide-w), calc(100% - 16px));
    --home-scroll-height: calc(var(--home-scroll-slide) * var(--home-scroll-ratio-h) / var(--home-scroll-ratio-w));
    --home-scroll-peek: max(0px, calc((100% - var(--home-scroll-slide)) / 2));
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #ccc;
}

.home-scroll-banner > .shell {
    padding-top: 8px;
    padding-bottom: 8px;
}

.home-scroll-banner__stage {
    position: relative;
    width: 100%;
    /* max-width: var(--home-scroll-stage-max); */
    margin: 0 auto;
}

.home-scroll-banner__viewport {
    overflow: hidden;
    width: 100%;
    background: #e8e8e8;
}

.home-scroll-banner__track {
    display: flex;
    gap: var(--home-scroll-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: var(--home-scroll-peek);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px var(--home-scroll-peek);
    width: 100%;
    box-sizing: border-box;
}

.home-scroll-banner__track::-webkit-scrollbar {
    display: none;
}

.home-scroll-banner__slide {
    position: relative;
    flex: 0 0 var(--home-scroll-slide);
    width: var(--home-scroll-slide);
    max-width: 100%;
    scroll-snap-align: center;
    display: block;
    line-height: 0;
    text-decoration: none;
    border: 1px solid #bbb;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
    aspect-ratio: var(--home-scroll-ratio-w) / var(--home-scroll-ratio-h);
    height: auto;
    opacity: 0.72;
    transition: opacity 0.25s ease, box-shadow 0.25s ease;
}

/* 白ベールは左右が「真っ白で切れた」ように見えるため廃止。薄い暗転のみ */
.home-scroll-banner__slide:not(.is-active)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.08);
    pointer-events: none;
}

.home-scroll-banner__slide.is-active {
    opacity: 1;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.home-scroll-banner__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    vertical-align: top;
}

.home-scroll-banner__btn {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #4a3428;
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.home-scroll-banner__btn:hover {
    background: #3a281f;
}

.home-scroll-banner__btn:focus-visible {
    outline: 2px solid var(--home-accent);
    outline-offset: 2px;
}

/* 中央スライドの左右端（peek の内側）に配置 */
.home-scroll-banner__btn--prev {
    left: calc(var(--home-scroll-peek) + 4px);
    transform: translateY(-50%);
}

.home-scroll-banner__btn--next {
    left: auto;
    right: calc(var(--home-scroll-peek) + 4px);
    transform: translateY(-50%);
}

.home-scroll-banner__thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 10px auto 0;
    padding: 0;
    max-width: var(--home-scroll-stage-max);
}

.home-scroll-banner__thumb {
    flex: 0 0 auto;
    margin: 0;
    padding: 1px;
    border: 2px solid #ccc;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    line-height: 0;
    opacity: 0.65;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.home-scroll-banner__thumb:hover {
    opacity: 0.9;
    border-color: #999;
}

.home-scroll-banner__thumb.is-active {
    border-color: var(--home-accent);
    opacity: 1;
    box-shadow: 0 0 0 1px var(--home-accent);
}

.home-scroll-banner__thumb:focus-visible {
    outline: 2px solid var(--home-accent);
    outline-offset: 2px;
}

.home-scroll-banner__thumb img {
    display: block;
    width: 76px;
    height: 40px;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 599px) {
    .home-scroll-banner {
        --home-scroll-slide-w: 320px;
        --home-scroll-stage-max: 100%;
    }

    .home-scroll-banner__btn--prev {
        left: max(4px, calc(var(--home-scroll-peek) + 2px));
    }

    .home-scroll-banner__btn--next {
        right: max(4px, calc(var(--home-scroll-peek) + 2px));
    }
}

@media (max-width: 767px) {
    .home-scroll-banner__btn {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }

    .home-scroll-banner__thumb img {
        width: 64px;
        height: 34px;
    }
}

/* ----- ボディ 2カラム ----- */
.home-body {
    padding: 12px 0 32px;
}

.home-body__grid {
    display: grid;
    gap: 16px;
    align-items: start;
}

@media (max-width: 767px) {
    .home-body__main {
        order: 1;
    }

    .home-sidebar {
        order: 2;
    }
}

@media (min-width: 768px) {
    .home-body__grid {
        grid-template-columns: var(--home-sidebar-width) minmax(0, 1fr);
    }
}

.home-body__main {
    min-width: 0;
}

.home-panel {
    margin: 0 0 16px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.home-panel:last-child {
    margin-bottom: 0;
}

.home-panel__inner {
    padding: 14px 12px 16px;
}

/* ----- サイドバー ----- */
.home-sidebar {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 10px 8px 12px;
}

.home-sidebar__section + .home-sidebar__section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dotted #ccc;
}

.home-sidebar__heading {
    margin: 0 0 8px;
    padding: 0 4px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--home-accent);
    line-height: 1.3;
}

.home-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-sidebar__item + .home-sidebar__item {
    margin-top: 8px;
}

.home-sidebar__link {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.home-sidebar__link:hover .home-sidebar__title {
    color: var(--home-accent);
    text-decoration: underline;
}

.home-sidebar__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    margin-top: 2px;
    border-radius: 50%;
    background: #222;
}

.home-sidebar__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-sidebar__title {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    color: #222;
}

.home-sidebar__desc {
    font-size: 0.62rem;
    line-height: 1.4;
    color: #666;
}

.home-sidebar__list--text .home-sidebar__item + .home-sidebar__item {
    margin-top: 10px;
}

.home-sidebar__text-link {
    display: block;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.home-sidebar__text-link:hover {
    color: var(--home-accent);
}

/* ----- ヒーロ ----- */
.home-hero {
    padding: 0;
}

.home-hero__link {
    display: block;
}

.home-hero__img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* ----- キットバナー ----- */
.home-kit-banner {
    padding: 0;
}

.home-kit-banner__link {
    display: block;
}

.home-kit-banner__link img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* ----- カテゴリグリッド ----- */
.home-section-title {
    margin: 0 0 14px;
    font-size: 1.15rem;
    font-weight: 800;
}

.home-category-grid {
    padding: 0;
}

.home-category-grid__items {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .home-category-grid__items {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .home-body__main .home-category-grid__items {
        grid-template-columns: repeat(2, 1fr);
    }
}

.home-category-card {
    margin: 0;
}

.home-category-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--home-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.home-category-card__link:hover,
.home-category-card__link:focus-visible {
    box-shadow: 0 6px 20px rgba(28, 45, 66, 0.12);
    outline: none;
}

.home-category-card__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f0f2f5;
}

.home-category-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-category-card__title {
    padding: 10px 12px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

/* ----- フッター ----- */
.site-footer-rebuild {
    border-top: 1px solid var(--home-border);
    padding: 24px 0 32px;
    background: #f3f4f6;
    font-size: 0.82rem;
    color: var(--home-muted);
}

.site-footer-rebuild a {
    color: var(--home-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer-rebuild__nav-wrap {
    text-align: center;
}

.site-footer-rebuild__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 4px;
    align-items: center;
}

.site-footer-rebuild__sep {
    color: #ccc;
    user-select: none;
}

.site-footer-rebuild__copy,
.site-footer-rebuild__note {
    margin: 10px 0 0;
}

@media (max-width: 480px) {
    .site-footer-rebuild__sep {
        display: none;
    }

    .site-footer-rebuild__nav {
        flex-direction: column;
    }
}
