/*
 * Re:Auto display stability fixes.
 * Loaded after the legacy bundled stylesheet.
 */

@font-face {
    font-family: "Chillax";
    src: url("../fonts/chillax-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Chillax";
    src: url("../fonts/chillax-500.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

:root {
    --font-family: "Chillax", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
        "Yu Gothic", YuGothic, Meiryo, sans-serif;
    --icon-font-family: sans-serif;
    --pagination-arrow-first: "«";
    --pagination-arrow-prev: "‹";
    --pagination-arrow-next: "›";
    --pagination-arrow-last: "»";
}

html {
    background-color: var(--color-bg, #fff);
    scrollbar-gutter: stable;
}

body {
    background-color: var(--color-bg, #fff);
    overflow-x: clip;
}

.c-pagination .c-pagination__item .first::before,
.c-pagination .c-pagination__item .previouspostslink::before,
.c-pagination .c-pagination__item .nextpostslink::before,
.c-pagination .c-pagination__item .last::before {
    font-family: inherit;
}

.l-floating__button .l-floating__icon path,
.l-floating__button .l-floating__icon rect {
    fill: none;
}

.l-floating__button .l-floating__icon--car circle {
    fill: currentColor;
}

/*
 * Barba remains available for its initial component setup, but navigation is
 * intentionally native. These rules prevent stale transition styles from
 * hiding content if an older page is restored from the back-forward cache.
 */
body[data-barba-prevent="all"] [data-barba="container"] {
    filter: none !important;
    opacity: 1 !important;
}

.section-interview .c-card--interview .c-card__figure {
    aspect-ratio: 4 / 3 !important;
}

.reauto-entry {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 0 clamp(60px, 8vw, 120px);
}

.reauto-entry__date {
    margin: 0 0 20px;
    color: #666;
    font-size: 0.875rem;
}

.reauto-entry__content {
    line-height: 1.9;
}

.reauto-entry__content img {
    max-width: 100%;
    height: auto;
}

/*
 * Splide hides its root until JavaScript mounts. Keep the stock cards visible
 * as a non-interactive fallback if the main module is delayed or unavailable.
 */
.interview__slider.splide:not(.is-initialized) {
    visibility: visible;
    overflow: hidden;
}

.interview__slider.splide:not(.is-initialized) .splide__list {
    display: flex;
    gap: 30px;
    transform: none !important;
}

.interview__slider.splide:not(.is-initialized) .splide__slide {
    flex: 0 0 280px;
    width: 280px;
}

@media (min-width: 575px) {
    .interview__slider.splide:not(.is-initialized) .splide__slide {
        flex-basis: 330px;
        width: 330px;
    }
}

@media (min-width: 1280px) {
    .interview__slider.splide:not(.is-initialized) .splide__slide {
        flex-basis: 360px;
        width: 360px;
    }
}

@media (max-width: 574px) {
    .top-workstyle__heading {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Published-stock maker filter. */
.stock-maker-filter {
    margin: clamp(28px, 5vw, 52px) 0 20px;
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #e2e5e9;
    border-radius: 12px;
    background: #f7f8fa;
}

.stock-maker-filter__label {
    display: block;
    margin-bottom: 14px;
    color: #1d1d1f;
    font-size: 1rem;
    font-weight: 600;
}

.stock-maker-filter__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stock-maker-filter__button {
    display: inline-flex;
    min-height: 42px;
    padding: 8px 15px;
    border: 1px solid #c9ced5;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    color: #303234;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.stock-maker-filter__button:hover,
.stock-maker-filter__button:focus-visible,
.stock-maker-filter__button.is-active {
    border-color: #123458;
    background: #123458;
    color: #fff;
    text-decoration: none;
}

.stock-maker-filter__button:focus-visible {
    outline: 3px solid #327fd9;
    outline-offset: 3px;
}

.stock-maker-filter__count {
    display: inline-flex;
    min-width: 1.6em;
    height: 1.6em;
    padding: 0 0.35em;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(18, 52, 88, 0.1);
    font-size: 0.75rem;
}

.stock-maker-filter__button:hover .stock-maker-filter__count,
.stock-maker-filter__button:focus-visible .stock-maker-filter__count,
.stock-maker-filter__button.is-active .stock-maker-filter__count {
    background: rgba(255, 255, 255, 0.2);
}

/* Stock detail copy and bottom navigation. */
.car-title .car-title__maker {
    margin-left: 0.5em;
    color: #6e6e73;
    font-size: 0.6em;
    font-weight: 500;
}

.stock-detail-copy__body {
    margin-top: 20px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.stock-detail-copy__body > :first-child {
    margin-top: 0;
}

.stock-detail-copy__body img {
    max-width: 100%;
    height: auto;
}

.stock-single-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
    margin-top: clamp(48px, 7vw, 80px);
    padding-top: 28px;
    border-top: 1px solid #d2d2d7;
}

.stock-single-nav__link {
    display: flex;
    min-width: 0;
    min-height: 72px;
    padding: 14px 16px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    flex-direction: column;
    justify-content: center;
    color: #1d1d1f;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.stock-single-nav__link--previous {
    align-items: flex-start;
    text-align: left;
}

.stock-single-nav__link--next {
    align-items: flex-end;
    text-align: right;
}

.stock-single-nav__link--list {
    min-height: 52px;
    align-items: center;
    align-self: center;
    background: #123458;
    color: #fff;
    white-space: nowrap;
}

.stock-single-nav a:hover,
.stock-single-nav a:focus-visible {
    border-color: #123458;
    background: #f1f5f9;
    color: #123458;
    text-decoration: none;
}

.stock-single-nav__link--list:hover,
.stock-single-nav__link--list:focus-visible {
    background: #0a2746;
    color: #fff;
}

.stock-single-nav a:focus-visible {
    outline: 3px solid #327fd9;
    outline-offset: 3px;
}

.stock-single-nav__label {
    font-weight: 600;
}

.stock-single-nav__title {
    display: -webkit-box;
    margin-top: 5px;
    overflow: hidden;
    font-size: 0.8rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.stock-single-nav__link.is-disabled {
    visibility: hidden;
}

@media (max-width: 768px) {
    .stock-single .car-title {
        margin-bottom: 18px;
        font-size: clamp(1.25rem, 5.5vw, 1.5rem);
        line-height: 1.45;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .stock-maker-filter__buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stock-maker-filter__button {
        width: 100%;
    }

    .stock-single-nav {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
    }

    .stock-single-nav__link--list {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .stock-single-nav__link--previous {
        grid-column: 1;
        grid-row: 2;
    }

    .stock-single-nav__link--next {
        grid-column: 2;
        grid-row: 2;
    }
}

/*
 * Keep the mobile CLOSE control on the same horizontal anchor as MENU.
 * The legacy header reserves a final grid column after MENU; the drawer uses a
 * separate fixed control, so its right offset must include that reserved space.
 */
@media screen and (max-width: 767.98px) {
    .l-drawer__header {
        right: 30px;
    }

    .l-drawer__nav + .l-drawer__nav .l-drawer__nav__ul {
        margin-top: 0;
    }
}

@media screen and (max-width: 575.98px) {
    .l-drawer__header {
        right: 26px;
    }

    .l-floating__button svg {
        flex: 0 0 18px;
    }

    .l-floating__button.\:entry svg {
        width: 18px;
        height: 18px;
    }
}
