/* Visual system shared with journal_app: GitHub-style tokens, teal accent,
   light/dark theme, floating glass header, bordered rounded cards.
   Class names are kept from the previous stylesheet so templates stay untouched. */

:root,
[data-theme="light"] {
  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f6f8fa;
  --color-canvas-inset: #eff2f5;
  --color-border-default: #d0d7de;
  --color-border-muted: #d8dee4;
  --color-fg-default: #1f2328;
  --color-fg-muted: #59636e;
  --color-fg-subtle: #656d76;
  --color-accent-fg: #2a7489;
  --color-accent-emphasis: #5BA4B0;
  --color-accent-hover: #246a76;
  --color-accent-tint: rgba(91, 164, 176, .12);
  --color-btn-bg: #2a7489;
  --color-btn-hover: #246a76;
  --color-btn-fg: #ffffff;
  --color-border-control: #8c959f;
  --shadow-sm: 0 1px 2px rgba(31, 35, 40, .06);
  --shadow-md: 0 8px 24px rgba(31, 35, 40, .10);
  --logo-filter: none;
  --hero-glow: rgba(91, 164, 176, .16);
  color-scheme: light;
}

[data-theme="dark"] {
  --color-canvas-default: #000000;
  --color-canvas-subtle: #1c1c1e;
  --color-canvas-inset: #000000;
  --color-border-default: #38383a;
  --color-border-muted: #2c2c2e;
  --color-fg-default: #f5f5f7;
  --color-fg-muted: #98989f;
  --color-fg-subtle: #8e8e93;
  --color-accent-fg: #7CC5D0;
  --color-accent-emphasis: #5BA4B0;
  --color-accent-hover: #6DB5C0;
  --color-accent-tint: rgba(91, 164, 176, .16);
  --color-btn-bg: #5BA4B0;
  --color-btn-hover: #6DB5C0;
  --color-btn-fg: #04191d;
  --color-border-control: #636366;
  --shadow-sm: 0 1px 2px rgba(1, 4, 9, .4);
  --shadow-md: 0 8px 24px rgba(1, 4, 9, .55);
  --logo-filter: invert(1) hue-rotate(180deg) brightness(1.35);
  --hero-glow: rgba(91, 164, 176, .14);
  color-scheme: dark;
}

:root {
  /* aliases: templates use these names inline */
  --paper: var(--color-canvas-default);
  --paper-2: var(--color-canvas-subtle);
  --ink: var(--color-fg-default);
  --ink-soft: var(--color-fg-muted);
  --rule: var(--color-border-default);
  --rule-soft: var(--color-border-muted);
  --accent: var(--color-accent-fg);
  --navy: var(--color-fg-default);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --radius: 16px;

  /* Per-journal colour. Defaults to the site accent; any element with an
     inline --jc (a journal's cover colour) re-derives them just below. */
  --jc-text: var(--color-accent-fg);
  --jc-line: var(--color-accent-emphasis);
  --jc-border: var(--color-border-default);
  --jc-tint: var(--color-canvas-default);
}

/* text is mixed toward the foreground so it stays readable in both themes */
[style*="--jc:"] {
  --jc-text: color-mix(in srgb, var(--jc) 45%, var(--color-fg-default));
  --jc-line: var(--jc);
  --jc-border: color-mix(in srgb, var(--jc) 38%, var(--color-border-default));
  --jc-tint: color-mix(in srgb, var(--jc) 9%, var(--color-canvas-default));
}
[data-theme="dark"] [style*="--jc:"] {
  --jc-text: color-mix(in srgb, var(--jc) 58%, var(--color-fg-default));
}

* { box-sizing: border-box; }

/* room for the scrollbar is kept even while the page is locked under a card (stand.css), so the layout never jumps sideways */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--color-canvas-default);
  color: var(--color-fg-default);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--color-accent-fg); text-decoration: none; transition: color .15s ease, border-color .15s ease, background-color .15s ease; }
a:hover { color: var(--color-accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-accent-emphasis);
  outline-offset: 2px;
}

::selection { background: var(--color-accent-tint); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


/* Yandex Browser hangs a bar of its own buttons (search by picture, translate,
   Alice) over a picture the pointer rests on, right across our covers. A cover,
   and any picture inside a link, lets the pointer through to its box: the bar
   has no picture to sit on, while the link, the hover and the sheen around it
   work as before. Pictures in article texts are left alone. */
:is(a, .cover, [class*="cover"], .cart__thumb) img { pointer-events: none; -webkit-user-drag: none; }

/* dark scrollbar */
[data-theme="dark"] { scrollbar-color: var(--color-border-default) var(--color-canvas-default); }
[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--color-canvas-default); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--color-border-default); border-radius: 6px; }

.sc {
  font-size: 12px;
  font-weight: 600;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* buttons / pills */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border-default);
  background: var(--color-canvas-subtle);
  color: var(--color-fg-default);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:hover { border-color: var(--color-accent-emphasis); color: var(--color-fg-default); }
.btn-primary { background: var(--color-btn-bg); border-color: var(--color-btn-bg); color: var(--color-btn-fg); }
.btn-primary:hover { background: var(--color-btn-hover); border-color: var(--color-btn-hover); color: var(--color-btn-fg); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--color-border-default);
  background: var(--color-accent-tint);
  color: var(--color-accent-fg);
  font-size: 12px;
  font-weight: 600;
}

/* header: a quiet full-width bar; its inner edges line up with .container */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-canvas-default);
  border-bottom: 1px solid var(--color-border-muted);
}
.site-header {
  max-width: 1100px;
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px 24px;
  padding: 8px 24px;
}
.wordmark { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--color-fg-default); flex-shrink: 0; }
.wordmark:hover { color: var(--color-fg-default); }
.wordmark .mark { height: 30px; width: auto; display: block; filter: var(--logo-filter); }
.wordmark .name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.wordmark .name img { display: block; height: 24px; width: auto; filter: var(--logo-filter); }
/* On the home page's first screen the big lockup (the bat and the name) is the logo, so the
   header's own waits: it keeps its place (the header never shifts) and comes in as one piece,
   easing to a stop, once the big one has scrolled by. It goes back quickly. */
.wordmark { transition: opacity 0.4s var(--ease-out), translate 0.45s var(--ease-out); }
.wordmark.is-deferred {
  opacity: 0;
  translate: -10px 0;
  pointer-events: none;
  transition: opacity 0.2s ease, translate 0.25s ease;
}
/* arriving from the home page's first screen, where it was hidden: it comes in once, the same way */
.wordmark.is-arriving { animation: wordmark-in 0.45s var(--ease-out) 0.05s both; }
@keyframes wordmark-in {
  from { opacity: 0; translate: -10px 0; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark, .wordmark.is-deferred { transition: opacity 0.2s ease; translate: none; }
  .wordmark.is-arriving { animation: none; }
}

.primary-nav { display: flex; gap: 4px; flex-wrap: nowrap; flex-shrink: 0; margin-left: auto; }
.primary-nav .nav-link {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--color-fg-muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  text-underline-offset: 8px;
}
.primary-nav .nav-link:hover { color: var(--color-fg-default); }
.primary-nav .nav-link.active {
  color: var(--color-fg-default);
  font-weight: 600;
  text-decoration: underline 2px var(--color-accent-emphasis);
}


/* ── the header's drop-downs ("Журналы", "Для авторов") ──
   Open when pointed at after a short pause (a pointer crossing the header
   does not set them off) and close a beat after it leaves (a slip off the
   edge does not lose them); reached with the keyboard, they open too.
   The panel hangs from the item with a transparent bridge above it. */
.nav-item { position: relative; display: flex; }
.nav-drop {
  position: absolute; top: 100%; left: -10px; z-index: 50;
  padding-top: 8px;
  opacity: 0; visibility: hidden; translate: 0 -4px;
  transition: opacity 0.16s ease 0.15s, translate 0.2s var(--ease-out) 0.15s, visibility 0s linear 0.31s;
}
.has-drop--end .nav-drop { left: auto; right: -10px; }
.has-drop:hover > .nav-drop, .has-drop:focus-within > .nav-drop {
  opacity: 1; visibility: visible; translate: 0 0;
  transition: opacity 0.18s ease 0.1s, translate 0.24s var(--ease-out) 0.1s, visibility 0s linear 0.1s;
}
.has-drop.is-shut > .nav-drop { opacity: 0; visibility: hidden; transition: none; }  /* Esc */
.nav-drop__panel {
  padding: 8px; border-radius: 16px; background: var(--color-canvas-default);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), 0 24px 48px -22px rgb(6 30 38 / 0.42);
}
.nav-drop__panel--journals { width: 36rem; }
.nav-drop__journals { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-drop__journals a { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 8px; border-radius: 10px; color: var(--color-fg-default); font-size: 14px; line-height: 1.25; }
.nav-drop__journals a:hover { background: var(--color-canvas-subtle); color: var(--color-fg-default); }
.nav-drop__cover { flex: none; width: 28px; height: 38px; border-radius: 2px; overflow: hidden; background: color-mix(in srgb, var(--jc) 35%, #e8ecef); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06); }
.nav-drop__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-drop__all { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; padding: 10px 8px 4px; border-top: 1px solid var(--color-border-muted); color: var(--color-accent-fg); font-size: 14px; font-weight: 600; }
.nav-drop__all:hover { color: var(--color-accent-fg); }
.nav-drop__all span { transition: translate 0.3s var(--ease-out); }
.nav-drop__all:hover span { translate: 3px 0; }
.nav-drop__panel--authors { display: grid; gap: 2px; width: 16rem; }
.nav-drop__row { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--color-fg-default); }
.nav-drop__row:hover { background: var(--color-canvas-subtle); color: var(--color-fg-default); }
.nav-drop__row strong { font-size: 15px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .nav-drop, .has-drop:hover > .nav-drop, .has-drop:focus-within > .nav-drop { translate: none; } }

.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-default);
  border-radius: 50%;
  background: transparent;
  color: var(--color-fg-muted);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.icon-btn:hover { border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); background: var(--color-canvas-subtle); }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }

.lang-switch {
  display: flex;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
}
.lang-switch a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; color: var(--color-fg-muted); }
.lang-switch a:hover { background: var(--color-canvas-subtle); }
.lang-switch a.current { background: var(--color-accent-tint); color: var(--color-accent-fg); }

/* every nav link keeps its bold width, so the active one does not push the others */
.primary-nav .nav-link::after { content: attr(data-label); height: 0; overflow: hidden; visibility: hidden; font-weight: 600; }

/* search (inside the header): a magnifier in the cart's own shape. It opens a card under the header with the
   field and, as you type, the hits (base.html). Nothing in the header moves or hides, and the card has
   room for long article titles. */
.search-row { position: relative; flex: 0 0 44px; width: 44px; height: 44px; transition: opacity .3s ease, visibility 0s; }
/* folded away but still taking its place, so the header never shifts */
.search-row.is-deferred { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s .2s; }
.header-wrap.hero-search-visible .phone-search { opacity: 0; visibility: hidden; pointer-events: none; }
/* quiet: no frame, a thin magnifier; it only wakes up when pointed at or open */
.header-search-toggle { border-color: transparent; color: var(--color-fg-muted); }
.header-search-toggle:hover, .search-row.is-open .header-search-toggle { border-color: transparent; background: var(--color-canvas-subtle); color: var(--color-fg-default); }
.search-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: min(480px, calc(100vw - 32px));
  padding: 6px;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-muted);
  border-radius: 16px;
  box-shadow: 0 12px 32px -14px rgb(16 24 32 / 0.22);
  opacity: 0;
  visibility: hidden;
  translate: 0 -6px;
  transition: opacity .2s ease, translate .25s var(--ease-out), visibility 0s .25s;
}
.search-row.is-open .search-pop { opacity: 1; visibility: visible; translate: 0; transition: opacity .2s ease, translate .25s var(--ease-out), visibility 0s; }
.search-pop form {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--color-fg-subtle);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-pop form:focus-within { background: var(--color-canvas-subtle); }
.search-pop svg { flex-shrink: 0; }
.search-pop input { flex: 1; min-width: 0; align-self: stretch; border: 0; background: none; font: inherit; font-size: 15px; color: var(--color-fg-default); }
.search-pop input:focus { outline: none; }
.search-pop input::placeholder { color: var(--color-fg-subtle); }
/* the hits lie inside the card, not as a second floating one */
.search-pop .search-suggestions { position: static; width: auto; max-width: none; margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--color-border-muted); padding: 0; border: 0; border-radius: 0; box-shadow: none; max-height: min(52vh, 420px); animation: none; }
.search-pop .search-suggestions[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .search-pop, .search-row.is-open .search-pop { transition: none; translate: none; } }

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 50;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
  animation: suggestions-in .15s ease-out;
}
@keyframes suggestions-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.search-suggestion {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  color: var(--color-fg-default);
  font-size: 13px;
}
.search-suggestion:hover, .search-suggestion.active { background: var(--color-canvas-subtle); color: var(--color-fg-default); }
.search-suggestion .suggestion-type { color: var(--color-accent-fg); flex-shrink: 0; min-width: 52px; }
.search-suggestion .suggestion-title { flex: 1; }
.search-suggestion .suggestion-meta { color: var(--color-fg-muted); font-size: 12px; flex-shrink: 0; }

@media (max-width: 1100px) {
  .site-header { flex-wrap: wrap; }
  .search-suggestions { right: 0; left: auto; }
}
/* ── The phone's header ──
   One thin row - the bat and the name, search, cart and the menu - that
   tucks away as the page scrolls down and comes back at the first move up
   (base.html). The sections, the account, the language and the contacts are
   in the menu, a screen of the publisher's petrol. */
.phone-only { display: none; }
@media (max-width: 720px) {
  /* sliding back in eases out softly; tucking away is a touch quicker. Once
     away it is also hidden, so a phone's browser does not paint its bar in
     the header's white over the page (the white strip at the top) */
  .header-wrap {
    padding-top: env(safe-area-inset-top);
    transition: translate 0.45s cubic-bezier(0.2, 0.85, 0.25, 1), visibility 0s;
    will-change: translate;
  }
  .header-wrap.is-tucked {
    translate: 0 -100%; visibility: hidden;
    transition: translate 0.38s cubic-bezier(0.5, 0, 0.75, 0.4), visibility 0s 0.38s;
  }
  /* On the home page's first screen the big bat is the logo: the header's own
     waits until it scrolls by, and the header itself is see-through over the
     petrol band (home.css pulls the band up under it) - white icons on the
     band, not an empty white strip. Past the first screen it is white again. */
  .wordmark, .wordmark.is-deferred { transition: opacity 0.3s ease; translate: none; }
  .header-wrap { transition: translate 0.45s cubic-bezier(0.2, 0.85, 0.25, 1), visibility 0s, background-color 0.3s ease, border-color 0.3s ease; }
  .header-wrap:has(.wordmark.is-deferred) { background-color: transparent; border-bottom-color: transparent; }
  .header-wrap:has(.wordmark.is-deferred) .icon-btn { color: #fff; }
  .header-wrap:has(.wordmark.is-deferred) .header-cart__count { box-shadow: 0 0 0 2px var(--brand-deep, #234f5c); }
  /* Scrolling down from the first screen, the see-through header goes at once:
     sliding up, it would turn white half way (the big logo leaves just then)
     and flash. Coming back further down it slides in white, as anywhere. */
  .header-wrap.is-tucked:has(.wordmark.is-deferred) { transition: none; }
  .site-header { flex-wrap: nowrap; min-height: 56px; gap: 6px; padding: 6px 10px 6px 16px; }
  .primary-nav, .search-row, .header-tools .header-link, .header-tools .lang-switch { display: none !important; }
  .wordmark { flex: 1; min-width: 0; gap: 8px; }
  .wordmark .mark { height: 24px; }
  .wordmark .name { font-size: 16px; }
  .wordmark .name img { height: 20px; }
  .header-tools { margin-left: auto; gap: 4px; }
  .header-tools .icon-btn { border-color: transparent; }
  .phone-only { display: inline-flex; }
  .header-cart { order: 2; }
  .phone-search { order: 1; }
  .menu-btn { order: 3; }
}
@media (max-width: 360px) { .wordmark .name { display: none; } }

/* the menu button: two bars that turn into a cross while the menu is open */
.menu-btn__bars, .menu-btn__bars::before { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: translate 0.25s var(--ease-out, ease-out), rotate 0.25s var(--ease-out, ease-out); }
.menu-btn__bars { position: relative; translate: 0 -3px; }
.menu-btn__bars::before { content: ""; position: absolute; left: 0; top: 6px; }
.menu-btn { color: var(--color-fg-default); }

.phone-menu {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; overflow-y: auto; overscroll-behavior: contain;
  background: transparent; color: #fff;
}
.phone-menu::backdrop { background: rgb(8 22 28 / 0.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html:has(.phone-menu[open]) { overflow: hidden; }
/* the card: petrol, round, a margin of the dimmed page all round - like a journal's card on the home page */
.phone-menu__inner {
  display: flex; flex-direction: column; gap: 1.75rem;
  min-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: calc(env(safe-area-inset-top) + 10px) 10px calc(env(safe-area-inset-bottom) + 10px);
  padding: 6px 18px 26px;
  border-radius: 28px;
  background:
    radial-gradient(120% 70% at 100% 0%, var(--brand-deep-2, #2c6475), transparent 70%),
    var(--brand-deep, #234f5c);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.18), 0 34px 70px -20px rgb(0 0 0 / 0.6);
  transform-origin: calc(100% - 22px) 26px;  /* where the menu button is */
}
.phone-menu__top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.phone-menu__brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; }
.phone-menu__brand img { width: 52px; height: auto; filter: brightness(0) invert(1); }
.phone-menu__brand:hover { color: #fff; }
.phone-menu__close { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.1); color: #fff; cursor: pointer; }
.phone-menu__close span::before, .phone-menu__close span::after { content: ""; position: absolute; left: 13px; top: 21px; width: 18px; height: 2px; border-radius: 2px; background: currentColor; rotate: 45deg; }
.phone-menu__close span::after { rotate: -45deg; }
.phone-menu__search { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 999px; background: #fff; color: #4a6670; }
.phone-menu__search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--color-fg-default); outline: none; }
.phone-menu__search:focus-within { box-shadow: 0 0 0 3px var(--brand, #56a1bd); }
.phone-menu__nav { display: grid; }
.phone-menu__nav > a, .pm-group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0.7rem 0; border-bottom: 1px solid rgb(255 255 255 / 0.12);
  font-family: var(--font-display, Georgia, serif); font-size: 1.75rem; font-weight: 650; line-height: 1.15; letter-spacing: -0.01em;
  color: #fff;
}
.phone-menu__nav > a::after { content: "→"; font-family: var(--font-body, sans-serif); font-size: 1.1rem; opacity: 0.45; }
.phone-menu__nav > a[aria-current="page"], .pm-group[data-current] > summary { color: var(--on-brand-2, #cfe6ee); }
.phone-menu__nav > a[aria-current="page"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand, #56a1bd); opacity: 1; box-shadow: 0 0 0 4px rgb(86 161 189 / 0.25); }
.phone-menu__nav > a:hover { color: #fff; }
.pm-group > summary { cursor: pointer; list-style: none; }
.pm-group > summary::-webkit-details-marker { display: none; }
.pm-group > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: -5px 4px 0 0;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: 0.55;
  rotate: 45deg; transition: rotate 0.3s var(--ease-out), margin 0.3s var(--ease-out);
}
.pm-group[open] > summary::after { rotate: 225deg; margin-top: 5px; }
.pm-sub { display: grid; padding: 0.35rem 0 0.75rem; border-bottom: 1px solid rgb(255 255 255 / 0.12); }
.pm-sub a { padding: 0.45rem 0; color: var(--on-brand-2, #cfe6ee); font-size: 1rem; line-height: 1.3; }
.pm-sub a:hover { color: #fff; }
.pm-sub .pm-sub__all { color: #fff; font-weight: 600; }
.pm-group[open] > summary { border-bottom-color: transparent; }
.phone-menu__account { display: flex; flex-wrap: wrap; gap: 10px; }
.phone-menu__account a {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px;
  border-radius: 999px; background: rgb(255 255 255 / 0.1); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
  color: #fff; font-weight: 600;
}
.phone-menu__account a:hover { color: #fff; background: rgb(255 255 255 / 0.16); }
.phone-menu__count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: var(--brand, #56a1bd); color: #fff; font-size: 0.75rem; font-weight: 700; }
.phone-menu__foot { margin-top: auto; display: grid; gap: 10px; color: var(--on-brand-2, #cfe6ee); font-size: 15px; }
.phone-menu__foot a { color: var(--on-brand-2, #cfe6ee); }
.phone-menu__foot a:hover { color: #fff; }
.phone-menu__lang { display: inline-flex; justify-self: start; margin-bottom: 6px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.2); overflow: hidden; }
.phone-menu__lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; font-size: 13px; font-weight: 700; color: var(--on-brand-2, #cfe6ee); }
.phone-menu__lang a[aria-current] { background: rgb(255 255 255 / 0.16); color: #fff; }
/* Arriving, the card grows out of the menu button and eases to a stop, the
   sections follow one after another, the cross turns in. No bounce. Leaving,
   the text goes first and the card tucks back into the button. */
@media (prefers-reduced-motion: no-preference) {
  .phone-menu[open] .phone-menu__inner { animation: pm-pop 0.42s var(--ease-out); }
  .phone-menu[open]::backdrop { animation: pm-fade 0.3s ease; }
  .phone-menu[open] .phone-menu__nav > * { animation: pm-item 0.4s var(--ease-out) both; animation-delay: 120ms; }
  .phone-menu[open] .phone-menu__nav > :nth-child(2) { animation-delay: 150ms; }
  .phone-menu[open] .phone-menu__nav > :nth-child(3) { animation-delay: 180ms; }
  .phone-menu[open] .phone-menu__nav > :nth-child(4) { animation-delay: 210ms; }
  .phone-menu[open] .phone-menu__nav > :nth-child(5) { animation-delay: 240ms; }
  .phone-menu[open] .phone-menu__account a { animation: pm-spring 0.35s var(--ease-out) 0.26s both; }
  .phone-menu[open] .phone-menu__foot { animation: pm-item 0.4s var(--ease-out) 0.3s both; }
  .phone-menu[open] .phone-menu__close { animation: pm-cross 0.35s var(--ease-out) 0.16s both; }
  .phone-menu.is-closing :is(.phone-menu__nav, .phone-menu__account, .phone-menu__foot, .phone-menu__close) { animation: pm-fade 0.16s ease reverse forwards; }
  .phone-menu.is-closing .phone-menu__inner { animation: pm-tuck 0.34s cubic-bezier(0.65, 0, 0.35, 1) 0.06s forwards; }
  .phone-menu.is-closing::backdrop { animation: pm-fade 0.34s ease reverse forwards; }
}
@keyframes pm-pop { from { scale: 0.18; opacity: 0; border-radius: 60px; } 35% { opacity: 1; } }
@keyframes pm-tuck { to { scale: 0.18; opacity: 0; border-radius: 60px; } }
@keyframes pm-fade { from { opacity: 0; } }
@keyframes pm-item { from { opacity: 0; translate: 26px 0; } }
@keyframes pm-spring { from { opacity: 0; scale: 0.92; } }
@keyframes pm-cross { from { opacity: 0; scale: 0.8; rotate: -45deg; } }

/* breadcrumb */
.breadcrumb { font-size: 13px; color: var(--color-fg-muted); }
.breadcrumb .container { padding-top: 24px; display: flex; flex-wrap: wrap; align-items: center; padding-bottom: 0; }
.breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center; color: var(--color-fg-muted); }
.breadcrumb a:hover { color: var(--color-accent-fg); }
.breadcrumb .sep {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 4px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  font-size: 0;
  background: no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238d96a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3l5 5-5 5'/%3E%3C/svg%3E");
}
.breadcrumb .current { color: var(--color-fg-default); }

/* footer */
.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--color-border-muted);
  background: var(--color-canvas-subtle);
}
.site-footer .container {
  padding-top: 36px;
  padding-bottom: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-fg-muted);
}
.site-footer .footer-mark { height: 38px; width: auto; filter: var(--logo-filter); opacity: .85; }
.site-footer .contacts { display: flex; gap: 0 24px; flex-wrap: wrap; justify-content: center; align-items: center; }
.site-footer .links { display: flex; gap: 0 24px; flex-wrap: wrap; justify-content: center; align-items: center; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-fg-muted); }
.site-footer a:hover { color: var(--color-accent-fg); }
.site-footer .copy { color: var(--color-fg-subtle); font-size: 13px; }


/* section heading */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--color-border-muted);
  padding-bottom: 12px;
  margin: 28px 0 20px;
}
.section-head h2 { font-size: 20px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

/* book list */
.book-list { display: grid; gap: 12px; margin-bottom: 56px; }
.book-row {
  display: flex;
  gap: 20px;
  padding: 16px;
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  transition: border-color .15s ease;
}
.book-row:hover { border-color: var(--color-accent-emphasis); }
.book-row .cover-thumb {
  width: 100px;
  aspect-ratio: 3 / 4.4;
  background-size: cover;
  background-position: center;
  background-color: var(--color-canvas-subtle);
  flex-shrink: 0;
  border: 1px solid var(--color-border-muted);
  border-radius: 4px;
  transition: transform .3s ease, box-shadow .3s ease;
}
.book-row:hover .cover-thumb { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.book-row .cover-thumb.placeholder {
  background-color: var(--color-btn-bg);
  color: var(--color-btn-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.25;
  padding: 8px;
  font-weight: 600;
}
.book-row .content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.book-row .title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.book-row .title a { color: var(--color-fg-default); }
.book-row .title a:hover { color: var(--color-accent-fg); }
.book-row .authors { font-size: 13px; color: var(--color-fg-muted); }
.book-row .excerpt { font-size: 13px; line-height: 1.5; color: var(--color-fg-muted); }
.book-row .price { font-size: 15px; font-weight: 700; margin-top: auto; padding-top: 4px; }

/* the dedicated "Книги" page: a bigger cover and more breathing room than
   the compact "Новинки" teaser on the home page */
.book-list.large { gap: 20px; }
.book-row.large { gap: 28px; padding: 24px; }
.book-row.large .cover-thumb { width: 160px; }
.book-row.large .title { font-size: 20px; }
.book-row.large .excerpt { font-size: 15px; line-height: 1.5; }
.book-row.large .year { font-size: 13px; color: var(--color-fg-subtle); margin-top: 2px; }
.book-row.large .price { font-size: 17px; }
@media (max-width: 640px) {
  .book-row.large { flex-direction: column; }
  .book-row.large .cover-thumb { width: 128px; }
}

/* latest publications (home): each item carries its journal's colour */
.latest-list {
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
}
@media (max-width: 800px) { .latest-list { grid-template-columns: 1fr; } }
.latest-list li { padding-left: 16px; border-left: 3px solid var(--jc-line); }
.latest-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.38;
  font-weight: 700;
  color: var(--color-fg-default);
}
.latest-title:hover { color: var(--jc-text); }
.latest-meta { margin-top: 8px; font-size: 13px; color: var(--color-fg-muted); }
.latest-meta a { color: var(--jc-text); font-weight: 600; }

/* journals strip (home) */
.journals-strip {
  background: var(--color-canvas-subtle);
  border-top: 1px solid var(--color-border-muted);
  padding: 44px 0;
  margin-bottom: 0;
}
.journals-strip .eyebrow { color: var(--color-fg-muted); margin-bottom: 16px; }
.journals-strip .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 800px) { .journals-strip .grid { grid-template-columns: 1fr; } }
.journals-strip a {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-fg-default);
  background: var(--color-canvas-default);
  border: 1px solid var(--color-border-default);
  border-left: 4px solid var(--jc-line);
  border-radius: var(--radius);
}
.journals-strip a:hover { background: var(--jc-tint); border-color: var(--jc-border); border-left-color: var(--jc-line); color: var(--jc-text); }

/* journal masthead */
.journal-head {
  margin-top: 28px;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--color-border-muted);
  display: flex;
  gap: 40px;
}
.journal-head-cover {
  width: 150px;
  align-self: flex-start;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid var(--color-border-default);
  border-radius: 4px;
  box-shadow:
    0 20px 32px -14px color-mix(in srgb, var(--jc-line) 65%, transparent),
    0 2px 6px rgba(0, 0, 0, .15);
}
.journal-head-body { flex: 1; min-width: 0; }
.journal-head .eyebrow { color: var(--jc-text); margin-bottom: 12px; }
.journal-head .eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--jc-line);
}
.journal-head h1 { font-size: clamp(28px, 4vw, 34px); font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; text-wrap: balance; }
.journal-head .subtitle { font-size: 17px; color: var(--color-fg-muted); margin: 0 0 24px; }
@media (max-width: 640px) { .journal-head { flex-direction: column; } .journal-head-cover { width: 110px; } }
/* facts are a plain colophon: a coloured rule over each, no boxes */
.journal-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 28px;
  padding-top: 8px;
}
@media (max-width: 800px) { .journal-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.journal-facts > div { padding-top: 12px; border-top: 2px solid var(--jc-line); }
.journal-facts .label { color: var(--color-fg-muted); margin-bottom: 4px; }
.journal-facts .value { font-size: 15px; font-weight: 500; }
.badge-row { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  color: var(--color-fg-default);
  background: var(--color-canvas-default);
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}
.badge.badge-accent { background: var(--color-accent-tint); border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); }

/* tabs */
.subpage-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border-muted); flex-wrap: wrap; margin-top: 8px; }
.subpage-tabs a {
  padding: 12px 16px;
  color: var(--color-fg-muted);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.subpage-tabs a:hover { color: var(--color-fg-default); border-bottom-color: var(--color-border-default); }
.subpage-tabs a.active { color: var(--color-fg-default); border-bottom-color: var(--jc-line); }

/* archive */
.archive-year { display: flex; align-items: baseline; gap: 16px; margin: 32px 0 16px; }
.archive-year .year { font-size: 20px; font-weight: 700; }
.archive-year .rule { flex: 1; height: 1px; background: var(--color-border-muted); }
.issue-grid { display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: 12px; margin-bottom: 8px; }
.issue-tile {
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: 12px 0;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-fg-default);
  background: var(--color-canvas-default);
}
.issue-tile:hover { border-color: var(--jc-line); color: var(--jc-text); background: var(--jc-tint); }
.issue-tile.current { border: 1px solid var(--jc-line); background: var(--jc-tint); color: var(--jc-text); font-weight: 700; }

/* rubrics / specialties */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  padding: 32px 0 56px;
  margin-top: 8px;
}
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }
.two-col h3 { font-size: 17px; font-weight: 700; margin: 0 0 16px; }
.two-col ol, .two-col .list {
  font-size: 15px;
  line-height: 1.5;
  color: var(--color-fg-muted);
  margin: 0;
  padding-left: 20px;
}

/* issue detail */
.issue-head {
  margin-top: 28px;
  padding: 4px 0 4px 16px;
  border-left: 4px solid var(--jc-line);
}
.issue-head .eyebrow { margin-bottom: 8px; }
.issue-head .eyebrow a { display: inline-flex; align-items: center; min-height: 44px; color: var(--jc-text); }
.issue-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 0; }

/* an issue's contents is a table of contents, not a card stack */
.article-list { padding: 24px 0 56px; }
.article-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-muted);
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.article-row:first-child { border-top: 1px solid var(--color-border-muted); }
.article-row .title { font-size: 17px; line-height: 1.4; font-weight: 600; }
.article-row .title a { color: var(--color-fg-default); }
.article-row .title a:hover { color: var(--jc-text); }
.article-row .meta { font-size: 13px; color: var(--color-fg-muted); margin-top: 4px; }
.article-row .pages { font-size: 13px; color: var(--color-fg-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* article detail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 32px 0 64px;
}
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; gap: 32px; } }
.article-context { color: var(--jc-text); margin-bottom: 16px; }
.article-context::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--jc-line);
}
.article-title { font-size: clamp(22px, 3.4vw, 28px); line-height: 1.28; font-weight: 700; letter-spacing: -.02em; margin: 0 0 20px; text-wrap: balance; }
.article-meta-row {
  display: flex;
  gap: 8px 28px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-fg-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-muted);
  margin-bottom: 24px;
}
.article-authors { font-size: 15px; line-height: 1.5; margin-bottom: 8px; font-weight: 500; }
.article-affiliations { font-size: 13px; line-height: 1.5; color: var(--color-fg-muted); margin-bottom: 32px; }
.article-body h2.sc { color: var(--color-fg-default); margin: 0 0 16px; }
.article-abstract { font-size: 17px; line-height: 1.5; }
.article-abstract p { margin: 0 0 16px; }
.article-abstract p:last-child { margin-bottom: 0; }
.article-abstract em { font-style: italic; }
.article-keywords { margin: 28px 0; font-size: 13px; color: var(--color-fg-muted); }
.article-keywords .label { color: var(--color-fg-muted); margin-right: 12px; }
.article-pages { font-size: 13px; color: var(--color-fg-muted); margin-bottom: 32px; }
.citation-block {
  background: var(--color-canvas-subtle);
  border: 1px solid var(--color-border-muted);
  border-left: 3px solid var(--jc-line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 36px;
}
.citation-block .label { color: var(--jc-text); margin-bottom: 8px; }
.citation-block .text {
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--sans);
}
.citation-block .text.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}
.citation-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.citation-tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--color-fg-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.citation-tab:hover { color: var(--color-fg-default); }
.citation-tab.active { background: var(--color-canvas-default); border-color: var(--jc-border); color: var(--jc-text); }
.citation-copy {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--color-border-default);
  border-radius: 999px;
  background: var(--color-canvas-default);
  color: var(--color-fg-default);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.citation-copy:hover { border-color: var(--jc-line); color: var(--jc-text); }
.reference-list { font-size: 13px; line-height: 1.5; color: var(--color-fg-muted); margin: 0 0 36px; }
.reference-list ol { margin: 0; padding-left: 20px; }
.reference-list li { margin-bottom: 12px; }
.reference-list li:last-child { margin-bottom: 0; }
.article-dates {
  display: flex;
  gap: 8px 40px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-muted);
  font-size: 13px;
  color: var(--color-fg-muted);
}
.article-dates .label { color: var(--color-fg-muted); }

.book-detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: center;
  display: block;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.buy-box {
  background: var(--color-canvas-subtle);
  border: 1px solid var(--color-border-default);
  border-radius: 16px;
  padding: 24px;
  position: sticky;
  top: 84px;
}
.buy-box .label { color: var(--color-fg-muted); margin-bottom: 12px; }
.buy-box .price { font-size: 26px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.01em; }
.buy-box button, .buy-box .buy-cta {
  display: block;
  width: 100%;
  background: var(--color-btn-bg);
  color: var(--color-btn-fg);
  text-align: center;
  padding: 12px 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--color-btn-bg);
  cursor: pointer;
  margin-bottom: 12px;
  transition: background-color .15s ease, transform .1s ease;
}
.buy-box button:hover, .buy-box .buy-cta:hover { background: var(--color-btn-hover); border-color: var(--color-btn-hover); color: var(--color-btn-fg); }
.buy-box .buy-note { text-align: center; font-size: 13px; color: var(--color-fg-muted); }
.buy-box .related { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--color-border-muted); }
.buy-box .related a {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-fg-default);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-muted);
}
.buy-box .related a:hover { color: var(--color-accent-fg); }
.buy-box .related a:last-child { border-bottom: none; }

/* static / prose pages */
.prose { padding: 40px 0 64px; max-width: 760px; }
.prose h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 24px; }
.prose p { font-size: 15px; line-height: 1.5; color: var(--color-fg-muted); }
.prose p strong { color: var(--color-fg-default); }

/* news: a date column beside the text, like a press-release log, rather
   than another bordered card */
.news-list { padding: 24px 0 64px; }
.news-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--color-border-muted);
}
.news-item:last-child { padding-bottom: 0; }
.news-item .date {
  font-size: 13px;
  color: var(--color-fg-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.news-item h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.news-item p { font-size: 15px; line-height: 1.5; color: var(--color-fg-muted); margin: 0; }
@media (max-width: 560px) {
  .news-item { grid-template-columns: 1fr; gap: 8px; }
}

/* «Все книги →» и подобные ссылки в заголовке раздела — зона нажатия 44pt */
.section-head a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- content parity: book catalogue, journal long-form pages ---- */

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--color-border-default);
  background: var(--color-canvas-default);
  color: var(--color-fg-default); font-size: 13px; font-weight: 500;
}
.chip:hover { border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); }
.chip.active { background: var(--color-accent-tint); border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); }
.chip-count { color: var(--color-fg-subtle); font-size: 12px; font-variant-numeric: tabular-nums; }

.catalog-filter { display: block; margin: 0 0 28px; }
.catalog-filter .sc { display: block; color: var(--color-fg-muted); margin-bottom: 6px; }
.catalog-filter input {
  width: 100%; max-width: 420px; height: 38px; padding: 0 12px;
  border: 1px solid var(--color-border-default); border-radius: 8px;
  background: var(--color-canvas-default); color: var(--color-fg-default); font: inherit;
}
.catalog-filter input:focus { outline: none; border-color: var(--color-accent-emphasis); box-shadow: 0 0 0 3px var(--color-accent-tint); }
.catalog-section { margin-bottom: 40px; }
.catalog-section h3 { font-size: 18px; margin: 0 0 12px; }
.catalog-section h3 a { color: var(--color-fg-default); }
.catalog-section h3 a:hover { color: var(--color-accent-fg); }
.catalog-empty { color: var(--color-fg-muted); padding: 24px 0 48px; }

.table-scroll { overflow-x: auto; border: 1px solid var(--color-border-default); border-radius: var(--radius); }
.book-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.book-table th {
  text-align: left; padding: 10px 12px; white-space: nowrap;
  background: var(--color-canvas-subtle); color: var(--color-fg-muted);
  font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--color-border-default);
}
.book-table td { padding: 10px 12px; border-top: 1px solid var(--color-border-muted); vertical-align: top; }
.book-table tbody tr:first-child td { border-top: none; }
.book-table tbody tr:hover { background: var(--color-canvas-subtle); }
.book-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.book-table .isbn { white-space: nowrap; color: var(--color-fg-muted); font-variant-numeric: tabular-nums; }
.book-table .authors { color: var(--color-fg-muted); min-width: 150px; }
.book-table .title { min-width: 220px; font-weight: 600; }
.book-table .title a { color: var(--color-fg-default); }
.book-table .title a:hover { color: var(--color-accent-fg); }

.spec-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px 24px; margin: 0 0 32px; padding: 18px 0;
  border-top: 1px solid var(--color-border-muted); border-bottom: 1px solid var(--color-border-muted);
}
.spec-list dt { font-size: 12.5px; color: var(--color-fg-muted); font-weight: 600; margin-bottom: 2px; }
.spec-list dd { margin: 0; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.book-contents { font-size: 14.5px; }

/* journal pages */
.journal-section { padding-top: 24px; scroll-margin-top: 90px; }
.journal-section > h3 { font-size: 20px; margin: 0 0 10px; border-bottom: 1px solid var(--color-border-muted); padding-bottom: 8px; }

/* trusted legacy HTML (journal sections, static pages) */
.prose-body { font-size: 15px; line-height: 1.7; color: var(--color-fg-default); overflow-wrap: anywhere; }
.prose-body p { margin: 0 0 12px; }
.prose-body ul, .prose-body ol { padding-left: 22px; margin: 0 0 14px; }
.prose-body li { margin-bottom: 4px; }
.prose-body h1, .prose-body h2, .prose-body h3, .prose-body h4 { margin: 24px 0 10px; line-height: 1.3; }
.prose-body table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; margin: 0 0 16px; }
.prose-body td, .prose-body th { border: 1px solid var(--color-border-default); padding: 6px 10px; vertical-align: top; }
.prose-body img { max-width: 100%; height: auto; }
.prose-body a { text-decoration: underline; text-decoration-color: var(--color-border-default); text-underline-offset: 2px; }
.subscribe-price { margin: 0 0 20px; }
.subscribe-price strong { font-size: 24px; margin-left: 6px; }
.site-footer .contacts a { color: var(--color-fg-muted); }

.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 56px; }
.pager a {
  min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border-default); border-radius: 8px; color: var(--color-fg-default);
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); }
.pager a.active { background: var(--color-accent-tint); border-color: var(--color-accent-emphasis); color: var(--color-accent-fg); font-weight: 700; }

/* ---- book shelves and grid (covers first) ---- */
.chip-row--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin: 0; scrollbar-width: thin; }
.chip-row--scroll .chip { flex: none; white-space: nowrap; }


.header-link { padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--color-fg-muted); white-space: nowrap; }
.header-link:hover { background: var(--color-canvas-subtle); color: var(--color-fg-default); }

/* ---- journal page: accordions, quick links, sidebar ---- */


.acc { border-bottom: 1px solid var(--color-border-muted); scroll-margin-top: 90px; }
.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 2px; font-size: 16px; font-weight: 600; font-family: var(--serif);
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--color-fg-muted); border-bottom: 2px solid var(--color-fg-muted);
  transform: rotate(45deg); transition: transform .2s ease;
}
.acc[open] > summary::after { transform: rotate(-135deg); }
.acc > summary:hover { color: var(--jc-text); }
.acc-body { padding: 0 2px 22px; }


/* keep the floating header on one row down to tablet width */
@media (max-width: 1100px) and (min-width: 721px) {
  .site-header { gap: 8px 12px; flex-wrap: nowrap; }
  .wordmark .name { display: none; }
  .primary-nav .nav-link { padding: 6px 9px; }
  .search-row { order: 0; }
  .search-suggestions { right: 0; left: auto; width: 360px; }
  .header-tools { gap: 6px; }
}

/* ---- delight ---- */

/* smooth cross-fade between pages (Chromium/Safari); the header stays put */
@supports (view-transition-name: none) {
  @view-transition { navigation: auto; }
  .header-wrap { view-transition-name: site-header; }
  main { animation: none; }
  ::view-transition-group(root) { animation-duration: .26s; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

.article-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 36px 0 0; padding-top: 22px; border-top: 1px solid var(--color-border-muted); }
.article-pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--color-fg-default);
  border: 1px solid var(--color-border-default); border-radius: var(--radius); transition: border-color .15s ease;
}
.article-pager a:hover { border-color: var(--jc-line); }
.article-pager span { font-size: 13px; color: var(--jc-text); font-weight: 700; }
.article-pager strong { font-family: var(--serif); font-size: 14.5px; line-height: 1.35; }
.article-pager__next { text-align: right; grid-column: 2; }
@media (max-width: 640px) { .article-pager { grid-template-columns: 1fr; } .article-pager__next { grid-column: 1; text-align: left; } }

@media print {
  .header-wrap, .site-footer, .breadcrumb, .buy-box, .citation-tabs, .article-pager { display: none !important; }
  body { background: #fff; color: #000; }
  .article-layout { display: block; padding: 0; }
  main { animation: none; }
  a { color: #000; text-decoration: none; }
  .article-abstract, .prose-body { font-size: 11pt; line-height: 1.5; }
  .citation-block { border: 1px solid #999; background: none; }
  details.acc > :not(summary) { display: block; }
}

/* issue rubrics */
.rubric-title {
  margin: 34px 0 0; padding: 0 0 8px 12px; font-size: 13px;
  color: var(--jc-text); font-weight: 700; line-height: 1.4; border-left: 3px solid var(--jc-line);
}
.article-list > .rubric-title:first-child { margin-top: 0; }
.rubric-title + .article-row { border-top: 1px solid var(--color-border-muted); }

/* ---- search page, authors, keywords, related ---- */
.search-filters { display: grid; gap: 14px; margin: 0 0 28px; padding: 16px; border: 1px solid var(--color-border-default); border-radius: 12px; background: var(--color-canvas-subtle); }
.search-filters__main { display: flex; gap: 10px; }
.search-filters input[type="search"], .search-filters select, .search-filters input[type="number"] {
  height: 38px; padding: 0 12px; border: 1px solid var(--color-border-default); border-radius: 8px;
  background: var(--color-canvas-default); color: var(--color-fg-default); font: inherit; font-size: 14px; min-width: 0;
}
.search-filters input[type="search"] { flex: 1; }
.search-filters input:focus, .search-filters select:focus { outline: none; border-color: var(--color-accent-emphasis); box-shadow: 0 0 0 3px var(--color-accent-tint); }
.search-filters__row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.search-filters__row label { display: grid; gap: 4px; }
.search-filters__row .sc { color: var(--color-fg-muted); }
.search-filters__years input { width: 82px; }
.search-filters__reset { margin-left: auto; font-size: 13px; font-weight: 600; padding-bottom: 10px; color: var(--color-fg-muted); }
.search-heading { color: var(--color-fg-muted); margin: 0 0 8px; }
.search-section { margin-bottom: 20px; }
.author-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.author-list li { padding: 8px 0; border-bottom: 1px solid var(--color-border-muted); display: flex; justify-content: space-between; gap: 12px; }
.author-list a { font-weight: 600; color: var(--color-fg-default); }
.author-list a:hover { color: var(--color-accent-fg); }
.author-list span { color: var(--color-fg-subtle); font-size: 12.5px; white-space: nowrap; }
.pager__gap { align-self: center; color: var(--color-fg-subtle); padding: 0 4px; }

.author-link { color: inherit; border-bottom: 1px solid transparent; }
.author-link:hover { color: var(--jc-text); border-bottom-color: var(--jc-line); }
.article-row .meta .author-link { color: inherit; }
.author-alt { margin: 4px 0 0; color: var(--color-fg-muted); font-size: 15px; }
.author-facts { margin: 8px 0 14px; color: var(--color-fg-muted); font-size: 14px; }

.keyword {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border: 1px solid var(--color-border-default);
  border-radius: 999px; font-size: 12.5px; color: var(--color-fg-muted); background: var(--color-canvas-default);
}
.keyword:hover { border-color: var(--jc-line); color: var(--jc-text); }
.article-keywords .label { display: block; margin-bottom: 8px; }

.related-list { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 12px; }
.related-list li { padding-left: 14px; border-left: 3px solid var(--jc-line); }
.related-list a { display: block; font-family: var(--serif); font-weight: 700; font-size: 15px; line-height: 1.35; color: var(--color-fg-default); }
.related-list a:hover { color: var(--jc-text); }
.related-list span { font-size: 12.5px; color: var(--color-fg-muted); }
@media (max-width: 640px) { .search-filters__main { flex-direction: column; } .search-filters__reset { margin-left: 0; } }

/* ── the account in the header: an initial in a circle, and the cart's count ── */
.header-me { display: inline-flex; align-items: center; gap: 0.5rem; }
.header-me__dot { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand-tile, #2f7893); color: #fff; font-size: 0.8125rem; font-weight: 700; }
.header-cart { position: relative; }
.header-cart__count { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.25rem; border-radius: 999px; background: var(--brand-tile, #2f7893); color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px #fff; }
@media (max-width: 480px) { .header-me__name { display: none; } }

/* ── notes after an action (in the cart, order placed...) ── */
.toasts { position: fixed; z-index: 60; top: calc(var(--header-h, 4.5rem) + 0.75rem); left: 50%; translate: -50% 0; display: grid; gap: 0.5rem; width: min(30rem, calc(100% - 2rem)); pointer-events: none; }
.toast { margin: 0; padding: 0.85rem 1.2rem; border-radius: 16px; background: #0f2a33; color: #fff; font-weight: 600; text-align: center; box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.55); animation: toast-in 0.3s var(--ease-out) both; transition: opacity 0.5s ease, translate 0.5s ease; }
.toast.is-gone { opacity: 0; translate: 0 -8px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ── The dock ──
   On a phone the price and the one action of a page (publish in a journal,
   buy an article or a book) float at the thumb while the page's own button
   or card is off screen; it slides away when they come into view (base.html).
   In the colour of the journal or the cover when the page has one. */
.dock { display: none; }
@media (max-width: 720px) {
  .dock {
    position: fixed; z-index: 35; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 64px; padding: 8px 8px 8px 18px; border-radius: 22px;
    background: color-mix(in srgb, var(--jc, var(--brand-deep, #234f5c)) 55%, #12262d);
    color: #fff;
    box-shadow: 0 18px 40px -16px rgb(6 24 30 / 0.65), inset 0 1px 0 rgb(255 255 255 / 0.12);
    translate: 0 calc(100% + 24px + env(safe-area-inset-bottom));
    transition: translate 0.38s var(--ease-out, ease-out);
  }
  .dock.is-shown { translate: 0 0; }
  body:has(.dock) .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  html:has(.phone-menu[open]) .dock { translate: 0 calc(100% + 24px + env(safe-area-inset-bottom)); }
}
.dock__text { display: grid; gap: 1px; min-width: 0; }
.dock__label { font-size: 12px; line-height: 1.2; color: rgb(255 255 255 / 0.72); }
.dock__price { font-family: var(--font-display, Georgia, serif); font-size: 1.25rem; font-weight: 650; line-height: 1.15; white-space: nowrap; }
.dock__title { font-size: 0.9375rem; font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock form { margin: 0; flex: none; }
.dock__btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 48px; padding: 0 18px;
  border: 0; border-radius: 999px; background: #fff; color: #0f2a32;
  font: inherit; font-size: 15px; font-weight: 700; white-space: nowrap; cursor: pointer;
}
.dock__btn:hover { color: #0f2a32; }
.dock__btn svg { width: 16px; height: 16px; }
.dock__note { font-weight: 600; color: rgb(255 255 255 / 0.8); padding-right: 10px; }

/* the iPhone's home bar does not sit on the footer's last line */
.site-footer { padding-bottom: env(safe-area-inset-bottom); }

/* ── The phone's search ──
   Its own sheet, not the menu: a bar slides down from the top with the field
   ready and the keyboard up, the suggestions come under it as one types;
   "Отмена" or a tap below puts it away (base.html). */
.phone-find {
  position: fixed; inset: 0 0 auto; width: 100%; max-width: none; max-height: 100dvh;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: visible;
}
.phone-find::backdrop { background: rgb(10 26 32 / 0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.phone-find__sheet {
  padding: calc(env(safe-area-inset-top) + 10px) 12px 12px;
  background: #fff; border-radius: 0 0 22px 22px;
  box-shadow: 0 24px 50px -24px rgb(6 24 30 / 0.55);
}
.phone-find__bar { display: flex; align-items: center; gap: 8px; }
.phone-find__field { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 999px; background: var(--color-canvas-subtle, #f1f5f7); color: #4a6670; }
.phone-find__field:focus-within { box-shadow: 0 0 0 2px var(--brand, #56a1bd); background: #fff; }
.phone-find__field input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--color-fg-default); outline: none; }
.phone-find__cancel { flex: none; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--color-accent-fg, #2a7489); font: inherit; font-weight: 600; cursor: pointer; }
.phone-find__hint { margin: 10px 8px 2px; font-size: 13px; color: var(--color-fg-muted); }
.phone-find__results { display: grid; margin-top: 8px; max-height: calc(100dvh - 140px); overflow-y: auto; }
.phone-find__results a { display: grid; gap: 2px; padding: 11px 8px; border-top: 1px solid var(--color-border-muted); color: var(--color-fg-default); }
.phone-find__results a:first-child { border-top: 0; }
.phone-find__results .t { font-size: 12px; font-weight: 700; color: var(--color-accent-fg); }
.phone-find__results .n { font-weight: 600; line-height: 1.3; }
.phone-find__results .m { font-size: 13px; color: var(--color-fg-muted); }
html:has(.phone-find[open]) { overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .phone-find[open] .phone-find__sheet { animation: phone-find-in 0.42s cubic-bezier(0.2, 0.85, 0.25, 1); }
  .phone-find[open]::backdrop { animation: phone-find-fade 0.3s ease; }
  .phone-find.is-closing .phone-find__sheet { animation: phone-find-out 0.26s cubic-bezier(0.5, 0, 0.75, 0.4) forwards; }
  .phone-find.is-closing::backdrop { animation: phone-find-fade 0.26s ease reverse forwards; }
}
@keyframes phone-find-in { from { translate: 0 -100%; } }
@keyframes phone-find-out { to { translate: 0 -100%; } }
@keyframes phone-find-fade { from { opacity: 0; } }
