/* ========================================
   TOPICS INDEX PAGE CSS
   Slate/Charcoal Academic Theme
======================================== */

/* Topic Grid on Index Page */
.topics-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    padding: 3rem var(--gap-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.topics-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.topics-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin: 0 0 0.75rem 0;
    position: relative;
}

.topics-hero p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.topics-grid-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem var(--gap-md) 3rem;
}

.topics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.topic-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.topic-card:hover {
    border-color: #6366f1;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.topic-card-header {
    padding: 1.25rem 1.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topic-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.topic-card-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.topic-card-body {
    padding: 0.75rem 1.25rem 1.25rem;
    flex-grow: 1;
}

.topic-card-body p {
    font-size: 0.8rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0 0 1rem 0;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.topic-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 600;
}

.topic-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s;
}

.topic-read-more:hover {
    color: #4f46e5;
    gap: 0.6rem;
}

.topic-read-more i { font-size: 0.7rem; transition: transform 0.15s; }
.topic-read-more:hover i { transform: translateX(3px); }

/* Homepage Featured Topics Section */
.featured-topics {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem var(--gap-md);
}

.featured-topics-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.featured-topics-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.featured-topics-header p {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.featured-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.featured-card:hover {
    border-color: #6366f1;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.featured-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
}

.featured-card-text h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.featured-card-text p {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
}

.featured-view-all {
    display: flex;
    justify-content: center;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(30, 41, 59, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 41, 59, 0.4);
}

/* Color accents per topic */
.tc-quantum { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.tc-relativity { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.tc-organic { background: linear-gradient(135deg, #10b981, #059669); }
.tc-emwaves { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tc-nuclear { background: linear-gradient(135deg, #ef4444, #dc2626); }
.tc-fluids { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.tc-astro { background: linear-gradient(135deg, #1e293b, #475569); }
.tc-calculus { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.tc-stats { background: linear-gradient(135deg, #f97316, #ea580c); }
.tc-thermocycles { background: linear-gradient(135deg, #e11d48, #be123c); }
.tc-acoustics { background: linear-gradient(135deg, #0e7490, #0891b2); }

@media (min-width: 576px) {
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .topics-hero h1 { font-size: 2rem; }
    .topics-grid { gap: 1.5rem; }
}

@media (min-width: 1024px) {
    .topics-grid { grid-template-columns: repeat(3, 1fr); }
    .featured-grid { grid-template-columns: repeat(3, 1fr); }
    .topics-hero { padding: 4rem var(--gap-md); }
}

@media print {
    .topics-hero { background: white; color: #1e293b; }
    .topics-hero h1 { color: #1e293b; }
    .topics-hero p { color: #475569; }
}
