/* Terradoc base stylesheet — shared across all pages. */

/* ── Reset / Base ── */
html {
    scroll-behavior: smooth;
}
* {
    box-sizing: border-box;
}
body {
    font-family: var(--td-font-family);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--td-color-bg);
    color: var(--td-color-text);
}
.js-only {
    display: none;
}
.no-js-only {
    display: block;
}
.js .js-only {
    display: block;
}
.js .no-js-only {
    display: none;
}

/* ── Container ── */
.td-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Shadow system ── */
:root {
    --td-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --td-shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --td-shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
}

/* ── Skip link ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--td-color-primary);
    color: white;
    padding: 0.5rem 1rem;
    z-index: 100;
    text-decoration: none;
    border-radius: 0 0 var(--td-radius) 0;
    opacity: 0;
    pointer-events: none;
}
.skip-link:focus {
    top: 0;
    opacity: 1;
    pointer-events: auto;
}

/* ── Navigation ── */
#td-nav, nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.75rem 0;
    display: flex;
    align-items: center;
    background: transparent;
    transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
#td-nav.scrolled, nav.scrolled {
    background: rgba(244,241,234,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--td-shadow-sm);
}
nav .td-nav-inner {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
nav a {
    color: var(--td-color-text);
    text-decoration: none;
    padding: 0.3rem 0.75rem;
    border-radius: var(--td-radius-pill);
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 0.95rem;
}
nav a:hover {
    background: rgba(200,31,45,0.08);
    color: var(--td-color-primary);
}
nav a.active {
    background: var(--td-color-primary);
    color: white;
    border-bottom: none;
}
nav .brand {
    font-weight: 700;
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--td-font-headings);
    color: var(--td-color-primary);
}
nav .brand:hover {
    background: transparent;
    color: var(--td-color-primary);
}
nav .brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Target-ring logo mark */
.td-logo-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.td-logo-mark .ring-outer {
    width: 32px;
    height: 32px;
    border: 2px solid var(--td-color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.td-logo-mark .ring-inner {
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--td-color-text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.td-logo-mark .ring-dot {
    width: 8px;
    height: 8px;
    background: var(--td-color-primary);
    border-radius: 50%;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--td-color-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: auto;
    line-height: 1;
}

/* Language switch */
nav .lang-switch {
    margin-left: auto;
    display: flex;
    gap: 0.15rem;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}
nav .lang-link, nav .lang-current {
    padding: 0.25rem 0.5rem;
    border-radius: var(--td-radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}
nav .lang-link {
    color: var(--td-color-text-muted);
    text-decoration: none;
    opacity: 0.7;
}
nav .lang-link:hover {
    opacity: 1;
    color: var(--td-color-primary);
    background: rgba(200,31,45,0.08);
}
nav .lang-current {
    background: var(--td-color-primary);
    color: white;
}
nav .lang-sep {
    color: var(--td-color-text-muted);
    opacity: 0.3;
    font-weight: 300;
}

/* Main content offset for fixed nav */
main.td-container {
    padding-top: 5rem;
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--td-font-headings);
    letter-spacing: -0.02em;
}

/* ── Header ── */
header {
    text-align: center;
    padding: 1rem 0;
    border-bottom: none;
    margin-bottom: 1.5rem;
}
h1 {
    margin: 0 0 0.5rem 0;
    color: var(--td-color-primary);
    line-height: 1.3;
}
.subtitle {
    color: var(--td-color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Section heading with red accent bar + diamond motif ── */
.td-section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.td-section-heading-bar {
    width: 4px;
    min-height: 40px;
    align-self: stretch;
    background: var(--td-color-primary);
    border-radius: 2px;
    flex-shrink: 0;
}
.td-section-heading-content {
    flex: 1;
}
.td-section-heading-motif {
    flex-shrink: 0;
    opacity: 0.7;
}
.td-section-heading h1,
.td-section-heading h2,
.td-section-heading h3 {
    margin: 0;
}
.td-section-heading .subtitle {
    margin: 0.25rem 0 0 0;
}

/* ── Inner page split-circle badge ── */
.td-page-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-left: 0.6rem;
    flex-shrink: 0;
}

/* ── Card system ── */
.td-card {
    background: var(--td-color-surface);
    border-radius: var(--td-radius);
    border: 1px solid var(--td-color-border);
    box-shadow: var(--td-shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.td-card:hover {
    box-shadow: var(--td-shadow-md);
}
.td-card-red {
    background: var(--td-color-primary);
    color: white;
    border-color: var(--td-color-primary);
}
.td-card-red h2, .td-card-red h3, .td-card-red p {
    color: white;
}

/* ── Pill buttons ── */
.td-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--td-radius-pill);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}
.td-pill-red {
    background: var(--td-color-primary);
    color: white;
}
.td-pill-red:hover {
    background: var(--td-color-accent-muted);
}
.td-pill-outline {
    background: transparent;
    color: var(--td-color-primary);
    border: 2px solid var(--td-color-primary);
}
.td-pill-outline:hover {
    background: var(--td-color-accent-light);
}
.td-pill-gold {
    background: var(--td-color-accent);
    color: white;
}
.td-pill-gold:hover {
    background: #B8882F;
}
.td-pill-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* ── Search components ── */
.search-container {
    background: var(--td-color-surface);
    padding: 1rem;
    border-radius: var(--td-radius);
    border: 1px solid var(--td-color-border);
    margin-bottom: 1rem;
}
.search-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border: 1px solid var(--td-color-border);
    border-radius: var(--td-radius-pill);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--td-color-surface);
}
.search-input:focus {
    border-color: var(--td-color-primary);
    box-shadow: 0 0 0 3px var(--td-color-accent-ring);
}
.filter-select {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--td-color-border);
    border-radius: var(--td-radius-pill);
    background: var(--td-color-surface);
    cursor: pointer;
}
.stats {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--td-color-text-muted);
}

/* ── Results ── */
.results-container {
    background: var(--td-color-surface);
    border-radius: var(--td-radius);
    border: 1px solid var(--td-color-border);
    overflow: hidden;
}
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--td-color-text-muted);
}
.empty-state h2 {
    margin: 0 0 0.5rem 0;
    color: var(--td-color-text-muted);
}
.empty-state svg {
    display: block;
    margin: 0 auto 1rem auto;
    opacity: 0.4;
}

/* ── Loading skeleton ── */
.loading-state {
    padding: 3rem;
    text-align: center;
    color: var(--td-color-text-muted);
}
.skeleton {
    background: linear-gradient(90deg,
        var(--td-color-border-light) 25%,
        var(--td-color-bg-light) 50%,
        var(--td-color-border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--td-radius);
}
.skeleton-line {
    height: 1rem;
    margin-bottom: 0.75rem;
}
.skeleton-line:last-child {
    width: 60%;
}
.skeleton-block {
    height: 4rem;
    margin-bottom: 1rem;
}
@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Entries ── */
.entry {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--td-color-border-light);
}
.entry:last-child {
    border-bottom: none;
}
.entry:hover {
    background: var(--td-color-bg-light);
}
.entry-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.entry-word {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--td-color-primary);
}
.entry-secondary {
    color: var(--td-color-text-muted);
    font-size: 1rem;
}
.entry-ipa {
    color: var(--td-color-text-muted);
    font-family: var(--td-font-mono);
}
.entry-tag {
    font-size: 0.75rem;
    background: var(--td-color-accent-light);
    color: var(--td-color-accent-muted);
    padding: 0.15rem 0.6rem;
    border-radius: var(--td-radius-pill);
    font-weight: 500;
}
.entry-definition {
    margin: 0.5rem 0;
    color: var(--td-color-text-secondary);
}
.entry-example {
    margin: 0.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--td-color-primary);
    color: var(--td-color-text-secondary);
    font-style: italic;
}
.entry-scientific {
    font-style: italic;
    color: var(--td-color-text-muted);
    font-size: 0.9rem;
}
.entry-comment {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--td-color-warning-bg);
    border-radius: var(--td-radius);
    font-size: 0.9rem;
    color: var(--td-color-text-muted);
}
.entry-media {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    align-items: flex-start;
}
.entry-thumbnail {
    max-width: 120px;
    max-height: 90px;
    border-radius: var(--td-radius);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}
.entry-thumbnail:hover {
    transform: scale(1.05);
}
.entry-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.entry-links a {
    font-size: 0.85rem;
    color: var(--td-color-accent-muted);
    text-decoration: none;
}
.entry-links a:hover {
    text-decoration: underline;
}
.highlight {
    background: var(--td-color-highlight);
    padding: 0 2px;
    border-radius: 2px;
}

/* ── Footer ── */
footer {
    margin-top: 4rem;
    padding: 0;
    background: var(--td-color-dark, #0B0F17);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}
footer a {
    color: var(--td-color-accent);
    text-decoration: none;
}
footer a:hover {
    color: white;
    text-decoration: underline;
}
.footer-adugo-spine {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.footer-adugo-spine svg {
    width: 100%;
    height: 100%;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    padding: 3rem 0 2rem;
}
.footer-brand-desc {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 0.75rem;
}
.footer-heading {
    font-family: var(--td-font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin: 0 0 1rem 0;
}
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-links li {
    margin-bottom: 0.5rem;
}
.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}
.footer-links a:hover {
    color: white;
}
.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.footer-contact-icon {
    flex-shrink: 0;
    opacity: 0.5;
    font-size: 0.9rem;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
}
footer .td-container {
    padding: 0 1.5rem;
}

/* ── Page transition ── */
main.td-container {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Focus styles ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.word-item:focus-visible {
    outline: 2px solid var(--td-color-primary);
    outline-offset: 2px;
}

/* ── Cards (shared shadow behavior) ── */
.platform-card,
.portal-section,
.showcase-card {
    box-shadow: var(--td-shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.platform-card:hover,
.portal-section:hover {
    box-shadow: var(--td-shadow-md);
}

/* ── Language term emphasis ── */
.td-term {
    color: var(--td-term-color);
    font-weight: var(--td-term-weight);
}

/* ── Decorative components ── */
.td-decor-spine { display: flex; justify-content: center; }
.td-decor-motif { display: flex; justify-content: center; align-items: center; margin: 1.5rem 0; }
.td-decor-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.td-decor-dots { display: flex; gap: 6px; align-items: center; }
.td-decor-marker { display: inline-block; flex-shrink: 0; }

/* ── Target rings decorative ── */
.td-target-rings {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.td-target-ring {
    border: 2px solid var(--td-color-primary);
    border-radius: 50%;
    position: absolute;
    opacity: 0.15;
}
.td-target-ring:nth-child(1) { width: 300px; height: 300px; opacity: 0.08; }
.td-target-ring:nth-child(2) { width: 220px; height: 220px; opacity: 0.12; }
.td-target-ring:nth-child(3) { width: 140px; height: 140px; opacity: 0.18; }

/* ── Red wedge ── */
.td-red-wedge {
    position: absolute;
    width: 0;
    height: 0;
}

/* ── Grain overlay ── */
.td-grain-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23B8AFA2' fill-opacity='0.3'/%3E%3C/svg%3E");
}

/* ── Scroll animation ── */
.td-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.td-fade-in.td-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════════════════════════
   Terra theme — warm, organic, culturally-inspired
   ══════════════════════════════════════════════════════ */

/* ── Terra: Body texture ── */
.td-style-terra {
    font-size: 1.0625rem;
    line-height: 1.7;
}
.td-style-terra::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23B8AFA2' fill-opacity='0.3'/%3E%3C/svg%3E");
}

/* ── Terra: Shadow system ── */
.td-style-terra {
    --td-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --td-shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --td-shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}

/* ── Terra: Navigation ── */
.td-style-terra nav,
.td-style-terra #td-nav {
    background: transparent;
    box-shadow: none;
    border-bottom: none;
}
.td-style-terra nav.scrolled,
.td-style-terra #td-nav.scrolled {
    background: rgba(244,241,234,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--td-shadow-sm);
}
.td-style-terra nav a {
    color: var(--td-color-text);
    font-weight: 500;
    border-radius: var(--td-radius-pill);
}
.td-style-terra nav a:hover {
    color: var(--td-color-primary);
    background: rgba(200,31,45,0.08);
}
.td-style-terra nav a.active {
    color: white;
    background: var(--td-color-primary);
}
.td-style-terra nav .brand {
    color: var(--td-color-primary);
    font-family: var(--td-font-headings);
    font-size: 1.2rem;
}
.td-style-terra nav .brand:hover {
    color: var(--td-color-primary);
    background: transparent;
}
.td-style-terra .nav-toggle {
    color: var(--td-color-text);
}
.td-style-terra .skip-link {
    background: var(--td-color-primary);
    color: white;
}
.td-style-terra nav .lang-link {
    color: var(--td-color-text-muted);
    opacity: 0.7;
}
.td-style-terra nav .lang-link:hover {
    color: var(--td-color-primary);
    background: rgba(200,31,45,0.08);
    opacity: 1;
}
.td-style-terra nav .lang-current {
    background: var(--td-color-primary);
    color: white;
}

/* ── Terra: Typography ── */
.td-style-terra h1 {
    font-size: 2rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}
.td-style-terra h2 {
    font-size: 1.5rem;
    line-height: 1.3;
}

/* ── Terra: Container ── */
.td-style-terra .td-container {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ── Terra: Hero ── */
.td-style-terra .hero {
    border-radius: var(--td-radius);
    padding: 4rem 2rem;
    margin-bottom: 3rem;
}
.td-style-terra .hero h1 {
    font-size: 2.8rem;
    letter-spacing: -0.02em;
}
.td-style-terra .hero p {
    font-size: 1.25rem;
    opacity: 0.92;
    max-width: 640px;
}
.td-style-terra .hero-divider {
    width: 80px;
    height: 3px;
    background: var(--td-color-accent);
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

/* ── Terra: Cards ── */
.td-style-terra .platform-card {
    border: 1px solid var(--td-color-border);
    border-radius: var(--td-radius);
    padding: 2rem;
    box-shadow: var(--td-shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}
.td-style-terra .platform-card:hover {
    box-shadow: var(--td-shadow-md);
    transform: translateY(-2px);
}
.td-style-terra .platform-card h2 {
    font-size: 1.35rem;
}
.td-style-terra .platform-card .card-footer {
    border-top-color: var(--td-color-border-light);
    padding-top: 1rem;
}

/* ── Terra: About section ── */
.td-style-terra .about {
    border-radius: var(--td-radius);
    padding: 2.5rem;
    border: 1px solid var(--td-color-border);
}

/* ── Terra: Search ── */
.td-style-terra .search-container {
    border-radius: var(--td-radius);
}
.td-style-terra .search-input {
    border-radius: var(--td-radius-pill);
}
.td-style-terra .search-input:focus {
    box-shadow: 0 0 0 3px var(--td-color-accent-ring);
}
.td-style-terra .filter-select {
    border-radius: var(--td-radius-pill);
}

/* ── Terra: Results ── */
.td-style-terra .results-container {
    border-radius: var(--td-radius);
}

/* ── Terra: Entries ── */
.td-style-terra .entry {
    padding: 1.25rem;
}
.td-style-terra .entry:hover {
    background: var(--td-color-bg-infobox);
}

/* ── Terra: Footer ── */
.td-style-terra footer {
    background: var(--td-color-dark, #0B0F17);
    border-top: none;
    margin-top: 4rem;
}

/* ── Terra: Term emphasis ── */
.td-style-terra .td-term {
    border-bottom: 1px dotted var(--td-term-color);
    padding-bottom: 1px;
}

/* ══════════════════════════════════════════════════════
   Classic theme — legacy utilitarian style (opt-in)
   ══════════════════════════════════════════════════════ */
/* Classic uses the base styles as-is — no overrides needed.
   Body class .td-style-classic is applied but has no extra rules. */
.td-style-classic nav,
.td-style-classic #td-nav {
    position: sticky;
    background: var(--td-color-primary);
}
.td-style-classic nav a {
    color: white;
}
.td-style-classic main.td-container {
    padding-top: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding-top: 0.5rem;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 0.5rem 0.75rem;
        width: 100%;
        border-radius: 0;
    }
    nav .td-nav-inner {
        flex-wrap: wrap;
    }
    nav .lang-switch {
        width: 100%;
        justify-content: center;
        padding-top: 0.5rem;
        margin-top: 0.25rem;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .td-style-terra .hero h1 {
        font-size: 2rem;
    }
    .td-style-terra .td-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
@media (max-width: 768px) and (min-width: 601px) {
    .td-container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
@media (max-width: 600px) {
    .search-row {
        flex-direction: column;
    }
    .search-input, .filter-select {
        width: 100%;
    }
    .entry-thumbnail {
        max-width: 80px;
    }
    .td-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .td-style-terra .hero {
        padding: 2.5rem 1.25rem;
    }
    .td-style-terra .hero h1 {
        font-size: 1.75rem;
    }
    .td-style-terra .td-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    .td-fade-in {
        opacity: 1;
        transform: none;
    }
}

/* ── Print ── */
@media print {
    nav, #td-nav, footer, .skip-link, .nav-toggle, .lang-switch,
    .search-container, .dict-controls, .letter-bar,
    .back-link, .filter-select {
        display: none !important;
    }
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    .td-container {
        max-width: 100%;
        padding: 0;
    }
    main.td-container {
        animation: none;
        padding-top: 0;
    }
    a {
        color: inherit;
        text-decoration: underline;
    }
    .entry, .platform-card, .portal-section, .showcase-card {
        box-shadow: none !important;
        border-color: #ccc !important;
    }
    .infobox {
        float: right;
        border: 1px solid #ccc;
    }
    .highlight {
        background: none;
        font-weight: bold;
    }
}
