/*
 * Responsive styles for /home.
 * Keep the desktop baseline in common.css and scope rollout rules by page.
 *
 * 1100px: fluid desktop layout
 *  940px: hero selector reflow
 *  834px: compact header and mobile navigation
 *  680px: single-column content layout
 */

/* TOP baseline adjustments */

/* Let TOP section headings follow their container instead of a fixed-width image. */
body.top-css-nav .h1_ful {
    position: relative;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: calc(100% - 51px) 2px;
}

body.top-css-nav .h1_ful::before,
body.top-css-nav .h1_ful::after {
    content: "";
    position: absolute;
    height: 2px;
    background-color: currentColor;
    transform-origin: left center;
    pointer-events: none;
}

body.top-css-nav .h1_ful::before {
    left: 0;
    bottom: 10px;
    width: 41px;
    transform: rotate(-43deg);
}

body.top-css-nav .h1_ful::after {
    left: 30px;
    bottom: 38px;
    width: 44px;
    transform: rotate(61deg);
}

body.top-css-nav .topics th {
    padding: 0 0 0 12px;
}

body.top-css-nav .topics .topi_ttl {
    padding: 0;
    border-left: 0;
    border-right: 0;
    font-size: 16px;
    font-weight: 600;
}

body.top-css-nav .topics td.date {
    padding: 8px 8px 12px 0;
    line-height: 20px;
    background-image: none;
}

body.top-css-nav .topics td.topi_cont {
    padding: 8px 8px 12px 0;
    line-height: 20px;
}

body.top-css-nav .topics td.topi_cont2 {
    padding: 8px 0 12px 8px;
    line-height: 20px;
}

body.top-css-nav .topics td.date,
body.top-css-nav .topics td.topi_cont,
body.top-css-nav .topics td.topi_cont2 {
    border-bottom: 1px solid #c8c8c8;
}

body.top-css-nav #top_right {
    width: 705px;
}

body.top-css-nav #top_main {
    padding: 0 0 0 20px;
}

/* Keep the footer background in step with wrapped navigation content. */
body.top-css-nav .foot,
body.top-css-nav .f_content,
body.top-css-nav #f_nav {
    height: auto;
}

body.top-css-nav .f_content {
    padding-bottom: 12px;
}

body.top-css-nav .copyright {
    display: block;
}

body.top-css-nav .top-mobile-actions {
    display: none;
}

/* Fluid desktop layout */
@media screen and (max-width: 1100px) {
    body.top-css-nav {
        min-width: 0;
    }

    body.top-css-nav #top_header_in,
    body.top-css-nav #top,
    body.top-css-nav #top_bt,
    body.top-css-nav .wr_top,
    body.top-css-nav .wr_in {
        width: calc(100% - 32px);
        max-width: 980px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    body.top-css-nav #top_bt {
        background-size: min(850px, 100%) 11px;
    }

    body.top-css-nav #f_nav ul {
        width: 100%;
        max-width: 810px;
        box-sizing: border-box;
    }

    body.top-css-nav #h {
        width: 100%;
        box-sizing: border-box;
    }

    body.top-css-nav #h_left {
        width: clamp(190px, calc(100% - 745px), 235px);
    }

    body.top-css-nav #h_left img {
        width: 141px;
        max-width: 100%;
    }

    body.top-css-nav #h_right {
        width: min(745px, calc(100% - 190px));
    }

    body.top-css-nav #SizeChange {
        width: calc(100% - 234px);
        max-width: 511px;
    }

    body.top-css-nav #SizeChange .utility-search {
        width: calc(100% - 221px);
        max-width: 290px;
        margin-left: 30px;
        margin-right: 24px;
    }

    body.top-css-nav #h_nav.css-gnav ul {
        display: flex;
        width: 100%;
    }

    body.top-css-nav #h_nav.css-gnav li {
        float: none;
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    /* Keep equal columns until the two longest labels need more room. */
    body.top-css-nav #h_nav.css-gnav li:nth-child(2) {
        min-width: 135px;
    }

    body.top-css-nav #h_nav.css-gnav li:nth-child(5) {
        min-width: 120px;
    }

    body.top-css-nav #h_pan {
        height: 27px;
        width: calc(100% - 456px);
        box-sizing: border-box;
    }

    body.top-css-nav #h_contact {
        width: 456px;
    }

    body.top-css-nav #h_contact .h_contact_label_text {
        width: 130px;
    }

    body.top-css-nav #topimage {
        height: auto;
    }

    body.top-css-nav #top {
        overflow: visible;
    }

    body.top-css-nav #top_img1 {
        width: 100%;
        height: auto;
        aspect-ratio: 980 / 292;
    }

    body.top-css-nav #top_img1 .top_common,
    body.top-css-nav #top_img1 .top_common img {
        width: 100%;
        height: 100%;
    }

    body.top-css-nav #top_img1 .top_common img {
        display: block;
        object-fit: contain;
    }

    body.top-css-nav #top_img2 {
        width: 100%;
        box-sizing: border-box;
    }

    body.top-css-nav .wr_top img,
    body.top-css-nav #btn_space_gyousyu img,
    body.top-css-nav #bana img {
        max-width: 100%;
        height: auto;
    }

    body.top-css-nav #bg_space_gyousyu,
    body.top-css-nav #btn_space_gyousyu ul {
        width: 100%;
        height: auto;
    }

    body.top-css-nav #btn_space_gyousyu ul {
        display: flex;
        gap: 15px;
    }

    body.top-css-nav #btn_space_gyousyu li,
    body.top-css-nav #btn_space_gyousyu li:first-child {
        display: block;
        flex: 1 1 0;
        width: auto;
        height: auto;
        margin-left: 0;
    }

    body.top-css-nav #top_right {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    body.top-css-nav #top_main {
        flex: 0 1 clamp(190px, 28vw, 255px);
        min-width: 190px;
        box-sizing: border-box;
    }
}

/* Reflow the five hero selectors before their labels become cramped. */
@media screen and (max-width: 940px) {
    body.top-css-nav #top_img2 {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    body.top-css-nav #top_img2 a {
        min-height: 91px;
        height: auto;
        box-sizing: border-box;
    }

    body.top-css-nav #top_img2 a:nth-child(-n+2) {
        grid-column: span 3;
    }

    body.top-css-nav #top_img2 a:nth-child(n+3) {
        grid-column: span 2;
    }
}

/* Compact header and full-screen navigation */
@media screen and (max-width: 834px) {
    body.top-css-nav.mobile-nav-open {
        overflow: hidden;
    }

    body.top-css-nav.mobile-nav-open #top_header {
        z-index: 1000;
    }

    body.top-css-nav #top_header {
        height: 101px;
        border-bottom: 1px solid #d7dae3;
        background: #ffffff;
    }

    body.top-css-nav #top_header_in {
        width: 100%;
        max-width: none;
        padding: 0 16px;
    }

    body.top-css-nav #h {
        position: relative;
        height: 64px;
        border-bottom: 1px solid #7188cf;
    }

    body.top-css-nav #h_left {
        width: auto;
        height: 64px;
    }

    body.top-css-nav #h_left a {
        height: 64px;
    }

    body.top-css-nav #h_left img {
        width: 150px;
        max-width: none;
    }

    body.top-css-nav #h_right {
        display: none;
    }

    body.top-css-nav .top-mobile-actions {
        float: right;
        display: flex;
        align-items: center;
        height: 64px;
    }

    body.top-css-nav .top-mobile-menu-toggle {
        position: relative;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #2f4790;
        cursor: pointer;
    }

    body.top-css-nav .top-mobile-menu-toggle:focus-visible {
        outline: 2px solid #7188cf;
        outline-offset: 2px;
    }

    body.top-css-nav .top-mobile-menu-icon,
    body.top-css-nav .top-mobile-menu-icon::before,
    body.top-css-nav .top-mobile-menu-icon::after {
        position: absolute;
        width: 24px;
        height: 2px;
        background-color: currentColor;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    body.top-css-nav .top-mobile-menu-icon {
        top: 21px;
        left: 10px;
    }

    body.top-css-nav .top-mobile-menu-icon::before,
    body.top-css-nav .top-mobile-menu-icon::after {
        left: 0;
        content: "";
    }

    body.top-css-nav .top-mobile-menu-icon::before {
        top: -7px;
    }

    body.top-css-nav .top-mobile-menu-icon::after {
        top: 7px;
    }

    body.top-css-nav .top-mobile-menu-toggle[aria-expanded="true"] .top-mobile-menu-icon {
        background-color: transparent;
    }

    body.top-css-nav .top-mobile-menu-toggle[aria-expanded="true"] .top-mobile-menu-icon::before {
        transform: translateY(7px) rotate(45deg);
    }

    body.top-css-nav .top-mobile-menu-toggle[aria-expanded="true"] .top-mobile-menu-icon::after {
        transform: translateY(-7px) rotate(-45deg);
    }

    body.top-css-nav #h_nav.css-gnav {
        position: fixed;
        z-index: 30;
        top: 64px;
        right: 0;
        bottom: 0;
        left: 0;
        display: none;
        width: 100%;
        height: calc(100vh - 64px);
        height: calc(100dvh - 64px);
        overflow-x: hidden;
        overflow-y: auto;
        background: #f7f8fb;
        box-shadow: inset 0 1px 0 #d7dae3;
    }

    body.top-css-nav.mobile-nav-open #h_nav.css-gnav {
        display: block;
    }

    body.top-css-nav #h_nav.css-gnav ul {
        display: block;
        width: 100%;
        height: auto;
        padding: 22px 24px 36px;
        box-sizing: border-box;
        overflow: visible;
    }

    body.top-css-nav #h_nav.css-gnav li,
    body.top-css-nav #h_nav.css-gnav li:nth-child(2),
    body.top-css-nav #h_nav.css-gnav li:nth-child(5) {
        float: none;
        width: 100%;
        min-width: 0;
        height: auto;
        border-bottom: 1px solid #d9dce5;
    }

    body.top-css-nav #h_nav.css-gnav li + li::before,
    body.top-css-nav #h_nav.css-gnav li a::before {
        display: none;
    }

    body.top-css-nav #h_nav.css-gnav li a {
        height: auto;
        min-height: 62px;
        padding: 12px 4px;
        text-align: left;
    }

    body.top-css-nav #h_nav.css-gnav li a::after {
        right: auto;
        bottom: -1px;
        left: 0;
        width: 54px;
    }

    body.top-css-nav #h_nav.css-gnav li a .jp {
        margin-top: 0;
        font-size: 19px;
        line-height: 24px;
    }

    body.top-css-nav #h_nav.css-gnav li a .en {
        margin-top: 2px;
        font-size: 11px;
        line-height: 15px;
    }

    body.top-css-nav #h_pan {
        float: none;
        width: 100%;
        height: 36px;
        padding: 7px 0 0;
    }

    body.top-css-nav #h_contact {
        display: none;
    }

    body.top-css-nav .h1_ful {
        box-sizing: border-box;
        height: auto;
        min-height: 0;
        margin: 24px 0 18px;
        padding: 8px 0 10px;
        border-bottom: 2px solid currentColor;
        background-image: none;
        font-size: 22px;
        line-height: 1.4;
        white-space: normal;
    }

    body.top-css-nav .h1_ful::before,
    body.top-css-nav .h1_ful::after {
        display: none;
    }
}

/* Stack the main content and footer banners on phones. */
@media screen and (max-width: 680px) {
    body.top-css-nav #top_img1 {
        width: calc(100% + 32px);
        margin: 12px 0 12px -16px;
    }

    body.top-css-nav #btn_space_gyousyu ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 232px));
        justify-content: center;
        gap: 10px;
    }

    body.top-css-nav #btn_space_gyousyu a,
    body.top-css-nav #btn_space_gyousyu img {
        display: block;
        width: 100%;
    }

    body.top-css-nav .wr_in {
        display: block;
    }

    body.top-css-nav #top_right,
    body.top-css-nav #top_main {
        width: 100%;
        min-width: 0;
    }

    body.top-css-nav #top_main {
        padding: 24px 0 0;
    }

    body.top-css-nav #category,
    body.top-css-nav #category tbody {
        display: block;
        width: 100%;
    }

    /* jQuery show() writes an inline display value; visible rows must remain grids. */
    body.top-css-nav #category tr:not([style*="display: none"]) {
        display: grid !important;
        grid-template-columns: 106px minmax(0, 1fr);
    }

    body.top-css-nav #category tr:first-child,
    body.top-css-nav #category #more {
        grid-template-columns: 1fr;
    }

    body.top-css-nav #category th,
    body.top-css-nav #category td {
        box-sizing: border-box;
        width: auto;
    }

    body.top-css-nav #category th {
        grid-column: 1 / -1;
    }

    body.top-css-nav #category td.date,
    body.top-css-nav #category td.topi_cont {
        border-bottom: 0;
    }

    body.top-css-nav #category td.topi_cont2 {
        grid-column: 1 / -1;
        padding: 0 0 12px;
    }

    body.top-css-nav #category #more td.date,
    body.top-css-nav #category #more td.topi_cont {
        display: none;
    }

    body.top-css-nav #category #more td.topi_cont2 {
        grid-column: 1;
    }

    body.top-css-nav #bana ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 245px));
        justify-content: center;
        gap: 10px;
        margin: 0;
        padding: 0;
    }

    body.top-css-nav #bana li,
    body.top-css-nav #bana a,
    body.top-css-nav #bana img {
        display: block;
        width: 100%;
    }

    body.top-css-nav #bana li:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(245px, 100%);
    }
}
