/* A journal article /journal/:slug (pages/stranica-zhurnala.htm), design «С оглавлением»: a reading progress line,
   the contents beside the text, the previous and next posts at the end */

.lfa {
    --ink: #111; --muted: #6f6f6f; --line: #e9e6e1; --soft: #f7f5f2; --gold: #b08d57;
    max-width: 1100px; margin: 0 auto; padding: 168px 16px 72px; color: var(--ink);   /* the content ~32px under the fixed header */
    font-family: 'CenturyGothic', Arial, Helvetica, sans-serif;
}
.lfa * { font-size: inherit; box-sizing: border-box; }   /* the theme sets «* { font-size: 20px }» */
.lfa a { color: inherit; text-decoration: none; }
.lfa a:hover { color: inherit; text-decoration: none; }
.lfa a:focus-visible, .lfa summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.lfa ul, .lfa ol { margin: 0; padding: 0; list-style: none; }

/* the path, the topic and the title */
.lfa-crumbs { display: flex; gap: 10px; margin-bottom: 28px; font-size: 13px; color: var(--muted); }
.lfa-crumbs a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.lfa-crumbs a:hover { border-bottom-color: currentColor; }
.lfa-head { display: grid; justify-items: start; gap: 16px; max-width: none; margin: 0 0 40px calc((100% - 1004px) / 2); text-align: left; }
.lfa-tag { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #86663a; }
.lfa-title { margin: 0; max-width: 820px; font-size: 38px; font-weight: normal; line-height: 1.2; letter-spacing: .01em; }

/* the reading progress line */
.lfa-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 10001; height: 3px; pointer-events: none; }
.lfa-progress span { display: block; height: 100%; background: #b08d57; transform: scaleX(0); transform-origin: left; }

/* the contents and the text */
.lfa-layout { display: grid; grid-template-columns: 260px minmax(0, 680px); gap: 64px; justify-content: center; align-items: start; }
.lfa-toc { position: sticky; top: 130px; }
.lfa-toc summary { margin-bottom: 14px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); list-style: none; cursor: default; }
.lfa-toc summary::-webkit-details-marker { display: none; }
.lfa-toc ol { border-left: 1px solid var(--line); }
.lfa-toc li a {
    display: block; margin-left: -1px; padding: 8px 0 8px 18px; border-left: 2px solid transparent;
    font-size: 14px; line-height: 1.4; color: var(--muted); transition: color .2s, border-color .2s;
}
.lfa-toc li a:hover { color: var(--ink); }
.lfa-toc li a.is-on { border-left-color: var(--gold); color: var(--ink); }

.lfa-body { max-width: 680px; font-size: 17px; line-height: 1.75; color: #2a2a2a; }
.lfa-body p { margin: 0 0 1.1em; }
.lfa-body hr { display: none; }   /* the subheadings divide the parts */
.lfa-body h2 { margin: 2em 0 .7em; font-size: 24px; font-weight: normal; line-height: 1.3; color: var(--ink); scroll-margin-top: 30px;   /* + html scroll-padding-top (a11y.css) = ~130px under the header */ }
.lfa-body strong { font-weight: bold; color: var(--ink); }
.lfa-body a { color: var(--ink); border-bottom: 1px solid var(--gold); transition: color .2s; }
.lfa-body a:hover { color: var(--gold); }

/* the previous and next posts */
.lfa-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.lfa .lfa-pager a { display: grid; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; line-height: 1.4; transition: border-color .2s; }
.lfa .lfa-pager a:hover { border-color: var(--ink); color: var(--ink); }
.lfa-pager small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #86663a; }
.lfa-pager__next { grid-column: 2; text-align: right; }

/* tablets: the contents go above the text */
@media (max-width: 1023px) {
    .lfa-layout { grid-template-columns: minmax(0, 680px); gap: 40px; }
    .lfa-head { margin-left: auto; margin-right: auto; width: 100%; max-width: 680px; }
    .lfa-toc { position: static; }
}

/* phones: the contents fold into a bar above the text */
@media (max-width: 767px) {
    .lfa { padding: 88px 16px 56px; }   /* the header is 57px tall on phones */
    .lfa-title { font-size: 27px; }
    .lfa-head { margin-bottom: 28px; }
    .lfa-body { font-size: 16px; }
    .lfa-body h2 { font-size: 21px; }

    .lfa-layout { gap: 24px; }
    .lfa-toc { position: static; margin: 0 -16px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }   /* stays above the text, does not follow the scroll */
    .lfa-toc summary { margin: 0; padding: 14px 0; cursor: pointer; color: var(--ink); }
    .lfa-toc summary::after { content: '+'; float: right; color: var(--muted); }
    .lfa-toc details[open] summary::after { content: '−'; }
    .lfa-toc ol { max-height: 50vh; overflow-y: auto; margin-bottom: 14px; }
    .lfa-pager { grid-template-columns: 1fr; }
    .lfa-pager__next { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .lfa *, .lfa-progress span { transition: none !important; }
}

/* «Журнал / Камни» starts where «Содержание» does (2026-12-02): as wide as the two columns under it (260 + 64 + 680px),
   centred as they are; one column of 680px below 1024px */
.lfa-crumbs { width: 100%; max-width: 1004px; margin-left: auto; margin-right: auto; }
@media (max-width: 1023px) { .lfa-crumbs { max-width: 680px; } }

/* The article on a white card, as a promotion and the product page (promo-page.css, product-info.css), 2026-12-02: the
   site's background is grey #f9f9f9. A layer behind the content, from the crumbs to the previous / next posts */
.lfa { position: relative; z-index: 0; padding-top: 188px; }   /* 20px more: a gap between the header and the card */
.lfa::before {
    content: ''; position: absolute; z-index: -1; top: 160px; right: -24px; bottom: 44px; left: -24px;
    border: 1px solid #e9e6e1; border-radius: 12px; background: #fff; pointer-events: none;
}
@media (max-width: 1151px) { .lfa::before { right: 0; left: 0; } }   /* no room beside it: within the page's 16px */
@media (max-width: 767px) {
    .lfa { padding: 100px 20px 56px; }   /* the header is 57px: the card 19px under it */
    .lfa::before { top: 76px; right: 8px; bottom: 32px; left: 8px; }
    .lfa .lfa-toc { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }   /* the contents bar to the card's edges, not the screen's */
}
