/* Topics: topic.php, topics.php */
.tp { font-family: Outfit, system-ui, sans-serif; color: #0f172a; background: #f8fafc; padding-top: var(--tp-head, 90px); padding-bottom: 60px; min-height: 60vh; }
.tp a { text-decoration: none; }
.tp-wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.tp section.tp-hero { background: radial-gradient(1100px 480px at 85% -10%, rgba(255,255,255,.10), transparent 60%), linear-gradient(135deg, #4a0000 0%, #800000 55%, #9f1d1d 100%); color: #fff; padding: 40px 0 36px; }
.tp-hero h1 { margin: 6px 0 8px; font-size: clamp(30px, 6vw, 50px); font-weight: 900; letter-spacing: -1px; line-height: 1.08; color: #fff; overflow-wrap: anywhere; }
.tp-hero h1 span { color: #fca5a5; margin-right: 4px; }
.tp-hero p { margin: 0; font-size: 16px; color: rgba(255,255,255,.88); max-width: 640px; line-height: 1.6; }
.tp-back { display: inline-flex; gap: 8px; align-items: center; color: rgba(255,255,255,.9) !important; font-weight: 700; font-size: 14px; }
.tp-find { margin-top: 18px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 0 16px; max-width: 560px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.tp-find i { color: #94a3b8; }
.tp-find input { flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; font: 500 16px Outfit, system-ui, sans-serif; color: #0f172a; background: transparent; }

/* Related chips */
.tp-related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 20px 0 4px; }
.tp-related span { font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #64748b; margin-right: 4px; }
.tp-related a { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid #e5e7eb; color: #334155; font-weight: 700; font-size: 13.5px; }
.tp-related a:hover { border-color: #800000; color: #800000; }

/* Story grid */
.tp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.tp-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #edf0f4; border-radius: 16px; overflow: hidden; color: #0f172a; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tp-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15,23,42,.08); border-color: rgba(128,0,0,.3); }
.tp-img { position: relative; display: block; aspect-ratio: 16/10; background: #f1f5f9; overflow: hidden; }
.tp-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.tp-card:hover .tp-img img { transform: scale(1.04); }
.tp-img b { position: absolute; top: 10px; left: 10px; background: #800000; color: #fff; font-size: 10.5px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; padding: 4px 10px; border-radius: 99px; }
.tp-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.tp-date { font-size: 12px; color: #64748b; font-weight: 600; }
.tp-date .fa-crown { color: #b45309; }
.tp-card h2 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tp-card p { margin: 0; font-size: 14px; line-height: 1.55; color: #475569; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* First story on page 1: wide */
.tp-card.lead { grid-column: span 3; flex-direction: row; }
.tp-card.lead .tp-img { flex: 0 0 58%; aspect-ratio: auto; min-height: 300px; }
.tp-card.lead .tp-body { justify-content: center; padding: 22px 26px; }
.tp-card.lead h2 { font-size: clamp(20px, 2.4vw, 28px); -webkit-line-clamp: 4; }
.tp-card.lead p { -webkit-line-clamp: 4; font-size: 15.5px; }
.tp-pages { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 26px; font-size: 14px; color: #475569; }
.tp-pages a { color: #800000; font-weight: 800; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid #e5e7eb; }

/* Topics index */
.tp-sec { margin-top: 30px; }
.tp-sec > h2 { margin: 0 0 14px; font-size: 22px; font-weight: 900; display: flex; gap: 10px; align-items: center; }
.tp-sec > h2 i { color: #800000; font-size: 18px; }
.tp-cloud { display: flex; flex-wrap: wrap; gap: 10px; background: #fff; border: 1px solid #edf0f4; border-radius: 16px; padding: 18px; }
.tp-cloud a { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 99px; background: #fdf2f2; color: #800000; font-weight: 800; line-height: 1.3; transition: background .15s, color .15s; }
.tp-cloud a:hover { background: #800000; color: #fff; }
.tp-cloud small, .tp-list small { font-size: 11.5px; font-weight: 700; opacity: .65; }
.tp-letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tp-letters a { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: #fff; border: 1px solid #e5e7eb; color: #334155; font-weight: 800; font-size: 13.5px; }
.tp-letters a:hover { border-color: #800000; color: #800000; }
.tp-group { background: #fff; border: 1px solid #edf0f4; border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; scroll-margin-top: calc(var(--tp-head, 90px) + 12px); }
.tp-group h3 { margin: 0 0 8px; font-size: 18px; font-weight: 900; color: #800000; }
.tp-list { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.tp-list a { padding: 5px 11px; border-radius: 8px; background: #f8fafc; border: 1px solid #eef0f3; color: #334155; font-weight: 600; font-size: 14px; }
.tp-list a:hover { border-color: #800000; color: #800000; }
.tp-none { color: #475569; }
.tp-none a { color: #800000; font-weight: 700; }
.tp-empty { text-align: center; padding: 50px 16px; margin-top: 24px; background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px; color: #475569; }
.tp-empty i { font-size: 30px; color: #800000; }
.tp-empty h1, .tp-empty h3 { margin: 10px 0 6px; color: #0f172a; font-size: 22px; }
.tp-btn { display: inline-flex; margin-top: 10px; height: 46px; align-items: center; padding: 0 20px; border-radius: 12px; background: #800000; color: #fff !important; font-weight: 800; }

@media (max-width: 900px) {
    .tp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tp-card.lead { grid-column: span 2; flex-direction: column; }
    .tp-card.lead .tp-img { flex: none; aspect-ratio: 16/9; min-height: 0; }
    .tp-card.lead .tp-body { padding: 16px; }
}
@media (max-width: 560px) {
    .tp-grid { grid-template-columns: 1fr; gap: 14px; }
    .tp-card.lead { grid-column: auto; }
    .tp section.tp-hero { padding: 30px 0 28px; }
}
.tp section.tp-sec { padding: 0; }
