/* words.css — public vocabulary pages (/words)
   Uses the app's existing theme tokens from theme.css so light/dark follow the
   site toggle with no page-local theme code. */

.wd-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 20px 72px;
}

/* ── breadcrumbs ─────────────────────────────────────────────── */
.wd-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.wd-crumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.wd-crumbs a:hover {
    color: var(--primary-indigo);
    text-decoration: underline;
}

.wd-crumbs .sep {
    opacity: 0.5;
}

/* ── page head ───────────────────────────────────────────────── */
.wd-head {
    margin-bottom: 28px;
}

.wd-head h1 {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 10px;
    line-height: 1.2;
}

.wd-head p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 68ch;
    margin: 0;
}

.wd-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-indigo);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* ── generic card grid ───────────────────────────────────────── */
.wd-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.wd-card {
    display: block;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.wd-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-indigo);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .wd-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.wd-card-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 12px;
}

.wd-card h2,
.wd-card h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.wd-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.wd-card-meta {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── word list (level + category pages) ──────────────────────── */
.wd-section {
    margin-top: 36px;
}

.wd-section-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.wd-section-head h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.wd-section-head .n {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.wd-words {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.wd-word {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.wd-word:hover {
    border-color: var(--primary-indigo);
    background: var(--surface-hover);
}

.wd-word .term {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.wd-word .reading {
    font-size: 0.8125rem;
    color: var(--primary-indigo);
    font-weight: 600;
}

.wd-word .meaning {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── single word page ────────────────────────────────────────── */
.wd-hero {
    padding: 32px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    margin-bottom: 26px;
}

.wd-hero .term {
    font-size: clamp(2.75rem, 9vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.wd-hero .reading {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--primary-indigo);
    margin: 0 0 14px;
}

.wd-hero .meaning {
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.wd-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.wd-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

a.wd-tag:hover {
    border-color: var(--primary-indigo);
    color: var(--primary-indigo);
}

.wd-panel {
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    margin-bottom: 20px;
}

.wd-panel h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px;
}

.wd-example .sentence {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.55;
    margin: 0 0 6px;
}

.wd-example .sentence-reading {
    font-size: 0.9375rem;
    color: var(--primary-indigo);
    font-weight: 500;
    margin: 0 0 6px;
}

.wd-example .sentence-translation {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

/* prev / next */
.wd-pager {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
}

.wd-pager a {
    flex: 1;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--surface-bg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
    min-width: 0;
}

.wd-pager a:hover {
    border-color: var(--primary-indigo);
}

.wd-pager .dir {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 3px;
}

.wd-pager .label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wd-pager .next {
    text-align: right;
}

/* call to action */
.wd-cta {
    margin-top: 30px;
    padding: 26px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-indigo), var(--primary-purple));
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.wd-cta h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 5px;
    color: #fff;
}

.wd-cta p {
    margin: 0;
    font-size: 0.9375rem;
    opacity: 0.92;
}

.wd-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    background: #fff;
    color: var(--primary-indigo);
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
}

.wd-cta-btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .wd-wrap { padding: 20px 16px 56px; }
    .wd-hero { padding: 24px 20px; }
    .wd-pager { flex-direction: column; }
    .wd-pager .next { text-align: left; }
}
