/*
    Theme Name: SWELL Child
    Theme URI: https://example.com/
    Description: SWELLテーマの子テーマ
    Version: 1.0.0
    Requires at least: 5.6
    Requires PHP: 7.3.0
    Author: Your Name
    Author URI: https://example.com/
    Template: swell
    Text Domain: swell-child
    Domain Path: /languages
    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/

/* 
親テーマのスタイルを読み込みます。
この記述は必須です。削除しないでください。
*/
@import url('../swell/style.css');

/* 
ここから下に独自のCSSを追加してください
親テーマのCSSを上書きすることができます
*/


@media (max-width: 768px) {
    h2.wp-block-heading.topspfs_h{
        font-size: 15px!important;
    }
    
    p.topspfs_p{
        font-size: 14px!important;
    }

    .l-mainContent {
        width: 85%;
    }    
}



/* 制作実績スライダー */
.p-works-slider {
    margin-bottom: 2em;
    display: flex;
    flex-direction: column;
    align-items: center; /* ギャラリーを中央に配置 */
}

.p-works-slider__main {
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 4px;
    /* 4:3の比率を設定 */
    aspect-ratio: 4 / 3;
    width: 100%;
    max-width: 1200px; /* 最大幅を設定（お好みで調整してください） */
}

.p-works-slider__main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent; /* 背景を透明に */
    height: 100%; /* aspect-ratioに合わせて自動調整 */
}

.p-works-slider__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.p-works-slider__thumbs {
    overflow: hidden;
}

.p-works-slider__thumbs .swiper-slide {
    width: 100px; /* サムネイルの幅（4:3比率に合わせて調整） */
    height: 75px; /* サムネイルの高さ（4:3比率） */
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.3s;
    border-radius: 3px;
    overflow: hidden;
    margin-right: 10px;
    border: 1px solid #eee;
}

.p-works-slider__thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 1px solid #333;
}

.p-works-slider__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Swiperナビゲーションボタンを非表示 */
.p-works-slider .swiper-button-next,
.p-works-slider .swiper-button-prev {
    display: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .p-works-slider__main {
        max-width: 400px; /* スマホでの最大幅を調整 */
    }
    
    .p-works-slider__thumbs .swiper-slide {
        width: 80px; /* スマホでのサムネイル幅 */
        height: 60px; /* スマホでのサムネイル高さ（4:3比率維持） */
    }
}

@media (max-width: 480px) {
    .p-works-slider__main {
        max-width: 300px; /* より小さな画面での最大幅 */
    }
    
    .p-works-slider__thumbs .swiper-slide {
        width: 60px; /* より小さなサムネイル */
        height: 45px;
    }
}

/* ギャラリーのループスライド */
/* 自動スライドギャラリー用のスタイル（通常版） */
.wp-block-gallery.auto-slide-gallery {
    overflow: hidden !important;
    position: relative;
    height: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: block !important;
}

.wp-block-gallery.auto-slide-gallery .auto-slide-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.wp-block-gallery.auto-slide-gallery .auto-slide-track {
    display: flex !important; /* スマホでも強制的にflex */
    width: calc(100% * 2) !important;
    height: 100% !important;
    animation: infiniteScroll 60s linear infinite;
    align-items: center;
    flex-wrap: nowrap !important; /* 改行を禁止 */
}

.wp-block-gallery.auto-slide-gallery .auto-slide-item {
    flex-shrink: 0 !important;
    margin-right: 0;
    width: auto !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery .auto-slide-item .wp-block-image {
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery .auto-slide-item img {
    width: auto !important;
    height: 100% !important;
    border-radius: 0;
    display: block !important;
    pointer-events: none;
}

@keyframes infiniteScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* 逆向きスライドギャラリー用のスタイル */
.wp-block-gallery.auto-slide-gallery-reverse {
    overflow: hidden !important;
    position: relative;
    height: 200px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    display: block !important;
}

.wp-block-gallery.auto-slide-gallery-reverse .auto-slide-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.wp-block-gallery.auto-slide-gallery-reverse .auto-slide-track {
    display: flex !important;
    width: calc(100% * 2) !important;
    height: 100% !important;
    animation: infiniteScrollReverse 60s linear infinite;
    align-items: center;
    flex-wrap: nowrap !important;
}

.wp-block-gallery.auto-slide-gallery-reverse .auto-slide-item {
    flex-shrink: 0 !important;
    margin-right: 0;
    width: auto !important;
    height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery-reverse .auto-slide-item .wp-block-image {
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery-reverse .auto-slide-item img {
    width: auto !important;
    height: 100% !important;
    border-radius: 0;
    display: block !important;
    pointer-events: none;
}

@keyframes infiniteScrollReverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* グラデーションオーバーレイ（通常版） */
.wp-block-gallery.auto-slide-gallery::before,
.wp-block-gallery.auto-slide-gallery::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), transparent);
}

.wp-block-gallery.auto-slide-gallery::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), transparent);
}

/* グラデーションオーバーレイ（逆向き版） */
.wp-block-gallery.auto-slide-gallery-reverse::before,
.wp-block-gallery.auto-slide-gallery-reverse::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.wp-block-gallery.auto-slide-gallery-reverse::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,1), transparent);
}

.wp-block-gallery.auto-slide-gallery-reverse::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,1), transparent);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .wp-block-gallery.auto-slide-gallery,
    .wp-block-gallery.auto-slide-gallery-reverse {
        height: 120px;
    }
    
    .wp-block-gallery.auto-slide-gallery::before,
    .wp-block-gallery.auto-slide-gallery::after,
    .wp-block-gallery.auto-slide-gallery-reverse::before,
    .wp-block-gallery.auto-slide-gallery-reverse::after {
        width: 30px; /* グラデーション幅を小さく */
    }
}

@media (max-width: 480px) {
    .wp-block-gallery.auto-slide-gallery,
    .wp-block-gallery.auto-slide-gallery-reverse {
        height: 100px;
    }
    
    .wp-block-gallery.auto-slide-gallery::before,
    .wp-block-gallery.auto-slide-gallery::after,
    .wp-block-gallery.auto-slide-gallery-reverse::before,
    .wp-block-gallery.auto-slide-gallery-reverse::after {
        width: 20px; /* さらに小さく */
    }
}