/* ==========================================================================
   トップページ
   ========================================================================== */

/* 共通セクションスタイル */
.services .container,
.case-studies .container,
.achievements .container,
.flow .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* セクション別パディング */
.services .container {
    padding-top: 120px;
    padding-bottom: 60px;
}

.case-studies .container,
.achievements .container {
    padding-top: 60px;
    padding-bottom: 60px;
}

.flow .container {
    padding-top: 60px;
    padding-bottom: 120px;
}

/* ヒーローセクション */
.img-frame {
    position: relative;
    width: 100%;
    height: calc(100vh - 46px);
    max-height: 700px;
    overflow: hidden;
    margin: var(--space-header-sp) auto 0;
}

.img-01,
.img-02 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.img-01 {
    background-image: url('../img/fv1-sp.jpg');
    -webkit-animation: slide-animation-01 12s infinite;
    animation: slide-animation-01 12s infinite;
}

.img-02 {
    background-image: url('../img/fv2-sp.jpg');
    -webkit-animation: slide-animation-02 12s infinite;
    animation: slide-animation-02 12s infinite;
}

@-webkit-keyframes slide-animation-01 {
    0%,
    30% {
        opacity: 1;
    }
    40%,
    90% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes slide-animation-01 {
    0%,
    30% {
        opacity: 1;
    }
    40%,
    90% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@-webkit-keyframes slide-animation-02 {
    0%,
    30% {
        opacity: 0;
    }
    40%,
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes slide-animation-02 {
    0%,
    30% {
        opacity: 0;
    }
    40%,
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.msg.container {
    position: absolute;
    top: 0;
    left: 50%;
    max-width: 1264px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: end;
    transform: translateX(-50%);
}

.msg.container p {
    font-size: min(5.867vw, 22px);
    font-weight: var(--font-weight-semibold);
    color: var(--color-white);
    text-shadow: var(--shadow-hero);
    margin-bottom: 100px;
}

/* Services */
.services-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    width: 100%;
}

.service-item {
    position: relative;
}

.service-item__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    border-radius: 10px;
}

.service-item__content {
    position: relative;
    z-index: 3;
    height: 100%;
    color: var(--color-white);
}

/* 横長カード（散布・撮影）のスタイル */
.service-item--wide {
    --service-item-height: 160px;
    height: var(--service-item-height);
    min-height: var(--service-item-height);
}

.service-item--wide .service-item__content {
    display: flex;
    align-items: center;
    padding: var(--space-lg);
}

.service-item--wide .service-item__main-title {
    position: relative;
    padding-right: 50px;
}

.service-item--wide .service-item__main-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: calc(var(--service-item-height) * 0.625);
    background-color: var(--color-white);
}

.service-item--wide .service-item__title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: var(--font-weight-medium);
}

.service-item--wide .service-item__details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding-left: 50px;
}

.service-item--wide .service-detail__title {
    font-size: clamp(1.125rem, 3vw, 2rem);
    color: var(--color-white);
}

/* 小さなカード（点検・測量）のスタイル */
.service-item-row {
    display: flex;
    gap: var(--space-md);
}

.service-item--small {
    flex: 1;
    height: 85px;
    min-height: 85px;
}

.service-item--small .service-item__content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    height: 100%;
}

.service-item--small .service-item__title {
    font-size: clamp(1.125rem, 3vw, 2rem);
    font-weight: var(--font-weight-medium);
    text-align: center;
}

/* 各サービスの背景画像 */
.service-item--spraying .service-item__image {
    background-image: url('../img/service-bg_1.jpg');
}

.service-item--photography .service-item__image {
    background-image: url('../img/service-bg_2.jpg');
}

.service-item--inspection .service-item__image {
    background-image: url('../img/service-bg_3.jpg');
}

.service-item--surveying .service-item__image {
    background-image: url('../img/service-bg_4.jpg');
}

/* アクセシビリティ対応 */
.service-item:focus,
.service-item:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* ==========================================================================
   パララックスセクション
   ========================================================================== */
.parallax-section {
    position: relative;
    height: 35vh; /* SP版の値をベースに */
    min-height: 250px;
    max-height: 400px;
    overflow: hidden;
}

.parallax-container {
    position: absolute;
    top: -10%; /* SP版の修正値をベースに */
    left: 0;
    width: 100%;
    height: 200%; /* SP版の修正値をベースに */
    background: url('../img/parallax.jpg') center/cover no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: scroll; /* SP版の設定をベースに */
    will-change: transform;
    transform: translateY(0);
}

.parallax-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* パララックステキスト（オプション） */
.parallax-text {
    position: relative;
    z-index: 3;
    color: white;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 2.5rem);
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    padding: 0 20px;
}

/* 縦画面のスマートフォン対応 */
@media (max-width: 767px) and (orientation: portrait) {
    .parallax-section {
        height: 30vh;
        min-height: 200px;
        max-height: 300px;
    }
}

/* 横画面のスマートフォン対応 */
@media (max-width: 767px) and (orientation: landscape) {
    .parallax-section {
        height: 60vh;
        min-height: 250px;
        max-height: 400px;
    }
}

/* タブレット対応 */
@media (min-width: 768px) {
    .parallax-section {
        height: 60vh;
        min-height: 400px;
    }

    .parallax-container {
        /* タブレット以上でパララックス効果を適用 */
        top: -20%;
        height: 140%;
    }
}

/* PC対応 */
@media (min-width: 1024px) {
    .parallax-section {
        height: 70vh;
        min-height: 500px;
    }

    .parallax-container {
        top: -25%;
        height: 150%;
    }
}

/* パフォーマンス最適化 */
@media (prefers-reduced-motion: reduce) {
    .parallax-container {
        transform: none !important;
        top: 0 !important;
        height: 100% !important;
    }
}

/* ==========================================================================
   Flow セクション
   ========================================================================== */
.flow {
    background-color: #f0efe9;
}

/* SP版とPC版の表示切り替え */
.flow-steps--sp {
    display: flex;
}

.flow-steps--pc {
    display: none;
}

/* SP版スタイル */
.flow-steps--sp {
    width: 100%;
    flex-direction: column;
    gap: 40px;
}

.flow-steps--sp .flow-step {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}

.flow-steps--sp .flow-step__header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.flow-steps--sp .flow-step__icon {
    width: 60px;
    height: 60px;
    background-color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flow-steps--sp .flow-step__icon img {
    width: 36px;
    height: 36px;
}

.flow-steps--sp .flow-step__text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
}

.flow-steps--sp .flow-step__number {
    border: 1px solid var(--color-text);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    white-space: nowrap;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin-bottom: 8px;
}

.flow-steps--sp .flow-step__title {
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    text-align: left;
}

.flow-steps--sp .flow-step__content {
    background-color: var(--color-white);
    border-radius: 10px;
    padding: 10px 20px;
    width: 100%;
}

.flow-step__description {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--color-text);
    line-height: 1.6;
    text-align: left;
    margin: 0;
}

/* Contact */
.section-contact {
    background: url(../img/contact-bg-sp.jpg) center/cover no-repeat;
}

.section-contact .container {
    padding-top: 100px;
    padding-bottom: 150px;
}

.section-contact .sec-ttl,
.section-contact__info {
    color: var(--color-white);
}

.section-contact .sec-ttl {
    margin-bottom: 50px;
}

.section-contact__info .section-contact__description {
    font-size: var(--font-size-md);
    margin-bottom: 80px;
}

.section-contact__actions {
    max-width: 462px;
    width: 100%;
    text-align: center;
}

.section-contact__button {
    position: relative;
    display: inline-block;
    max-width: 462px;
    width: 90%;
    background-color: var(--color-secondary);
    color: var(--color-white);
    font-size: var(--font-size-md);
    line-height: 1;
    text-align: center;
    padding: 16px 0;
    border-radius: var(--border-radius-full);
    margin: 0 auto;
}

.section-contact__button-icon {
    position: absolute;
    right: 24px;
    top: 0;
    translate: 0 50%;
    font-size: 2.5em;
    font-weight: var(--font-weight-extra-light);
    line-height: 0.5;
}

/* ==========================================================================
   ワークス・事例リスト
   ========================================================================== */
.works-list {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.works-item {
    width: 100%;
}

.works-item__thumb {
    margin-bottom: var(--space-sm);
}

.works-item__thumb img {
    border-radius: 10px;
}

.works-item__link:hover {
    opacity: 0.8;
}

.works-item__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    text-align: left;
    margin-top: var(--space-sm);
}

.more-btn-wrapper {
    display: flex;
    justify-content: center;
}

.more-btn {
    display: inline-flex;
    align-items: center;
    background: #2c4632;
    color: #fff;
    font-size: var(--font-size-md);
    padding: 0.6em calc(2.5em - 1em) 0.6em 2.5em;
    border-radius: 32px;
    text-decoration: none;
    transition: background 0.2s;
    letter-spacing: 0.05em;
    font-family: inherit;
    font-weight: 400;
}

.more-btn .more-arrow {
    margin-left: 24px;
    display: flex;
    align-items: center;
}

.more-btn .more-arrow img {
    display: block;
}

.more-btn:hover,
.more-btn:focus {
    background: #3a5a40;
    color: #fff;
}

/* ==========================================================================
   タブレット対応（480px以上）
   ========================================================================== */
@media (min-width: 480px) {
    /* Contact - タブレット時の調整 */
    .section-contact .container {
        padding-top: 120px;
        padding-bottom: 180px;
    }

    .section-contact .sec-ttl {
        margin-bottom: 60px;
    }

    .section-contact__info .section-contact__description {
        font-size: calc(var(--font-size-md) + 2px);
        margin-bottom: 90px;
    }

    .section-contact__actions {
        max-width: 500px;
    }

    .section-contact__button {
        max-width: 500px;
        width: 85%;
        padding: 18px 0;
        font-size: calc(var(--font-size-md) + 1px);
    }

    .section-contact__button-icon {
        right: 28px;
        translate: 0 55%;
    }
}

/* ==========================================================================
   中サイズタブレット対応（600px以上）
   ========================================================================== */
@media (min-width: 600px) {
    /* Contact - 中サイズタブレット時の調整 */
    .section-contact .container {
        padding-top: 150px;
        padding-bottom: 200px;
    }

    .section-contact .sec-ttl {
        margin-bottom: 65px;
    }

    .section-contact__info .section-contact__description {
        font-size: calc(var(--font-size-md) + 3px);
        margin-bottom: 100px;
    }

    .section-contact__actions {
        max-width: 550px;
    }

    .section-contact__button {
        max-width: 550px;
        width: 80%;
        padding: 20px 0;
        font-size: calc(var(--font-size-md) + 2px);
    }

    .section-contact__button-icon {
        right: 32px;
        translate: 0 58%;
    }
}

/* ==========================================================================
   大サイズタブレット対応（768px以上）
   ========================================================================== */
@media (min-width: 768px) {
    /* セクション別パディング */
    .services .container {
        padding-top: 150px;
        padding-bottom: 100px;
    }

    .case-studies .container,
    .achievements .container {
        padding-top: 100px;
        padding-bottom: 100px;
    }

    .flow .container {
        padding-top: 100px;
        padding-bottom: 150px;
    }

    /* ヒーローセクション */
    .img-frame {
        height: calc(100vh - 76px);
        margin: var(--space-header-pc) auto 0;
    }

    .img-01 {
        background-image: url('../img/fv1-pc.jpg');
    }

    .img-02 {
        background-image: url('../img/fv2-pc.jpg');
    }

    .msg.container p {
        font-size: clamp(22px, 4.167vw, 60px);
    }

    /* Services */
    .services-grid {
        gap: var(--space-lg);
    }

    .service-item--wide {
        --service-item-height: 320px;
        height: var(--service-item-height);
        min-height: var(--service-item-height);
    }

    .service-item--wide .service-item__content {
        padding: var(--space-xl);
        padding-left: 140px;
    }

    .service-item--wide .service-item__main-title {
        padding-right: 140px;
    }

    .service-item--wide .service-detail__title {
        font-size: clamp(1.5rem, 2.5vw, 2rem);
    }

    .service-item--wide .service-item__details {
        padding-left: 120px;
    }

    .service-item--small {
        height: 130px;
        min-height: 130px;
    }

    .service-item-row {
        gap: var(--space-lg);
    }

    /* Flow - PC版とSP版の表示切り替え */
    .flow-steps--sp {
        display: none;
    }

    .flow-steps--pc {
        display: flex;
        flex-direction: column;
        gap: 60px;
        width: 100%;
    }

    /* PC版スタイル */
    .flow-step--pc {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: var(--space-2xl);
        position: relative;
        width: 100%;
    }

    .flow-step--pc .flow-step__arrow {
        display: block;
        position: absolute;
        left: 78px;
        top: -30px;
        translate: -50% -25%;
        z-index: 1;
    }

    .flow-step--pc .flow-step__arrow svg {
        -webkit-filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    }

    .flow-step--pc:first-child .flow-step__arrow {
        display: none;
    }

    .flow-step--pc .flow-step__icon {
        width: 156px;
        height: 156px;
        background-color: var(--color-white);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .flow-step--pc .flow-step__icon img {
        width: 72px;
        height: 72px;
    }

    .flow-step--pc .flow-step__content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .flow-step--pc .flow-step__text {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .flow-step--pc .flow-step__number {
        border: 1px solid var(--color-text);
        border-radius: 20px;
        padding: 4px 12px;
        font-size: 12px;
        background-color: transparent;
        color: var(--color-text);
        display: inline-block;
        width: -webkit-fit-content;
        width: -moz-fit-content;
        width: fit-content;
    }

    .flow-step--pc .flow-step__title {
        font-size: 24px;
        font-weight: var(--font-weight-semibold);
        text-align: left;
    }

    .flow-step--pc .flow-step__content {
        background-color: var(--color-white);
        border-radius: 12px;
        padding: 16px 40px;
        width: 100%;
    }

    /* Step 04 の特別な調整 */
    .flow-step:nth-child(4) .flow-step__content {
        min-height: auto;
    }

    /* Contact - 大サイズタブレット時の調整 */
    .section-contact {
        background: url(../img/contact-bg-pc.jpg) bottom/cover no-repeat;
    }

    .section-contact .container {
        padding-top: 180px;
        padding-bottom: 220px;
    }

    .section-contact .sec-ttl {
        margin-bottom: 65px;
        white-space: nowrap; /* 見出しの改行を防ぐ */
    }

    .section-contact__info .section-contact__description {
        font-size: calc(var(--font-size-md) + 4px);
        margin-bottom: 110px;
    }

    .section-contact__actions {
        max-width: 400px;
        text-align: center;
    }

    .section-contact__button {
        max-width: 400px;
        width: 90%;
        padding: 20px 0;
        font-size: calc(var(--font-size-md) + 3px);
    }

    .section-contact__button-icon {
        right: 28px;
        translate: 0 58%;
    }

    /* Works */
    .works-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-lg);
    }

    .works-item {
        max-width: 390px;
    }

    .more-btn {
        padding: 1em calc(3.5em - 10px) 1em 3.5em;
    }
}

/* ==========================================================================
   PC対応（1024px以上）
   ========================================================================== */
@media (min-width: 1024px) {
    /* Contact - PC版レイアウト */
    .section-contact .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 220px;
        padding-bottom: 260px;
    }

    .section-contact .sec-ttl {
        margin-bottom: 70px;
        white-space: normal; /* PC版では改行を許可 */
    }

    .section-contact__actions {
        text-align: right;
        max-width: 420px;
    }

    .section-contact__button {
        font-size: var(--font-size-lg); /* XLからLGに変更 */
        width: 100%;
        max-width: 420px; /* 462pxから420pxに変更 */
        padding: 20px 24px; /* 24pxから20pxに変更 */
    }

    .section-contact__button-icon {
        translate: 0 60%;
        right: 24px;
    }
}

/* ==========================================================================
   大型PC対応（1200px以上）
   ========================================================================== */
@media (min-width: 1200px) {
    /* Contact - 大型PC版での最適化 */
    .section-contact__actions {
        max-width: 462px;
    }

    .section-contact__button {
        font-size: var(--font-size-xl);
        max-width: 462px;
        padding: 24px;
    }
}

/* ==========================================================================
   サービス動画セクション
   ========================================================================== */
.service-movie-section {
    background: #fff;
    padding: 64px 0 32px 0;
}
.service-movie-catch {
    text-align: center;
    color: #222;
    background: #fff;
    padding-bottom: 24px;
}
.service-movie-catch h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}
.service-movie-catch p {
    font-size: 1.1rem;
    color: #555;
    margin: 0;
}
.service-movie-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.service-movie {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    display: block;
}
.movie-sound-toggle-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.movie-sound-toggle {
    background: linear-gradient(90deg, #38e6c5 0%, #ffb347 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 24px;
    padding: 10px 36px;
    box-shadow: 0 2px 8px rgba(56, 230, 197, 0.08);
    cursor: pointer;
    transition:
        background 0.2s,
        box-shadow 0.2s,
        transform 0.1s;
    outline: none;
    letter-spacing: 0.05em;
}
.movie-sound-toggle:hover,
.movie-sound-toggle:focus {
    background: linear-gradient(90deg, #ffb347 0%, #38e6c5 100%);
    box-shadow: 0 4px 16px rgba(255, 179, 71, 0.12);
    transform: translateY(-2px) scale(1.03);
}

/* サービスイメージ動画セクションの音声切替ボタン */
#movie-sound-toggle {
    background: linear-gradient(90deg, #4caf50 0%, #6fcf97 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 10px 28px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(42, 63, 46, 0.15);
    transition:
        opacity 0.2s,
        box-shadow 0.2s;
}
#movie-sound-toggle:hover,
#movie-sound-toggle:focus {
    opacity: 0.85;
    box-shadow: 0 4px 16px rgba(42, 63, 46, 0.25);
}

/* --- メディアクエリ統合 --- */
@media (max-width: 768px) {
    .service-movie-section {
        padding: 32px 0 16px 0;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 2;
        transition: background 0.2s;
    }
    .service-movie-catch h2 {
        font-size: 1.2rem;
    }
    .service-movie-catch p {
        font-size: 0.95rem;
    }
    .service-movie {
        max-width: 100vw;
        aspect-ratio: 16/9;
        border-radius: 6px;
    }
    .movie-sound-toggle {
        font-size: 1rem;
    }
}
