/* ============================================================================
   «КАРТА ПИСЕМ» — серия «Письма о добром и прекрасном» (категория pismo-o-dobre).
   Баннер на рубрике (.rn-tlb--lm: реюз базы .rn-tlb из timeline-pro.css),
   страница-навигатор /lihachev-karta/ (.rn-lm-*), рулетка «Случайное письмо»,
   лента жизни Лихачева. v1.2.1 (05.12.2026): колонки-ссылки на части;
   transition на слоях убран (Chromium замораживает их на потомках SVG <a>).
   Тема: переменные темы radnews_tech; светлая — html.rn-light.
   Цвета блоков = палитра эпох ленты Соловьева (семейственность).
   ========================================================================== */

.rn-tlb--lm {
    --rn-lm-man:  #ffb000;
    --rn-lm-word: #35c3ff;
    --rn-lm-mem:  #5dd39e;
    --rn-lm-way:  #e05a3a;
}

html.rn-light .rn-tlb--lm {
    --rn-lm-man:  #a06e00;
    --rn-lm-word: #0084c2;
    --rn-lm-mem:  #1a8152;
    --rn-lm-way:  #c24526;
}

/* ---- баннер: слои карты ---- */
.rn-tlb__era--man  { --band-color: var(--rn-lm-man, #ffb000); }
.rn-tlb__era--word { --band-color: var(--rn-lm-word, #35c3ff); }
.rn-tlb__era--mem  { --band-color: var(--rn-lm-mem, #5dd39e); }
.rn-tlb__era--way  { --band-color: var(--rn-lm-way, #e05a3a); }

.rn-lm__col--man  { --band-color: var(--rn-lm-man, #ffb000); }
.rn-lm__col--word { --band-color: var(--rn-lm-word, #35c3ff); }
.rn-lm__col--mem  { --band-color: var(--rn-lm-mem, #5dd39e); }
.rn-lm__col--way  { --band-color: var(--rn-lm-way, #e05a3a); }

.rn-lm__colbg {
    fill: transparent;
    stroke: var(--rn-line, #2a333d);
    stroke-width: 1;
}

.rn-lm__colbar {
    fill: var(--band-color, var(--rn-line, #2a333d));
    opacity: 0.9;
    /* transition убран (v1.2.1): переходы на потомках SVG <a> в Chromium
       зависают на стартовом значении — hover-затемнение не срабатывало */
}

.rn-lm__col circle {
    fill: rgba(255, 255, 255, 0.62);
}

html.rn-light .rn-lm__col circle {
    fill: rgba(255, 255, 255, 0.8);
}

/* кликабельные слои карты (v1.2.0): колонка+номер — ссылка на статью части,
   сегмент полосы блоков — ссылка на страницу-навигатор */
.rn-lm__link,
.rn-lm__eralink { cursor: pointer; }

.rn-lm__link:hover .rn-lm__colbar { opacity: 0.72; }
.rn-lm__link:hover .rn-tlb__num { fill: var(--band-color, currentColor); }

.rn-lm__eralink:hover rect { opacity: 1; }
.rn-lm__eralink:hover text { text-decoration: underline; }

.rn-lm__link:focus-visible .rn-lm__colbg { stroke: var(--band-color, currentColor); stroke-width: 2; }
.rn-lm__eralink:focus-visible rect { stroke: #0b0e11; stroke-width: 2; }

.rn-lm-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
}

/* кнопка «Случайное письмо» */
.rn-lm-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--rn-accent, #35c3ff);
    background: transparent;
    border: 1px solid var(--rn-line, #2a333d);
    border-radius: 999px;
    padding: 7px 14px;
    cursor: pointer;
    transition: border-color 0.15s ease-out, color 0.15s ease-out, transform 0.15s ease-out;
}

.rn-lm-btn:hover,
.rn-lm-btn:focus-visible {
    border-color: var(--rn-accent, #35c3ff);
    transform: translateY(-1px);
    outline: none;
}

.rn-lm-btn--big {
    font-size: 12px;
    padding: 10px 18px;
}

.rn-lm-btn--ghost {
    color: var(--rn-muted, #8a94a0);
    text-decoration: none;
}

.rn-lm-btn--ghost:hover,
.rn-lm-btn--ghost:focus-visible {
    border-color: var(--rn-muted, #8a94a0);
    color: var(--rn-ink-bright, #f2f6fa);
}

html.rn-light .rn-lm-btn--ghost:hover,
html.rn-light .rn-lm-btn--ghost:focus-visible {
    color: var(--rn-ink-bright, #0b1218);
}

/* ---- раскрытие баннера карты (свои слои) ---- */
.rn-lm__colbar { transform-box: fill-box; transform-origin: 50% 100%; }
.rn-tlb--lm .rn-tlb__era { transform-box: fill-box; }

.rn-tlb--pre:not(.rn-tlb--in) .rn-lm__colbar { opacity: 0; transform: scaleY(0.08); }
.rn-tlb--pre:not(.rn-tlb--in) .rn-lm__col circle { opacity: 0; }
.rn-tlb--pre:not(.rn-tlb--in) .rn-tlb__era,
.rn-tlb--pre:not(.rn-tlb--in) .rn-tlb__num { opacity: 0; }

.rn-tlb--pre.rn-tlb--in .rn-tlb__era { animation: rn-tlb-fade 0.55s ease-out backwards; }
.rn-tlb--pre.rn-tlb--in .rn-lm__colbar {
    animation: rn-lm-bar-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    animation-delay: calc(120ms + var(--bi, 0) * 42ms);
}
.rn-tlb--pre.rn-tlb--in .rn-lm__col circle {
    animation: rn-tlb-fade 0.4s ease-out backwards;
    animation-delay: calc(460ms + var(--bi, 0) * 42ms);
}
.rn-tlb--pre.rn-tlb--in .rn-tlb__num {
    animation: rn-tlb-fade 0.45s ease-out backwards;
    animation-delay: calc(640ms + var(--bi, 0) * 26ms);
}

@keyframes rn-lm-bar-in {
    from { opacity: 0; transform: scaleY(0.08); }
    to   { opacity: 1; transform: scaleY(1); }
}

/* ============================================================================
   СТРАНИЦА-НАВИГАТОР /lihachev-karta/
   ========================================================================== */

.rn-lm {
    max-width: 1060px;
    margin: 0 auto;
    padding: 30px 20px 40px;
}

/* ---- hero ---- */
.rn-lm-kicker {
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rn-amber, #ffb000);
    margin: 0 0 10px;
}

.rn-lm-h1 {
    font-family: var(--rn-font-display, 'Russo One', sans-serif);
    font-weight: 400;
    font-size: clamp(26px, 4vw, 40px);
    line-height: 1.08;
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 12px;
}

html.rn-light .rn-lm-h1 { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-lede {
    font-size: 15px;
    line-height: 1.6;
    color: var(--rn-ink, #d6dde6);
    max-width: 720px;
    margin: 0 0 16px;
}

html.rn-light .rn-lm-lede { color: var(--rn-ink, #17222e); }

.rn-lm-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 18px;
}

.rn-lm-stat {
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rn-muted, #8a94a0);
    border: 1px solid var(--rn-line, #2a333d);
    border-radius: 999px;
    padding: 6px 12px;
}

.rn-lm-stat b {
    color: var(--rn-ink-bright, #f2f6fa);
    font-weight: 700;
}

html.rn-light .rn-lm-stat b { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-hint {
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    color: var(--rn-muted, #8a94a0);
    margin: 12px 0 0;
}

/* ---- карта книги ---- */
.rn-lm-map { margin: 34px 0 0; }

.rn-lm-map-title,
.rn-lm-life-title {
    font-family: var(--rn-font-display, 'Russo One', sans-serif);
    font-weight: 400;
    font-size: clamp(19px, 2.2vw, 24px);
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 6px;
}

html.rn-light .rn-lm-map-title,
html.rn-light .rn-lm-life-title { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-map-note,
.rn-lm-life-note {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--rn-muted, #8a94a0);
    max-width: 720px;
    margin: 0 0 18px;
}

.rn-lm-block {
    border-left: 3px solid var(--rn-lm-block-color, var(--rn-line, #2a333d));
    border-top: 1px solid var(--rn-line, #2a333d);
    border-radius: 0 12px 0 0;
    padding: 14px 16px 16px 18px;
    margin: 0 0 18px;
    background: var(--rn-panel, #141a20);
}

html.rn-light .rn-lm-block { background: var(--rn-panel, #ffffff); }

.rn-lm-block--man  { --rn-lm-block-color: var(--rn-lm-man, #ffb000); }
.rn-lm-block--word { --rn-lm-block-color: var(--rn-lm-word, #35c3ff); }
.rn-lm-block--mem  { --rn-lm-block-color: var(--rn-lm-mem, #5dd39e); }
.rn-lm-block--way  { --rn-lm-block-color: var(--rn-lm-way, #e05a3a); }

.rn-lm-block-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 12px;
}

.rn-lm-block-name {
    font-family: var(--rn-font-display, 'Russo One', sans-serif);
    font-size: 16px;
    color: var(--rn-ink-bright, #f2f6fa);
}

html.rn-light .rn-lm-block-name { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-block-range {
    font-family: var(--rn-font-mono, monospace);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rn-muted, #8a94a0);
}

.rn-lm-block-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.rn-lm-card {
    border: 1px solid var(--rn-line, #2a333d);
    border-radius: 10px;
    background: var(--rn-bg, #0b0e11);
    overflow: hidden;
    transition: border-color 0.15s ease-out, transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

html.rn-light .rn-lm-card { background: var(--rn-bg, #eef1f5); }

.rn-lm-card:hover,
.rn-lm-card:focus-within {
    border-color: var(--rn-lm-block-color, var(--rn-line, #2a333d));
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
}

html.rn-light .rn-lm-card:hover,
html.rn-light .rn-lm-card:focus-within {
    box-shadow: 0 10px 24px rgba(23, 34, 46, 0.12);
}

.rn-lm-card-head {
    display: block;
    text-decoration: none;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--rn-line, #2a333d);
    transition: background 0.12s ease-out;
}

.rn-lm-card-head:hover {
    background: rgba(255, 255, 255, 0.03);
}

html.rn-light .rn-lm-card-head:hover { background: rgba(23, 34, 46, 0.04); }

.rn-lm-card-num {
    display: inline-block;
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    font-weight: 700;
    color: #0b0e11;
    background: var(--rn-lm-block-color, var(--rn-amber, #ffb000));
    border-radius: 5px;
    padding: 2px 7px;
    margin: 0 0 8px;
}

.rn-lm-card-title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 6px;
}

html.rn-light .rn-lm-card-title { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--rn-font-mono, monospace);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--rn-accent, #35c3ff);
}

.rn-lm-letters {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
}

.rn-lm-letter a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 6px;
    border-radius: 7px;
    text-decoration: none;
    transition: background 0.12s ease-out;
}

.rn-lm-letter a:hover,
.rn-lm-letter a:focus-visible {
    background: rgba(255, 255, 255, 0.04);
    outline: none;
}

html.rn-light .rn-lm-letter a:hover,
html.rn-light .rn-lm-letter a:focus-visible {
    background: rgba(23, 34, 46, 0.05);
}

.rn-lm-letter-n {
    flex: none;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--rn-font-mono, monospace);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--rn-lm-block-color, var(--rn-amber, #ffb000));
    border: 1px solid var(--rn-lm-block-color, var(--rn-line, #2a333d));
    border-radius: 999px;
    opacity: 0.9;
}

.rn-lm-letter-t {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--rn-ink, #d6dde6);
}

html.rn-light .rn-lm-letter-t { color: var(--rn-ink, #17222e); }

/* ---- лента жизни ---- */
.rn-lm-life { margin: 40px 0 0; }

.rn-lm-life-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0 0 0 22px;
    border-left: 2px solid var(--rn-line, #2a333d);
}

.rn-lm-life-item {
    position: relative;
    padding: 0 0 18px 16px;
}

.rn-lm-life-item:last-child { padding-bottom: 0; }

.rn-lm-life-dot {
    position: absolute;
    left: -29px;
    top: 4px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--rn-amber, #ffb000);
    box-shadow: 0 0 0 3px var(--rn-bg, #0b0e11);
}

html.rn-light .rn-lm-life-dot { box-shadow: 0 0 0 3px var(--rn-bg, #eef1f5); }

.rn-lm-life-year {
    display: inline-block;
    font-family: var(--rn-font-mono, monospace);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--rn-amber, #ffb000);
    margin: 0 0 4px;
}

.rn-lm-life-body { display: block; }

.rn-lm-life-ev {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 4px;
}

html.rn-light .rn-lm-life-ev { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-life-text {
    display: block;
    font-size: 13px;
    line-height: 1.6;
    color: var(--rn-ink, #d6dde6);
    max-width: 640px;
}

html.rn-light .rn-lm-life-text { color: var(--rn-ink, #17222e); }

/* ---- «Ваше письмо о добром» ---- */
.rn-lm-write {
    margin: 40px 0 0;
    border-left: 3px solid var(--rn-amber, #ffb000);
    border-top: 1px solid var(--rn-line, #2a333d);
    border-radius: 0 12px 0 0;
    padding: 18px 20px;
    background:
        linear-gradient(120deg, rgba(255, 176, 0, 0.05), rgba(0, 0, 0, 0) 60%),
        var(--rn-panel, #141a20);
}

html.rn-light .rn-lm-write {
    background:
        linear-gradient(120deg, rgba(160, 110, 0, 0.05), rgba(0, 0, 0, 0) 60%),
        var(--rn-panel, #ffffff);
}

.rn-lm-write-title {
    font-family: var(--rn-font-display, 'Russo One', sans-serif);
    font-weight: 400;
    font-size: clamp(19px, 2.2vw, 24px);
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 8px;
}

html.rn-light .rn-lm-write-title { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-write-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--rn-ink, #d6dde6);
    max-width: 700px;
    margin: 0 0 14px;
}

html.rn-light .rn-lm-write-text { color: var(--rn-ink, #17222e); }

/* ---- футер страницы ---- */
.rn-lm-foot {
    margin: 34px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--rn-line, #2a333d);
    font-size: 12px;
    line-height: 1.6;
    color: var(--rn-muted, #8a94a0);
}

.rn-lm-foot-links {
    margin: 8px 0 0;
}

.rn-lm-foot-links a {
    color: var(--rn-accent, #35c3ff);
    text-decoration: none;
}

.rn-lm-foot-links a:hover {
    text-decoration: underline;
}

/* ---- раскрытие блоков карты и ленты жизни (scroll-драйв JS) ---- */
.rn-lm--pre:not(.rn-lm--seen) { opacity: 0; transform: translateY(14px); }

.rn-lm--pre.rn-lm--seen {
    animation: rn-lm-reveal 0.55s ease-out backwards;
    animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes rn-lm-reveal {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
   РУЛЕТКА «СЛУЧАЙНОЕ ПИСЬМО» — модалка
   ========================================================================== */

.rn-lm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rn-lm-modal.is-open { display: flex; }

.rn-lm-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 10, 0.72);
    cursor: pointer;
}

html.rn-light .rn-lm-modal-overlay { background: rgba(23, 34, 46, 0.5); }

.rn-lm-modal-card {
    position: relative;
    width: min(460px, 100%);
    background: var(--rn-panel, #141a20);
    border: 1px solid var(--rn-line, #2a333d);
    border-top: 3px solid var(--rn-lm-block-color, var(--rn-amber, #ffb000));
    border-radius: 14px;
    padding: 22px 24px 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

html.rn-light .rn-lm-modal-card {
    box-shadow: 0 24px 54px rgba(23, 34, 46, 0.22);
}

.rn-lm-modal.is-spinning .rn-lm-modal-card { animation: rn-lm-pop 0.3s ease-out; }

@keyframes rn-lm-pop {
    from { transform: scale(0.94); opacity: 0.6; }
    to   { transform: scale(1); opacity: 1; }
}

.rn-lm-modal-kicker {
    font-family: var(--rn-font-mono, monospace);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rn-lm-block-color, var(--rn-amber, #ffb000));
    margin: 0 0 10px;
}

.rn-lm-modal-title {
    font-family: var(--rn-font-display, 'Russo One', sans-serif);
    font-weight: 400;
    font-size: clamp(18px, 3vw, 23px);
    line-height: 1.25;
    color: var(--rn-ink-bright, #f2f6fa);
    margin: 0 0 8px;
    min-height: 1.3em;
}

html.rn-light .rn-lm-modal-title { color: var(--rn-ink-bright, #0b1218); }

.rn-lm-modal-part {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--rn-muted, #8a94a0);
    margin: 0 0 16px;
}

.rn-lm-modal-part a {
    color: var(--rn-accent, #35c3ff);
    text-decoration: none;
}

.rn-lm-modal-part a:hover { text-decoration: underline; }

.rn-lm-modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rn-lm-modal-go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--rn-font-mono, monospace);
    font-size: 11px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    text-decoration: none;
    color: #0b0e11;
    background: var(--rn-accent, #35c3ff);
    border: 1px solid var(--rn-accent, #35c3ff);
    border-radius: 999px;
    padding: 9px 16px;
    transition: transform 0.15s ease-out, filter 0.15s ease-out;
}

.rn-lm-modal-go:hover,
.rn-lm-modal-go:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.08);
    outline: none;
}

.rn-lm-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--rn-muted, #8a94a0);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.12s ease-out, background 0.12s ease-out;
}

.rn-lm-modal-close:hover,
.rn-lm-modal-close:focus-visible {
    color: var(--rn-ink-bright, #f2f6fa);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

body.rn-lm-lock { overflow: hidden; }

/* ---- мобайл ---- */
@media (max-width: 640px) {
    .rn-lm { padding: 22px 14px 30px; }
    .rn-lm-block { padding: 12px 12px 12px 14px; }
    .rn-lm-block-grid { grid-template-columns: 1fr; }
    .rn-lm-life-list { padding-left: 16px; }
    .rn-lm-life-dot { left: -24px; width: 9px; height: 9px; }
    .rn-lm-modal-card { padding: 18px 16px 16px; }
}

/* ---- reduced-motion: контент статичен и виден ---- */
@media (prefers-reduced-motion: reduce) {
    .rn-tlb--lm .rn-tlb__era,
    .rn-tlb--lm .rn-lm__colbar,
    .rn-tlb--lm .rn-lm__col circle,
    .rn-tlb--lm .rn-tlb__num,
    .rn-lm--pre.rn-lm--seen,
    .rn-lm-modal.is-spinning .rn-lm-modal-card,
    .rn-lm-btn,
    .rn-lm-card,
    .rn-lm-modal-go { animation: none !important; transition: none; }
    .rn-lm--pre:not(.rn-lm--seen) { opacity: 1; transform: none; }
}
