/*
 * トップの「制作実績」カード（index.php の .portfolio.top-works）
 * 白い帯の上に、端末の 3D 画像（img/works/<案件>/top.webp）と記事名を 2 列で並べる。
 * スマホでは横にスクロールするカードにする。
 */
.portfolio.top-works {
    background: #fff;
    padding: 24px 0 88px;
    margin-top: 48px;
}
.top-works .title_s {
    color: #0F6535;
}
.top-works .otobtn {
    background-color: #0F6535;
    color: #fff;
}
.top-works .otobtn:hover,
.top-works .otobtn:focus {
    background-color: #0B4E29;
    color: #fff;
}

.tpw-grid {
    max-width: 1200px;
    margin: 48px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px 40px;
}
.tpw-item {
    position: relative;
}
.tpw-stage {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #ECEDEF;
    overflow: hidden;
}
.tpw-shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
/* 端末の画像がない記事は、メイン画像の左上から見せる */
.tpw-stage:not(.is-device) .tpw-shot {
    object-position: top left;
}
.tpw-item:hover .tpw-shot {
    transform: scale(1.035);
}

.tpw-txt {
    padding: 20px 2px 0;
}
.tpw-meta {
    margin: 0 0 4px;
    font-size: 13px;
    letter-spacing: .04em;
    color: #5A6A60;
}
.tpw-title {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.55;
}
.tpw-title a {
    color: #18251D;
    text-decoration: none;
}
/* カード全体を押せるようにする */
.tpw-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}
.tpw-item:hover .tpw-title a {
    color: #0F6535;
}
.tpw-title a:focus-visible {
    outline: none;
}
.tpw-title a:focus-visible::after {
    outline: 3px solid #0F6535;
    outline-offset: 4px;
}
.tpw-sum {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 700;
    color: #0F6535;
}
.tpw-note {
    max-width: 1200px;
    margin: 32px auto 0;
    padding: 0 24px;
    font-size: 12px;
    color: #5A6A60;
    text-align: right;
}

@media (prefers-reduced-motion: reduce) {
    .tpw-shot {
        transition: none;
    }
    .tpw-item:hover .tpw-shot {
        transform: none;
    }
}

@media (max-width: 760px) {
    .portfolio.top-works {
        padding-bottom: 56px;
    }
    .tpw-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin-top: 28px;
        padding: 4px 16px 16px;
        scroll-padding: 0 16px;
    }
    .tpw-item {
        flex: 0 0 86%;
        scroll-snap-align: start;
    }
    .tpw-title {
        font-size: 16px;
    }
    .tpw-note {
        margin-top: 16px;
        padding: 0 16px;
        text-align: left;
    }
}
