/*
Theme Name: Книга историй
Description: Литературный журнал с авторскими рассказами.
Version: 2.0.0
Text Domain: kniga
*/
@font-face {
  font-family: Lora; src: url("assets/lora.woff2") format("woff2");
  font-style: normal; font-weight: 400 700; font-display: swap;
}
@font-face {
  font-family: Roboto; src: url("assets/roboto.woff2") format("woff2");
  font-style: normal; font-weight: 100 900; font-display: swap;
}
:root {
  --paper: #fbfaf7; --ink: #1d302a; --muted: #54635c; --green: #183a30;
  --rust: #a14129; --line: #d5d8ce; --serif: Lora, Georgia, serif;
  --sans: Roboto, Arial, sans-serif; --edge: clamp(1rem, 4.4vw, 4.75rem);
  --floor-height: 74px;
  --page-inset: max(var(--edge),env(safe-area-inset-left),env(safe-area-inset-right));
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); overflow-wrap: break-word; }
body.floor-on { padding-bottom: calc(var(--floor-height) + .5rem); }
h1,h2,h3,p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible,button:focus-visible { outline: 3px solid #bc6138; outline-offset: 3px; }
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
.frame { width: min(calc(100% - var(--page-inset) - var(--page-inset)), 77rem); margin-inline: auto; }
.skip { position: fixed; left: 1rem; top: 0; padding: .6rem 1rem; transform: translateY(-130%); background: white; z-index: 100; }
.skip:focus { transform: none; }
.site-head { border-bottom: 1px solid var(--line); }
.masthead { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding-block: 1.1rem; }
.wordmark { display: inline-flex; align-items: center; min-width: 0; gap: .75rem; text-decoration: none; }
.brand-name { font: 650 clamp(1.5rem,2.25vw,2rem)/1.15 var(--serif); letter-spacing: -.065em; }
.brand-name::first-letter { text-transform: uppercase; }
.book-mark { flex: none; width: 2.5rem; height: 2.5rem; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-bottom: 10px; background: var(--rust); color: var(--paper); border-radius: 7px; }
.book-mark i { width: 4px; height: 19px; border: 1.4px solid currentColor; border-block-width: 3px; }
.book-mark i:nth-child(2) { height: 15px; }
.book-mark i:last-child { transform: rotate(-12deg); transform-origin: bottom; margin-left: 4px; height: 20px; }
.menu-links { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; padding: 0; margin: 0; list-style: none; }
.menu-links a { display: grid; place-items: center; min-height: 42px; padding: .5rem 1.05rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .97rem; font-weight: 520; }
.menu-links a[aria-current],.menu-links a:hover { background: #e9eee7; color: var(--green); }
.page-shell { padding-block: clamp(1.4rem,3vw,2.8rem) clamp(2.4rem,5vw,5rem); }
.feature { display: grid; grid-template-columns: minmax(0,.93fr) minmax(0,1.07fr); background: var(--green); color: #fffaf0; border-radius: 12px; overflow: hidden; }
.feature-copy { align-self: center; padding: clamp(1.6rem,3.8vw,3.85rem); }
.kicker,.section-label { font-size: .8rem; line-height: 1.3; letter-spacing: .115em; text-transform: uppercase; font-weight: 650; }
.kicker { display: flex; align-items: center; gap: .7rem; color: #edc890; margin-bottom: clamp(1.05rem,1.9vw,1.8rem); }
.kicker span { display: block; width: 1.75rem; height: 2px; background: currentColor; }
.feature h1 { font: 500 clamp(2.2rem,4.25vw,4.25rem)/1.06 var(--serif); letter-spacing: -.065em; overflow-wrap: anywhere; text-wrap: balance; }
.feature h1 a,.card-title a,.profile h2 a { text-decoration: none; }
.feature a:focus-visible { outline-color: #f2c998; }
.feature h1 a:hover,.card-title a:hover,.profile h2 a:hover,.rec-card:hover strong { text-decoration: underline; text-decoration-thickness: 1px; }
.feature-teaser { color: #e2e8df; margin-top: 1rem; max-width: 36rem; font-size: clamp(1rem,1.2vw,1.12rem); line-height: 1.58; }
.feature-byline,.story-meta,.card-meta,.author-link,.feature-byline a { display: flex; flex-wrap: wrap; align-items: center; }
.feature-byline { margin-top: 1.35rem; gap: .5rem 1rem; font-size: .9rem; color: #e4e8df; }
.feature-byline a,.author-link { gap: .55rem; text-decoration: none; font-weight: 550; }
.feature-byline > span,.card-meta > span { display: inline-flex; align-items: center; gap: .55rem; }
.feature-byline > span::before,.card-meta > span::before { content: ''; height: .19rem; width: .19rem; border-radius: 50%; background: currentColor; }
.avatar { width: 1.85rem; height: 1.85rem; border-radius: 50%; object-fit: cover; flex: none; }
.read-button { font-weight: 650; display: inline-flex; align-items: center; min-height: 44px; margin-top: 1.5rem; padding: .55rem 1.3rem; background: #f7efdd; color: #1a352b; border-radius: 5px; text-decoration: none; }
.read-button:hover { background: white; }
.feature-art { display: block; min-height: 100%; min-width: 0; position: relative; background: #bc865d; }
.feature-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.shelf-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem 1rem; margin: clamp(2.2rem,4.8vw,4.1rem) 0 1.45rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.shelf-heading h2,.page-title { font: 550 clamp(1.85rem,3.2vw,2.85rem)/1.14 var(--serif); letter-spacing: -.055em; overflow-wrap: anywhere; }
.text-link { font-size: .94rem; font-weight: 600; color: var(--rust); }
.page-title { margin: .25rem 0 1.9rem; }
.feed-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin: .25rem 0 1.9rem; }
.feed-heading .page-title { margin: 0; }
.feed-grid,.rec-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(2rem,3.8vw,3.4rem) clamp(1rem,2.4vw,2rem); }
.feed-card { min-width: 0; }
.thumb,.rec-card img,.hero,.profile-portrait { background: #e9e6dc; }
.thumb { display: block; overflow: hidden; border-radius: 7px; }
.thumb img { width: 100%; aspect-ratio: 1.88; object-fit: cover; }
.card-copy { padding-top: 1rem; }
.card-meta { gap: .35rem .65rem; line-height: 1.4; font-size: .87rem; color: var(--muted); }
.card-meta a { color: var(--rust); text-decoration: none; font-weight: 650; }
.card-meta a:hover,.author-link:hover,.feature-byline a:hover { text-decoration: underline; }
.card-title { margin-top: .55rem; font: 550 clamp(1.3rem,1.65vw,1.63rem)/1.27 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
.excerpt { font-size: 1rem; line-height: 1.55; color: var(--muted); margin-top: .65rem; }
.card-date,.rec-card small { font-size: .83rem; color: var(--muted); display: block; margin-top: .7rem; }
.pager { border-top: 1px solid var(--line); display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding-top: 1.4rem; margin-top: 2rem; }
.pager a,.pager .here,.more { display: inline-grid; place-items: center; min-height: 44px; min-width: 44px; padding: .45rem .86rem; border: 1px solid var(--line); border-radius: 5px; background: transparent; text-decoration: none; font-weight: 550; }
.pager .here,.more:hover,.pager a:hover { background: var(--green); color: white; }
.pager .next { margin-left: auto; }
.more { display: flex; width: fit-content; margin: 2rem auto 0; }
.section-label { color: var(--rust); }
.section-label a { text-decoration: none; }
.section-label span { margin: 0 .35rem; color: #89918a; }
.story-heading { max-width: 57rem; margin: .4rem auto 1.7rem; }
.story h1 { font: 550 clamp(2rem,4vw,3.8rem)/1.12 var(--serif); letter-spacing: -.06em; margin: 1.05rem 0 1.3rem; overflow-wrap: anywhere; }
.story-meta { color: var(--muted); gap: .45rem 1rem; font-size: .9rem; }
.story-meta .avatar { width: 2.4rem; height: 2.4rem; }
.author-link { color: var(--ink); }
.views { display: inline-flex; align-items: center; gap: .25rem; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linejoin: round; stroke-linecap: round; }
.hero { width: 100%; max-width: 57rem; aspect-ratio: 2.18; object-fit: cover; border-radius: 8px; margin: 0 auto; }
.copy,.end-note { max-width: 40rem; margin: 2rem auto 0; }
.copy { font: 400 clamp(1.1rem,1.7vw,1.25rem)/1.72 var(--serif); color: #26372e; overflow-wrap: anywhere; }
.copy p,.copy ul,.copy ol { margin: 1em 0; }
.copy .story-break { width: 3rem; margin: 2em auto; border: 0; border-top: 1px solid currentColor; opacity: .45; }
.copy > :first-child { margin-top: 0; }
.copy figure,.copy video,.copy iframe,.copy embed,.copy table { max-width: 100%; }
.copy figure { margin-inline: 0; }
.copy pre,.copy .wp-block-table { max-width: 100%; overflow-x: auto; }
.copy table { width: 100%; border-collapse: collapse; }
.copy td,.copy th { overflow-wrap: anywhere; }
.end-note { padding: 1.2rem 1.4rem; border-left: 3px solid var(--rust); background: #f0eee4; font-size: 1rem; }
.rec-card { display: grid; grid-template-columns: 5.75rem minmax(0,1fr); align-items: start; color: var(--ink); gap: .85rem; text-decoration: none; }
.rec-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; }
.rec-card strong { font: 550 1.12rem/1.3 var(--serif); overflow-wrap: anywhere; }
.story-partners { margin: 2rem 0; min-width: 0; }
.story-partners .section-label { margin-bottom: .65rem; }
.partner-widget { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.partner-widget iframe, .partner-widget img { max-width: 100%; }
.also .rec-list { gap: 1.45rem; }
.authors-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.3rem; }
.profile,.author-heading { display: flex; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.profile { padding: clamp(1.25rem,2.3vw,1.8rem); border: 1px solid var(--line); border-radius: 8px; background: #fffefa; }
.profile-portrait { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; flex: none; }
.profile-body,.author-heading > div { min-width: 0; }
.profile h2 { font: 550 1.5rem/1.22 var(--serif); letter-spacing: -.045em; }
.profile p,.bio { margin: .55rem 0 .9rem; color: var(--muted); }
.profile small { display: block; color: var(--muted); font-size: .85rem; margin-top: .65rem; }
.author-heading { max-width: 50rem; margin-bottom: 2rem; }
.author-heading .page-title { margin: .4rem 0; }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; padding-block: 1.25rem 1.75rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.pop-rec { display: flex; align-items: center; position: fixed; right: max(1rem,env(safe-area-inset-right)); bottom: 1rem; width: min(19.5rem,calc(100% - 2rem)); padding: .85rem 2.8rem .85rem .85rem; background: #fffefb; border: 1px solid var(--line); border-left: 3px solid var(--rust); border-radius: 7px; box-shadow: 0 3px 18px #1b2c241c; z-index: 10; }
.floor-on .pop-rec { bottom: calc(var(--floor-height) + .75rem); }
.pop-rec a { min-width: 0; display: grid; grid-template-columns: 3.3rem minmax(0,1fr); align-items: center; gap: .7rem; text-decoration: none; }
.pop-rec img { width: 3.3rem; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.pop-rec small { display: block; color: var(--rust); font-weight: 600; font-size: .8rem; }
.pop-rec strong { font: 550 .97rem/1.25 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dismiss { position: absolute; right: .25rem; top: .25rem; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; color: var(--muted); font: 400 1.55rem/1 var(--sans); }
.dismiss:hover { background: #e6eae4; }
.floor-demo { position: fixed; z-index: 12; inset: auto 0 0; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -3px 16px #152a2312; padding: .38rem calc(48px + max(.25rem,env(safe-area-inset-right))) max(.38rem,env(safe-area-inset-bottom)) max(var(--edge),env(safe-area-inset-left)); }
.floor-demo .dismiss { inset: 50% max(4px,env(safe-area-inset-right)) auto auto; transform: translateY(-50%); width: 44px; height: 44px; }
.ad-rail { max-width: 77rem; margin-inline: auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .85rem; }
.creative { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.creative img { width: 3.6rem; height: 3.3rem; object-fit: cover; flex: none; border-radius: 4px; }
.creative > div { min-width: 0; }
.creative small,.creative strong { display: block; }
.creative small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.creative strong { font: 600 .95rem/1.23 var(--sans); margin-top: .13rem; }
.full-demo { position: fixed; inset: 0; z-index: 60; background: #12231ff5; color: #fff; display: grid; grid-template-rows: auto minmax(0,1fr); justify-items: center; align-items: center; gap: .65rem; overflow-y: auto; padding: max(.75rem,env(safe-area-inset-top)) max(1rem,env(safe-area-inset-right)) max(1rem,env(safe-area-inset-bottom)) max(1rem,env(safe-area-inset-left)); }
.full-demo .ad-label { font-size: .83rem; letter-spacing: .12em; min-height: 44px; display: grid; place-items: center; }
.full-demo .dismiss { top: max(.45rem,env(safe-area-inset-top)); right: max(.6rem,env(safe-area-inset-right)); width: 44px; height: 44px; color: #fff; background: #ffffff24; }
.full-creative { width: min(100%,46rem); max-height: 100%; overflow: auto; border-radius: 8px; background: #f9f5e9; color: var(--ink); }
.full-creative img { width: 100%; max-height: 60vh; max-height: 60dvh; object-fit: cover; }
.full-creative p { padding: .7rem 1rem; text-align: center; font: 550 clamp(1.15rem,3vw,1.75rem)/1.3 var(--serif); }
@media (max-width:900px) {
  .feed-grid,.rec-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pop-rec,.floor-on .pop-rec { position: relative; z-index: auto; inset: auto; width: min(calc(100% - var(--page-inset) - var(--page-inset)),77rem); margin: 0 auto 1.5rem; box-shadow: none; }
  .pop-rec strong { display: block; }
  .profile { flex-direction: column; }
}
@media (max-width:660px) {
  .masthead { align-items: stretch; flex-direction: column; gap: .3rem; padding-block: .7rem .4rem; }
  .wordmark { align-self: flex-start; min-height: 40px; }
  .book-mark { height: 2.15rem; width: 2.15rem; padding-bottom: 7px; }
  .masthead nav { width: 100%; }
  .menu-links { display: grid; grid-template-columns: repeat(4,auto); gap: .14rem; }
  .menu-links li { min-width: 0; }
  .menu-links a { padding: .4rem .2rem; min-height: 44px; font-size: .91rem; border-radius: 5px; text-align: center; overflow-wrap: anywhere; }
  .page-shell { padding-top: 1.05rem; }
  .feature { grid-template-columns: minmax(0,1fr); border-radius: 8px; }
  .feature-art { grid-row: 1; aspect-ratio: 1.92; min-height: 0; }
  .feature-art img { object-position: 50% 54%; }
  .feature-copy { padding: 1.4rem clamp(1.1rem,5.3vw,2.2rem) 1.5rem; }
  .feature h1 { font-size: clamp(2rem,8.8vw,2.85rem); }
  .kicker { margin-bottom: .8rem; }
  .feature-teaser { margin-top: .8rem; }
  .feature-byline { margin-top: .95rem; }
  .read-button { margin-top: 1.1rem; }
  .feed-grid,.authors-grid,.rec-list { grid-template-columns: minmax(0,1fr); }
  .feed-grid { row-gap: 1.75rem; }
  .card-title { font-size: 1.52rem; }
  .shelf-heading { margin: 2rem 0 1.1rem; gap: .5rem .7rem; }
  .shelf-heading h2 { font-size: 1.9rem; }
  .rec-card { grid-template-columns: 5rem minmax(0,1fr); }
  .story-meta { gap: .4rem .8rem; }
  .story-heading { margin-bottom: 1.2rem; }
  .hero { aspect-ratio: 1.56; }
  .profile { flex-direction: row; gap: .8rem; }
  .profile-portrait { height: 3.4rem; width: 3.4rem; }
  .author-heading { flex-direction: column; gap: .7rem; }
  .ad-rail { grid-template-columns: minmax(0,1fr); }
  .creative:not(.mobile-creative) { display: none; }
  .creative img { width: 3.4rem; height: 3.1rem; }
  .floor-demo { padding-left: max(var(--edge),env(safe-area-inset-left)); }
}
@media (max-width:360px) {
  .profile { flex-direction: column; }
  .menu-links a { font-size: .86rem; }
  .shelf-heading .text-link { font-size: .87rem; }
}
@media (prefers-reduced-motion:no-preference) {
  .menu-links a,.read-button,.more { transition: background-color .15s,color .15s; }
}
