/*
Theme Name: RK Koumu Child
Theme URI: http://example.com/
Description: RK工務店専用デザイン（子テーマ / 営業用v22 - Footer Center Fix）
Author: Lead Architect
Template: hapo-campus
Version: 22.0.0
*/

/* --- DESIGN SYSTEM --- */
:root {
    --bg-color: #fdfcf8;
    --text-main: #222;
    --text-gray: #777;
    --accent-line: rgba(0,0,0,0.08);
    --font-mincho: 'Shippori Mincho', serif;
    --font-serif-en: 'Cormorant Garamond', serif;
    --font-gothic: 'Zen Kaku Gothic New', sans-serif;
    --easing: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Base & Reset */
html, body {
    width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-gothic);
    line-height: 2.0;
    letter-spacing: 0.05em;
    box-sizing: border-box;
}
*, *::before, *::after {
    box-sizing: border-box;
}

body.menu-open { overflow: hidden; }

a { text-decoration: none; color: inherit; transition: opacity 0.5s; }
a:hover { opacity: 0.6; }
img { width: 100%; height: auto; display: block; object-fit: cover; }

/* Typography */
.jp-serif { font-family: var(--font-mincho); }
.en-serif { font-family: var(--font-serif-en); font-style: italic; }
.vertical-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.2em;
    line-height: 2.2;
}

/* --- LAYOUT STRUCTURE --- */
.wrapper {
    display: flex;
    width: 100%;
    overflow: hidden;
}

/* Sidebar Navigation (PC) */
.sidebar {
    width: 120px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--accent-line);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
    z-index: 1000;
    background-color: #fff;
}
.logo-vertical {
    font-family: var(--font-serif-en);
    font-size: 1.4rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.15em;
    font-weight: 600;
}
.nav-links {
    writing-mode: vertical-rl;
    display: flex;
    gap: 40px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}
.menu-trigger { display: none; } 

/* Main Content Area */
.main-content {
    width: calc(100% - 120px);
    margin-left: 120px;
    position: relative;
    background: var(--bg-color);
    overflow: hidden;
}

/* --- HERO (PC: Right Aligned) --- */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.hero-slider {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
.hero-slider::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.15);
    z-index: 1;
}
.hero-slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    z-index: 0;
}
.hero-slide img {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scale(1.05);
}
.hero-slide.active { opacity: 1; }
.hero-slide.active img {
    animation: slowZoom 20s infinite alternate;
}
@keyframes slowZoom { from { transform: scale(1.05); } to { transform: scale(1.0); } }

/* ヒーローテキスト (PC) */
.hero-copy-container {
    position: relative;
    z-index: 10;
    color: #fff;
    margin-right: 15%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-shadow: 1px 1px 15px rgba(0,0,0,0.4);
}
.hero-copy h1 {
    font-family: var(--font-mincho);
    font-size: clamp(2.5rem, 4vw, 3.8rem);
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.2em;
    margin-left: 40px;
}
.hero-copy p {
    font-family: var(--font-gothic);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 2.2;
    letter-spacing: 0.15em;
    margin-top: 0;
    color: rgba(255,255,255,0.9);
    border-top: 1px solid rgba(255,255,255,0.6);
    padding-top: 30px;
}

/* --- WORKS --- */
.section-works { padding: 180px 8%; overflow: hidden; }
.section-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 120px;
    border-bottom: 1px solid var(--accent-line);
    padding-bottom: 20px;
}
.section-title-en {
    font-family: var(--font-serif-en); font-size: 5rem; line-height: 1;
    color: #f0f0f0; position: absolute; transform: translateY(-40%); z-index: -1;
}
.section-title-jp { font-family: var(--font-mincho); font-size: 1.8rem; letter-spacing: 0.1em; }

.work-item { position: relative; margin-bottom: 250px; height: 600px; }
.work-img-box { position: absolute; width: 60%; height: 100%; top: 0; overflow: hidden; }
.work-img-box img { height: 100%; transition: transform 1.2s ease; }
.work-item:hover .work-img-box img { transform: scale(1.05); }

.work-text-box {
    position: absolute; background: var(--bg-color); padding: 60px 50px;
    width: 45%; top: 55%; transform: translateY(-50%);
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    z-index: 2;
}
.work-item:nth-child(odd) .work-img-box { left: 0; }
.work-item:nth-child(odd) .work-text-box { right: 0; }
.work-item:nth-child(even) .work-img-box { right: 0; }
.work-item:nth-child(even) .work-text-box { left: 0; }

.work-cat { font-family: var(--font-serif-en); font-size: 0.8rem; color: var(--text-gray); margin-bottom: 15px; display: block; letter-spacing: 0.1em; }
.work-title { font-family: var(--font-mincho); font-size: 1.8rem; margin-bottom: 25px; line-height: 1.4; }
.work-desc { font-size: 0.9rem; color: #666; margin-bottom: 30px; text-align: justify; }
.btn-arrow { font-family: var(--font-serif-en); font-size: 0.9rem; border-bottom: 1px solid #aaa; padding-bottom: 5px; }

/* --- PHILOSOPHY (PC) --- */
.section-philosophy { background-color: #f2f0eb; padding: 150px 0; position: relative; }
.philo-container { max-width: 1000px; margin: 0 auto; display: flex; justify-content: center; align-items: center; gap: 80px; height: 500px; }
.philo-visual { width: 400px; height: 500px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.philo-text-area { height: 450px; display: flex; flex-direction: row-reverse; gap: 40px; }
.philo-title { font-family: var(--font-mincho); font-size: 2rem; writing-mode: vertical-rl; height: 100%; letter-spacing: 0.2em; }
.philo-body { font-size: 0.95rem; writing-mode: vertical-rl; line-height: 2.2; height: 100%; text-align: justify; letter-spacing: 0.1em; }

/* --- CONTACT BANNER --- */
.section-contact-banner {
    padding: 160px 8%; 
    text-align: left;
    background: #fdfcf8;
    border-top: 1px solid var(--accent-line);
}
.contact-container { max-width: 800px; margin: 0 auto; }
.contact-banner-title {
    font-family: var(--font-mincho);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 40px;
    line-height: 1.5;
}
.contact-desc { margin-bottom: 50px; font-size: 1rem; color: #666; }
.btn-contact-line {
    display: inline-block; border: 1px solid #333; color: #333;
    padding: 15px 60px; font-size: 1rem; transition: 0.3s; background: transparent;
}
.btn-contact-line:hover { background: #333; color: #fff; }

/* --- FOOTER (PC) --- */
.footer {
    padding: 120px 5% 60px;
    background: #fff;
    color: #2b2b2b;
    border-top: 1px solid var(--accent-line);
}
.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.footer-left { flex: 1; }
.footer-right { flex: 1; display: flex; justify-content: flex-end; }

.footer-logo-text {
    font-family: var(--font-serif-en); font-size: 1.8rem;
    letter-spacing: 0.1em; display: block; margin-bottom: 20px; font-weight: 600;
}
.footer-address {
    font-size: 0.8rem; line-height: 2.2; color: var(--text-gray); letter-spacing: 0.05em;
}
.footer-nav-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 15px; text-align: right;
}
.footer-nav-list a {
    font-family: var(--font-serif-en); font-size: 0.95rem;
    letter-spacing: 0.1em; color: #2b2b2b; position: relative;
}
.footer-nav-list a::after {
    content: ''; position: absolute; bottom: -5px; right: 0; width: 0; height: 1px;
    background: #2b2b2b; transition: 0.3s;
}
.footer-nav-list a:hover::after { width: 100%; }
.copyright {
    margin-top: 80px; text-align: center; font-size: 0.7rem; color: #ccc;
    font-family: var(--font-serif-en); letter-spacing: 0.1em;
}

/* --- MOBILE HEADER & MENU --- */
.rk-mobile-header { display: none; }
.rk-hamburger-btn { display: none; }
.rk-mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #fff; z-index: 9998;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
}
.rk-mobile-menu-overlay.active { opacity: 1; pointer-events: auto; }
.rk-mobile-nav-links { display: flex; flex-direction: column; gap: 30px; text-align: center; }
.rk-mobile-nav-links a {
    font-family: var(--font-serif-en); font-size: 1.5rem; color: #2b2b2b;
    opacity: 0; transform: translateY(20px); transition: 0.5s;
}
.rk-mobile-menu-overlay.active .rk-mobile-nav-links a { opacity: 1; transform: translateY(0); }

/* --- AOS Overrides --- */
[data-aos] {
    transition-duration: 2000ms !important;
    transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

/* =========================================
   MOBILE RESPONSIVE (Fixes applied here)
   ========================================= */
@media (max-width: 900px) {
    /* 1. 全体設定 */
    html, body, .wrapper, .main-content {
        width: 100% !important; max-width: 100% !important; overflow-x: hidden !important;
        margin-left: 0 !important; padding-left: 0 !important; padding-right: 0 !important;
    }

    /* 2. サイドバー非表示 */
    .sidebar { display: none !important; width: 0 !important; height: 0 !important; }

    /* 3. ヘッダー */
    .rk-mobile-header {
        position: fixed; top: 0; left: 0; width: 100%; height: 60px;
        background: rgba(255,255,255,0.95); z-index: 2147483640 !important;
        display: flex !important; justify-content: flex-start; align-items: center; padding: 0 20px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    /* 4. ハンバーガーボタン */
    .rk-hamburger-btn {
        display: block !important; position: fixed !important;
        top: 25px !important; right: 25px !important;
        width: 30px !important; height: 20px !important;
        z-index: 2147483647 !important; cursor: pointer;
    }
    .rk-hamburger-btn span {
        display: block !important; position: absolute; height: 2px; width: 100%;
        background-color: #000000 !important; transition: 0.3s; right: 0;
    }
    .rk-hamburger-btn span:nth-child(1) { top: 0 !important; }
    .rk-hamburger-btn span:nth-child(2) { top: 9px !important; }
    .rk-hamburger-btn span:nth-child(3) { top: 18px !important; }
    .rk-hamburger-btn.active span:nth-child(1) { top: 9px !important; transform: rotate(45deg); }
    .rk-hamburger-btn.active span:nth-child(2) { opacity: 0; }
    .rk-hamburger-btn.active span:nth-child(3) { top: 9px !important; transform: rotate(-45deg); }

    /* 5. ヒーロー */
    .hero { justify-content: flex-start; align-items: flex-end; }
    .hero-copy-container {
        writing-mode: horizontal-tb; margin: 0; width: 100%; height: auto;
        padding: 0 30px; bottom: 80px; flex-direction: column-reverse; align-items: flex-start;
    }
    .hero-copy h1 { margin-left: 0; margin-bottom: 15px; font-size: 2rem; }
    .hero-copy p {
        border-top: none; padding-top: 0; border-left: 1px solid rgba(255,255,255,0.6);
        padding-left: 15px; margin-bottom: 15px;
    }

    /* 6. Works */
    .section-works { padding: 100px 5%; width: 100%; }
    .work-item { height: auto; margin-bottom: 100px; width: 100%; }
    .work-img-box { position: relative; width: 100%; height: 300px; }
    .work-text-box {
        position: relative; width: 90%; margin: -40px auto 0;
        top: auto; transform: none; right: auto; left: auto; padding: 40px 30px;
    }
    
    /* 7. Philosophy */
    .section-philosophy { padding: 80px 0 0; width: 100%; }
    .philo-container { display: block; gap: 0; height: auto; }
    .philo-visual { 
        width: 100%; height: 55vh !important; 
        margin-bottom: 0; box-shadow: none; display: block; 
        transform: none !important; background-color: #eee;
    }
    .philo-visual img { height: 100%; object-fit: cover; }
    .philo-text-area { 
        display: block; width: 90%; height: auto; 
        margin: -80px auto 50px !important; 
        background: #fdfcf8; padding: 50px 30px; 
        box-shadow: 0 20px 50px rgba(0,0,0,0.08); 
        position: relative; z-index: 10; 
        writing-mode: horizontal-tb; flex-direction: column; gap: 20px; 
    }
    .philo-title { 
        display: block; writing-mode: horizontal-tb; height: auto; 
        font-size: 1.5rem; margin-bottom: 25px; 
        border-bottom: 1px solid var(--accent-line); padding-bottom: 20px; 
        line-height: 1.4; color: var(--text-main); text-align: left; 
    }
    .philo-body { 
        display: block; writing-mode: horizontal-tb; height: auto; 
        font-size: 0.95rem; line-height: 2.0; text-align: left; color: var(--text-main); 
    }
    
    /* 8. Footer & Banner Fix */
    .section-contact-banner { 
        padding: 100px 5%; text-align: center; margin-top: 0; width: 100%; 
    }
    
    /* フッターの中央寄せ & ナビゲーション非表示 */
    .footer { padding: 80px 5%; width: 100%; }
    .footer-container { 
        flex-direction: column; 
        text-align: center; 
        align-items: center; /* 確実に中央へ */
        gap: 30px; 
    }
    .footer-left {
        width: 100%;
        text-align: center;
    }
    
    /* スマホでナビゲーション（Conceptなど）を非表示にする */
    .footer-right,
    .footer-nav-list { 
        display: none !important; 
    }
    
    .copyright { margin-top: 40px; }
}