:root {
    --primary-color: #6f0d0c;
    --secondary-color: #c7b299;
    --text-color: #333;
    --background-color: #fff;
    --max-width: 1200px;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
    margin: 0;
    padding: 0;
}

main {
    background-color: var(--background-color);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px 40px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 30px;
    position: relative;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 0 0 20px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: var(--max-width);
    margin: 0 auto;
}

h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px var(--secondary-color), 0 0 20px var(--secondary-color);
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px var(--secondary-color), 0 0 30px var(--secondary-color), 0 0 40px var(--primary-color);
    }
}

h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin: 15px 0;
}

p {
    margin-bottom: 15px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

.manga-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.manga-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    text-align: center;
    transition: transform 0.3s;
}

.manga-item:hover {
    transform: translateY(-5px);
}

.manga-item img {
    width: 45px;
    height: 64px;
    object-fit: cover;
    margin-bottom: 5px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.volume-section {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f5f0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.volume-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.volume-cover {
    width: 180px;
    height: 256px;
    object-fit: cover;
    margin-right: 20px;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    border-radius: 5px;
    transition: transform 0.3s;
}

.volume-cover:hover {
    transform: scale(1.05);
}

.volume-info {
    flex: 1;
}

.volume-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.conversation {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.speech-bubble {
    position: relative;
    background-color: #fff;
    border-radius: 20px;
    padding: 15px;
    max-width: 250px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    border: 1px solid var(--primary-color); /* Added thin outline in the primary color */
}

.speech-bubble:before {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 50px;
    border-width: 15px 15px 0;
    border-style: solid;
    border-color: #fff transparent transparent;
    /* Adding a small triangle for the border outline effect */
    z-index: 1;
}

.speech-bubble:after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50px;
    border-width: 16px 16px 0;
    border-style: solid;
    border-color: var(--primary-color) transparent transparent;
    z-index: 0;
}

.character {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.character img {
    width: 192px;
    height: 192px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.character-name {
    font-weight: bold;
    margin-top: 10px;
    color: var(--primary-color);
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    gap: 20px;
    width: 100%;
}

.nav-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-button:hover {
    background-color: #8a0f0e;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.nav-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    max-width: var(--max-width);
    margin: 0 auto;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    .volume-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .volume-cover {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .speech-bubble {
        max-width: 100%;
    }

    .nav-buttons {
        flex-direction: column;
    }
}
/* Footer Styling */
footer.copy {
    text-align: left;
    padding: 30px 20px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 3px solid var(--secondary-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

footer.copy p {
    margin-bottom: 12px;
}

footer.copy strong {
    color: #fff;
    font-weight: bold;
}

footer.copy a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s, border-bottom 0.2s;
    border-bottom: 1px solid transparent;
}

footer.copy a:hover {
    color: #fff;
    border-bottom: 1px solid #fff;
}

.contact-info, .usage-terms, .copyright {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(199, 178, 153, 0.3);
}

.copyright {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.copyright img {
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

@media (max-width: 768px) {
    footer.copy {
        padding: 20px 15px;
        font-size: 0.85rem;
    }
}
/* Recommendations Section Styling - Improved Layout */
#recommendations {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f5f0;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#recommendations h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    width: 100%;
}

#recommendations a {
    display: block;
    color: var(--text-color);
    background-color: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    height: 100%;
}

#recommendations a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    color: var(--primary-color);
}

#recommendations a .img-container {
    position: relative;
    width: 100%;
    padding-top: 45.75%; /* Maintain aspect ratio of 800:366 */
    overflow: hidden;
}

#recommendations a img.sneak {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 3px solid var(--primary-color);
}

#recommendations a .text-container {
    padding: 15px;
    font-weight: 500;
}

@media (max-width: 800px) {
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
}
/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 12px 15px;
    margin: 0 0 20px 0;
    list-style: none;
    background-color: #f0e8dd;
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 8px;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 8px;
    color: #777;
    content: "/";
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

.breadcrumb-link:hover {
    color: #8a0f0e;
    text-decoration: underline;
}

.current-page {
    color: #555;
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 10px;
        font-size: 0.9rem;
    }
}
/* Social Sharing Buttons */
.share-buttons {
    margin: 25px 0;
    padding: 15px;
    background-color: #f9f5f0;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    border-left: 3px solid var(--primary-color);
}

.share-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.share-buttons:before {
    content: "この記事をシェアする:";
    margin-right: 15px;
    color: var(--primary-color);
    font-weight: 500;
}

.twitter-share-button iframe,
.fb-share-button iframe {
    vertical-align: middle !important;
}

.fb-share-button a {
    display: inline-block;
    background-color: #1877f2;
    color: white !important;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.3s;
}

.fb-share-button a:hover {
    background-color: #166fe5;
    text-decoration: none !important;
}

@media (max-width: 768px) {
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-buttons:before {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
/* Fade link on hover */
.fade-hover {
    transition: opacity 0s ease;
}

.fade-hover:hover {
    opacity: 0.5;
}
/* 目次スタイル */
.toc-container {
    background-color: #f9f5f0;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.toc-container h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.toc-nav li:before {
    content: "▶";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.toc-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.toc-nav a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* メイン画像スタイル */
.main-image {
    margin: 30px 0;
    text-align: center;
}

.main-image img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
}

.main-image figcaption {
    margin-top: 10px;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

/* 動画コンテナ */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 相関図の見方テーブル */
.chart-guide {
    margin: 20px 0;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.guide-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: bold;
}

.guide-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.guide-table tr:last-child td {
    border-bottom: none;
}

.guide-table img {
    display: block;
    margin: 0 auto;
}

/* ハイライトアイテム */
.highlight-item {
    margin-bottom: 40px;
    padding: 20px;
    background-color: #f9f5f0;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
}

.highlight-item h3 {
    color: var(--primary-color);
    margin-top: 0;
}

.highlight-item img {
    margin: 15px 0;
}

/* ランキングコンテナ */
.ranking-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.ranking-item {
    text-align: center;
    padding: 20px;
    background-color: #f9f5f0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    min-width: 150px;
}

.ranking-item:hover {
    transform: translateY(-5px);
}

.rank-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.ranking-item img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    margin-bottom: 10px;
}

.match-count {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

/* スマホ対応 */
@media (max-width: 768px) {
    /* 左右の余白を最小限に */
    main {
        padding: 0 10px 40px;
    }

    section {
        padding: 0 5px;
    }

    .toc-container {
        padding: 15px 10px;
        margin: 20px -5px;
    }

    .guide-table {
        font-size: 0.9rem;
    }

    .guide-table th,
    .guide-table td {
        padding: 10px 8px;
    }

    .guide-table img {
        width: 80px;
        height: auto;
    }

    .ranking-container {
        gap: 20px;
    }

    .ranking-item {
        min-width: 120px;
        padding: 15px;
    }

    .highlight-item {
        padding: 15px 10px;
        margin-left: -5px;
        margin-right: -5px;
    }

    .nav-buttons {
        margin: 20px -5px;
    }

    .nav-button {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* 超小型スマホ対応 */
@media (max-width: 400px) {
    main {
        padding: 0 8px 30px;
    }

    .guide-table {
        font-size: 0.85rem;
    }

    .ranking-item img {
        width: 72px;
        height: 72px;
    }
}
/* 関連記事一覧 */
#related-articles {
    margin: 40px 0;
    padding: 30px 20px;
    background-color: #f9f5f0;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#related-articles h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

#related-articles h3 {
    color: #666;
    font-size: 1.1rem;
    margin: 0 0 25px 0;
    font-weight: normal;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.article-item {
    display: block;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.article-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.article-item .img-container {
    position: relative;
    width: 100%;
    padding-top: 45.75%; /* アスペクト比 800:366 を維持 */
    overflow: hidden;
    background-color: #f0f0f0;
}

.article-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-item:hover img {
    transform: scale(1.05);
}

.article-item .text-container {
    padding: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-color);
    font-weight: 500;
    min-height: 80px;
    display: flex;
    align-items: center;
}

/* タブレット対応 */
@media (max-width: 768px) {
    #related-articles {
        margin: 30px -10px;
        padding: 20px 15px;
        border-radius: 0;
    }

    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .article-item .text-container {
        padding: 12px;
        font-size: 0.85rem;
        min-height: 70px;
    }
}

/* スマホ対応 */
@media (max-width: 480px) {
    #related-articles {
        margin: 20px -8px;
        padding: 20px 10px;
    }

    #related-articles h2 {
        font-size: 1.5rem;
    }

    #related-articles h3 {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .article-item {
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    .article-item .text-container {
        padding: 10px 12px;
        font-size: 0.82rem;
        min-height: auto;
    }
}
