/* 共通: バス乗車便利ツール（index / home_hiyoshi / home_shinkawasaki） */

:root {
    --primary: #77a6c8;
    --secondary: #316789;
    --tertiary: #e75b4f;
    --white: #ffffff;
    --gray: #666666;
    --primary-container: #f3fafc;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* 発車予定ページ用 .frame（grid） */
.frame {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100svh;
    padding: 24px 12px;
    background-color: var(--primary-container);
    font-family: "Noto Sans JP", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
}

.itemOrder {
    align-self: start;
}

.orderList {
    display: grid;
    gap: 16px;
    counter-reset: orderNum;

    .orderListItem {
        display: grid;
        align-items: center;
        gap: 12px;
        counter-increment: orderNum;
        position: relative;
        padding: 16px 12px;
        border-radius: 12px;
        box-shadow: 0 0 16px color-mix(in srgb, var(--secondary) 10%, transparent);
        background-color: var(--white);

        &.col2 {
            grid-template-columns: auto 1fr;
        }

        &.col3 {
            grid-template-columns: auto 1fr 56px;
        }

        &::before {
            display: grid;
            place-content: center;
            content: counter(orderNum);
            position: static;
            width: 24px;
            height: 24px;
            color: var(--primary);
            font-size: 14px;
            border: 1px solid var(--primary);
            border-radius: 999em;
        }

        &.departed {
            filter: grayscale(1);
            opacity: 0.5;
            pointer-events: none;
        }

        &.active {
            border: 2px solid var(--tertiary);
            box-shadow: 0 0 20px color-mix(in srgb, var(--tertiary) 20%, transparent);
        }

        .busInfo {
            .busInfoTop {
                display: grid;
                grid-template-columns: auto 1fr;
                align-items: center;
                gap: 8px;

                .destinationNumber {
                    padding: 4px;
                    border-radius: 6px;
                    background-color: color-mix(in srgb, var(--primary) 10%, transparent);
                    color: var(--primary);
                    font-size: 14px;
                    font-weight: bold;
                    line-height: 1;
                }

                .destinationName {
                    color: var(--gray);
                    font-size: 14px;
                    font-weight: bold;
                }
            }

            .busInfoBottom {
                display: grid;
                grid-template-columns: auto 1fr;
                align-items: end;
                gap: 8px;

                .departure {
                    color: var(--tertiary);
                    font-size: 30px;
                    font-weight: 700;
                    line-height: 1;
                }

                .alighting {
                    font-size: 14px;
                }
            }
        }

        .platformInfo {
            display: grid;
            place-content: center;
            width: 56px;
            height: 56px;
            border-radius: 6px;
            background-color: var(--secondary);
            color: var(--white);
            text-align: center;

            .platformLabel {
                font-size: 12px;
                line-height: 1;
            }

            .platformNumber {
                font-size: 28px;
                line-height: 1;
            }
        }
    }
}

.buttonArea {
    align-self: end;
}

.button {
    display: block;
    width: 100%;
    padding: 16px;
    border: 0;
    border-radius: 6px;
    color: var(--white);
    font-size: 16px;
    font-weight: bold;

    &.reload {
        background-color: var(--tertiary);
    }
}

/* トップページ（index）用 */
body.page-index .frame {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100svh;
    padding: 24px;
    background-color: var(--primary-container);

    .cover {
        overflow: hidden;
        border-radius: 16px;

        img {
            object-fit: cover;
            width: 100%;
            height: 100%;
        }
    }

    .select-list {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;

        & > div {
            &.hiyoshi {
                flex: 1;
                min-width: 0;
            }

            &.shinkawsaki {
                width: 32%;
            }

            &.station {
                width: 100%;
            }

            button {
                display: grid;
                width: 100%;
                padding: 16px 8px;
                border: 0;
                border-radius: 6px;
                background-color: green;
                color: var(--white);
                font-size: 18px;
                font-weight: bold;
                line-height: 1.4;

                .sub {
                    font-size: 0.7em;
                    font-weight: normal;
                }

                &.home {
                    background-color: var(--tertiary);
                }

                &.station {
                    background-color: var(--secondary);
                }

                &.disabled {
                    background-color: #cccccc;
                    color: #999999;
                    pointer-events: none;
                }
            }
        }
    }
}
