/* ── Global ── */
body {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    color: #333;
    background: #fff;
    margin: 0;
}

a { color: darkorange; }
a:hover { color: #c77700; text-decoration: none; }

h1, h2, h3, h4 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
}

/* ── Header ── */
#header {
    background: #2C2C2C;
    color: #fff;
    padding: 50px 0 30px;
}

#header h1 {
    font-size: 48px;
    margin-bottom: 5px;
}

#header h2 {
    font-size: 22px;
    font-weight: 300;
    font-family: 'Raleway', sans-serif;
    color: #ccc;
    margin-top: 0;
}

/* ── Navigation ── */
#nav {
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

#nav .nav-link {
    display: inline-block;
    padding: 6px 20px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

#nav .nav-link:hover {
    color: #333;
    border-bottom-color: #ccc;
}

#nav .nav-link.active {
    color: darkorange;
    border-bottom-color: darkorange;
}

/* ── Content Sections ── */
.content-section {
    display: none;
    padding: 40px 0 60px;
}

.content-section.active {
    display: block;
}

.content-section h2 {
    font-size: 32px;
    margin-bottom: 10px;
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
    display: inline-block;
}

.section-desc {
    color: #666;
    font-size: 15px;
    margin-bottom: 25px;
    max-width: 800px;
}

/* ── About ── */
.abstract {
    font-size: 16px;
    line-height: 1.7;
    max-width: 800px;
    margin-bottom: 30px;
}

.authors h3, .method-note h3 {
    font-size: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-top: 30px;
}

.authors p { margin: 5px 0; }

.method-note {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
}

.method-note p { font-size: 14px; margin: 5px 0; }

/* ── Topic Selector ── */
#topic-selector {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    background: #fafafa;
}

.selector-header {
    margin-bottom: 10px;
}

.topic-checkbox {
    display: flex;
    align-items: center;
    padding: 3px 0;
    font-size: 13px;
    cursor: pointer;
}

.topic-checkbox input {
    margin-right: 8px;
}

.topic-checkbox:hover {
    background: #f0f0f0;
}

.topic-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

/* ── Topic Words ── */
#topic-words {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
    min-height: 60px;
}

.word-chip {
    display: inline-block;
    padding: 3px 10px;
    margin: 2px;
    background: #e8e8e8;
    border-radius: 12px;
    font-size: 12px;
}

/* ── Semantic Change ── */
#word-shift-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    font-size: 14px;
}

/* ── Data Table ── */
.table th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 14px;
}

.table td {
    font-size: 14px;
}

/* ── Footnotes ── */
.footnotes {
    margin-top: 30px;
    padding-top: 10px;
}

.footnotes h3 {
    font-size: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.footnotes p {
    font-size: 13px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 18px;
    max-width: 900px;
    text-indent: -1.2em;
    padding-left: 1.2em;
}

.footnotes sup {
    font-weight: 600;
    color: darkorange;
    margin-right: 3px;
}

sup a {
    color: darkorange;
    text-decoration: none;
    font-weight: 600;
}

sup a:hover {
    text-decoration: underline;
}

/* ── Footer ── */
footer {
    background: #2C2C2C;
    color: #999;
    padding: 20px 0;
    font-size: 13px;
}

/* ── Dendrogram ── */
#dendrogram-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 1000px;
    border: 1px solid #eee;
    border-radius: 5px;
    background: #fafafa;
}

#dendrogram .link {
    transition: stroke-width 0.2s;
}

#dendrogram .link:hover {
    stroke-width: 3px !important;
    stroke: darkorange !important;
    opacity: 1 !important;
}

#dendrogram .node text {
    cursor: pointer;
    transition: fill 0.2s;
}

#dendrogram .node text:hover {
    fill: darkorange;
}

/* ── Source Toggle ── */
.source-toggle .btn {
    margin: 0 4px;
    font-size: 13px;
    padding: 4px 14px;
}

.source-toggle .btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    #header h1 { font-size: 28px; }
    #header h2 { font-size: 16px; }
    #nav .nav-link { padding: 6px 10px; font-size: 13px; }
}
