/* ==========================================================================
   anime 作品個別ページ専用スタイル
   ========================================================================== */

/* ----------------------------------------
   記事本文：見出し（h2 / h3）
   ---------------------------------------- */
.single-anime .articleBody h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 48px 0 20px;
    padding: 16px 20px;
    position: relative;
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
    border-radius: 0 8px 8px 0;
    line-height: 1.4;
}

.single-anime .articleBody h2:first-child {
    margin-top: 0;
}

.single-anime .articleBody h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 36px 0 16px;
    padding: 0 0 10px;
    border-bottom: 2px solid #333;
    position: relative;
    line-height: 1.4;
}
.single-anime .articleBody h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #f59e0b;
}

/* ----------------------------------------
   記事本文：段落・リンク
   ---------------------------------------- */
.single-anime .articleBody p {
    color: #d1d5db;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.single-anime .articleBody a {
    color: #f59e0b;
    text-decoration: underline;
    text-decoration-color: rgba(245, 158, 11, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}
.single-anime .articleBody a:hover {
    text-decoration-color: #f59e0b;
}

/* 目次ブロック内のリンクは下線なし */
.single-anime .articleBody .toc_block a {
    text-decoration: none;
}
.single-anime .articleBody .toc_block a:hover {
    text-decoration: underline;
    text-decoration-color: #f59e0b;
}

/* 視聴方法ウィジェット直後の余分なボーダーを消す */
.single-anime .articleBody .vod-providers-wrapper {
    border-bottom: none;
}

/* 視聴方法の見出しはボーダー不要 */
.single-anime .articleBody .vod-providers-wrapper h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin: 0 0 20px;
}
.single-anime .articleBody .vod-providers-wrapper h3::after {
    content: none;
}

/* VODカード内のリンク装飾を無効化 */
.single-anime .articleBody .vod-providers-wrapper a {
    text-decoration: none;
}

/* ----------------------------------------
   記事本文：リスト（ul / li）
   ---------------------------------------- */
.single-anime .articleBody ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.single-anime .articleBody ul li {
    position: relative;
    padding: 12px 16px 12px 44px;
    margin-bottom: 8px;
    background: #1e1e1e;
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
}

.single-anime .articleBody ul li::before {
    content: '✓';
    position: absolute;
    left: 16px;
    top: 12px;
    color: #f59e0b;
    font-weight: 900;
    font-size: 16px;
}

/* MERIT/DEMERIT 内のリストは既定の黒丸スタイルに戻す */
.single-anime .articleBody .deco-merit ul,
.single-anime .articleBody .deco-demerit ul,
.deco-merit ul,
.deco-demerit ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}
.single-anime .articleBody .deco-merit ul li,
.single-anime .articleBody .deco-demerit ul li,
.deco-merit ul li,
.deco-demerit ul li {
    position: static;
    padding: 4px 0;
    margin: 0;
    background: transparent;
    border-radius: 0;
    font-size: 14px;
}
.single-anime .articleBody .deco-merit ul li::before,
.single-anime .articleBody .deco-demerit ul li::before,
.deco-merit ul li::before,
.deco-demerit ul li::before {
    content: none;
}

/* MERIT/DEMERIT 内の段落・リストアイテムの文字色を保護 */
.single-anime .articleBody .deco-merit p,
.single-anime .articleBody .deco-merit li,
.single-anime .articleBody .deco-demerit p,
.single-anime .articleBody .deco-demerit li {
    color: #d1d5db;
    background: transparent;
    padding: 4px 0;
    margin: 0;
}
.single-anime .articleBody .deco-merit li::before,
.single-anime .articleBody .deco-demerit li::before {
    content: none;
}

/* FAQ質問（h3）は本文h3装飾の対象外にする */
.single-anime .articleBody h3.faq-item-question {
    padding: 16px 20px;
    border-bottom: none;
    margin: 0;
}
.single-anime .articleBody h3.faq-item-question::after {
    content: none;
}

/* FAQ質問と回答の間の余白を詰める */
.single-anime .articleBody h3.faq-item-question + .faq-item-answer {
    margin-top: 0;
}

/* h3とdivの間に wpautop が差し込んだ空の <p> タグを無効化 */
.single-anime .articleBody h3.faq-item-question + p:empty {
    display: none;
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}
.single-anime .articleBody h3.faq-item-question + p:empty + .faq-item-answer {
    margin-top: 0;
}

/* ----------------------------------------
   ヒーローヘッダー
   ---------------------------------------- */
.anime-hero-wrapper {
    margin-bottom: 32px;
}

.anime-hero {
    position: relative;
    min-height: 400px;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.anime-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(20, 20, 20, 0.85) 0%,
        rgba(20, 20, 20, 0.65) 50%,
        rgba(20, 20, 20, 0.85) 100%
    );
    pointer-events: none;
}

.anime-hero-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 48px;
    min-height: 400px;
    box-sizing: border-box;
}

.anime-hero-poster {
    flex-shrink: 0;
    width: 180px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.anime-hero-poster img {
    display: block;
    width: 100%;
    height: auto;
}

.anime-hero-info {
    flex: 1;
    color: #ffffff;
    min-width: 0;
}

.anime-hero-tagline {
    font-style: italic;
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 8px;
    line-height: 1.5;
}

.anime-hero-title.articleHeader__title {
    font-size: 36px;
    line-height: 1.25;
    margin: 0 0 20px;
    color: #ffffff;
    font-weight: 700;
}

.anime-hero-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.anime-hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #ffffff;
    font-size: 14px;
}

.anime-hero-meta-label {
    color: #9ca3af;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.anime-hero-meta-value {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.anime-hero-meta-rating .anime-hero-meta-value {
    color: #f59e0b;
}

/* ----------------------------------------
   基本情報テーブル
   ---------------------------------------- */
.anime-info-table {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.anime-info-heading {
    font-size: 18px;
    margin: 0 0 16px;
    color: #ffffff;
    font-weight: 600;
}

.anime-info-list {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.anime-info-list th,
.anime-info-list td {
    text-align: left;
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #333;
    vertical-align: top;
}

.anime-info-list th {
    color: #9ca3af;
    font-weight: 500;
    width: 30%;
    white-space: nowrap;
}

.anime-info-list td {
    color: #ffffff;
}

.anime-info-list tr:last-child th,
.anime-info-list tr:last-child td {
    border-bottom: none;
}

.anime-info-list td a {
    color: #f59e0b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.anime-info-list td a:hover,
.anime-info-list td a:focus {
    text-decoration: underline;
    color: #fbbf24;
}

/* ----------------------------------------
   キャスト一覧
   ---------------------------------------- */
.anime-cast-section {
    margin-bottom: 32px;
}
.anime-cast-heading {
    font-size: 18px;
    margin: 0 0 16px;
    color: #ffffff;
    font-weight: 600;
}
.anime-cast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.anime-cast-card {
    text-align: center;
    min-width: 0;
}
.anime-cast-image {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    border-radius: 50%;
    margin: 0 auto 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.anime-cast-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.anime-cast-placeholder {
    font-size: 32px;
    color: #6b7280;
}
.anime-cast-name {
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    margin-bottom: 2px;
}
.anime-cast-character {
    font-size: 12px;
    color: #9ca3af;
}

/* ----------------------------------------
   予告編動画
   ---------------------------------------- */
.anime-trailer-section {
    margin-bottom: 32px;
}
.anime-trailer-heading {
    font-size: 18px;
    margin: 0 0 16px;
    color: #ffffff;
    font-weight: 600;
}
.anime-trailer-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    cursor: pointer;
}
.anime-trailer-thumbnail {
    position: absolute;
    inset: 0;
}
.anime-trailer-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.anime-trailer-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(229, 9, 20, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    transition: transform 0.3s ease;
    pointer-events: none;
}
.anime-trailer-embed:hover .anime-trailer-play {
    transform: translate(-50%, -50%) scale(1.1);
}
.anime-trailer-embed.loaded {
    cursor: default;
}
.anime-trailer-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ----------------------------------------
   PR表記
   ---------------------------------------- */
.anime-pr-notice {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin: 12px 0 0;
    padding: 0;
}

/* ----------------------------------------
   レスポンシブ（スマホ）
   ---------------------------------------- */
@media (max-width: 768px) {
    .anime-hero {
        min-height: auto;
    }

    .anime-hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 24px;
        min-height: auto;
    }

    .anime-hero-poster {
        width: 140px;
    }

    .anime-hero-title.articleHeader__title {
        font-size: 24px;
        margin: 0 0 16px;
    }

    .anime-hero-meta {
        gap: 14px;
    }

    .anime-info-table {
        padding: 20px;
    }

    .anime-info-list th,
    .anime-info-list td {
        padding: 8px 12px;
        font-size: 13px;
    }

    .anime-info-list th {
        width: 35%;
    }

    .anime-cast-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .anime-cast-image {
        width: 72px;
        height: 72px;
    }
}

/* ========================================
 * 評価ソースバッジ（TMDB + ツールチップ）
 * ======================================== */

.rating-source {
    display: inline-block;
    margin-left: 0.5em;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #9ca3af;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    cursor: help;
    position: relative;
    vertical-align: middle;
    user-select: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.rating-source::after {
    content: 'ⓘ';
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.7;
}

.rating-source:hover,
.rating-source:focus {
    color: #f59e0b;
    border-color: #f59e0b;
    outline: none;
}

.rating-source-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1e1e1e;
    color: #d1d5db;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: normal;
    line-height: 1.5;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.rating-source-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e1e1e;
}

.rating-source:hover .rating-source-tooltip,
.rating-source:focus .rating-source-tooltip {
    opacity: 1;
    visibility: visible;
}

/* スマホでは折り返しを許可（白背景端で切れるのを防ぐ） */
@media (max-width: 600px) {
    .rating-source-tooltip {
        white-space: normal;
        width: 240px;
    }
}
