/* ── Topics page ── */
.topics-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0 8rem;
}

.topics-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin-bottom: 1.25rem;
}

/* ── Research area cards (large) ── */
.area-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}
.area-card {
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    border-top-width: 5px;
    background: #fff;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.area-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
html.dark .area-card {
    background: #242424;
    border-color: rgba(255,255,255,0.08);
}
html.dark .area-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.area-card-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.area-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}
.area-card-desc {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #666;
    flex: 1;
}
html.dark .area-card-desc { color: #aaa; }
.area-card-arrow {
    font-size: 1.1rem;
    font-weight: 700;
    align-self: flex-end;
}

/* ── All topics grid ── */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.topic-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.topic-card:hover {
    border-color: #0a8f37;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
html.dark .topic-card {
    background: #242424;
    border-color: rgba(255,255,255,0.08);
}
html.dark .topic-card:hover { border-color: #0a8f37; }
.topic-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}
.topic-card-count {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 800px) {
    .area-cards { grid-template-columns: 1fr; }
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .topics-grid { grid-template-columns: 1fr; }
}

/* ── Term page ── */
.topic-content {
    font-size: 0.95rem;
    line-height: 1.75;
    color: #444;
    max-width: 600px;
    margin-bottom: 1rem;
}
html.dark .topic-content { color: #bbb; }
.topic-content p { margin-bottom: 0.75rem; }

.project-back {
    display: inline-block;
    font-size: 0.9rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.2s;
}
.project-back:hover { color: #0a8f37; }
/* Hide image from _index.md content on topics list page */
.topics-page .projects-intro-text img {
    display: none;
}
