/* =========================================
   TORA-E MASTER STYLE SHEET - MANGA STYLE
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700;900&display=swap');

:root {
    --tora-yellow: #FFE100;
    --tora-black: #111111;
    --tora-dark: #1a1a1a;
    --tora-gray: #333333;
    --tora-text: #f0f0f0;
    --tora-white: #ffffff;
    --comic-border: 3px solid #000;
    --comic-bg: #ffffff;
    --font-main: 'Noto Sans JP', "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

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

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

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

/* Back to Main Banner */
.back-to-main-banner {
    width: 100%;
    height: 60px;
    background-color: #f0f4f8;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid #ddd;
}

.back-to-main-banner a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    position: relative;
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.back-to-main-banner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.back-to-main-banner a:hover img {
    opacity: 0.5;
}

.back-to-main-banner span {
    position: relative;
    z-index: 10;
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 5px 20px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccc;
}

/* Header */
header {
    background-color: rgba(17, 17, 17, 0.95);
    border-top: 4px solid var(--tora-yellow);
    border-bottom: 1px solid #222;
    padding: 15px 0;
    position: relative;
    z-index: 1000;
}

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

.logo img {
    height: 40px;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

.nav-group {
    display: flex;
    gap: 12px;
}

.nav-group a {
    color: var(--tora-yellow);
    font-weight: bold;
    font-size: 0.85rem;
    border: 1px solid var(--tora-yellow);
    padding: 6px 16px;
    border-radius: 4px;
    background-color: rgba(255, 225, 0, 0.05);
}

.nav-group a:hover {
    background-color: var(--tora-yellow);
    color: #000;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5)), url('../img/yuyake.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 80px 20px;
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: repeating-linear-gradient(45deg,
            #000,
            #000 10px,
            #222 10px,
            #222 20px);
}

.hero h1 {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 900;
    font-size: 3.5rem;
    color: var(--tora-yellow);
    text-shadow: 4px 4px 0 #000;
    letter-spacing: 1px;
    margin-bottom: 15px;
    line-height: 1.2;
}

/* Main Content */
main {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Section Title */
.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--tora-white);
    margin-bottom: 40px;
    font-weight: 900;
    display: block;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Article & Post Titles */
article {
    background-color: var(--tora-black);
    padding: 0;
}

.post-header h2 {
    font-size: 1.6rem;
    color: var(--tora-white);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    border-left: 6px solid var(--tora-yellow);
    padding-left: 15px;
    background: linear-gradient(90deg, rgba(255, 225, 0, 0.1), transparent);
    padding-top: 5px;
    padding-bottom: 5px;
}

.post-date {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Post Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.post-card {
    background-color: var(--tora-dark);
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    border-color: var(--tora-yellow);
    box-shadow: 0 8px 15px rgba(255, 225, 0, 0.1);
}

.post-thumbnail {
    width: 100%;
    height: 180px;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--tora-yellow);
    overflow: hidden;
}

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

.text-thumbnail {
    width: 100%;
    height: 160px;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--tora-yellow);
    position: relative;
}

.text-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.thumb-text {
    font-family: 'Impact', sans-serif;
    font-size: 3rem;
    color: var(--tora-yellow);
    transform: rotate(-3deg);
    z-index: 1;
    text-shadow: 3px 3px 0 #000;
}

.post-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-cat {
    align-self: flex-start;
    background-color: var(--tora-yellow);
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 2px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.post-card .post-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 10px;
}

.post-summary {
    font-size: 0.85rem;
    color: #bbb;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden;
    flex-grow: 1;
}

/* =========================================
   MANGA STYLE CONVERSATION
   ========================================= */

.conversation-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* コマの間隔 */
    margin-top: 40px;
    padding: 0 10px;
}

/* 1つの発言＝1つの「コマ」として定義 */
.chat-row {
    background-color: #ffffff;
    /* 紙の白 */
    border: 3px solid #000;
    /* コマの枠線 */
    border-radius: 4px;
    padding: 15px;
    display: flex;
    align-items: center;
    /* 上下中央 */
    gap: 20px;
    box-shadow: 6px 6px 0 #444;
    /* コミック風の影 */
    position: relative;
    overflow: hidden;
    /* コマからはみ出さない */
    color: #000;
    /* 文字色は黒 */
}

/* 竹さん（右配置） */
.chat-row.take {
    flex-direction: row-reverse;
}

/* アイコン（キャラ） */
.icon-col {
    flex-shrink: 0;
    text-align: center;
    width: 80px;
    z-index: 2;
}

.icon-col img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #000;
    /* キャラの枠も黒 */
    object-fit: cover;
    background: #fff;
}

.icon-col .name {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #000;
    background: var(--tora-yellow);
    padding: 2px 5px;
    margin-top: -10px;
    position: relative;
    z-index: 3;
    border: 2px solid #000;
    border-radius: 10px;
    transform: rotate(-3deg);
}

/* 吹き出し（セリフ） */
.bubble-col {
    flex-grow: 1;
}

.bubble {
    background: transparent;
    padding: 10px;
    border: none;
    font-size: 1.15rem;
    color: #000;
    font-weight: 700;
    line-height: 1.7;
    position: relative;
    font-family: var(--font-main);
}

/* 強調したいセリフの装飾 */
/* removed empty rules */

/* 漫画の効果線（集中線）風の背景をCSSグラデーションで */
.chat-row.matsu::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 20px,
            rgba(255, 225, 0, 0.1) 20px,
            rgba(255, 225, 0, 0.1) 40px);
    transform: rotate(15deg);
    z-index: 0;
    pointer-events: none;
}

/* 竹さんは冷静なブルーの背景ライン */
.chat-row.take::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(45deg,
            transparent,
            transparent 10px,
            rgba(0, 0, 255, 0.03) 10px,
            rgba(0, 0, 255, 0.03) 12px);
    z-index: 0;
    pointer-events: none;
}

/* ジェミー（AI）の特別コマ */
.chat-row.gemi {
    background-color: #1a1a2e;
    /* 宇宙っぽいダークブルー */
    border-color: #4285F4;
    color: #fff;
    /* 白文字 */
    flex-direction: column;
    text-align: center;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.3);
}

.chat-row.gemi .icon-col {
    width: auto;
}

.chat-row.gemi .icon-col img {
    border-color: #4285F4;
}

.chat-row.gemi .icon-col .name {
    background: #4285F4;
    color: #fff;
    border-color: #fff;
    transform: rotate(0deg);
}

.chat-row.gemi .bubble {
    color: #fff;
    font-weight: normal;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid #4285F4;
    padding: 15px;
}

/* Tags */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    font-size: 0.8rem;
    background: transparent;
    border: 1px solid #444;
    padding: 4px 12px;
    border-radius: 20px;
    color: #ccc;
    transition: all 0.2s;
}

.tag:hover {
    border-color: var(--tora-yellow);
    color: var(--tora-yellow);
}

/* Author Profile */
.author-profile {
    margin-top: 60px;
    background: #111;
    border: 3px solid #333;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 12px;
}

.author-profile img,
.icon-col img,
.icon img,
.profile-image {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    /* 頭が切れないように上部を基準に */
    border: 2px solid var(--tora-yellow);
    box-shadow: 0 0 10px rgba(255, 225, 0, 0.2);
    flex-shrink: 0;
}

/* =========================================
   22. Related Posts Section (あわせて読みたい) - TORA-E THEME
   ========================================= */
.related-posts-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px dashed #444;
}

.decorated-subtitle {
    color: var(--tora-yellow);
    font-size: 1.5rem;
    margin-bottom: 20px;
    font-weight: 900;
    text-transform: uppercase;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px auto 0;
    max-width: 1000px;
    justify-content: center;
}

.related-post-card {
    max-width: 320px;
    width: 100%;
    margin: 0;
    background: var(--tora-dark);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.related-post-card:hover {
    transform: translateY(-5px);
    border-color: var(--tora-yellow);
    box-shadow: 0 8px 15px rgba(255, 225, 0, 0.1);
}

.related-post-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: top;
}

.related-post-card .card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-post-card .card-title {
    font-size: 1rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--tora-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.related-post-card:hover .card-title {
    color: var(--tora-yellow);
}

.related-post-card .card-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.related-post-card .card-genre {
    color: var(--tora-yellow);
    font-weight: bold;
}

@media (min-width: 900px) {
    .related-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    }
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.85rem;
    color: #444;
    background-color: #050505;
    border-top: 1px solid #222;
}