/*
Theme Name: Canvas Inspired
Theme URI: https://canvas.ws/
Author: Antigravity
Description: A clean, creative, and modern WordPress theme inspired by canvas.ws.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: creative, grid-layout, clean, modern, colorful
Text Domain: canvas-theme
*/

:root {
    --primary-color: #d19e66; /* キャラメルのようなブラウン */
    --secondary-color: #e4c19b; /* ミルクティー色 */
    --accent-color: #dda77b; /* 優しいオレンジブラウン */
    --warning-color: #ead5b0; /* バター色 */
    --purple-color: #bfa892; /* カフェオレ色 */
    --text-color: #5c4d43; /* ココアブラウン */
    --bg-color: #fdfbf6; /* クリーム色 */
    --muted-color: #9a8c82;
    --border-color: #f0e6d8;
    --font-main: 'Quicksand', 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
    
    /* グラデーション */
    --grad-primary: linear-gradient(135deg, #fdfbf6 0%, #f4ebd8 100%);
    --grad-creative: linear-gradient(135deg, #d19e66 0%, #dda77b 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

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

/* Header */
.site-header {
    position: relative;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px; /* 画像とテキストの隙間 */
}

.site-title-text {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo-icon {
    height: 40px;
    width: auto;
    display: block;
}

.logo img.custom-logo {
    max-height: 70px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    font-weight: 600;
    font-size: 14px;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 120px 0;
    text-align: center;
    background: #fdfdfd;
    position: relative;
    overflow: hidden;
    margin-bottom: 50px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,51,102,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(52,152,219,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-mascot {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.hero-mascot img {
    max-width: 180px;
    height: auto;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    font-weight: 900;
    background: var(--grad-creative);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
    filter: drop-shadow(0 4px 10px rgba(92, 77, 67, 0.1));
    text-wrap: balance;
    word-break: auto-phrase;
}

.hero p {
    font-size: 20px;
    color: var(--muted-color);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Grid Layout */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(92, 77, 67, 0.1);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    background-color: #f0f0f0;
    object-fit: cover;
}

.post-content {
    padding: 20px;
}

.post-category {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 15px;
    margin-right: 8px;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* カテゴリー別カラー設定 */
.post-category.cat-hokkaido { background-color: #8dbedb; } /* 北海道：ブルー */
.post-category.cat-tama { background-color: #9ab973; }     /* 多摩：グリーン */
.post-category.cat-various { background-color: #f1b281; }  /* その他グルメ：オレンジ */
.post-category.cat-zakki, 
.post-category.cat-default { background-color: #bfa892; }   /* 雑記・その他：ベージュグレー */

.post-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #111;
    transition: color 0.3s ease;
    line-height: 1.4;
    text-wrap: balance;
    word-break: auto-phrase;
}

.post-card:hover .post-title {
    color: var(--primary-color);
}

.post-excerpt {
    font-size: 14px;
    color: var(--muted-color);
}

/* Page Layout (2 Columns) */
.page-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 50px;
    margin-bottom: 50px;
}

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

.static-page-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.05);
}

.static-page-card .page-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 30px;
    padding-bottom: 15px;
    color: var(--primary-color);
    text-align: center;
}

.page-content {
    font-size: 16px;
    color: #444;
}

/* Content Headings */
.post-content h2, .page-content h2 {
    position: relative;
    padding: 15px 20px;
    background: #fdfaf5;
    border-left: 6px solid var(--primary-color);
    border-radius: 0 15px 15px 0;
    font-size: 26px;
    font-weight: 800;
    margin: 50px 0 30px;
    color: var(--text-color);
    line-height: 1.4;
}

.post-content h3, .page-content h3 {
    position: relative;
    padding: 10px 0 10px 25px;
    font-size: 22px;
    font-weight: 700;
    border-bottom: 2px dashed var(--border-color);
    margin: 40px 0 20px;
    color: var(--text-color);
}

.post-content h3::before, .page-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent-color);
    border-radius: 50%;
}

.post-content h4, .page-content h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 15px;
    color: var(--text-color);
    padding-left: 10px;
    border-left: 3px solid var(--secondary-color);
}

/* Content Boxes (Block Styles) */
.is-style-canvas-box,
.is-style-canvas-box-info,
.is-style-canvas-box-alert,
.is-style-canvas-box-note,
.canvas-box { /* 手動用も維持 */
    padding: 25px;
    margin: 30px 0;
    border-radius: 24px;
    background: #fff;
    border: 2px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.03);
    position: relative;
    color: var(--text-color);
}

/* お知らせ・ポイント */
.is-style-canvas-box-info,
.canvas-box.info {
    background: #fdfaf5;
    border-color: var(--secondary-color);
}
.is-style-canvas-box-info::before,
.canvas-box.info::before {
    content: '💡';
    position: absolute;
    top: -18px;
    left: 20px;
    background: #fff;
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* 注意・警告 */
.is-style-canvas-box-alert,
.canvas-box.alert {
    background: #fff9f5;
    border-color: var(--accent-color);
}
.is-style-canvas-box-alert::before,
.canvas-box.alert::before {
    content: '⚠️';
    position: absolute;
    top: -18px;
    left: 20px;
    background: #fff;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* ふせん・メモ */
.is-style-canvas-box-note,
.canvas-box.note {
    border: none;
    border-left: 8px solid var(--secondary-color);
    background: #fcf6ed;
    border-radius: 0 20px 20px 0;
    padding-left: 30px;
}

/* Sidebar */
.page-sidebar {
    width: 320px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.05);
}

/* Profile Widget Styles */
.profile-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    background: var(--bg-color);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-color);
}

.profile-icon img {
    width: 80%;
    height: auto;
}

.profile-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-color);
}

.profile-description {
    font-size: 14px;
    color: var(--muted-color);
    text-align: left;
    line-height: 1.6;
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 20px;
    padding-bottom: 10px;
    color: var(--primary-color);
    text-align: center;
}

.widget-content ul {
    list-style: none;
}

.widget-content ul li {
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.widget-content ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget-content ul li a {
    color: var(--muted-color);
    font-size: 14px;
}

.widget-content ul li a:hover {
    color: var(--primary-color);
}

@media (max-width: 800px) {
    .page-layout {
        flex-direction: column;
    }
    .page-sidebar {
        width: 100%;
    }
}

/* Pagination */
.canvas-pagination {
    width: 100%;
    margin: 60px 0 20px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.canvas-pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.canvas-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    font-weight: 700;
    color: var(--text-color);
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(92, 77, 67, 0.03);
}

.canvas-pagination .page-numbers.current {
    background: var(--grad-creative);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(209, 158, 102, 0.3);
    transform: translateY(-2px);
}

.canvas-pagination .page-numbers:not(.current):not(.dots):hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(92, 77, 67, 0.08);
}

.canvas-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    box-shadow: none;
    color: var(--muted-color);
}

.canvas-pagination .next.page-numbers,
.canvas-pagination .prev.page-numbers {
    width: auto;
    font-size: 14px;
    padding: 0 24px;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .canvas-pagination .page-numbers {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 14px;
        border-radius: 12px;
    }
    .canvas-pagination .next.page-numbers,
    .canvas-pagination .prev.page-numbers {
        padding: 0 15px;
    }
}

/* Footer */
footer {
    padding: 60px 0;
    background: var(--text-color);
    color: var(--bg-color);
    text-align: center;
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

.footer-nav ul li {
    margin: 0 15px;
}

.copyright {
    font-size: 12px;
    opacity: 0.5;
}

/* ==========================================
   Table of Contents (自動目次)
   ========================================== */
.canvas-toc {
    background: #fdfaf5; /* 優しいクリーム色 */
    border: 2px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    margin: 40px 0;
    font-family: var(--font-main);
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.03);
}

.canvas-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.canvas-toc-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.canvas-toc-title::before {
    content: '📋';
    margin-right: 10px;
    font-size: 22px;
}

.canvas-toc-toggle {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    color: var(--muted-color);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.canvas-toc-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff9f5;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(209, 158, 102, 0.1);
}

.canvas-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: max-height 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
    overflow: hidden;
}

/* アコーディオン閉じている状態 */
.canvas-toc-list.collapsed {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.toc-item-h2 {
    margin-bottom: 12px;
}

.toc-item-h2:last-child {
    margin-bottom: 0;
}

.toc-item-h2 > a {
    display: flex;
    align-items: flex-start;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.5;
    transition: color 0.2s ease;
    padding: 4px 0;
}

.toc-item-h2 > a:hover {
    color: var(--primary-color);
}

.toc-num {
    color: var(--accent-color);
    font-weight: 800;
    margin-right: 12px;
    font-size: 15px;
    position: relative;
    top: 1px;
}

.toc-num::after {
    content: '|';
    margin-left: 10px;
    color: var(--border-color);
    font-weight: 400;
}

.toc-text {
    flex: 1;
}

/* H3リスト (子要素) */
.toc-child-list {
    list-style: none;
    padding-left: 36px;
    margin-top: 6px;
    margin-bottom: 12px;
}

.toc-item-h3 {
    margin-bottom: 6px;
    position: relative;
}

.toc-item-h3:last-child {
    margin-bottom: 0;
}

.toc-item-h3::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
}

.toc-item-h3 a {
    font-size: 14px;
    color: var(--muted-color);
    font-weight: 500;
    transition: color 0.2s ease;
    display: block;
    padding: 2px 0;
}

.toc-item-h3 a:hover {
    color: var(--primary-color);
}

/* スムーズスクロールとスクロールマージンの調整 */
html {
    scroll-behavior: smooth;
}

.post-content h2, 
.post-content h3 {
    scroll-margin-top: 40px; /* 固定ヘッダーに重ねないためのマージン */
}

/* ==========================================
   Chat Speech Balloon (会話風吹き出し)
   ========================================== */
.canvas-chat-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 35px 0;
    width: 100%;
}

.canvas-chat-speaker {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.canvas-chat-avatar {
    margin: 0 0 8px 0 !important;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border-color);
    background: #fff;
    box-shadow: 0 6px 12px rgba(92, 77, 67, 0.05);
}

.canvas-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.canvas-chat-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted-color);
    margin: 0 !important;
    line-height: 1.3;
    text-align: center;
}

.canvas-chat-balloon {
    flex: 1;
    position: relative;
    padding: 20px 24px;
    background: #f5eee6; /* 枠線なしの優しいベージュグレー背景 */
    border-radius: 24px;
    font-size: 16px;
    color: var(--text-color);
    margin: 0 !important;
    line-height: 1.7;
    box-shadow: 0 10px 30px rgba(92, 77, 67, 0.02);
}

/* 吹き出しのツノ（左側アイコンの右吹き出し用） */
.canvas-chat-left .canvas-chat-balloon::after {
    content: '';
    position: absolute;
    right: 100%;
    top: 25px;
    border: 10px solid transparent;
    border-right-color: #f5eee6;
    margin-top: -10px;
}

/* 吹き出しのツノ（右側アイコンの左吹き出し用） */
.canvas-chat-right .canvas-chat-balloon::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 25px;
    border: 10px solid transparent;
    border-left-color: #f5eee6;
    margin-top: -10px;
}

/* エディタとフロントエンドの両方でアライメントを正しく調整する設定 */
.canvas-chat-left {
    flex-direction: row;
}

.canvas-chat-right {
    flex-direction: row;
}

/* モバイル（スマートフォン）対応 */
@media (max-width: 600px) {
    .canvas-chat-container {
        gap: 12px;
        margin: 25px 0;
    }
    .canvas-chat-speaker {
        width: 70px;
    }
    .canvas-chat-avatar {
        width: 56px;
        height: 56px;
        border-width: 2px;
    }
    .canvas-chat-name {
        font-size: 11px;
    }
    .canvas-chat-balloon {
        padding: 15px 18px;
        font-size: 15px;
        border-radius: 20px;
    }
    .canvas-chat-left .canvas-chat-balloon::after {
        border-width: 8px;
        margin-top: -8px;
        top: 20px;
    }
    .canvas-chat-right .canvas-chat-balloon::after {
        border-width: 8px;
        margin-top: -8px;
        top: 20px;
    }
}


