/* ===== poetry-by-topic.php — extracted inline <style> → poetry-by-topic.css ===== */
/* ==========================================================================
   POETRY BY TOPIC SCOPED & ISOLATED STYLES (PREVENTS GLOBAL COLLISION)
   ========================================================================== */
.topic-page-wrapper {
    width: 100%;
    min-height: 80vh;
    padding: 1.5rem 0 3.5rem 0;
    box-sizing: border-box;
}

.topic-page-container {
    width: 94%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Breadcrumb */
.topic-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.topic-breadcrumb a {
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topic-breadcrumb a:hover {
    color: #ea580c;
}

.topic-breadcrumb .sep {
    color: #e2e8f0;
    font-weight: 400;
}

.topic-breadcrumb .current {
    color: #f97316;
    font-weight: 700;
}

/* 1. Topic Hero Banner */
.topic-hero-banner {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: 24px;
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(249, 115, 22, 0.3);
    text-align: center;
}

.topic-hero-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.18) 0%, transparent 60%),
                radial-gradient(circle at 20% 80%, rgba(15, 23, 42, 0.4) 0%, transparent 70%);
    pointer-events: none;
}

.topic-hero-content {
    position: relative;
    z-index: 2;
    max-width: 840px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.topic-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(249, 115, 22, 0.18);
    color: #fed7aa;
    border: 1px solid rgba(249, 115, 22, 0.35);
    padding: 0.35rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
}

.topic-hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    line-height: 1.25;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.topic-hero-subtitle {
    font-size: 1.15rem;
    color: #e2e8f0;
    line-height: 1.7;
    margin: 0;
    max-width: 720px;
}

/* Hero Search */
.topic-search-form {
    width: 100%;
    max-width: 580px;
    margin-top: 0.25rem;
}

.topic-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(249, 115, 22, 0.4);
}

.topic-search-icon {
    position: absolute;
    right: 20px;
    color: #94a3b8;
    font-size: 1.1rem;
}

.topic-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 2.8rem 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: transparent;
}

.topic-search-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.topic-search-btn:hover {
    background: linear-gradient(135deg, #ea580c, #ea580c);
}

/* Stats Ribbon */
.topic-stats-ribbon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}

.topic-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.topic-stat-item i {
    font-size: 1.2rem;
    color: #fed7aa;
    margin-bottom: 0.2rem;
}

.topic-stat-val {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
}

.topic-stat-lbl {
    font-size: 0.82rem;
    color: #e2e8f0;
}

/* Quick Genres Bar */
.topic-quick-genres-bar {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.topic-quick-genres-header {
    margin-bottom: 0.75rem;
}

.topic-quick-genres-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topic-quick-genres-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-genre-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-genre-pill:hover {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
}

.topic-genre-pill i {
    font-size: 0.85rem;
}

/* ==========================================================================
   TOPIC CARDS GRID & ISOLATED ARTICLE CARDS
   ========================================================================== */
.topic-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.topic-card {
    height: auto;
    min-height: 220px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 0.85rem;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    text-align: right;
}

.topic-card:hover {
    border-color: rgba(249, 115, 22, 0.45);
}

.topic-card--has-poems {
    border-color: rgba(249, 115, 22, 0.3);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.topic-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topic-card-emblem {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f97316, #ea580c);
    color: #fed7aa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(249, 115, 22, 0.4);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
}

.topic-card-emblem i {
    font-size: 1.3rem;
    margin: 0;
    color: #fed7aa;
}

.topic-card-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.topic-card-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    line-height: 1.3;
}

.topic-card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topic-card-title a:hover {
    color: #ea580c;
}

.topic-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.topic-card-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

.topic-badge-gold {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

.topic-badge-gold i {
    font-size: 0.75rem;
    color: #ea580c;
    margin: 0;
}

.topic-badge-muted {
    display: inline-flex;
    background: #f1f5f9;
    color: #94a3b8;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.topic-card-bottom {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.topic-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f97316;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.topic-card-btn:hover {
    color: #ea580c;
    gap: 0.65rem;
}

.topic-card-btn i {
    font-size: 0.8rem;
    margin: 0;
}

/* Educational Box */
.topic-education-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 5px solid #f97316;
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.topic-edu-icon {
    font-size: 2rem;
    color: #f97316;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.topic-edu-body {
    flex: 1;
    min-width: 0;
}

.topic-edu-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.topic-edu-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.75;
    margin: 0;
}

/* ==========================================================================
   SINGLE TOPIC VIEW STYLES
   ========================================================================== */
.single-topic-hero {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.25rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.single-topic-emblem {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fed7aa;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #f97316;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
    flex-shrink: 0;
}

.single-topic-emblem i {
    font-size: 2.2rem;
    color: #fed7aa;
    margin: 0;
}

.single-topic-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.single-topic-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #f97316;
}

.single-topic-badge i {
    font-size: 0.85rem;
}

.single-topic-title {
    font-size: 2rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
}

.single-topic-desc {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

.single-topic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.single-topic-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    font-size: 0.9rem;
    color: #475569;
}

.single-topic-stat i {
    font-size: 0.85rem;
    color: #f97316;
}

.single-topic-stat strong {
    color: #0f172a;
}

/* Quick Nav Ribbon */
.topic-quick-nav {
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
}

.topic-quick-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.topic-quick-pills {
    display: flex;
    gap: 0.45rem;
}

.topic-quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.topic-quick-pill:hover,
.topic-quick-pill--active {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
}

.topic-quick-pill i {
    font-size: 0.8rem;
}

/* Single Filter Bar */
.topic-filter-bar {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.topic-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.topic-search-field {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
}

.topic-search-field i {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    font-size: 0.95rem;
}

.topic-inner-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 2.4rem 0.65rem 1rem;
    font-size: 0.92rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.topic-inner-input:focus {
    border-color: #f97316;
}

.topic-sort-select {
    padding: 0.65rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    cursor: pointer;
}

.topic-sort-field {
    flex-shrink: 0;
}

.topic-filter-submit {
    background: #f97316;
    color: #ffffff;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s ease;
}

.topic-filter-submit:hover {
    background: #ea580c;
}

.topic-view-switcher {
    display: flex;
    gap: 0.35rem;
    margin-right: auto;
}

.topic-view-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.topic-view-btn.active {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
}

/* ==========================================================================
   POEM CARDS GRID & ISOLATED POEM ARTICLES
   ========================================================================== */
.topic-poems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin-bottom: 2.5rem;
}

.topic-poems-grid.is-list-view {
    grid-template-columns: 1fr;
}

.topic-poem-card {
    height: auto;
    min-height: 280px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.15rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    text-align: right;
}

.topic-poem-card:hover {
    border-color: rgba(249, 115, 22, 0.45);
}

.topic-poem-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.topic-poem-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.35;
}

.topic-poem-card-title a {
    color: #0f172a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topic-poem-card-title a:hover {
    color: #ea580c;
}

.topic-poem-author {
    font-size: 0.92rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topic-poem-author i {
    font-size: 0.85rem;
    color: #f97316;
    margin: 0;
}

.topic-poem-author a {
    color: #f97316;
    font-weight: 700;
    text-decoration: none;
}

/* Opening Verse Box */
.topic-verse-preview {
    background: #f8fafc;
    border-right: 3px solid #f97316;
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    font-family: 'Amiri', serif;
    font-size: 1.18rem;
    color: #334155;
    line-height: 1.85;
    text-align: center;
    box-sizing: border-box;
}

.topic-verse-sep {
    font-size: 0.75rem;
    color: #f97316;
    margin: 0.25rem 0;
}

.topic-verse-first {
    text-align: right;
}

.topic-verse-second {
    text-align: left;
}

.topic-poem-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

.topic-count-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.65rem;
    border-radius: 12px;
}

.topic-count-tag i {
    font-size: 0.75rem;
    margin: 0;
}

.topic-poem-footer {
    display: flex;
    justify-content: flex-end;
}

.topic-read-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #f97316;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: gap 0.2s ease, color 0.2s ease;
}

.topic-read-link:hover {
    color: #ea580c;
    gap: 0.65rem;
}

.topic-btn-gold {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 30px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease;
    margin-top: 1rem;
}

.topic-btn-gold:hover {
    opacity: 0.95;
}

/* Pagination */
.topic-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.topic-pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.85rem;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.topic-pagination-item:hover:not(.topic-pagination-item--active) {
    background: #f8fafc;
    border-color: #ea580c;
    color: #ea580c;
}

.topic-pagination-item--active {
    background: #f97316 !important;
    color: #ffffff !important;
    border-color: #f97316 !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.25);
}

.topic-pagination-item--nav {
    color: #f97316;
}

.topic-pagination-dots {
    color: #94a3b8;
    padding: 0 0.25rem;
    font-weight: 700;
}

/* Empty Box */
.topic-empty-card,
.topic-empty-box {
    text-align: center;
    padding: 3.5rem 2rem;
    background: #ffffff;
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
    margin-bottom: 2rem;
}

.topic-empty-icon,
.topic-empty-box-icon {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.topic-empty-desc {
    color: #64748b;
    margin: 0;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1100px) {
    .topic-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .topic-cards-grid {
        grid-template-columns: 1fr;
    }
    .topic-poems-grid {
        grid-template-columns: 1fr;
    }
    .single-topic-hero {
        flex-direction: column;
        text-align: center;
    }
    .single-topic-stats {
        justify-content: center;
    }
    .topic-stats-ribbon {
        grid-template-columns: 1fr;
    }
    .topic-hero-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .topic-hero-banner {
        padding: 2rem 1.25rem;
    }
}
