/* Articles: an editorial grid (the newest one leads) and a reading frame. Prefix: ar- */

.ar { position: relative; padding-top: 8px }
.ar-title { max-width: 16ch }
.ar-topics { margin-bottom: 24px }

.ar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 20px }
.ar-card { display: flex; flex-direction: column; gap: 12px; color: var(--sr-text); text-decoration: none; animation: qb-rise .45s var(--sr-ease) both; animation-delay: calc(min(var(--i, 0), 12) * 40ms) }
.ar-card:hover { color: var(--sr-text) }
.ar-card__cover { display: block; aspect-ratio: 16 / 10; border-radius: var(--sr-r-lg); overflow: hidden; background: var(--sr-raise); box-shadow: var(--sr-e1); transition: transform .25s var(--sr-ease), box-shadow .25s }
.ar-card:hover .ar-card__cover { transform: translateY(-2px); box-shadow: var(--sr-e2) }
.ar-card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--sr-ease) }
.ar-card:hover .ar-card__cover img { transform: scale(1.04) }
/* no cover: the topic's first letter in the logo-chip shape */
.ar-card__nocover { display: grid; place-items: center; width: 100%; height: 100%; font: 700 64px/1 var(--sr-font); color: var(--sr-accent-text); letter-spacing: -0.04em }
.ar-card__body { display: flex; flex-direction: column; gap: 6px }
.ar-card__topic { color: var(--sr-accent-text) }
.ar-card__title { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3 }
.ar-card__date { font-size: 13.5px; color: var(--sr-muted) }
/* the newest article leads: two columns wide, title larger */
.ar-card--lead { grid-column: span 2; grid-row: span 2 }
.ar-card--lead .ar-card__cover { aspect-ratio: 16 / 9 }
.ar-card--lead .ar-card__title { font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -0.025em }

.ar-locked { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 24px; align-items: start }
.ar-locked__topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
.ar-locked__topics li { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--sr-r-md); border: 1px dashed var(--sr-line-strong); font-size: 15px }
.ar-locked__topics .ar-card__nocover { width: 40px; height: 40px; flex: none; border-radius: 12px 4px 12px 12px; background: var(--sr-raise); font-size: 18px }

/* reading frame: the article file is shown inside a calm, page-coloured frame */
.ar-other__topic { display: block; margin-top: 2px; font: 500 10.5px/1.3 var(--sr-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--sr-muted) }

@media (max-width: 1024px) {
    .ar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
    .ar-locked { grid-template-columns: minmax(0, 1fr) }
}
@media (max-width: 640px) {
    .ar-grid { grid-template-columns: minmax(0, 1fr) }
    .ar-card--lead { grid-column: auto; grid-row: auto }
    .ar-locked__topics { grid-template-columns: minmax(0, 1fr) }
}
@media (prefers-reduced-motion: reduce) { .ar-card { animation: none } }
.ar-locked__card { padding: 24px; color: var(--sr-feature-ink); display: flex; flex-direction: column; align-items: flex-start; gap: 10px }
.ar-locked__card .sr-mono-label { color: var(--sr-feature-muted); padding-right: 64px }
.ar-locked__card h2 { margin: 0; padding-right: 56px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25 }
.ar-locked__card p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--sr-feature-muted) }
.ar-locked__card .sr-btn { margin-top: 6px }

/* topic identity colours (fixed per topic, never by position) */
[data-topic="HR"] { --topic: var(--sr-stage-hr) }
[data-topic="Рынок"] { --topic: var(--sr-stage-sd) }
[data-topic="Резюме"] { --topic: var(--sr-stage-final) }
[data-topic="Легенда"] { --topic: var(--sr-stage-tech) }
.ar-card__topic[data-topic] { color: var(--topic, var(--sr-accent-text)) }
.ar-topics .qb-chip__dot { background: var(--topic, var(--sr-accent)) }
.ar-locked__topics li[data-topic] .ar-card__nocover { color: var(--topic) }

/* the article's own voice on its card: a line by the author, ruled in the topic colour */
.ar-card__quote {
    display: block; margin: 2px 0 2px; padding-left: 12px; border-left: 2px solid var(--topic, var(--sr-accent));
    font-size: 14.5px; line-height: 1.5; color: var(--sr-muted); quotes: "«" "»";
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ar-card--lead .ar-card__quote { font-size: 17px; line-height: 1.55; -webkit-line-clamp: 4; color: var(--sr-read, var(--sr-muted)) }
.ar-card__quote[data-topic="HR"], .ar-read[data-topic="HR"] { --topic: var(--sr-stage-hr) }
.ar-card__quote[data-topic="Рынок"], .ar-read[data-topic="Рынок"] { --topic: var(--sr-stage-sd) }
.ar-card__quote[data-topic="Резюме"], .ar-read[data-topic="Резюме"] { --topic: var(--sr-stage-final) }
.ar-card__quote[data-topic="Легенда"], .ar-read[data-topic="Легенда"] { --topic: var(--sr-stage-tech) }

/* ---------- article page ---------- */
.ard { position: relative; padding-top: 8px }
.ard .qd-back { margin: 32px 0 0 }
/* the cover stands in the side column: its edges are the edges of «next» and the topic list below */
.ard-hero { padding-top: 24px; grid-template-columns: minmax(0, var(--sr-read-col)) var(--sr-side-col); justify-content: space-between; align-items: start }
.ard-hero--nocover { grid-template-columns: minmax(0, 1fr) }
.ard-hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; animation: qb-rise .55s var(--sr-ease) both }
.ard-topic[data-topic] .qb-chip__dot { background: var(--topic) }
.ard-title { margin: 0; max-width: 18ch }
.ard-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 15px; color: var(--sr-muted) }
.ard-meta b { color: var(--sr-text); font-weight: 600 }
.ard-cover { margin: 0; aspect-ratio: 16 / 11; border-radius: var(--sr-r-lg); overflow: hidden; background: var(--sr-raise); box-shadow: var(--sr-e2); animation: qb-rise .55s var(--sr-ease) .08s both }
.ard-cover img { width: 100%; height: 100%; object-fit: cover; display: block }

.ard-layout {
    display: grid; grid-template-columns: minmax(0, var(--sr-read-col)) var(--sr-side-col); grid-template-areas: "head side" "text side"; grid-template-rows: auto 1fr; /* the tall right column stretches the text row, not the title row */
    justify-content: space-between; column-gap: var(--sr-col-gap); align-items: start; padding-top: 32px;
}
.ard-head { grid-area: head; padding-bottom: 40px }
.ard-layout > .ar-read { grid-area: text }
/* the right column runs the full height: the cover on top, then «read next» and the lists stay in view while reading */
.ard-side { grid-area: side; align-self: stretch; display: flex; flex-direction: column; gap: 32px }
.ard-side__rest { position: sticky; top: calc(var(--sr-header-h) + 16px); display: flex; flex-direction: column; gap: 32px }

/* «what next»: the featured element of the page */
.ard-next { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; color: var(--sr-feature-ink); text-decoration: none }
.ard-next:hover { color: var(--sr-feature-ink) }
.ard-next .sr-mono-label { color: var(--sr-feature-muted); padding-right: 60px }
.ard-next__title { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; padding-right: 40px }
.ard-next__quote { font-size: 14px; line-height: 1.5; color: var(--sr-feature-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.ard-next__meta { font: 500 11.5px/1 var(--sr-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--sr-feature-muted) }
.ard-list h2 { margin: 0 0 10px }
.ard-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column }
.ard-list a { display: flex; gap: 10px; align-items: baseline; padding: 9px 8px; margin: 0 -8px; border-radius: var(--sr-r-sm); color: var(--sr-text); text-decoration: none; font-size: 15px; line-height: 1.4; transition: background-color .15s }
.ard-list a:hover { color: var(--sr-text); background: var(--sr-raise) }
.ard-list small { display: block; margin-top: 3px; font: 500 10.5px/1.3 var(--sr-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--sr-muted) }
.ard-list .qb-chip__dot { flex: none; transform: translateY(-1px); color: var(--topic, var(--sr-muted)) }
.ard-list li[data-topic="HR"] { --topic: var(--sr-stage-hr) }
.ard-list li[data-topic="Рынок"] { --topic: var(--sr-stage-sd) }
.ard-list li[data-topic="Резюме"] { --topic: var(--sr-stage-final) }
.ard-list li[data-topic="Легенда"] { --topic: var(--sr-stage-tech) }

/* the Notion export in the site's reading type */
.ar-read { --topic: var(--sr-accent) }
.ar-read h1 { margin: 1.8em 0 .6em; font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; color: var(--sr-text) }
.ar-read > h1:first-child, .ar-read > h2:first-child, .ar-read > h3:first-child { margin-top: 0 }
.ar-read h3 { margin-top: 1.6em }
.ar-read blockquote { margin: 1.2em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--topic); color: var(--sr-text); font-size: 18px }
.ar-read img { max-width: 100%; height: auto; border-radius: var(--sr-r-md) }
.ar-read img.icon { width: 1.4em; height: 1.4em; border-radius: 4px }
.ar-read figure { margin: 1.4em 0 }
.ar-read hr { border: 0; border-top: 1px solid var(--sr-line); margin: 2.2em 0 }
.ar-read del { color: var(--sr-muted) }
.ar-read mark { background: none; color: var(--sr-accent-text); font-weight: 600 }
.ar-read .indented { padding-left: 1.4em }
.ar-read .column-list { display: flex; gap: 24px }
.ar-read .column { flex: 1; min-width: 0 }
/* callouts: Notion's colours become the site's accent families */
.ar-read .callout {
    --c: var(--sr-muted); display: flex; gap: 14px; align-items: flex-start; margin: 1.4em 0; padding: 16px 18px;
    border-radius: var(--sr-r-md); background: color-mix(in srgb, var(--c) 11%, var(--sr-surface)); border: 1px solid color-mix(in srgb, var(--c) 24%, transparent);
    font-size: 16px; line-height: 1.6;
}
.ar-read .callout > div:first-child { flex: none; font-size: 20px; line-height: 1.3 }
.ar-read .callout > div:last-child { min-width: 0 }
.ar-read .callout p:last-child { margin-bottom: 0 }
.ar-read .block-color-teal_background, .ar-read .block-color-green_background { --c: var(--sr-stage-final) }
.ar-read .block-color-red_background, .ar-read .block-color-orange_background, .ar-read .block-color-pink_background { --c: var(--sr-accent) }
.ar-read .block-color-blue_background { --c: var(--sr-stage-sd) }
.ar-read .block-color-yellow_background, .ar-read .block-color-brown_background { --c: var(--sr-stage-tech) }
.ar-read .block-color-purple_background { --c: var(--sr-stage-hr) }
.ar-read .highlight-red_background, .ar-read .highlight-teal_background, .ar-read .highlight-yellow_background, .ar-read .highlight-blue_background { padding: 0 .2em; border-radius: 4px; background: var(--sr-accent-soft) }
.ar-read .highlight-teal_background { background: color-mix(in srgb, var(--sr-stage-final) 18%, transparent) }

@media (max-width: 1100px) {
    /* one column: title, cover, text, then «read next» */
    .ard-layout { grid-template-columns: minmax(0, var(--sr-read-col)); grid-template-areas: "head" "cover" "text" "rest" }
    .ard-side { display: contents }
    .ard-cover { grid-area: cover; margin-bottom: 32px; max-width: 560px }
    .ard-side__rest { grid-area: rest; position: static; margin-top: 56px }
    .ard-head { padding-bottom: 28px }
}
@media (max-width: 860px) {
    .ard .qd-back { margin-top: 20px }
    .ar-read .column-list { flex-direction: column; gap: 0 }
}
@media (prefers-reduced-motion: reduce) { .ard-hero__copy, .ard-cover { animation: none } }
/* the lead card fills its two rows: the cover grows, so its text ends on the same line as the right column's */
@media (min-width: 641px) {
    .ar-card--lead .ar-card__cover { flex: 1 1 auto; aspect-ratio: auto; min-height: 280px }
}

/* ---------- without the subscription: the real articles, locked; each opens a teaser ---------- */
.ar-locked { grid-template-columns: minmax(0, 640px) }
.ar-preview__title { margin: 40px 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em }
.ar-card__cover { position: relative }
.ar-card__lock {
    position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
    border-radius: var(--sr-r-pill); background: rgb(16 17 19 / .72); color: #F2EFE8; font-size: 13.5px; font-weight: 500;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ar-card__lock svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
/* the text continues behind the paywall: the line fades out instead of stopping */
.ard-teaser { margin: 0 0 28px; font-size: 19px; line-height: 1.6; color: var(--sr-read); -webkit-mask-image: linear-gradient(#000 45%, transparent); mask-image: linear-gradient(#000 45%, transparent) }
.ard-paywall { max-width: 640px }
/* the paywall sits inside the article's text block: reset the reading styles */
.ar-read .ard-paywall h2 { margin: 0; padding: 0 56px 0 0; border: 0; font-size: 24px; line-height: 1.25; color: var(--sr-feature-ink) }
.ar-read .ard-paywall p { margin: 0 }

/* the paywall sits inside the text block, but its buttons are buttons, not links in a text */
.ard-paywall a, .ard-paywall a:hover { text-decoration: none }
.ard-paywall .sr-bite__dot, .ard-paywall .sr-bite__dot:hover { color: var(--sr-accent-ink) }
.ard-paywall .sr-btn--primary, .ard-paywall .sr-btn--primary:hover { color: var(--sr-feature) }
