
/* =========================================================
   SPIRYTUS POST DETAIL
   Instagram風メディア + YouTube風コメント
========================================================= */


/* =========================================================
   全体レイアウト
========================================================= */

.content-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 14px 40px;
    box-sizing: border-box;
}


/* =========================================================
   投稿カード
========================================================= */

.post-detail {
    width: 100%;
    margin: 0 auto 28px;
    padding: 0;
    overflow: hidden;

    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
}


/* =========================================================
   投稿者ヘッダー
========================================================= */

.post-detail .post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 64px;
    padding: 12px 16px;

    box-sizing: border-box;
    background: #fff;
}

.post-detail .post-user {
    display: flex;
    align-items: center;
    min-width: 0;
}

.post-detail .post-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    margin-right: 11px;
    overflow: hidden;

    border-radius: 50%;
    background: #f0f2f4;

    display: flex;
    align-items: center;
    justify-content: center;
}

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

.post-detail .post-user-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.post-detail .post-username {
    overflow: hidden;

    color: #222;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-detail .post-date {
    color: #888;
    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   投稿メニュー
========================================================= */

.post-detail .post-menu {
    position: relative;
    flex-shrink: 0;
}

.post-detail .post-menu-button {
    width: 34px;
    height: 34px;

    padding: 0;
    border: none;
    border-radius: 50%;

    background: transparent;
    color: #555;

    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}

.post-detail .post-menu-button:hover {
    background: #f3f3f3;
}

.post-detail .post-menu-dropdown {
    position: absolute;
    z-index: 20;
    top: 38px;
    right: 0;

    width: 190px;
    padding: 6px;

    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;

    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.12);
}

.post-detail .post-menu-item {
    display: block;
    width: 100%;

    padding: 10px 12px;
    border: none;
    border-radius: 7px;

    background: transparent;
    color: #333;

    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.post-detail .post-menu-item:hover {
    background: #f5f5f5;
}


/* =========================================================
   タイトル
========================================================= */

.post-detail .post-title-area {
    padding: 8px 18px 12px;
}

.post-detail .post-title-area h1,
.post-detail .post-title-area h2 {
    margin: 0;

    color: #171717;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.55;
    word-break: break-word;
}


/* =========================================================
   本文
========================================================= */

.post-detail .post-body {
    padding: 2px 18px 18px;

    color: #292929;
    font-size: 15px;
    line-height: 1.85;
    word-break: break-word;
}

.post-detail .post-body p {
    margin: 0 0 10px;
}

.post-detail .post-body p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   画像
   Instagram風：横幅を広く、比率を維持
========================================================= */

.post-detail .post-image-wrapper {
    width: 100%;
    margin: 0;
    padding: 0;

    background: #f5f5f5;
    overflow: hidden;
}

.post-detail .post-image {
    display: block;

    width: 100%;
    max-width: 100%;
    height: auto;

    margin: 0 auto;

    object-fit: contain;
    background: #f5f5f5;
}


/* =========================================================
   動画
========================================================= */

.post-detail .post-video-area {
    width: 100%;
    margin: 0;
    padding: 0;

    background: #000;
    overflow: hidden;
}

.post-detail .post-video-area iframe,
.post-detail .post-video-area video,
.post-detail .post-video-area embed {
    display: block;

    width: 100%;
    max-width: 100%;
    min-height: 320px;

    border: none;
}

.post-detail .post-video-area iframe {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
}


/* =========================================================
   投稿アクション
========================================================= */

.post-detail .post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 16px 8px;
    border-top: 1px solid #f0f0f0;
}

.post-detail .post-actions-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-detail .post-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 30px;
    min-height: 30px;

    padding: 0;
    border: none;

    background: transparent;
    color: #333;

    font-size: 24px;
    text-decoration: none;
    cursor: pointer;
}

.post-detail .post-action-button:hover {
    color: #777;
}


/* =========================================================
   保存・通報
========================================================= */

.post-detail .save-post-area,
.post-detail .report-area {
    padding: 0 16px 14px;
}

.post-detail .save-btn,
.post-detail .report-btn {
    padding: 8px 14px;

    border: 1px solid #ddd;
    border-radius: 18px;

    background: #fff;
    color: #444;

    font-size: 12px;
    cursor: pointer;
}

.post-detail .save-btn.saved {
    background: #f1f5f2;
    border-color: #cbded0;
    color: #42734d;
}

.post-detail .report-area form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-detail .report-area select {
    max-width: 180px;
    padding: 7px;

    border: 1px solid #ddd;
    border-radius: 7px;

    font-size: 12px;
}

/* =========================================================
   通報フォーム
========================================================= */
.post-detail .post-report-form label {
    display: block;
    margin-bottom: 6px;

    color: #555;
    font-size: 12px;
}

.post-detail .post-report-form select {
    display: block;
    width: 100%;
    min-width: 0;

    margin-bottom: 8px;
    padding: 9px;

    box-sizing: border-box;

    border: 1px solid #d8d8d8;
    border-radius: 7px;

    background: #fff;
    color: #333;

    font-size: 13px;
    cursor: pointer;
}

.post-detail .post-report-form select:focus {
    border-color: #888;
    outline: 2px solid rgba(100, 100, 100, 0.12);
}

.post-detail .post-report-form .post-menu-item {
    padding: 9px 4px;
    color: #b42318;
}

/* =========================================================
   YouTube風 コメントセクション
========================================================= */

.youtube-comment-section {
    width: 100%;
    margin: 0 auto 26px;
    padding: 22px 20px 24px;

    box-sizing: border-box;

    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
}


/* コメント見出し */

.comment-section-header {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 22px;
    padding-bottom: 14px;

    border-bottom: 1px solid #ededed;
}

.comment-section-header h2 {
    margin: 0;

    color: #222;
    font-size: 18px;
    font-weight: 700;
}

.comment-section-header span {
    color: #888;
    font-size: 12px;
}


/* コメント入力 */

.comment-input-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    margin-bottom: 28px;
    padding-bottom: 22px;

    border-bottom: 1px solid #ededed;
}

.comment-input-avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;
    flex: 0 0 38px;

    border-radius: 50%;
    background: #f0f2f4;

    font-size: 17px;
}

.comment-form {
    flex: 1;
    min-width: 0;
}

.comment-form p {
    margin: 0 0 10px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;

    color: #555;
    font-size: 12px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 12px;

    border: none;
    border-bottom: 1px solid #bbb;
    border-radius: 0;

    background: #fafafa;
    color: #222;

    font-size: 14px;
    line-height: 1.6;
    outline: none;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-bottom: 2px solid #333;
    background: #fff;
}

/* コメント投稿ボタンを中央配置 */

.comment-form-actions {
    display: flex;
    justify-content: center;
    align-items: center;

    margin-top: 16px;
}

.comment-submit-btn {
    padding: 9px 17px;

    border: none;
    border-radius: 20px;

    background: #222;
    color: #fff;

    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.comment-submit-btn:hover {
    background: #444;
}


/* =========================================================
   コメント一覧
========================================================= */

.youtube-comments {
    width: 100%;
    min-width: 0;
}

.youtube-comments > * {
    max-width: 100%;
}


/* =========================================================
   戻るボタン
========================================================= */

.back-area {
    padding: 8px 0 24px;
    text-align: center;
}

.back-button {
    display: inline-block;

    padding: 10px 24px;

    border: 1px solid #ddd;
    border-radius: 22px;

    background: #fff;
    color: #555;

    font-size: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.back-button:hover {
    background: #f4f4f4;
}


/* =========================================================
   メディアモーダル
========================================================= */

.media-modal-content img,
.media-modal-content video,
.media-modal-content iframe {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    margin: 0 auto;
}


/* =========================================================
   スマートフォン
========================================================= */

@media (max-width: 600px) {

    .content-container {
        max-width: 100%;
        padding: 8px 0 30px;
    }

    .post-detail {
        margin-bottom: 18px;
        border-right: none;
        border-left: none;
        border-radius: 0;
        box-shadow: none;
    }

    .post-detail .post-header {
        padding: 11px 14px;
    }

    .post-detail .post-title-area {
        padding: 8px 14px 12px;
    }

    .post-detail .post-title-area h1,
    .post-detail .post-title-area h2 {
        font-size: 17px;
    }

    .post-detail .post-body {
        padding: 0 14px 16px;
        font-size: 14px;
        line-height: 1.8;
    }

    .post-detail .post-image {
        max-height: none;
    }

    .post-detail .post-video-area iframe,
    .post-detail .post-video-area video {
        min-height: 0;
    }

    .post-detail .post-actions {
        padding: 9px 14px;
    }

    .youtube-comment-section {
        margin-bottom: 18px;
        padding: 20px 14px 22px;

        border-right: none;
        border-left: none;
        border-radius: 0;
    }

    .comment-input-card {
        gap: 9px;
    }

    .comment-input-avatar {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .comment-submit-btn {
        padding: 9px 14px;
    }

    .back-area {
        padding: 6px 0 20px;
    }
}

/* コメントの日付と通報を同じ行に配置 */
.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

/* コメント通報フォーム */
.comment-report-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

/* 通報理由の選択 */
.comment-report-form select {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

/* 通報ボタン */
.comment-report-form .report-btn {
    font-size: 12px;
    padding: 4px 9px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #777;
    cursor: pointer;
}

.comment-report-form .report-btn:hover {
    background: #f5f5f5;
    color: #d9534f;
}

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

.comment-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.comment-author {
    flex: 1;
    min-width: 0;
}

/* =========================
   ❤️ いいねボタン
========================= */

.post-detail .blog-like-btn .like-icon {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.post-detail .blog-like-btn .like-icon svg {
    display: block;
}

.post-detail .blog-like-btn .like-count {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -48%);

    font-size: 9px;
    font-weight: 700;
    line-height: 1;

    color: currentColor;

    pointer-events: none;
}


/* =========================================
   🖼️ Blog 複数画像スライダー
   frontpage と同じ表示
========================================= */

.post-image-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.post-image-track {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease;
    touch-action: pan-y;
}

.post-image-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.post-image-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    cursor: pointer;
}


/* =========================================
   左右ボタン
========================================= */

.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 36px;
    height: 36px;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.45);
    color: white;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-button:disabled {
    opacity: 0.3;
    cursor: default;
}


/* =========================================
   ドット
========================================= */

.slider-dots {
    position: absolute;

    bottom: 12px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    gap: 6px;

    z-index: 2;
}

.slider-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
}

.slider-dot.active {
    background: #ffffff;
}


/* =========================================
   枚数カウンター
========================================= */

.slider-counter {
    position: absolute;

    top: 10px;
    right: 10px;

    padding: 4px 9px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.55);
    color: white;

    font-size: 12px;

    z-index: 2;
}


/* =========================================
   スマートフォン
========================================= */

@media (max-width: 768px) {

    .post-image-slide img {
        max-height: 500px;
    }

    .slider-button {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }

}