/* ============================================================
   forum/detail.css — Trang chi tiết bài viết cộng đồng
   Palette: navy #0a2d6e | blue #0d5db5 | cyan #29b6f6 | red #e53935
   ============================================================ */

.rtm-fdetail { background: #f0f7ff; min-height: 80vh; padding: 20px 0 60px; }
.rtm-fdetail__body { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }

/* ── Back link ───────────────────────────────────────────── */
.rtm-fdetail__back-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #0d5db5;
    text-decoration: none; margin-bottom: 14px;
    transition: color .15s, gap .15s;
}
.rtm-fdetail__back-link:hover { color: #29b6f6; gap: 8px; }

/* ── Main card ───────────────────────────────────────────── */
.rtm-fdetail__card {
    background: #fff; border-radius: 16px;
    border: 1px solid #c5d8f0; overflow: hidden;
    box-shadow: 0 4px 16px rgba(13,93,181,0.07);
}

.rtm-fdetail__head { padding: 22px 26px; border-bottom: 1px solid #e8f4fd; }

/* Category badge */
.rtm-fdetail__cat {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
    margin-bottom: 12px; background: #e8f4fd; color: #0d5db5; border: 1px solid #c5d8f0;
}

.rtm-fdetail__title { font-size: 22px; font-weight: 800; color: #0a2d6e; margin: 0 0 14px; line-height: 1.35; }

/* Meta */
.rtm-fdetail__meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #9ca3af; flex-wrap: wrap; }
.rtm-fdetail__meta span { display: flex; align-items: center; gap: 4px; }

/* Content */
.rtm-fdetail__content { padding: 24px 26px; font-size: 15px; color: #374151; line-height: 1.85; }
.rtm-fdetail__content p { margin: 0 0 14px; }
.rtm-fdetail__content p:last-child { margin-bottom: 0; }
.rtm-fdetail__content strong { color: #0a2d6e; }
.rtm-fdetail__content a { color: #0d5db5; }
.rtm-fdetail__content a:hover { color: #29b6f6; }

/* Images */
.rtm-fdetail__images { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 26px 20px; }
.rtm-fdetail__images img { height: 120px; border-radius: 10px; object-fit: cover; cursor: pointer; border: 1px solid #c5d8f0; transition: opacity .15s, transform .15s; }
.rtm-fdetail__images img:hover { opacity: .9; transform: scale(1.02); }

/* Tags */
.rtm-fdetail__tags { padding: 0 26px 18px; display: flex; gap: 6px; flex-wrap: wrap; }
.rtm-fdetail__tag {
    background: #f0f7ff; color: #3a5a8a; padding: 4px 12px;
    border-radius: 8px; font-size: 12px; font-weight: 600;
    border: 1px solid #c5d8f0; text-decoration: none;
    transition: background .15s, color .15s;
}
.rtm-fdetail__tag:hover { background: #e8f4fd; color: #0d5db5; }

/* Actions */
.rtm-fdetail__actions { padding: 14px 26px; border-top: 1px solid #e8f4fd; display: flex; align-items: center; gap: 12px; }
.rtm-fdetail__like {
    display: flex; align-items: center; gap: 6px;
    background: #f0f7ff; border: 1.5px solid #c5d8f0;
    padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s;
    color: #5a6a8a; font-family: inherit;
    min-height: auto !important;
}
.rtm-fdetail__like:hover { background: #fdecea; border-color: #f9baba; color: #e53935; }
.rtm-fdetail__like.is-liked { background: #fdecea; border-color: #f9baba; color: #e53935; }
.rtm-fdetail__share-text { font-size: 13px; color: #9ca3af; }

/* ── Replies ─────────────────────────────────────────────── */
.rtm-fdetail__replies { margin-top: 14px; background: #fff; border-radius: 16px; border: 1px solid #c5d8f0; box-shadow: 0 4px 16px rgba(13,93,181,0.07); overflow: hidden; }
.rtm-fdetail__replies-head { padding: 16px 22px; font-size: 15px; font-weight: 700; color: #0a2d6e; border-bottom: 2px solid #e8f4fd; display: flex; align-items: center; gap: 8px; }
.rtm-fdetail__replies-empty { padding: 28px; text-align: center; color: #9ca3af; font-size: 14px; }
.rtm-fdetail__reply { padding: 16px 22px; border-bottom: 1px solid #f0f7ff; display: flex; gap: 12px; }
.rtm-fdetail__reply:last-of-type { border-bottom: none; }

/* Avatar */
.rtm-fdetail__reply-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #0d5db5, #29b6f6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(13,93,181,0.2);
}
.rtm-fdetail__reply-body { flex: 1; min-width: 0; }
.rtm-fdetail__reply-author { font-size: 13px; font-weight: 700; color: #0a2d6e; margin-bottom: 4px; }
.rtm-fdetail__reply-content { font-size: 14px; color: #4b5563; line-height: 1.65; }
.rtm-fdetail__reply-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #9ca3af; margin-top: 6px; }
.rtm-fdetail__reply-like { background: none !important; border: none !important; cursor: pointer; font-size: 12px; color: #9ca3af !important; display: flex !important; align-items: center; gap: 4px; font-family: inherit; transition: color .15s; min-height: auto !important; padding: 0 !important; box-shadow: none !important; }
.rtm-fdetail__reply-like:hover { color: #e53935 !important; }
.rtm-fdetail__reply-like.is-liked { color: #e53935 !important; }

/* ── Comment form ────────────────────────────────────────── */
.rtm-fdetail__form { padding: 20px 22px; border-top: 2px solid #e8f4fd; }
.rtm-fdetail__form h3 { font-size: 15px; font-weight: 700; color: #0a2d6e; margin: 0 0 14px; }

/* Login notice */
.rtm-fdetail__login-notice {
    padding: 16px 20px; background: #e8f4fd; border: 1px solid #c5d8f0;
    border-radius: 12px; text-align: center; font-size: 14px; color: #5a6a8a;
}
.rtm-fdetail__login-link { color: #0d5db5; font-weight: 700; text-decoration: none; }
.rtm-fdetail__login-link:hover { color: #29b6f6; }

.rtm-fdetail__form input,
.rtm-fdetail__form textarea {
    width: 100%; border: 1.5px solid #c5d8f0; border-radius: 10px;
    padding: 10px 14px; font-size: 14px; color: #374151; outline: none;
    font-family: inherit; box-sizing: border-box; background: #f8fbff;
    transition: border-color .2s, box-shadow .2s;
}
.rtm-fdetail__form input:focus,
.rtm-fdetail__form textarea:focus { border-color: #29b6f6; background: #fff; box-shadow: 0 0 0 3px rgba(41,182,246,0.12); }
.rtm-fdetail__form textarea { resize: vertical; min-height: 110px; }
.rtm-fdetail__form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }

/* Submit */
.rtm-fdetail__submit {
    background: #e53935 !important; color: #fff !important; border: none !important;
    padding: 12px 24px !important; border-radius: 10px !important; font-size: 14px; font-weight: 700;
    cursor: pointer; width: 100%; margin-top: 10px; font-family: inherit;
    box-shadow: 0 4px 14px rgba(229,57,53,0.3); transition: background .15s, transform .15s;
    min-height: auto !important;
}
.rtm-fdetail__submit:hover { background: #c62828 !important; transform: translateY(-1px); }

/* ── Sidebar ─────────────────────────────────────────────── */
.rtm-fdetail__widget {
    background: #fff; border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
    border: 1px solid #c5d8f0; box-shadow: 0 2px 10px rgba(13,93,181,0.05);
}
.rtm-fdetail__widget-title {
    font-size: 11px; font-weight: 800; color: #0a2d6e;
    margin: 0 0 14px; padding-bottom: 10px;
    border-bottom: 2px solid #29b6f6;
    text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: center; gap: 6px;
}

/* Category links */
.rtm-fdetail__cat-link {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 0; text-decoration: none; color: #374151; font-size: 13px; font-weight: 500;
    border-bottom: 1px solid #f0f7ff; transition: color .15s, padding-left .15s;
}
.rtm-fdetail__cat-link:last-child { border-bottom: none; }
.rtm-fdetail__cat-link:hover { color: #0d5db5; padding-left: 4px; }
.rtm-fdetail__cat-link span:first-child { font-size: 16px; }

/* Trending */
.rtm-fdetail__trending-item { display: flex; gap: 8px; padding: 9px 0; border-bottom: 1px solid #f0f7ff; align-items: flex-start; }
.rtm-fdetail__trending-item:last-child { border-bottom: none; }
.rtm-fdetail__trending-num {
    width: 22px; height: 22px; border-radius: 6px; background: #0d5db5;
    color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rtm-fdetail__trending-item:first-child .rtm-fdetail__trending-num { background: #e53935; }
.rtm-fdetail__trending-title { font-size: 13px; color: #374151; text-decoration: none; line-height: 1.4; transition: color .15s; }
.rtm-fdetail__trending-title:hover { color: #0d5db5; }

/* Post button */
.rtm-fdetail__post-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #e53935; color: #fff; padding: 13px; border-radius: 12px;
    font-weight: 700; font-size: 14px; text-decoration: none;
    box-shadow: 0 4px 14px rgba(229,57,53,0.3);
    transition: background .2s, transform .2s;
}
.rtm-fdetail__post-btn:hover { background: #c62828; color: #fff; transform: translateY(-1px); }

/* ── Related posts ───────────────────────────────────────── */
.rtm-frelated { background: #f0f7ff; padding: 0 0 48px; }
.rtm-frelated__head { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #0a2d6e; margin-bottom: 18px; padding-top: 8px; }
.rtm-frelated__grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }

.rtm-frelated__card {
    background: #fff; border-radius: 14px; padding: 16px 18px;
    border: 1px solid #c5d8f0; text-decoration: none; display: flex;
    flex-direction: column; gap: 8px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    box-shadow: 0 2px 10px rgba(13,93,181,0.05);
}
.rtm-frelated__card:hover { border-color: #29b6f6; box-shadow: 0 4px 20px rgba(13,93,181,0.1); transform: translateY(-2px); }
.rtm-frelated__card-cat { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; width: fit-content; background: #e8f4fd; color: #0d5db5; border: 1px solid #c5d8f0; }
.rtm-frelated__card-title { font-size: 14px; font-weight: 700; color: #0a2d6e; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rtm-frelated__card-excerpt { font-size: 13px; color: #5a6a8a; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.rtm-frelated__card-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) { .rtm-frelated__grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) {
    .rtm-fdetail__body { grid-template-columns: 1fr; }
    .rtm-fdetail__form-row { grid-template-columns: 1fr; }
    .rtm-fdetail__head,.rtm-fdetail__content,.rtm-fdetail__actions,.rtm-fdetail__form,.rtm-fdetail__reply,.rtm-fdetail__replies-head { padding-left: 16px; padding-right: 16px; }
    .rtm-fdetail__images,.rtm-fdetail__tags { padding-left: 16px; padding-right: 16px; }
    .rtm-fdetail__title { font-size: 18px; }
}
@media (max-width: 480px) { .rtm-frelated__grid { grid-template-columns: 1fr; } }