/*
Theme Name: KAI portfolio
Description: オリジナルポートフォリオテーマ
Version: 1.0
Author: KAI
*/

@charset "UTF-8";

/* ==========================================================================
   RESET & BASE STYLES (共通設定)
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-shadow: none;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    background-color: #ffffff;
    /* 💡 管理バーのバグを引き起こす原因になるため、html/bodyへの高さ100%や100vhの固定を徹底排除 */
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    color: #333333;
    line-height: 1.6;
    overflow-x: hidden; /* 💡 右側へのはみ出し防止 */
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

h2 {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.05em;
}

.section-subtitle {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 40px;
    font-size: 1rem;
}

/* ==========================================================================
   HEADER (PC版・どんな環境でもバグらない最新の固定方法)
   ========================================================================== */
.header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    
    /* 💡 position: fixedをやめ、sticky（追従型）に変更します。
       これにより、WordPressの管理バーの下に潜り込むバグが物理的に発生しなくなります。 */
    position: sticky;
    top: 0;
    z-index: 9999;
    height: 70px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.header-logo {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #557a95;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    line-height: 40px;
}

.header-title {
    display: none;
}

.menu-toggle {
    display: none;
}

.header-nav {
    display: flex;
    gap: 30px;
}

.header-nav a {
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.header-nav a:hover {
    color: #557a95;
}

/* ==========================================================================
   HERO SECTION (PC版・隙間を絶対に作らない設定)
   ========================================================================== */
.hero {
    /* 💡 高さを「画面いっぱい(100vh)」に固定するのをやめ、
       画像の比率や中身に応じて、隙間なくきれいに広がるようにpaddingで高さを出します。
       これで謎の白い空白は完全に消滅します。 */
    width: 100%;
    min-height: 600px; /* 最低限確保したい高さ */
    padding: 140px 0;  /* 上下にたっぷり余白を取ることで、自動的に高さを作ります */
    
    background-image: url('image/Frame\ 3096.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center; 
    justify-content: center;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    padding: 0 40px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 25px;
    letter-spacing: 0.02em;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

.btn-hero {
    display: inline-block;
    width: 160px;
    padding: 12px 0;
    background-color: #557a95;
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    border-radius: 20px;
    transition: background-color 0.3s;
}

.btn-hero:hover {
    background-color: #436177;
}

/* ==========================================================================
   WORKS SECTION (PC版：3カラム)
   ========================================================================== */
.works {
    background-color: #557a95;
    color: #ffffff;
    padding: 80px 0;
}

.works h2 {
    color: #ffffff;
}

.works-grid {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

.works-item {
    width: calc((100% - 60px) / 3);
    text-align: center;
}

.works-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.works-item h3 {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: normal;
}

.works-more {
    text-align: center;
}

.btn-more {
    display: inline-block;
    width: 200px;
    padding: 12px 0;
    background-color: #ffffff;
    color: #557a95;
    text-align: center;
    font-weight: bold;
    border-radius: 25px;
    transition: opacity 0.3s;
}

.btn-more:hover {
    opacity: 0.9;
}

.works-item a {
    transition: opacity 0.3s ease;
}
.works-item a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   SERVICE SECTION (PC版・右寄せレイアウト)
   ========================================================================== */
.service {
    padding: 80px 0;
    width: 100%;
    background-image: url('image/Frame\ 3097.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden; 
}

.service h2, .service .section-subtitle {
    color: #333333;
    text-align: center;
    width: 100%;
}

.service .section-subtitle {
    margin: 10px auto 50px auto;
}

.service-cards {
    display: grid;
    grid-template-columns: 42% 58%; 
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.service-cards::before {
    content: "";
}

.service-cards-inner {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
}

.service-card {
    width: calc((100% - 40px) / 3); 
    min-width: 180px; 
    background-color: #ffffff;
    padding: 40px 15px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.15rem;
    line-height: 1.4;
    min-height: 2.8em; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon {
    display: block;
    margin: 0 auto 20px auto;
    width: 50px;
    height: auto;
}

.service-card p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.6;
    text-align: left;
    flex-grow: 1; 
}

/* ==========================================================================
   ABOUT SECTION (トップページ・共通)
   ========================================================================== */
.about-section {
    padding: 80px 0;
    background-color: #ffffff;
}

.about-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.about-subtitle {
    text-align: center;
    color: #666666;
    margin-bottom: 50px;
    font-size: 0.9rem;
}

.about-flex-box {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.about-image-area {
    flex: 0 0 320px;
    max-width: 320px;
}

.about-image-area img {
    width: 100%;
    height: auto;
    display: block;
}

.about-text-area {
    flex: 1;
}

.about-name-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 25px;
    color: #333333;
}

.about-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: #333333;
    margin-bottom: 20px;
    text-align: justify;
}

/* ==========================================================================
   CONTACT SECTION (ボタンの中身の偏りまで完全にリセットして中央揃え)
   ========================================================================== */
.contact {
    background-color: #557a95;
    color: #ffffff;
    padding: 80px 0;
}

.contact h2 {
    color: #ffffff;
}

.contact-form {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-form form,
.contact-form p {
    display: block !important;
    text-align: left !important;
    width: 100% !important;
    margin: 0 0 20px 0 !important;
}

.form-group {
    display: block !important;
    width: 100% !important;
    margin-bottom: 20px;
}

.form-group label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: left !important;
}

.form-group input, 
.form-group textarea {
    width: 100% !important;
    padding: 12px !important;
    border: none !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    font-size: 1rem !important;
    color: #333333 !important;
    display: block !important;
}

.form-group textarea {
    margin-bottom: 40px !important;
}

.contact-form br {
    display: none !important;
}

/* 送信ボタンを含む親ブロックを完全に中央揃えにする設定 */
.form-submit,
.contact-form p.form-submit,
.contact-form p:last-child {
    display: block !important;
    text-align: center !important;  
    width: 100% !important;
    margin: 40px auto 0 auto !important;
}

/* 💡 【解決】送信ボタン本体の文字とアイコンを1ミリのズレもなく中央にロックする設定 */
.btn-submit,
.contact-form input[type="submit"],
.wpcf7-submit {
    display: inline-flex !important;  
    align-items: center !important;
    justify-content: center !important;
    width: 220px !important;
    height: 50px !important;
    
    /* 💡 左側の偏りの原因だったpaddingを完全にゼロにして左右均等にリセット */
    padding: 0 0 0 0 !important; 
    
    background-color: #ffffff !important;
    color: #557a95 !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    border: none !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    transition: opacity 0.3s !important;
    
    /* 💡 飛行機アイコンの位置調整：文字との干渉を防ぐため、固定位置からパーセントベースの安全な位置に変更 */
    background-image: url('./image/Vector.png') !important;
    background-repeat: no-repeat !important;
    background-position: 24% center !important; /* ボタンの左寄りに固定し、文字と絶対に重ならないように調整 */
    background-size: 18px auto !important;
    
    /* 💡 文字位置の微調整：アイコンのスペース分だけ、テキストの開始位置を自然に右へずらす */
    text-indent: 26px !important;
    
    margin: 0 auto !important;
    float: none !important;
}

.btn-submit:hover,
.wpcf7-submit:hover {
    opacity: 0.9 !important;
}

/* ==========================================================================
   FOOTER SECTION 
   ========================================================================== */
footer {
    background-color: #ffffff;
    padding: 50px 0 30px 0;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

.footer-logo-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.footer-logo-block .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #557a95;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 4px;
}

.footer-logo-block .logo-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333333;
    letter-spacing: 0.05em;
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    width: 100%;
}

.footer-nav li {
    display: inline-block;
}

.footer-nav a {
    color: #333333;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: #557a95;
}

.copyright {
    font-size: 0.75rem;
    color: #666666;
    margin: 0;
}

/* ==========================================================================
   WORKS LIST PAGE (固定用スタイル)
   ========================================================================== */
.works-page {
    padding: 120px 0 100px;
    background-color: #ffffff;
    width: 100%;
}

.works-page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    color: #333333;
    margin-bottom: 50px;
}

.works-page-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.works-card {
    display: flex;
    flex-direction: column;
}

.works-card a {
    transition: opacity 0.3s ease;
    display: block;
}

.works-card a:hover {
    opacity: 0.8;
}

.works-img img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
}

.works-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333333;
    margin-top: 15px;
}

/* ==========================================================================
   ABOUT PAGE (下層固定ページ用スタイル)
   ========================================================================== */
.about-page {
    padding: 120px 0 100px;
    background-color: #ffffff;
    width: 100%;
}

.about-page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 0.1em;
}

.about-page-subtitle {
    text-align: center;
    color: #666666;
    margin-bottom: 60px;
    font-size: 0.9rem;
}

.about-page-flex {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.about-img {
    flex: 0 0 320px;
    max-width: 320px;
}

.about-img img {
    width: 100%;
    height: auto;
    display: block;
}

.about-content {
    flex: 1;
}

.about-name {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 25px;
    color: #333333;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #333333;
    margin-bottom: 20px;
    text-align: justify;
}


/* ==========================================================================
   SMARTPHONE STYLES (スマホ・タブレット版：画面幅768px以下)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    h2 {
        font-size: 1.8rem;
    }

    /* -----------------------------------------
       HEADER & HAMBURGER MENU (スマホ)
       ----------------------------------------- */
    .header {
        height: 60px;
        position: sticky;
        top: 0;
    }

    .header-inner {
        padding: 10px 20px;
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
    }

    .header-logo {
        width: 36px;
        height: 36px;
        line-height: 36px;
        border-radius: 4px;
        font-size: 1.3rem;
        flex-shrink: 0;
        z-index: 1001; 
    }

    .header-title {
        display: block !important;
        font-size: 1.1rem;
        font-weight: bold;
        color: #333333;
        margin-left: 12px;
        margin-right: auto; 
        z-index: 1001;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        cursor: pointer;
        z-index: 1001;
        background: none;
        border: none;
    }

    .menu-toggle span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: #557a95;
        border-radius: 2px;
        transition: all 0.3s ease-in-out;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9.5px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9.5px) rotate(-45deg);
    }

    .header-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: #ffffff;
        display: flex;
        flex-direction: column;   
        justify-content: center;  
        align-items: center;
        gap: 35px;
        padding: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
    }

    .header-nav.active {
        transform: translateX(0);
    }

    .header-nav a {
        font-size: 1.4rem;
        font-weight: bold;
        color: #000000;
        letter-spacing: 0.05em;
        width: 100%;
        text-align: center;
        display: block;
    }

    /* -----------------------------------------
       HERO SECTION (スマホ版設定)
       ----------------------------------------- */
    .hero {
        margin-top: 0;
        min-height: auto;
        padding: 80px 0;
        
        background-image: url('image/Frame\ 3096.png');
        background-size: cover; 
        background-position: 85% center; 
        background-repeat: no-repeat;
        background-color: #ffffff; 
        position: relative;
        overflow: hidden;

        display: flex;
        align-items: flex-end;
        justify-content: flex-start;
    }

    .hero-content {
        position: relative;
        top: 0;
        transform: none;
        left: 0;
        width: 100%;
        max-width: 100%;
        text-align: left;
        padding: 0 20px; 
        box-sizing: border-box;
        z-index: 2;
    }

    .hero-content h1 {
        font-size: 1.8rem; 
        margin-bottom: 12px;
        font-weight: bold;
        line-height: 1.3;
    }

    .hero-buttons {
        display: flex;
        justify-content: flex-start; 
        gap: 12px; 
    }

    .btn-hero {
        width: 110px; 
        padding: 10px 0;
        font-size: 0.8rem;
        text-align: center;
        border-radius: 20px;
    }

    /* -----------------------------------------
       WORKS SECTION (トップページ)
       ----------------------------------------- */
    .works-grid {
        flex-direction: column;
        gap: 30px;
    }
    .works-item {
        width: 100%;
    }

    /* -----------------------------------------
       SERVICE SECTION (スマホ)
       ----------------------------------------- */
    .service {
        background-image: none; 
        background-color: #f4f6f7; 
        padding: 60px 0;
    }
    .service-cards {
        display: block; 
        padding: 0 20px;
    }
    .service-cards::before {
        display: none; 
    }
    .service-cards-inner {
        flex-direction: column; 
        gap: 20px;
    }
    .service-card {
        width: 100%; 
        min-height: auto;
    }
    .service-card h3 {
        min-height: auto; 
    }

    /* -----------------------------------------
       ABOUT SECTION (スマホ)
       ----------------------------------------- */
    .about-flex-box, .about-page-flex {
        flex-direction: column; 
        align-items: center;
        gap: 30px;
    }
    .about-image-area, .about-img {
        flex: 0 0 auto;
        width: 100%;
        max-width: 280px; 
    }

    /* -----------------------------------------
       WORKS LIST PAGE (スマホ)
       ----------------------------------------- */
    .works-page-grid {
        grid-template-columns: 1fr; 
        gap: 40px;
    }
    .works-img img {
        height: auto; 
    }
    
    /* -----------------------------------------
       FOOTER SECTION (スマホ)
       ----------------------------------------- */
    .footer-nav {
        flex-wrap: wrap; 
        gap: 15px 20px;
    }
    
    .wpcf7-response-output {
        margin-top: 20px !important;
        padding: 10px !important;
        border-radius: 8px !important;
        text-align: center;
        font-size: 0.9rem;
    }
}
/* ==========================================================================
   CONTACT BUTTON - キャッシュ強制突破＆絶対中央配置
   ========================================================================== */
.btn-submit,
.contact-form input[type="submit"],
.wpcf7-submit {
    /* 💡 ボタンそのものを画面の真ん中に強制ロック */
    display: block !important;
    margin: 40px auto 0 auto !important;
    float: none !important;
    
    width: 220px !important;
    height: 50px !important;
    background-color: #ffffff !important;
    color: #557a95 !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    border: none !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    
    /* 💡 左の偏りの原因を徹底的に排除 */
    padding: 0 !important;
    text-indent: 0 !important;
    text-align: center !important;
    
    /* 💡 アイコン画像を背景ではなく、文字の「左側」に滑り込ませる最新の手法 */
    background-image: url('./image/Vector.png') !important;
    background-repeat: no-repeat !important;
    background-position: 55px center !important; /* 文字のすぐ左に配置 */
    background-size: 18px auto !important;
    
    /* 💡 文字がアイコンと被らないよう、ボタンの「中身のテキスト」だけを右に少し寄せる */
    padding-left: 30px !important; 
    
    transition: opacity 0.3s !important;
}

/* 万が一、親要素（pタグなど）が邪魔をしている場合の中央揃えの保険 */
.contact-form p.form-submit,
.contact-form p:last-child {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}