/* ========================================
   FVセクション
======================================== */
.fv {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    min-height: 360px;
    padding-top: var(--header-height-sp);
}

@media (min-width: 768px) {
    .fv {
        padding-top: var(--header-height-pc);
    }
}

@media (min-width: 1200px) {
    .fv {
        max-height: 800px;
    }
}

/* Slickスライダー（背景） */
.fv-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.fv-slide {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 360px;
}

@media (min-width: 1200px) {
    .fv-slide {
        max-height: 800px;
    }
}

.fv-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    min-height: 360px;
}

@media (min-width: 1200px) {
    .fv-slide img {
        max-height: 800px;
    }
}

/* FVレイアウトコンテナ */
.fv-layout {
    position: absolute;
    top: var(--header-height-sp);
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-height-sp));
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    z-index: 2;
    pointer-events: none;
}

/* 476px未満: フィルターを下側、FVの下端から20%の高さ */
@media (max-width: 575px) {
    .fv-layout {
        grid-template-rows: 80% 20%;
    }
    
    /* 画像エリアを上(1行目)に */
    .fv-right {
        order: 1;
    }
    
    /* フィルターエリアを下(2行目)に */
    .fv-left {
        order: 2;
    }
}

/* 476px以上: PC版レイアウト */
@media (min-width: 576px) {
    .fv-layout {
        grid-template-columns: 180px minmax(60px, 100px) 1fr;
        grid-template-rows: 1fr;
    }
}

@media (min-width: 680px) {
    .fv-layout {
        grid-template-columns: 200px minmax(70px, 110px) 1fr;
    }
}

@media (min-width: 768px) {
    .fv-layout {
        top: var(--header-height-pc);
        height: calc(100% - var(--header-height-pc));
        grid-template-columns: 240px minmax(80px, 120px) 1fr;
    }
}

@media (min-width: 1024px) {
    .fv-layout {
        grid-template-columns: 320px minmax(90px, 130px) 1fr;
    }
}

@media (min-width: 1200px) {
    .fv-layout {
        grid-template-columns: 360px minmax(100px, 140px) 1fr;
    }
}

/* 左側：キャッチコピーエリア（半透明背景） */
.fv-left {
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1.5rem;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    height: 100%;
    clip-path: polygon(
        0 0,
        100% 0,
        100% 63%,
        82% 63%,
        82% calc(63% + clamp(60px, 8vw, 100px)),
        100% calc(63% + clamp(60px, 8vw, 100px)),
        100% 100%,
        0 100%
    );
}

/* 476px未満: フィルターを下側、下から33%、clip-path解除 */
@media (max-width: 575px) {
    .fv-left {
        clip-path: none;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.5);
        padding: 1rem 1.25rem;
        height: 100%;
        align-items: center;
        justify-content: flex-end;
    }
}

/* 長方形ギャップの境界線（上から63%の位置） */
.fv-left::after {
    content: '';
    position: absolute;
    top: 63%;
    right: 0;
    width: 18%;
    height: clamp(60px, 8vw, 100px);
    box-shadow: 
    0 -1px 0 0 rgba(255, 255, 255, 0.5),  /* 上 */
    0 1px 0 0 rgba(255, 255, 255, 0.5);  /* 左 */
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* 476px未満: ギャップの境界線を非表示 */
@media (max-width: 575px) {
    .fv-left::after {
        display: none;
    }
}

@media (min-width: 576px) {
    .fv-left {
        padding: 2rem 1rem;
    }
}

@media (min-width: 680px) {
    .fv-left {
        padding: 2.5rem 1.25rem;
    }
}

@media (min-width: 768px) {
    .fv-left {
        padding: 3rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .fv-left {
        padding: 4rem 2rem;
    }
}

@media (min-width: 1200px) {
    .fv-left {
        padding: 4.5rem 2.25rem;
    }
}

.fv-left-content {
    width: 100%;
    max-width: 450px;
}

@media (min-width: 576px) {
    .fv-left-content {
        max-width: none;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateX(-10%);
    }
}

/* 中央：透明ギャップ（電池の区切り） */
.fv-gap {
    background: transparent;
    display: none;
}

@media (min-width: 576px) {
    .fv-gap {
        display: block;
    }
}

/* 右側：画像エリア（透明） */
.fv-right {
    background: transparent;
}

/* キャッチコピー */
.fv-catchcopy {
    color: var(--color-white);
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.6;
    text-shadow: 
        0 2px 6px color-mix(in srgb, var(--color-primary) 50%, transparent),
        0 4px 12px color-mix(in srgb, var(--color-primary) 30%, transparent);
    opacity: 0;
    animation: fadeInUp 1.0s ease 0.5s forwards;
    margin: 0;
}

/* 576px以上: 縦書き（左から右へ） */
@media (min-width: 576px) {
    .fv-catchcopy {
        writing-mode: vertical-lr;
        text-orientation: upright;
        max-height: 100%;
        line-height: 1.8;
    }
}

/* 476px未満: テキストを1行で右寄せ表示 */
@media (max-width: 575px) {
    .fv-catchcopy {
        font-size: clamp(1.1rem, 4.5vw, 1.325rem);
        font-weight: 500;
        white-space: nowrap;
        text-align: right;
        letter-spacing: 0.12em;
    }
    
    .fv-catchcopy br {
        display: none;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   会社概要イントロセクション（ヒーロー）
======================================== */
.company-intro-hero {
    position: relative;
    width: 100%;
    padding: 4.5rem 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('../images/fv-slide-04.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

@media (min-width: 768px) {
    .company-intro-hero {
        padding: 6.5rem 0;
    }
}

/* ジグザグ装飾をオーバーレイより前面に */
.company-intro-hero .section-divider {
    z-index: 2;
}



/* 下端のジグザグ装飾 */
.company-intro-hero .section-divider-bottom {
    margin-top: 2.5rem;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .company-intro-hero .section-divider-bottom {
        margin-top: 5rem;
    }
}

.company-intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(3, 155, 229, 0.4) 0%,      /* 上：薄い */
        rgba(2, 136, 209, 0.67) 40%,     /* 中間 */
        rgba(25, 118, 210, 1) 100%       /* 下：完全不透明 */
    );
    z-index: 1;
}

.company-intro-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.company-intro-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

@media (min-width: 768px) {
    .company-intro-content {
        gap: 3rem;
    }
}

.company-intro-heading {
    color: var(--color-white);
    font-size: 20px;
    font-family: var(--font-ja);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.05em;
    margin: 0;
}

@media (min-width: 768px) {
    .company-intro-heading {
        font-size: 32px;
    }
}

.company-intro-description {
    max-width: clamp(20rem, 60vw, 27rem);
    color: var(--color-white);
    font-size: var(--body-font-size-sp);
    font-family: var(--font-ja);
    font-weight: 400;
    line-height: 1.8;
    letter-spacing: 0.05em;
    margin: 0;
}

@media (min-width: 768px) {
    .company-intro-description {
        font-size: var(--body-font-size-pc);
    }
}

.company-intro-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 電気設備工事イントロセクション */
.electrical-intro-section {
    position: relative;
    background: var(--color-white);
    overflow: hidden;
    padding: 4rem 0;
}

/* 電気設備工事セクション - 右上にアイコン配置 */
.electrical-intro-section .section-container::before {
    background-image: url('../images/nakamura-thunder-icon.png');
}

@media (min-width: 768px) {
    .electrical-intro-section {
        padding: 6rem 0;
    }
}

/* 施工実績画像スライダー */
.section-image-slider-wrapper {
    flex: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100%;
}

.works-image-slider {
    width: 100%;
    position: relative;
}

/* Slick初期化前は2枚目以降を非表示にする（スマホで全て縦並びになる問題を解決） */
.works-image-slider:not(.slick-initialized) .works-image-slide:not(:first-child) {
    display: none;
}

.works-image-slide {
    position: relative;
    width: 100%;
}

.works-image-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
    .works-image-slide img {
        aspect-ratio: 16 / 11;
    }
}

/* 画像キャプション用オーバーレイ */
.section-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.section-image-caption {
    color: var(--color-white);
    font-size: var(--body-font-size-sp);
    font-family: var(--font-ja);
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .section-image-caption {
        font-size: var(--body-font-size-pc);
    }

    .section-image-overlay {
        padding: 1.25rem;
    }
}

/* ========================================
   その他工事イントロセクション
======================================== */
.other-works-intro-section {
    position: relative;
    background: var(--color-section-light);
    overflow: hidden;
    padding: 4rem 0;
}

/* その他工事セクション - 左上にアイコン配置 */
.other-works-intro-section .section-container::before {
    background-image: url('../images/nakamura-nipper-icon.png');
}

.other-works-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .other-works-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 2rem;
    }

    .other-works-intro-section {
        padding: 6rem 0;
    }
}


.grid-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
}

.grid-item-image {
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    aspect-ratio: 16 / 10;
}

@media (min-width: 768px) {
    .grid-item-image {
        display: block;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        cursor: pointer;
        aspect-ratio: 4 / 3;
    }
}



.grid-item-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.grid-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.grid-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.grid-item-title {
    color: var(--color-white);
    font-size: clamp(1.2rem, 2vw, 1.25rem); 
    font-family: var(--font-ja);
    font-weight: 500;
    letter-spacing: 0.05em;
}

@media (min-width: 768px) {
    .grid-item-title {
        font-size: clamp(1.25rem, 2vw, 1.5rem);
    }
}

.grid-item-text {
    display: flex;
    align-items: center;
    order: -1; /* SP時に最初に表示 */
}

@media (min-width: 768px) {
    .grid-item-text {
        order: 0; /* PC時は元の順番 */
    }
}

.grid-item-text > div {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.grid-item-text p {
    color: var(--color-text);
    font-size: var(--body-font-size-sp);
    line-height: var(--body-line-height-sp);
    letter-spacing: var(--body-letter-spacing);
}

@media (min-width: 768px) {
    .grid-item-text p {
        font-size: var(--body-font-size-pc);
        line-height: var(--body-line-height-pc);
    }
}

.intro-section {
    position: relative;
    overflow: hidden;
}

.intro-section:nth-of-type(odd) {
    background: var(--color-white);
}

.intro-section:nth-of-type(even) {
    background: var(--color-section-light);
}

.intro-container {
    max-width: var(--container-width-sp);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .intro-container {
        max-width: var(--container-width-pc);
        flex-direction: row;
        align-items: center;
        gap: 4rem;
    }
    
    .image-left .intro-container {
        flex-direction: row-reverse;
    }
}

.intro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .intro-content {
        gap: 2rem;
    }
}

.intro-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.intro-en {
    color: var(--color-primary);
    font-size: var(--section-title-en-sp);
    font-family: var(--font-en);
    font-weight: 400;
    letter-spacing: var(--section-title-letter-spacing-en);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .intro-en {
        font-size: var(--section-title-en-pc);
        gap: 1rem;
    }
}

.intro-en::after {
    content: '';
    width: 3rem;
    height: 2px;
    background: var(--color-primary);
    border-radius: 1px;
}

@media (min-width: 768px) {
    .intro-en::after {
        width: 4rem;
    }
}

.intro-ja {
    color: var(--color-text);
    font-size: var(--section-title-ja-sp);
    font-family: var(--font-ja);
    font-weight: 500;
    letter-spacing: var(--section-title-letter-spacing-ja);
}

@media (min-width: 768px) {
    .intro-ja {
        font-size: var(--section-title-ja-pc);
    }
}

.intro-text {
    color: var(--color-text);
    font-size: var(--body-font-size-sp);
    line-height: var(--body-line-height-sp);
    letter-spacing: var(--body-letter-spacing);
}

@media (min-width: 768px) {
    .intro-text {
        font-size: var(--body-font-size-pc);
        line-height: var(--body-line-height-pc);
    }
}

.intro-list {
    list-style: none;
    margin-top: 1rem;
    padding-left: 0;
}

.intro-list li {
    color: var(--color-text);
    font-size: var(--body-font-size-sp);
    line-height: var(--body-line-height-sp);
    letter-spacing: var(--body-letter-spacing);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

@media (min-width: 768px) {
    .intro-list li {
        font-size: var(--body-font-size-pc);
        line-height: var(--body-line-height-pc);
    }
}

.intro-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.intro-image {
    flex: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.intro-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .intro-image img {
        aspect-ratio: 4 / 3;
    }
}

.intro-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .intro-button-wrapper {
        margin-top: 3rem;
    }
}

/* ========================================
   BUSINESSスクロールセクション
======================================== */
.business-scroll-section {
    background: var(--color-primary);
    padding: 2rem 0;
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .business-scroll-section {
        padding: clamp(2.5rem, 4vw, 3rem) 0;
    }
}

.business-scroll-wrapper {
    display: flex;
    gap: 4rem;
    white-space: nowrap;
    will-change: transform;
}

@media (min-width: 768px) {
    .business-scroll-wrapper {
        gap: clamp(3rem, 4vw, 4rem);
    }
}

.business-scroll-item {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .business-scroll-item {
        gap: clamp(2rem, 3vw, 3rem);
    }
}

.business-scroll-text {
    color: var(--color-white);
    font-size: 3rem;
    font-family: var(--font-en);
    font-weight: 700;
    letter-spacing: 0.1em;
}

@media (min-width: 768px) {
    .business-scroll-text {
        font-size: clamp(4rem, 6vw, 6rem);
    }
}

.business-scroll-icon {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    background: var(--color-white);
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
}

@media (min-width: 768px) {
    .business-scroll-icon {
        width: clamp(4.25rem, 6.5vw, 4.75rem);
        height: clamp(4.25rem, 6.5vw, 4.75rem);
        padding: clamp(0.425rem, 0.9vw, 0.5rem);
        border-radius: clamp(0.425rem, 0.9vw, 0.5rem);
    }
}

.business-scroll-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ========================================
   施工実績セクション
======================================== */
.works-intro-section {
    position: relative;
    background: var(--color-white);
    overflow: hidden;
    padding: 4rem 0;
}

/* 施工実績セクション - 右上にアイコン配置 */
.works-intro-section .section-container::before {
    background-image: url('../images/nakamura-minus-driver-icon.png');
}

@media (min-width: 768px) {
    .works-intro-section {
        padding: 6rem 0;
    }
}

/* 以下のスタイルはスライダー使用時のみ必要 */
/* 現在は電気設備工事セクションと同じレイアウトを使用 */

/* 後でスライダーを使用する場合のために残しておく */
/*
.works-intro-section .section-container {
    position: relative;
}

.works-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.5;
}

.works-bg-layer-pc {
    display: none;
}

@media (min-width: 768px) {
    .works-bg-layer-pc {
        display: block;
    }
    
    .works-bg-layer-sp {
        display: none;
    }
}

.works-bg-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.works-intro-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .works-intro-content {
        flex-direction: row;
        align-items: stretch;
        gap: 3rem;
    }
}

.works-left-content {
    display: contents;
}

@media (min-width: 768px) {
    .works-left-content {
        display: flex;
        flex-direction: column;
        flex: 2;
        gap: 2.5rem;
    }
}

.works-intro-section .section-title-wrapper {
    margin-bottom: 0;
    order: 1;
}

@media (min-width: 768px) {
    .works-intro-section .section-title-wrapper {
        order: unset;
    }
}

.works-text-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
}

@media (min-width: 768px) {
    .works-text-wrapper {
        min-height: 150px;
        order: unset;
    }
}

.works-text-item {
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.works-text-item.active {
    opacity: 1;
    visibility: visible;
}

.works-slider-wrapper {
    position: relative;
    width: 100%;
    order: 3;
}

@media (min-width: 768px) {
    .works-slider-wrapper {
        flex: 3;
        order: 0;
    }
}

.works-slider {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .works-slider {
        border-radius: 0;
        box-shadow: none;
    }
}

.works-slide {
    position: relative;
}

.works-slide-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

@media (min-width: 768px) {
    .works-slide-image {
        aspect-ratio: 16 / 10;
    }
}

.works-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.works-category-description {
    color: var(--color-text);
    font-size: var(--body-font-size-sp);
    line-height: var(--body-line-height-sp);
    letter-spacing: var(--body-letter-spacing);
    margin: 0;
    width: 100%;
    text-align: left;
}

@media (min-width: 768px) {
    .works-category-description {
        font-size: var(--body-font-size-pc);
        line-height: var(--body-line-height-pc);
    }
}

.works-button-wrapper {
    display: flex;
    justify-content: center;
    order: 4;
}

@media (min-width: 768px) {
    .works-button-wrapper {
        justify-content: flex-start;
        order: unset;
    }
}
*/

/* ========================================
   フェードインアニメーション
======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   FVプログレスバー
======================================== */
.fv-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    z-index: 30;
}

.fv-progress-bar {
    height: 100%;
    width: 0;
    background: rgb(255, 255, 255);
}

/* プログレスバーのアニメーション */
.fv-progress-bar.is-animating {
    animation: fv-progress 5s linear forwards;
}

@keyframes fv-progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}