/*
Theme Name: Tech Shade
Author: クスノキ技術
Description: Swiperによるカルーセルスライダー、PV数計測ロジック、絞り込み検索機能を実装した高機能ブログテーマ。内部SEO対策済みで、JavaScriptの最適化により高速な動作を実現しています。管理画面からサイトカラーやコンセプトテキストを自由に編集可能です。
Version: 1.0.0
*/

/* --- 1. 基本設定 --- */
:root {
    --bg-color: #fdfcf8;
    --text-color: #3e3a39;
    --primary-color: #6b8e23;
    --accent-color: #8d7d77;
    --light-gray: #f0f0e8;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.8;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: 0.3s; }
.container { max-width: 1050px; margin: 0 auto; padding: 0 25px; }

/* --- 2. ヘッダー --- */
.site-header { padding: 40px 0 10px; position: relative; z-index: 100; }
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 15px; }
.site-logo-text { display: flex; align-items: center; justify-content: center; gap: 15px; }
.site-logo img { max-height: 55px; width: auto; }
.site-header h1 { font-size: 2.2rem; margin: 0; letter-spacing: 0.1em; font-weight: 700; line-height: 1.2; }
.site-header h1 a { color: var(--primary-color); }
.site-header h1 a:hover { color: var(--accent-color); opacity: 1; }

.header-menu-list { list-style: none; padding: 0; margin: 20px 0 0; display: flex; justify-content: center; gap: 15px; }
.header-menu-list li { min-width: 120px; text-align: center; }
.header-menu-list a { display: block; padding: 10px 5px; font-size: 0.95rem; font-weight: 700; border-bottom: 2px solid transparent; }
.header-menu-list a:hover { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }

/* 基本のハンバーガーボタン */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; }
.hamburger-line { display: block; width: 26px; height: 2px; background: var(--text-color); margin: 6px 0; transition: 0.4s; }

/* --- 3. サイトコンセプトセクション --- */
.site-concept { padding: 30px 0 60px; text-align: center; }
.concept-inner { max-width: 800px; margin: 0 auto; }
.concept-tag {
    display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--primary-color);
    background: rgba(107, 142, 35, 0.1); padding: 4px 15px; border-radius: 20px; margin-bottom: 15px; letter-spacing: 0.1em;
}
.concept-title { font-size: 1.8rem; color: var(--primary-color); margin: 0 0 20px; font-weight: 700; }
.concept-body p { font-size: 1.05rem; color: var(--text-color); line-height: 2; margin: 0; }

/* --- 4. 人気記事スライダー (Swiper) --- */
.slider-outer { position: relative; width: 100%; overflow: hidden; padding: 10px 0 40px; }
.popular-slider { overflow: hidden !important; padding-bottom: 60px !important; }
.swiper-button-next, .swiper-button-prev {
    background: var(--white) !important; width: 48px !important; height: 48px !important;
    border-radius: 50% !important; box-shadow: var(--shadow) !important;
    top: 45% !important; display: flex !important; align-items: center !important; justify-content: center !important;
}
.swiper-button-next::after, .swiper-button-prev::after { display: none !important; }
.swiper-button-next::before, .swiper-button-prev::before {
    content: ""; width: 12px; height: 12px; border-top: 2px solid var(--primary-color); border-right: 2px solid var(--primary-color); display: block;
}
.swiper-button-next::before { transform: rotate(45deg); margin-left: -5px; }
.swiper-button-prev::before { transform: rotate(-135deg); margin-right: -5px; }
.swiper-pagination-bullet-active { background: var(--primary-color) !important; }

/* --- 5. 記事グリッド & カード --- */
.post-section { margin-bottom: 70px; }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 35px; text-align: center; color: var(--accent-color); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px 20px; }
.post-card { background: var(--white); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.3s; height: 100%; display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-5px); }
.post-thumbnail { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-content { padding: 20px; flex-grow: 1; }
.post-title { font-size: 1rem; margin: 0; line-height: 1.5; font-weight: 700; }
.post-date { font-size: 0.8rem; color: var(--accent-color); margin-bottom: 8px; }

/* --- 6. 個別記事・関連記事 --- */
.single-post-container { max-width: 850px; margin: 0 auto 100px; background: var(--white); padding: 50px; border-radius: 20px; box-shadow: var(--shadow); }
.entry-eye-catch { text-align: center; margin-bottom: 40px; }
.entry-eye-catch img { display: inline-block; border-radius: 12px; box-shadow: var(--shadow); }
.entry-header { text-align: center; margin-bottom: 40px; }
.entry-title { font-size: 2rem; line-height: 1.4; font-weight: 700; margin: 10px 0; }
.entry-content { margin-bottom: 80px; padding-bottom: 40px; border-bottom: 1px dashed var(--light-gray); }

.related-posts { margin-top: 60px; }
.related-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 30px; color: var(--accent-color); text-align: left; position: relative; padding-left: 15px; }
.related-title::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary-color); border-radius: 2px; }

/* --- 7. トップへ戻るボタン --- */
.back-to-top {
    position: fixed; right: 30px; bottom: 30px; width: 50px; height: 50px;
    background-color: var(--primary-color); color: var(--white); border: none; border-radius: 50%;
    cursor: pointer; z-index: 99; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); opacity: 0; visibility: hidden;
    transform: translateY(20px); transition: all 0.4s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { transform: translateY(-5px); opacity: 0.9; }
.arrow-up { width: 12px; height: 12px; border-top: 3px solid var(--white); border-right: 3px solid var(--white); transform: rotate(-45deg); margin-top: 5px; }

/* --- 8. スマホ用レスポンシブ (ここを重点修正) --- */
@media (max-width: 768px) {
    .site-header { padding: 15px 0; position: sticky; top: 0; z-index: 200; border-bottom: 1px solid var(--light-gray); background: var(--bg-color); }
    .header-inner { flex-direction: row; justify-content: space-between; align-items: center; }
    
    .site-logo img { max-height: 40px; }
    .site-header h1 { font-size: 1.3rem; }

    /* メニューボタンの修正 */
    .menu-toggle { 
        display: block; 
        position: relative; /* 重要：これがないとz-indexが効きません */
        z-index: 300;       /* メニュー画面(250)より上に設定 */
    }
    
    /* ×印に変形するアニメーション */
    .menu-toggle.is-active .hamburger-line:nth-child(1) { transform: translateY(8px) rotate(45deg); background: var(--text-color); }
    .menu-toggle.is-active .hamburger-line:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .hamburger-line:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background: var(--text-color); }

    /* 全画面メニュー */
    .menu-container { 
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh; 
        background: rgba(253, 252, 248, 0.98); 
        display: flex; align-items: center; justify-content: center; 
        opacity: 0; visibility: hidden; transform: translateY(-20px); 
        transition: 0.4s; z-index: 250; /* ヘッダーより上で、ボタンより下 */
    }
    .menu-container.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
    
    .header-menu-list { flex-direction: column; gap: 40px; text-align: center; margin: 0; }
    .header-menu-list li { min-width: auto; }
    .header-menu-list a { border-bottom: none; font-size: 1.4rem; }
    
    body.menu-open { overflow: hidden; }
    
    .site-concept { padding: 40px 0 50px; }
    .concept-title { font-size: 1.3rem; }
    .single-post-container { padding: 30px 20px; border-radius: 0; }
    .back-to-top { right: 20px; bottom: 20px; width: 45px; height: 45px; }
}

/* --- 9. その他 --- */
.site-footer { padding: 60px 0; text-align: center; font-size: 0.8rem; color: var(--accent-color); border-top: 1px solid var(--light-gray); }
.error-404-container { padding: 80px 20px; text-align: center; background: var(--white); border-radius: 20px; box-shadow: var(--shadow); margin: 40px auto 100px; max-width: 700px; }
input[type="text"], input[type="email"], textarea { width: 100%; padding: 12px; border: 1px solid var(--light-gray); border-radius: 8px; margin-bottom: 20px; background: var(--bg-color); }
input[type="submit"] { background: var(--primary-color); color: var(--white); border: none; padding: 12px 40px; border-radius: 30px; cursor: pointer; font-weight: 700; }

/* フッターメニューのスタイル */
.footer-navigation {
    margin-bottom: 20px;
}

.footer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-menu-list a {
    font-size: 0.85rem;
    color: var(--accent-color);
}

.footer-menu-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* コピーライトとの余白調整 */
.footer-copyright {
    margin-top: 10px;
}

/* スマホでは縦に並べる場合 */
@media (max-width: 768px) {
    .footer-menu-list {
        flex-direction: column;
        gap: 10px;
    }
}