/*
Theme Name: Ichienen (一縁庵)
Description: 小説・絵画発表サイト。ノベリスト風のシックでモノトーンなデザイン。
Version: 1.0.0
*/

/* --- Reset & Base --- */
body {
    margin: 0;
    font-family: 'Yu Mincho', 'Noto Serif JP', serif; /* 明朝体で小説風に */
    color: #333;
    background-color: #fafafa;
    line-height: 1.8;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* --- Header --- */
.site-header {
    position: relative;
    display: flex;
    flex-direction: column;
}
.site-header-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.6); /* 背景画像がある場合のために半透明化 */
    text-align: center;
}
.site-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: normal;
    letter-spacing: 0.1em;
}
.site-description {
    margin-top: 10px;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

/* --- Global Navigation (PC) --- */
.header-nav-container {
    background-color: #222; /* シックなモノトーン */
    width: 100%;
}
.main-navigation ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    justify-content: flex-end; /* 右詰 */
}
.main-navigation a {
    display: block;
    padding: 15px 30px;
    color: #ccc;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.main-navigation a:hover {
    background-color: #555;
    color: #fff;
}

/* --- Content Layout --- */
.site-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}
.site-main { flex: 1 1 65%; }
.site-sidebar {
    flex: 1 1 25%;
    padding: 30px;
    background: #fff;
    border: 1px solid #eaeaea;
}

/* --- Index (メッセージ & 投稿一覧) --- */
.intro-message {
    padding: 60px 30px;
    margin-bottom: 50px;
    text-align: center;
    background-color: #111; /* 文字色が目立つ背景色 */
    color: #eee;
    font-size: 1.2rem;
    line-height: 2;
    opacity: 0;
    transition: opacity 1.5s ease;
}
.intro-message.is-visible { opacity: 1; }
.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: normal;
    border-bottom: 1px solid #ccc;
    padding-bottom: 15px;
    margin-bottom: 30px;
}
.post-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.post-item {
    flex: 1 1 calc(33.333% - 20px);
    background: #fff;
    border: 1px solid #eee;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease, box-shadow 0.3s ease;
}
.post-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.post-item:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.post-thumbnail img, .no-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}
.no-image {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}
.post-title { font-size: 1.1rem; margin: 15px; font-weight: normal; }
.post-excerpt { font-size: 0.9rem; color: #777; margin: 0 15px 15px; }

/* --- Single & Page --- */
.single-title, .page-title {
    font-size: 2rem;
    font-weight: normal;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 30px;
}
.single-thumbnail, .page-thumbnail { margin-bottom: 30px; text-align: center; }
.entry-content { font-size: 1.05rem; }
.next-post-btn {
    display: inline-block;
    margin-top: 40px;
    padding: 12px 30px;
    border: 1px solid #333;
    transition: all 0.3s;
    float: right;
}
.next-post-btn:hover { background: #333; color: #fff; }

/* --- Sidebar --- */
.widget-title { font-size: 1.2rem; font-weight: normal; border-bottom: 1px solid #ccc; padding-bottom: 10px; }
.shop-info { list-style: none; padding: 0; font-size: 0.95rem; }

/* --- Footer --- */
.site-footer {
    background-color: #1a1a1a;
    color: #888;
    text-align: center;
    padding: 25px 0;
    font-size: 0.85rem;
}

/* --- Hamburger Menu (Tablet & Mobile) --- */
.menu-toggle { display: none; }

@media (max-width: 767px) {
    .site-main, .site-sidebar { flex: 1 1 100%; }
    .post-item { flex: 1 1 calc(50% - 20px); }
    
    /* ハンバーガーボタン設定 */
    .menu-toggle {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 9999;
        background: transparent;
        border: none;
        cursor: pointer;
        width: 30px;
        height: 24px;
        padding: 0;
    }
    .hamburger-line {
        display: block;
        width: 100%;
        height: 2px;
        background: #333; /* タイトルに被らないよう絶対配置 */
        position: absolute;
        transition: all 0.4s ease;
    }
    .hamburger-line:nth-child(1) { top: 0; }
    .hamburger-line:nth-child(2) { top: 11px; }
    .hamburger-line:nth-child(3) { top: 22px; }
    
    .menu-toggle.is-active .hamburger-line:nth-child(1) { transform: translateY(11px) rotate(45deg); background: #fff; }
    .menu-toggle.is-active .hamburger-line:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .hamburger-line:nth-child(3) { transform: translateY(-11px) rotate(-45deg); background: #fff; }
    
    /* スマホ時のメニュー展開（全画面フェードイン） */
    .header-nav-container {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        background: rgba(17, 17, 17, 0.95);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: all 0.5s ease;
        z-index: 9998;
    }
    .header-nav-container.is-open { opacity: 1; visibility: visible; }
    .main-navigation ul { flex-direction: column; text-align: center; }
    .main-navigation a { font-size: 1.5rem; padding: 20px; }
}

@media (max-width: 480px) {
    .post-item { flex: 1 1 100%; }
}