/**
 * FMDA Design System 7.4.0
 * A stable visual foundation for all public archive interfaces.
 */
:root {
    --fmda-bg: #f8f6f2;
    --fmda-surface: #ffffff;
    --fmda-surface-soft: #fbf7ef;
    --fmda-primary: #6d1f2c;
    --fmda-primary-dark: #4f1520;
    --fmda-secondary: #b8923d;
    --fmda-text: #222222;
    --fmda-muted: #667085;
    --fmda-border: #eadfc9;
    --fmda-radius-sm: 12px;
    --fmda-radius-md: 18px;
    --fmda-radius-lg: 28px;
    --fmda-shadow-sm: 0 8px 24px rgba(24, 24, 27, .06);
    --fmda-shadow-md: 0 16px 44px rgba(24, 24, 27, .09);
    --fmda-space-1: 8px;
    --fmda-space-2: 16px;
    --fmda-space-3: 24px;
    --fmda-space-4: 32px;
    --fmda-space-5: 48px;
    --fmda-space-6: 64px;
}

.fmda-wrap {
    background: var(--fmda-bg);
    color: var(--fmda-text);
    font-family: inherit;
}

.fmda-wrap *,
.fmda-wrap *::before,
.fmda-wrap *::after {
    box-sizing: border-box;
}

.fmda-ui-section-title,
.fmda-section-title {
    text-align: center;
    margin-bottom: var(--fmda-space-3);
}

.fmda-ui-section-title span,
.fmda-section-title span {
    display: inline-block;
    color: var(--fmda-secondary);
    font-weight: 800;
    letter-spacing: .02em;
    margin-bottom: var(--fmda-space-1);
}

.fmda-ui-section-title h2,
.fmda-section-title h2 {
    margin: 0;
    color: var(--fmda-text);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.45;
}

.fmda-ui-section-title p,
.fmda-section-title p {
    max-width: 760px;
    margin: 10px auto 0;
    color: var(--fmda-muted);
    line-height: 1.9;
}

.fmda-ui-btn,
.fmda-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none !important;
    font-weight: 800;
    line-height: 1.4;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.fmda-ui-btn:hover,
.fmda-btn:hover {
    transform: translateY(-2px);
}

.fmda-ui-btn-primary,
.fmda-btn-primary {
    background: var(--fmda-secondary);
    color: #151515 !important;
    box-shadow: var(--fmda-shadow-sm);
}

.fmda-ui-btn-secondary,
.fmda-btn-secondary,
.fmda-btn-soft {
    background: rgba(255,255,255,.14);
    color: #fff !important;
    border-color: rgba(255,255,255,.28);
}

.fmda-ui-badge,
.fmda-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--fmda-surface-soft);
    border: 1px solid var(--fmda-border);
    color: var(--fmda-primary);
    font-size: 13px;
    font-weight: 800;
}

.fmda-section-block,
.fmda-search-block,
.fmda-meta-card,
.fmda-description,
.fmda-viewer {
    background: var(--fmda-surface);
    border: 1px solid rgba(234, 223, 201, .95);
    border-radius: var(--fmda-radius-lg);
    box-shadow: var(--fmda-shadow-sm);
}

.fmda-card,
.fmda-gate,
.fmda-section-card,
.fmda-ui-stat,
.fmda-stats > div {
    background: var(--fmda-surface);
    border: 1px solid rgba(234, 223, 201, .95);
    border-radius: var(--fmda-radius-md);
    box-shadow: var(--fmda-shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.fmda-card:hover,
.fmda-gate:hover,
.fmda-section-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fmda-shadow-md);
    border-color: rgba(184,146,61,.55);
}

.fmda-icon svg {
    width: 42px;
    height: 42px;
    stroke: currentColor;
}

.fmda-ui-stat {
    padding: var(--fmda-space-3);
    text-align: center;
}

.fmda-ui-stat strong,
.fmda-stats strong {
    display: block;
    color: var(--fmda-primary);
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.1;
}

.fmda-ui-stat span,
.fmda-stats span {
    display: block;
    margin-top: 8px;
    color: var(--fmda-muted);
}

.fmda-search-bar input,
.fmda-search-block input,
.fmda-filter-panel input,
.fmda-filter-panel select {
    border: 1px solid var(--fmda-border);
    border-radius: 999px;
    background: #fff;
    color: var(--fmda-text);
}

.fmda-search-bar button,
.fmda-filter-panel button {
    background: var(--fmda-primary);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

.fmda-empty,
.fmda-empty-inline {
    color: var(--fmda-muted);
}

body.dark-skin,
body.dark-skin :root {
    --fmda-bg: #151515;
    --fmda-surface: #1f1f1f;
    --fmda-surface-soft: #292929;
    --fmda-text: #f5f5f5;
    --fmda-muted: #c8c8c8;
    --fmda-border: #3a3a3a;
}

body.dark-skin .fmda-section-block,
body.dark-skin .fmda-search-block,
body.dark-skin .fmda-meta-card,
body.dark-skin .fmda-description,
body.dark-skin .fmda-viewer,
body.dark-skin .fmda-card,
body.dark-skin .fmda-gate,
body.dark-skin .fmda-section-card,
body.dark-skin .fmda-ui-stat,
body.dark-skin .fmda-stats > div {
    background: var(--fmda-surface);
    border-color: var(--fmda-border);
}

@media (prefers-reduced-motion: reduce) {
    .fmda-wrap *,
    .fmda-wrap *::before,
    .fmda-wrap *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
