/*
 * Shared mobile rules from the supplied 375px design data.
 *
 * Component CSS remains responsible for its internal card padding and special
 * display copy. This file owns only the site-wide SP type scale and the outer
 * 24px content gutter requested for all pages.
 */

@media (max-width: 768px) {
    :root {
        --yasuragi-body-copy-sp: 0.9375rem;
        --yasuragi-content-gutter-sp: 1.5rem;
    }

    /* Common Japanese h2 headings: 20px on SP. */
    body .jobs-section__heading,
    body .profile-section__heading,
    body .environment-section__heading,
    body .interview-section__heading,
    body .news-section__heading,
    body .page-about-content__heading,
    body .about-contents-section__heading,
    body .page-about-us-content__heading,
    body .philosophy-section__heading,
    body .workstyle-section__heading,
    body .wellness-section__heading,
    body .page-benefits-content__heading,
    body .benefits-overview__heading,
    body .career-growth__heading,
    body .features-merit__heading,
    body .data-section-heading__title,
    body .jobs-intro__heading,
    body .jobs-section-heading__title,
    body .our-family-intro__heading,
    body .staff-interview-list h2,
    body .staff-interview-question__title,
    body .recruitment-section-heading__title,
    body .recruitment-detail-intro__title,
    body .recruitment-detail-section-heading__title,
    body .recruitment-detail-location__title,
    body .contact-section-heading__title,
    body .contact-complete__title,
    body .entry-section-heading__title,
    body .entry-complete__title,
    body .privacy-policy__heading {
        font-size: 1.25rem;
    }

    /* Common Japanese h3 headings: 18px on SP. */
    body .jobs-section__card-title,
    body .environment-section__sub-heading,
    body .about-contents-section__card-title,
    body .page-about-us-content__message-title,
    body .workstyle-section__card-title,
    body .benefits-overview__card-title,
    body .benefits-points__title,
    body .career-growth__lead,
    body .career-growth__sub-heading,
    body .features-merit__title,
    body .features-merit-card__title,
    body .data-card__title,
    body .data-card h3,
    body .jobs-position__title,
    body .jobs-position__title.jobs-position--normal,
    body .jobs-schedule-block__title,
    body .jobs-schedule-block--teal .jobs-schedule-block__title,
    body .recruitment-group__title,
    body .recruitment-detail-card__title,
    body .entry-form__section-title,
    body .privacy-policy-section__title {
        font-size: 1.125rem;
    }

    /*
     * Body copy only. Labels, catch copy, numeric displays, card quotes and
     * CTA copy retain their component-specific design sizes.
     */
    body .about-section__description,
    body .jobs-section__description,
    body .jobs-section__card-text,
    body .profile-section__info-text,
    body .environment-section__benefit-text,
    body .about-contents-section__description,
    body .page-about-us-content__message-text p,
    body .philosophy-section__text,
    body .philosophy-section__value-subtitle,
    body .workstyle-section__card-text,
    body .benefits-overview__text,
    body .benefits-points__text,
    body .career-growth__intro,
    body .career-step__text,
    body .career-details__item p,
    body .features-merit__text p,
    body .features-achievement__note,
    body .features-merit-card__text,
    body .data-card__note,
    body .data-entry__text p,
    body .jobs-intro__description p,
    body .jobs-position__text,
    body .jobs-position__subhead,
    body .jobs-position__tags li,
    body .jobs-timeline li,
    body .jobs-timeline-card__note,
    body .jobs-work-list li,
    body .jobs-faq-item__answer,
    body .jobs-voice-card__body p,
    body .our-family-intro__text p,
    body .staff-interview-question__answer,
    body .recruitment-detail-intro__body p,
    body .recruitment-detail-card__body,
    body .recruitment-detail-table__content,
    body .recruitment-detail-location__body,
    body .recruitment-detail-entry__text p,
    body .news-index-item__excerpt,
    body .news-single__content p,
    body .contact-intro__lead,
    body .contact-callout__lead,
    body .entry-intro__lead,
    body .entry-callout__lead,
    body .privacy-policy__lead,
    body .privacy-policy-section__text,
    body .privacy-policy-section__list li {
        font-size: var(--yasuragi-body-copy-sp);
    }

    /*
     * Outer page/section gutter. Full-bleed media, waves, sliders and the CTA
     * banner are intentionally excluded; their own inner components keep
     * responsibility for cropping and decorative edges.
     */
    body .news-section,
    body .about-contents-section,
    body .workstyle-section,
    body .wellness-section,
    body .aboutus-contents-section,
    body .data-stats,
    body .jobs-positions,
    body .jobs-schedule,
    body .jobs-faq,
    body .jobs-related,
    body .jobs-voice,
    body .staff-interview-list--index,
    body .staff-interview-list,
    body .recruitment-index,
    body .recruitment-detail-intro,
    body .recruitment-detail-attractions,
    body .recruitment-detail-table-section,
    body .recruitment-detail-location,
    body .recruitment-detail-flow,
    body .news-index,
    body .news-single,
    body .contact-intro,
    body .contact-form-section,
    body .entry-intro,
    body .entry-form-section,
    body .privacy-policy {
        padding-right: var(--yasuragi-content-gutter-sp);
        padding-left: var(--yasuragi-content-gutter-sp);
    }

    /* The wave remains full bleed while its parent adopts the 24px gutter. */
    body .workstyle-section__wave-top {
        margin-right: calc(0px - var(--yasuragi-content-gutter-sp));
        margin-left: calc(0px - var(--yasuragi-content-gutter-sp));
    }

    /*
     * Shared lower-page MV geometry from the supplied 375px designs.
     * The first four templates overlap their following white panel by 40px,
     * so a 404px hero places that panel at the common y=364px boundary.
     */
    body .page-hero--about-company,
    body.page-template-template-staff-interview .staff-interview-hero {
        background-image: url("../images/about-company/about-company-hero-background-sp.webp");
        background-position: center center;
        background-size: cover;
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data),
    body.page-template-template-about-us .page-hero--about-company,
    body .page-hero--benefits-career,
    body .page-hero--jobs {
        height: 404px;
        min-height: 404px;
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__collage,
    body.page-template-template-about-us .page-hero--about-company .page-hero__collage,
    body .page-hero--benefits-career .page-hero__collage,
    body .page-hero--jobs .page-hero__collage {
        width: 100%;
        height: 404px;
        opacity: 1;
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__inner,
    body.page-template-template-about-us .page-hero--about-company .page-hero__inner,
    body .page-hero--benefits-career .page-hero__inner,
    body .page-hero--jobs .page-hero__inner {
        position: absolute;
        right: 0;
        bottom: 58px;
        left: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        padding: 0 24px;
    }

    body .page-hero--data .page-hero__inner,
    body .page-hero--our-family .page-hero__inner {
        position: absolute;
        right: 0;
        bottom: 42px;
        left: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        padding: 0 24px;
    }

    /* All lower-page Japanese H1 titles use the shared SP type token. */
    body .page-hero .page-hero__title,
    body .staff-interview-hero__title,
    body .news-single-hero .page-hero__title {
        font-size: 1.25rem;
        letter-spacing: 0.1em;
        margin-left: 0;
    }

    /*
     * Photo-collage MVs use one designated SP photo. The photo remains owned
     * by the hero/collage component rather than being offset from the page.
     */
    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__collage-photo--1,
    body.page-template-template-about-us .page-hero--about-company .page-hero__collage-photo--1,
    body .page-hero--benefits-career .page-hero__collage-photo--1,
    body .page-hero--jobs .page-hero__collage-photo--1,
    body .page-hero--data .page-hero__collage-photo--1,
    body .page-hero--our-family .page-hero__collage-photo--1 {
        display: none;
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-about-content__overlap-photo {
        top: 80px;
        right: -8px;
        width: 300px;
        height: auto;
    }

    body.page-template-template-about-us .page-about-content__overlap-photo {
        top: -285px;
        right: 0;
        width: 300px;
        height: auto;
    }

    body .page-hero--benefits-career .page-hero__collage-photo--2,
    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2 {
        top: 80px;
        right: -8px;
        width: 300px;
        height: auto;
    }

    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2 {
        transform: none;
    }

    body .page-hero--data .page-hero__collage {
        width: 100%;
    }

    body .page-hero--data .page-hero__collage-photo--2 {
        top: 80px;
        right: -5px;
        width: 250px;
        height: auto;
        transform: none;
    }
}

/*
 * Lower-page first views
 * --------------------------------------------------------------------------
 * The PC design exports include an 80px browser-chrome strip. The website
 * geometry therefore uses the design coordinates after removing that strip:
 * photo MVs expose 300px before the following panel and keep another 100px
 * behind the overlap; compact MVs expose 261px before their following panel.
 * The heading and photos stay owned by the MV instead of being offset from
 * the following section.
 */
@media (min-width: 769px) {
    body .page-hero--about-company {
        box-sizing: border-box;
        height: 301px;
        min-height: 301px;
        align-items: flex-start;
    }

    body .page-hero--about-company .page-hero__inner {
        box-sizing: border-box;
        display: flex;
        width: calc(100% - 160px);
        height: 261px;
        max-width: 1280px;
        padding: 72px 0 0;
        align-items: center;
    }

    body .page-hero--contact .page-hero__inner,
    body .page-hero--entry .page-hero__inner,
    body .page-hero--recruitment .page-hero__inner,
    body .page-hero--news .page-hero__inner,
    body .page-hero--news-single .page-hero__inner,
    body .page-hero--privacy-policy .page-hero__inner {
        justify-content: center;
        text-align: center;
    }

    body .page-hero--recruitment-detail .page-hero__inner {
        flex-direction: column;
        justify-content: center;
        padding-top: 132px;
        text-align: center;
    }

    body .page-hero--recruitment-detail .recruitment-detail-hero__tag {
        box-sizing: border-box;
        min-width: 336px;
        min-height: 40px;
        padding-top: 0;
        padding-bottom: 0;
        justify-content: center;
    }

    body.page-template-page-about-company .page-hero--about-company,
    body.page-template-template-about-us .page-hero--about-company,
    body .page-hero--benefits-career,
    body .page-hero--jobs,
    body .page-hero--data,
    body .page-hero--our-family {
        height: 400px;
        min-height: 400px;
    }

    body.page-template-page-about-company .page-hero--about-company .page-hero__inner,
    body.page-template-template-about-us .page-hero--about-company .page-hero__inner,
    body .page-hero--benefits-career .page-hero__inner,
    body .page-hero--jobs .page-hero__inner,
    body .page-hero--data .page-hero__inner,
    body .page-hero--our-family .page-hero__inner {
        height: 300px;
        padding-top: 72px;
        align-items: center;
    }

    body .page-about-content,
    body .page-about-us-content,
    body .page-benefits-content,
    body .jobs-intro {
        margin-top: -100px;
        border-radius: 20px 20px 0 0;
    }

    body.page-template-page-about-company .page-hero--about-company .page-hero__collage,
    body.page-template-template-about-us .page-hero--about-company .page-hero__collage,
    body .page-hero--benefits-career .page-hero__collage,
    body .page-hero--jobs .page-hero__collage,
    body.page-template-page-about-company .page-hero--data .page-hero__collage,
    body .page-hero--our-family .page-hero__collage {
        inset: 0;
        width: auto;
    }

    /* Keep every shared FV collage above the overlapping white content panel. */
    body .page-hero--about-company .page-hero__collage {
        z-index: 3;
    }

    body .page-hero--about-company .page-hero__inner {
        z-index: 4;
    }

    body.page-template-page-about-company .page-hero__collage-photo--1,
    body.page-template-template-about-us .page-hero__collage-photo--1,
    body .page-hero--benefits-career .page-hero__collage-photo--1,
    body .page-hero--jobs .page-hero__collage-photo--1,
    body .page-hero--our-family .page-hero__collage-photo--1 {
        top: -30px;
        right: auto;
        left: 53.4722%;
        width: min(365px, 25.3472vw);
        height: auto;
    }

    body.page-template-template-about-us .page-about-content__overlap-photo {
        top: -207px;
        right: 1.4583%;
        width: min(379px, 26.3194vw);
        height: auto;
    }

    body.page-template-page-about-company .page-about-content__overlap-photo,
    body .page-hero--benefits-career .page-hero__collage-photo--2,
    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2 {
        top: 93px;
        right: 1.4583%;
        width: min(379px, 26.3194vw);
        height: auto;
    }

    body .page-hero--data .page-hero__collage-photo--2 {
        top: 62px;
        right: 6%;
        width: min(320px, 22.2222vw);
        height: min(213px, 14.7917vw);
    }

    body.page-template-template-staff-interview .staff-interview-hero {
        align-items: flex-start;
    }

    body.page-template-template-staff-interview .staff-interview-hero__inner {
        box-sizing: border-box;
        display: flex;
        width: calc(100% - 160px);
        height: 300px;
        max-width: 1280px;
        padding: 72px 0 0;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    body.page-template-template-staff-interview .staff-interview-hero__photo--sign {
        z-index: 1;
    }

    body.page-template-template-staff-interview .staff-interview-hero__photo--person {
        z-index: 2;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    body .page-hero--about-company .page-hero__inner {
        width: calc(100% - 64px);
    }

    body .page-hero__collage,
    body .page-hero--data .page-hero__collage,
    body .page-hero--our-family .page-hero__collage {
        width: 62%;
    }

    body.page-template-page-about-company .page-hero__collage-photo--1,
    body.page-template-template-about-us .page-hero__collage-photo--1,
    body .page-hero--benefits-career .page-hero__collage-photo--1,
    body .page-hero--jobs .page-hero__collage-photo--1,
    body .page-hero--data .page-hero__collage-photo--1,
    body .page-hero--our-family .page-hero__collage-photo--1 {
        right: 39%;
        left: auto;
        width: 280px;
    }

    body.page-template-page-about-company .page-about-content__overlap-photo,
    body.page-template-template-about-us .page-about-content__overlap-photo,
    body .page-hero--benefits-career .page-hero__collage-photo--2,
    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2 {
        top: 93px;
        right: 0;
        left: auto;
        width: 300px;
    }

    body .page-hero--data .page-hero__collage-photo--2 {
        top: 93px;
        right: 0;
        width: 300px;
        height: auto;
        transform: none;
    }

    body.page-template-template-staff-interview .staff-interview-hero__inner {
        width: calc(100% - 64px);
    }

    body.page-template-template-staff-interview .staff-interview-hero__collage {
        inset: 0 0 0 auto;
        width: 62%;
    }

    body.page-template-template-staff-interview .staff-interview-hero__photo--sign {
        right: 39%;
        width: 280px;
    }

    body.page-template-template-staff-interview .staff-interview-hero__photo--person {
        right: 0;
        width: min(300px, 47.0207%);
    }
}

/*
 * On desktop the two exported hero photos form one 720px design group.
 * The group follows the centered 1440px design canvas; its children use only
 * group-relative coordinates, so wider viewports cannot pull them apart.
 */
@media (min-width: 1025px) {
    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__collage,
    body.page-template-template-about-us .page-hero--about-company .page-hero__collage,
    body .page-hero--benefits-career .page-hero__collage,
    body .page-hero--jobs .page-hero__collage,
    body.page-template-page-about-company .page-hero--data .page-hero__collage,
    body .page-hero--our-family .page-hero__collage {
        inset: 0 auto 0 50%;
        width: min(720px, 52vw);
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__collage-photo--1,
    body.page-template-template-about-us .page-hero__collage-photo--1,
    body .page-hero--benefits-career .page-hero__collage-photo--1,
    body .page-hero--jobs .page-hero__collage-photo--1,
    body .page-hero--data .page-hero__collage-photo--1,
    body .page-hero--our-family .page-hero__collage-photo--1 {
        top: -30px;
        right: auto;
        left: 6.9444%;
        width: 50.6944%;
        height: auto;
    }

    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-hero__collage-photo--2,
    body.page-template-template-about-us .page-hero__collage-photo--2,
    body .page-hero--benefits-career .page-hero__collage-photo--2,
    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--data .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2 {
        top: 93px;
        right: auto;
        left: 43.4722%;
        width: 52.6389%;
        height: auto;
    }

    body .page-hero--data .page-hero__collage-photo--2 {
        transform: none;
    }

    /* The editable interview photo uses its own CSS frame, not a precomposed export. */
    body.page-template-template-staff-interview .staff-interview-hero__photo--person {
        width: min(338.549px, 47.0207%);
    }
}

@media (max-width: 768px) {
    body.page-template-page-about-company .page-hero--about-company:not(.page-hero--data) .page-about-content__overlap-photo,
    body.page-template-template-about-us .page-about-content__overlap-photo,
    body .page-hero--benefits-career .page-hero__collage-photo--2,
    body .page-hero--jobs .page-hero__collage-photo--2,
    body .page-hero--our-family .page-hero__collage-photo--2,
    body .page-hero--data.page-hero--about-company
    .page-hero__collage
    .page-hero__collage-photo--2 {
        top: 76px;
        right: -20px;
        width: 269px;
        height: auto;
    }

    /*
     * Detail-page quotes can occupy three lines. Lift the person photo within
     * the shared FV group so variable text never runs underneath the image.
     */
    body.page-template-template-staff-interview .staff-interview-hero__photo--person {
        top: 48px;
    }
}

/*
 * The shared FV photo exports include the white frame and -12deg angle in
 * their bitmaps (the about-company reference is 568x444). The staff detail
 * uses an editable photo, so its CSS frame is inverse-sized and positioned so
 * the rotated visual bounds occupy the same shared photo slot.
 */
body.page-template-template-staff-interview
.page-hero--our-family.page-hero--staff-interview-detail
.staff-interview-hero__photo--person {
    --staff-fv-slot-width: 269px;
    --staff-fv-slot-height: 210.265625px;
    --staff-fv-frame-width: 240.166644px;
    --staff-fv-frame-height: 163.923313px;
    --staff-fv-slot-top: 76px;
    --staff-fv-slot-right: -20px;
    box-sizing: border-box;
    top: calc(var(--staff-fv-slot-top) + (var(--staff-fv-slot-height) - var(--staff-fv-frame-height)) / 2);
    right: calc(var(--staff-fv-slot-right) + (var(--staff-fv-slot-width) - var(--staff-fv-frame-width)) / 2);
    left: auto;
    width: var(--staff-fv-frame-width);
    height: var(--staff-fv-frame-height);
    aspect-ratio: auto;
    transform: rotate(-12deg);
}

@media (min-width: 769px) and (max-width: 1024px) {
    body.page-template-template-staff-interview
    .page-hero--our-family.page-hero--staff-interview-detail
    .staff-interview-hero__photo--person {
        --staff-fv-slot-width: 300px;
        --staff-fv-slot-height: 234.507042px;
        --staff-fv-frame-width: 267.843841px;
        --staff-fv-frame-height: 182.814103px;
        --staff-fv-slot-top: 93px;
        --staff-fv-slot-right: 0px;
    }
}

@media (min-width: 1025px) {
    body.page-template-template-staff-interview
    .page-hero--our-family.page-hero--staff-interview-detail
    .staff-interview-hero__photo--person {
        --staff-fv-slot-width: min(379px, 27.372228vw);
        --staff-fv-slot-height: min(296.25px, 21.396601vw);
        --staff-fv-frame-width: min(338.376053px, 24.438276vw);
        --staff-fv-frame-height: min(230.95515px, 16.680098vw);
        --staff-fv-slot-top: 93px;
        --staff-fv-slot-right: 3.8889%;
    }
}
