/*
Theme Name: Habitat - お家作りサイト
Description: 建築系（お家作り）に特化したWordPressテーマ
Version: 1.0.0
Author: Habitat Team
*/

/* 基本設定 */
:root {
    --base-color: #46413c;
    --background-color: #f2f2f2;
    --accent-color: #007cba;
    --pickup-label-color: #c9a445; /* ゴールド系 */
    --new-label-color: #007a7a;    /* ティール系 */
    --line-green: #00c300;
    --footer-bg: #737373;
    --border-radius: 8px; /* 丸み */
    --box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* 影 */
}

/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本設定 */
body {
    font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--base-color);
    background-color: var(--background-color);
    /* padding-bottom: 100px;  */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ヘッダー */
.site-header {
    background-color: rgba(255, 255, 255, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

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

.site-logo a {
    font-size: 24px;
    font-weight: bold;
    color: var(--base-color);
    text-decoration: none;
}

.main-nav {
    display: flex;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--base-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--accent-color);
}

/* ハンバーガーメニュー */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--base-color);
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    display: block;
}

.mobile-menu {
    list-style: none;
    padding: 20px;
}

.mobile-menu li {
    border-bottom: 1px solid #e0e0e0;
}

.mobile-menu li:last-child {
    border-bottom: none;
}

.mobile-menu a {
    display: block;
    padding: 15px 0;
    color: var(--base-color);
    text-decoration: none;
    font-weight: 500;
}

.mobile-menu a:hover {
    color: var(--accent-color);
}

/* メインコンテンツ */
.main-content {
    margin-top: 80px;
}

/* メインビューカルーセル */
.main-carousel {
    width: 100%;
    margin-top: 80px;
    padding: 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    color: white;
    z-index: 2;
    pointer-events: none;
}

.carousel-content h2 {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-content p {
    font-size: 18px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* .speech-bubble {
    background-color: white;
    color: var(--base-color);
    padding: 15px 20px;
    position: relative;
    max-width: 300px;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid white;
} */

.line-text {
    color: var(--line-green);
    font-weight: bold;
}

/* インジケーター */
.carousel-indicators-wrapper {
    margin-top: 15px;
    padding-bottom: 15px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.indicator {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: var(--base-color);
    transform: scale(1.4);
}

/* コンテンツエリア */
.content-area {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.main-content-inner {
    flex: 1;
    min-width: 0;
}

.sidebar {
    flex: 0 0 300px;
}

/* 検索セクション */
.search-section {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-field,
.category-select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    background-color: transparent;
    font-size: 14px;
    color: var(--base-color);
}

.search-field {
    flex: 1;
    max-width: 200px;
}

.category-select {
    min-width: 150px;
}

.search-btn {
    padding: 12px 20px;
    background-color: transparent;
    border: 2px solid var(--base-color);
    color: var(--base-color);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.search-btn:hover {
    background-color: var(--base-color);
    color: white;
}

/* 記事一覧 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.post-item {
    background-color: white;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

/* 記事ラベル */
.post-label {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
    line-height: 1;
}

.post-label.pickup {
    background-color: var(--pickup-label-color);
}

.post-label.new {
    background-color: var(--new-label-color);
}

.post-thumbnail {
    height: 150px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: 15px;
}

.post-title {
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-title a {
    color: var(--base-color);
    text-decoration: none;
}

.post-title a:hover {
    color: var(--accent-color);
}

.post-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

/* フッター */
.site-footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 150px 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: -100px auto;
    padding: 0 20px;
}
@media (max-width: 768px) {
    .footer-content {
    margin: -110px auto;
}
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.footer-links a {
    color: white;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* LINE CTAボタン */
.line-cta {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 999;
    max-width: 600px;
    margin: 0 auto;
}

.line-cta a {
    display: block;
}

.line-cta img {
    width: 100%;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

/* ページネーションのデザイン */
.pagination-wrapper {
    text-align: center;
    margin: 40px 0;
    font-size: 16px;
    font-weight: bold;
}

.pagination-wrapper .page-numbers {
    background-color: transparent;
    border: none;
    color: var(--base-color);
    text-decoration: none;
    padding: 5px 10px;
    margin: 0 2px;
    transition: color 0.3s;
}

.pagination-wrapper .page-numbers:hover {
    color: var(--accent-color);
    background-color: transparent;
}

.pagination-wrapper .page-numbers.current {
    color: var(--base-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    background-color: transparent;
}

.pagination-wrapper .page-numbers.dots {
    letter-spacing: 2px;
    padding: 5px 0;
    font-weight: normal;
}

.pagination-wrapper .prev,
.pagination-wrapper .next {
    font-weight: normal;
}

/* 記事詳細ページなど、トップページ以外 */
body:not(.home) .post-item,
body:not(.home) .page-content,
body:not(.home) .archive-header,
body:not(.home) .search-section {
    border-radius: var(--border-radius);
    /* box-shadow: var(--box-shadow); */
}

body:not(.home) .post-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* レスポンシブデザイン */
@media (max-width: 992px) {
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .content-area { flex-direction: column; }
    .sidebar { flex: none; width: 100%; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .carousel-content h2 { font-size: 24px; }
    .carousel-content p { font-size: 14px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-field, .category-select, .search-btn { width: 100%; max-width: 100%; }
    .main-carousel { margin-top: 10px; }
    .main-content-container { margin-top: 83px; }
}

@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header-content { padding: 10px 15px; }
    .site-logo a { font-size: 20px; }
    .posts-grid,
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .carousel-container { height: 250px; }
    .carousel-content { left: 20px; }
    .carousel-content h2 { font-size: 20px; }
    .carousel-content p { font-size: 12px; }
    /* .speech-bubble { padding: 10px 15px; max-width: 250px; } */
    .footer-links { flex-direction: column; text-align: center; gap: 15px; }
}

@media (max-width: 480px) {
    .posts-grid, .archive-grid {
        grid-template-columns: repeat(2, 1fr); /* スマートフォンでも2列を維持 */
    }
    .container { padding: 0 10px; }
    .header-content { padding: 8px 10px; }
    .site-logo a { font-size: 18px; }
    .carousel-container { height: 200px; }
    .carousel-content { left: 15px; }
    .carousel-content h2 { font-size: 18px; }
    .carousel-content p { font-size: 11px; }
    /* .speech-bubble { padding: 8px 12px; max-width: 200px; font-size: 12px; } */
    .post-content { padding: 12px; }
    .post-title { font-size: 13px; }
    .post-meta { font-size: 11px; }
}
/* 管理画面のスタイル */
.repeater-field .repeater-item {
    background: #fdfdfd;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: move;
}
.repeater-field .repeater-item-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    width: 100%;
}
.repeater-field .image-preview img {
    max-width: 100px;
    height: auto;
    display: block;
}
.repeater-field input[type="text"], .repeater-field input[type="url"] {
    flex-grow: 1;
}
.repeater-field .remove-item {
    margin-left: auto;
}
.nav-tab-wrapper { margin-bottom: 20px; }

/* ==================================================
// パンくずリスト
// =================================================*/
.breadcrumb-container {
    background-color: #f9f9f9;
    border-bottom: 1px solid #e9e9e9;
    padding: 12px 0;
    width: 100%;
}
.breadcrumb {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    font-size: 13px;
}
.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.breadcrumb li {
    margin: 0;
    padding: 0;
}
.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin: 0 0.8em;
    color: #b0b0b0;
}
.breadcrumb a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}
.breadcrumb a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
.breadcrumb li:last-child span {
    color: #222;
    font-weight: 500;
}
/* ==================================================
// モバイルメニュー：スライドイン形式への変更（最終確定版）
// =================================================*/

/* --- 1. メニュー本体の基本スタイル（完全に非表示の状態）--- */
.mobile-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background-color: #fff;
    z-index: 1000;
    padding: 20px 0;
    
    /* アニメーションの種類と時間を設定 */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    
    /* ★★★ 初期状態の定義 ★★★ */
    /* 画面の右側外へ移動させ、完全に透明にする */
    transform: translateX(100%);
    opacity: 0;
    /* この時点ではまだDOMに存在しているが、見えない・操作できない */
    visibility: hidden;
}

/* --- 2. メニューが開いたときのスタイル（表示状態）--- */
.mobile-nav.active {
    /* 画面内にスライドさせ、不透明にする */
    transform: translateX(0);
    opacity: 1;
    /* 表示して操作できるようにする */
    visibility: visible;
}

/* --- 3. 背面の黒い半透明オーバーレイ --- */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* --- 4. メニュー項目のデザイン --- */
.mobile-nav .mobile-menu {
    list-style: none;
    padding: 0;
    margin: 40px 0 0 0;
}

.mobile-nav .mobile-menu li a {
    display: block;
    padding: 15px 30px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.mobile-nav .mobile-menu li a:hover {
    background-color: #f9f9f9;
}

/* ==================================================
// メインビュー 吹き出しデザインのアップグレード
// =================================================*/

.carousel-content .speech-bubble {
    /* 既存のスタイルをリセットし、新しいデザインを適用 */
    background: linear-gradient(135deg, #e6ca8a, #c9a063); /* ゴールド系のグラデーション背景 */
    border-radius: 8px; /* 角を少し丸める */
    padding: 18px 30px; /* 内側の余白を調整 */
    margin-top: 30px; /* 上のテキストとの距離を調整 */
    display: inline-block; /* コンテンツの幅に合わせる */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2); /* 立体感を出すための影 */
    border: none; /* 既存のボーダーを削除 */
    position: relative; /* 疑似要素（しっぽ）を無効化するために必要 */
    transition: all 0.3s ease; /* スムーズな変化のため */
}

/* 吹き出しの「しっぽ」を削除 */
.carousel-content .speech-bubble::before,
.carousel-content .speech-bubble::after {
    content: none;
}

/* 吹き出し内のテキストスタイル */
.carousel-content .speech-bubble span {
    color: #fff;
    font-size: 18px;
    font-weight: 700; /* 文字を太くして力強さを出す */
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2); /* 文字にわずかな影を付けて読みやすく */
    transition: font-size 0.3s ease; /* スムーズな変化のため */
}

/* 「LINEで無料受付中！」部分のスタイル */
.carousel-content .speech-bubble .line-text {
    background-color: rgba(255, 255, 255, 0.15); /* 背景を少し明るくしてアクセントに */
    padding: 3px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 8px; /* 上の行とのマージン */
}

/* ==================================================
// ▼▼▼【ここから追加】スマートフォン向けレスポンシブ設定▼▼▼
// =================================================*/
@media (max-width: 480px) {
    .carousel-content .speech-bubble {
        padding: 15px 20px; /* スマホ用に余白を少し詰める */
        margin-top: 5px; /* 上のテキストとの距離を詰める */
    }

    .carousel-content .speech-bubble span {
        font-size: 10px; /* スマホ用に文字サイズを少し小さく */
    }
}