/*
 * TOP page tablet layout
 * --------------------------------------------------------------------------
 * Keep the PC composition through tablet where it remains readable, then
 * reduce only the structures that become too narrow before the SP layout.
 */

/*
 * Compact tablets such as iPad mini are 744px wide in portrait. They need
 * the intermediate composition rather than the 375px-specific TOP layout.
 * This layer is TOP-scoped so lower pages and phone designs stay untouched.
 */
@media (min-width: 601px) and (max-width: 1024px) {
    /*
     * The desktop collage is a wide transparent artwork. A viewport-height
     * hero turns it into a tall crop on portrait tablets, so keep this layer
     * close to the artwork's aspect ratio instead.
     */
    body.home .hero {
        height: clamp(440px, 52vw, 560px);
        min-height: 0;
    }

    body.home .hero__background {
        background-image: url('../images/top-hero/top-hero-background.webp');
    }

    body.home .hero__photos,
    body.home .front-page-hero-stack__photos {
        inset: auto 0 auto -17px;
        top: -60px;
        height: calc(100% + 120px);
    }

    body.home .hero__collage picture,
    body.home .hero__collage img {
        width: 100%;
        height: 100%;
        margin: 0;
    }

    body.home .hero__title {
        margin: 3.5rem 0 1rem;
    }

    body.home .hero__title-image {
        width: clamp(280px, 48vw, 400px);
    }

    body.home .hero__content {
        gap: 1.5rem;
    }
}

@media (min-width: 601px) and (max-width: 768px) {
    :root {
        --yasuragi-content-gutter-tablet: clamp(1.5rem, 4.6875vw, 2rem);
        --yasuragi-content-gap-tablet: clamp(1.25rem, 3.125vw, 1.5rem);
    }

    body.home .about-section {
        --about-divider-lane: 64px;
        --about-photo-width: 200px;
        --about-wave-gap: 80px;
    }

    body.home .about-section__container {
        padding: 4rem var(--yasuragi-content-gutter-tablet) 5rem;
        border-radius: 32px 32px 0 0;
    }

    body.home .about-section__inner {
        grid-template-columns: minmax(0, 1fr) var(--about-divider-lane) var(--about-photo-width);
    }

    body.home .about-section__content {
        align-self: center;
        padding: 0;
    }

    body.home .about-section__divider {
        display: block;
        margin: -4rem 1rem calc(-1 * var(--about-wave-gap));
    }

    body.home .about-section__timeline {
        grid-column: 3;
        padding: 2rem 0 0;
        gap: 1.5rem;
    }

    body.home .about-section__timeline-item {
        display: grid;
        width: calc(100% + var(--about-divider-lane));
        height: auto;
        margin-left: calc(-1 * var(--about-divider-lane));
    }

    body.home .about-section__timeline-connector {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        transform: none;
    }

    body.home .about-section__timeline-photo,
    body.home .about-section__timeline-item:nth-child(2) .about-section__timeline-photo {
        width: var(--about-photo-width);
        height: 150px;
        margin-right: 0;
        border-width: 8px;
    }

    body.home .about-section__wave-svg--pc {
        display: block;
        height: 64px;
    }

    body.home .about-section__wave-svg--sp {
        display: none;
    }

    body.home .jobs-section,
    body.home .environment-section,
    body.home .interview-section,
    body.home .news-section,
    body.home .footer-banner__top,
    body.home .footer-banner__bottom,
    body.home .site-footer {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .jobs-section {
        padding-top: 5rem;
    }

    body.home .jobs-section__header {
        display: grid;
        grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
        gap: var(--yasuragi-content-gap-tablet);
        align-items: center;
    }

    body.home .jobs-section__header-left {
        align-self: center;
    }

    body.home .jobs-section__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--yasuragi-content-gap-tablet);
    }

    body.home .jobs-section__card:last-child {
        grid-column: 1 / -1;
        width: calc((100% - var(--yasuragi-content-gap-tablet)) / 2);
        justify-self: center;
    }

    body.home .jobs-section__card-inner {
        padding: 2.25rem 1.25rem 1.5rem;
    }

    body.home .jobs-section__card-illustration {
        width: auto;
        height: 138px;
        aspect-ratio: auto;
    }

    body.home .environment-section__wave-top,
    body.home .environment-section__links-wrap,
    body.home .footer-banner__arc {
        margin-right: calc(-1 * var(--yasuragi-content-gutter-tablet));
        margin-left: calc(-1 * var(--yasuragi-content-gutter-tablet));
    }

    body.home .environment-section__benefits-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--yasuragi-content-gap-tablet);
    }

    body.home .environment-section__benefits-right {
        gap: var(--yasuragi-content-gap-tablet);
    }

    body.home .environment-section__benefit-inner,
    body.home .environment-section__benefit--tall .environment-section__benefit-inner,
    body.home .environment-section__benefit--compact:first-child .environment-section__benefit-inner,
    body.home .environment-section__benefit--compact:last-child .environment-section__benefit-inner {
        height: auto;
    }

    body.home .environment-section__benefit--compact .environment-section__benefit-inner--row {
        display: flex;
        gap: 1rem;
    }

    body.home .environment-section__benefit-body {
        display: block;
    }

    body.home .environment-section__benefit--compact .environment-section__benefit-title,
    body.home .environment-section__benefit--compact .environment-section__benefit-text {
        grid-column: auto;
    }

    body.home .environment-section__links-wrap {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .photo-banner__image {
        height: auto;
    }

    body.home .photo-banner__image img {
        height: auto;
        object-fit: initial;
    }

    body.home .photo-banner__arc-svg--pc {
        display: block;
        height: 64px;
    }

    body.home .photo-banner__arc-svg--sp {
        display: none;
    }

    body.home .interview-section {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    body.home .interview-section__header {
        flex-direction: row;
        align-items: center;
        gap: 0;
    }

    body.home .interview-section__header-right {
        width: auto;
    }

    body.home .interview-section__counter {
        margin-right: 0;
    }

    body.home .interview-section__divider {
        margin: 2.75rem auto 2.5rem;
    }

    body.home .interview-section__carousel {
        padding-left: 0;
    }

    body.home .interview-section__track {
        gap: 2rem;
    }

    body.home .interview-section__card {
        flex-basis: 320px;
    }

    body.home .interview-section__card-photo {
        width: 320px;
        height: auto;
        aspect-ratio: 377 / 408;
        border-width: 10px 10px 6px;
        margin-bottom: 1.5rem;
    }

    body.home .interview-section__card-photo img {
        height: 100%;
    }

    body.home .footer-banner__bottom {
        padding-bottom: 4rem;
    }

    body.home .footer-banner__bottom-subtitle {
        display: flex;
        padding: 3.5rem 0 2rem;
    }

    body.home .footer-banner__bottom-line {
        display: block;
    }

    body.home .footer-banner__cards {
        grid-template-columns: minmax(0, 860fr) minmax(0, 408fr);
        gap: 0.75rem;
    }

    body.home .footer-banner__cards-right {
        gap: 0.75rem;
    }

    body.home .footer-banner__card--entry {
        min-height: 320px;
    }

    body.home .footer-banner__card--blue,
    body.home .footer-banner__card--teal {
        min-height: 154px;
    }

    body.home .footer-banner__card--entry .footer-banner__card-label {
        left: 1.625rem;
        font-size: 3.25rem;
    }

    body.home .footer-banner__card--entry .footer-banner__card-title {
        right: 4.5rem;
        font-size: 1.625rem;
    }

    body.home .site-footer__inner {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 1.5rem;
        padding: 3rem 0;
    }

    body.home .site-footer__branding {
        flex-direction: column;
    }

    body.home .site-footer__logo-icon {
        width: 72px;
    }

    body.home .site-footer__nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    body.home .site-footer__col {
        padding: 0 0.75rem;
        gap: 1rem;
    }

    body.home .site-footer__copyright {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .news-section {
        padding-top: 4.5rem;
        padding-bottom: 4.5rem;
    }

    body.home .news-section__inner {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 2rem;
    }

    body.home .news-section__item-main {
        display: flex;
    }

    body.home .news-section__item-badge,
    body.home .news-section__item-date,
    body.home .news-section__item-title {
        grid-column: auto;
        grid-row: auto;
    }

    body.home .news-section__item-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --yasuragi-content-gutter-tablet: clamp(2rem, 4.6875vw, 3rem);
        --yasuragi-content-gap-tablet: clamp(1.5rem, 3.125vw, 2rem);
    }

    /* About keeps its PC timeline because the fixed photo column still fits. */
    body.home .about-section__container {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .about-section__divider {
        margin-right: 1.5rem;
    }

    /*
     * The heading and introduction remain side by side at tablet widths.
     * This avoids a short heading followed by a disconnected text block.
     */
    body.home .jobs-section {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .jobs-section__header {
        display: grid;
        grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.2fr);
        gap: var(--yasuragi-content-gap-tablet);
        align-items: center;
    }

    body.home .jobs-section__header-left {
        align-self: center;
    }

    body.home .jobs-section__cards {
        gap: var(--yasuragi-content-gap-tablet);
    }

    body.home .jobs-section__card-inner {
        padding: 2.25rem 1.5rem 1.75rem;
    }

    body.home .jobs-section__card-illustration {
        height: clamp(138px, 16vw, 170px);
    }

    body.home .environment-section {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .environment-section__wave-top {
        margin-right: calc(-1 * var(--yasuragi-content-gutter-tablet));
        margin-left: calc(-1 * var(--yasuragi-content-gutter-tablet));
    }

    body.home .environment-section__links-wrap {
        margin-right: calc(-1 * var(--yasuragi-content-gutter-tablet));
        margin-left: calc(-1 * var(--yasuragi-content-gutter-tablet));
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .environment-section__benefits-grid,
    body.home .environment-section__benefits-right {
        gap: var(--yasuragi-content-gap-tablet);
    }

    body.home .environment-section__link-item {
        grid-template-columns: minmax(180px, 0.82fr) minmax(0, 1fr) 40px;
    }

    body.home .environment-section__link-photo {
        width: 100%;
    }

    body.home .interview-section {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .interview-section__carousel {
        padding-left: 0;
    }

    body.home .interview-section__track {
        gap: clamp(2rem, 4vw, 3rem);
    }

    body.home .interview-section__card {
        flex-basis: clamp(320px, 35vw, 360px);
    }

    body.home .interview-section__card-photo {
        width: 100%;
        height: auto;
        aspect-ratio: 377 / 408;
    }

    body.home .interview-section__card-photo-wrap,
    body.home .interview-section__card-photo img {
        height: 100%;
    }

    body.home .interview-section__card-quote-line {
        font-size: 1.125rem;
    }

    body.home .news-section {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .footer-banner__top,
    body.home .footer-banner__bottom,
    body.home .site-footer {
        padding-right: var(--yasuragi-content-gutter-tablet);
        padding-left: var(--yasuragi-content-gutter-tablet);
    }

    body.home .footer-banner__arc {
        margin-right: calc(-1 * var(--yasuragi-content-gutter-tablet));
        margin-left: calc(-1 * var(--yasuragi-content-gutter-tablet));
    }
}

/*
 * Three job cards are still comfortable above 960px. Below that width, the
 * last card becomes a centered peer rather than compressing every card.
 */
@media (min-width: 769px) and (max-width: 960px) {
    body.home .jobs-section__header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    body.home .jobs-section__cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.home .jobs-section__card:last-child {
        grid-column: 1 / -1;
        width: calc((100% - var(--yasuragi-content-gap-tablet)) / 2);
        justify-self: center;
    }
}
