/*
 * Страница списка рассказов «Костёр Митича».
 * Файл подключается после styles.css и custom.css.
 * Один список рассказов используется и на desktop, и на mobile.
 */

.koster-page {
	padding: 0 clamp(22px, 4vw, 56px) 38px;
}

/* Hero */
.koster-hero {
	min-height: 270px;
}

.koster-hero .hero__img {
	object-position: center 48%;
	filter: saturate(.82) contrast(1.08) brightness(.72);
}

.koster-hero::before {
	background:
			linear-gradient(90deg, rgba(11, 17, 16, .93) 0%, rgba(11, 17, 16, .72) 39%, rgba(11, 17, 16, .28) 73%, rgba(11, 17, 16, .18) 100%),
			linear-gradient(180deg, rgba(11, 17, 16, .08), rgba(11, 17, 16, .42));
}

.koster-hero .hero__content {
	max-width: 650px;
	padding: 34px clamp(22px, 4vw, 56px) 36px;
}

.koster-hero h1 {
	color: #ead7bc;
	font-size: clamp(48px, 5vw, 66px);
	line-height: .95;
}

.koster-hero .hero__lead {
	max-width: 560px;
	margin-top: 14px;
	font-size: 17px;
	line-height: 1.5;
	color: rgba(247, 242, 232, .96);
}

.koster-hero__description {
	max-width: 430px;
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.55;
	color: rgba(247, 242, 232, .77);
}

/* Filters */
.koster-filters {
	margin: 0 0 10px;
	padding-top: 14px;
}

.koster-filters__list {
	display: flex;
	align-items: center;
	gap: 11px;
	margin: 0;
	padding: 0 0 2px;
	list-style: none;
}

.koster-filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 17px;
	border: 1px solid rgba(16, 35, 29, .14);
	border-radius: 6px;
	background: rgba(251, 247, 239, .54);
	color: var(--soft-charcoal);
	font-size: 12px;
	line-height: 1;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.koster-filter:hover {
	color: var(--road-clay);
	border-color: rgba(182, 106, 60, .34);
	background: rgba(255, 253, 248, .86);
	transform: translateY(-1px);
}

.koster-filter.is-active,
.koster-filter[aria-current="page"] {
	color: #fff;
	border-color: var(--road-clay);
	background: var(--road-clay);
}

.koster-filter:focus-visible,
.koster-story-row__button:focus-visible,
.koster-preview__link:focus-visible,
.koster-story-panel__link:focus-visible,
.koster-pagination a:focus-visible {
	outline: 3px solid rgba(182, 106, 60, .28);
	outline-offset: 3px;
}

.koster-hint {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 18px;
	color: var(--muted-text);
	font-size: 12px;
	line-height: 1.45;
}

.koster-hint > .raw-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--road-clay);
	font-size: 16px;
	line-height: 1;
}

/* Archive: one DOM for desktop and mobile */
.koster-archive__layout {
	display: grid;
	grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
	gap: clamp(48px, 4.6vw, 64px);
	align-items: start;
}

.koster-preview {
	position: sticky;
	top: 96px;
	min-width: 0;
	transition: opacity .16s ease;
}

.koster-preview.is-updating {
	opacity: .28;
}


.koster-preview__content[hidden],
.koster-preview__placeholder[hidden] {
	display: none;
}

.koster-preview__placeholder-image {
	width: 100%;
	aspect-ratio: 16 / 10;
	background:
			linear-gradient(110deg, rgba(16, 35, 29, .055) 8%, rgba(255, 253, 248, .72) 18%, rgba(16, 35, 29, .055) 33%);
	background-size: 220% 100%;
	animation: koster-preview-placeholder 1.6s linear infinite;
}

.koster-preview__placeholder-body {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 18px;
	padding-top: 17px;
}

.koster-preview__placeholder-number {
	width: 52px;
	height: 46px;
	background: rgba(182, 106, 60, .12);
}

.koster-preview__placeholder-copy {
	display: grid;
	gap: 10px;
	padding-top: 2px;
}

.koster-preview__placeholder-line {
	display: block;
	height: 10px;
	background: rgba(16, 35, 29, .09);
}

.koster-preview__placeholder-line--tag {
	width: 34%;
	height: 8px;
}

.koster-preview__placeholder-line--title {
	width: 92%;
	height: 22px;
}

.koster-preview__placeholder-line--title-short {
	width: 68%;
	height: 22px;
}

.koster-preview__placeholder-line--text {
	width: 100%;
	margin-top: 5px;
}

.koster-preview__placeholder-line--text-short {
	width: 76%;
}

@keyframes koster-preview-placeholder {
	to {
		background-position-x: -220%;
	}
}

.koster-preview__image {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	object-position: center;
}

.koster-preview__body {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 18px;
	padding-top: 17px;
}

.koster-preview__number {
	color: var(--road-clay);
	font-family: var(--font-heading);
	font-size: 62px;
	line-height: .78;
	font-weight: 500;
	letter-spacing: -.04em;
}

.koster-preview__copy {
	min-width: 0;
}

.koster-preview__tag,
.koster-story-row__tag {
	display: block;
	margin: 0 0 4px;
	color: var(--road-clay);
	font-size: 10px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.koster-preview__title {
	margin: 0;
	color: var(--charcoal);
	font-family: var(--font-heading);
	font-size: clamp(29px, 2.4vw, 37px);
	line-height: 1.02;
	font-weight: 600;
	letter-spacing: -.025em;
}

.koster-preview__teaser {
	margin: 15px 0 0;
	color: var(--soft-charcoal);
	font-size: 14px;
	line-height: 1.6;
}

.koster-preview__meta,
.koster-story-row__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0;
	margin-top: 12px;
	color: var(--muted-text);
	font-size: 11px;
	line-height: 1.4;
	font-weight: 650;
}

.koster-preview__meta > span,
.koster-story-row__meta > span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.koster-preview__meta > span + span,
.koster-story-row__meta > span + span {
	margin-left: 14px;
}

.koster-preview__meta .raw-icon,
.koster-story-row__meta .raw-icon {
	flex: 0 0 auto;
	color: var(--dust-gold);
	font-size: 14px;
	line-height: 1;
}

.koster-preview__link,
.koster-story-panel__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin-top: 10px;
	color: var(--road-clay);
	font-size: 13px;
	line-height: 1.2;
	font-weight: 800;
	text-decoration: none;
}

.koster-preview__link .raw-icon,
.koster-story-panel__link .raw-icon {
	font-size: 18px;
	line-height: 1;
	transition: transform .18s ease;
}

.koster-preview__link:hover .raw-icon,
.koster-story-panel__link:hover .raw-icon {
	transform: translateX(4px);
}

.koster-story-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.koster-story-row {
	position: relative;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid rgba(16, 35, 29, .15);
}

.koster-story-row:first-child {
	border-top: 1px solid rgba(16, 35, 29, .10);
}

.koster-story-row__button {
	width: 100%;
	min-height: 92px;
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr) 76px;
	gap: 14px;
	align-items: center;
	padding: 15px 12px;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	transition: background-color .18s ease, box-shadow .18s ease;
}

.koster-story-row__button:hover {
	background: rgba(255, 253, 248, .46);
}

.koster-story-row.is-active .koster-story-row__button {
	background: linear-gradient(90deg, rgba(182, 106, 60, .10), rgba(182, 106, 60, .035));
	box-shadow: inset 3px 0 0 var(--road-clay);
}

.koster-story-row__number {
	align-self: start;
	padding-top: 2px;
	color: var(--charcoal);
	font-family: var(--font-heading);
	font-size: 42px;
	line-height: .88;
	font-weight: 500;
	letter-spacing: -.04em;
}

.koster-story-row.is-active .koster-story-row__number {
	color: var(--road-clay);
}

.koster-story-row__content {
	min-width: 0;
}

.koster-story-row__title {
	display: block;
	color: var(--charcoal);
	font-family: var(--font-heading);
	font-size: 21px;
	line-height: 1.08;
	font-weight: 600;
	letter-spacing: -.012em;
}

.koster-story-row.is-active .koster-story-row__title {
	font-weight: 700;
}

.koster-story-row__meta {
	margin-top: 5px;
	font-size: 10.5px;
}

.koster-story-row__status {
	justify-self: end;
	align-self: end;
	padding-bottom: 2px;
	color: var(--road-clay);
	font-size: 10px;
	line-height: 1.25;
	font-weight: 750;
	visibility: hidden;
}

.koster-story-row.is-active .koster-story-row__status {
	visibility: visible;
}

.koster-story-row__arrow {
	display: none;
}

/* Accordion panel is part of the same list item and only appears below 1100px. */
.koster-story-panel {
	display: none;
}

.koster-story-panel__inner {
	min-height: 0;
	overflow: hidden;
}

.koster-story-panel__content {
	padding: 0 0 20px 50px;
}

.koster-story-panel__image {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.koster-story-panel__teaser {
	margin: 12px 0 0;
	color: var(--soft-charcoal);
	font-size: 13px;
	line-height: 1.55;
}

.koster-story-row__noscript {
	display: block;
	padding: 8px 12px 12px 66px;
	color: var(--road-clay);
	font-size: 12px;
	font-weight: 800;
}

/* Quote */
.koster-quote {
	max-width: 860px;
	margin: 34px auto 0;
	padding: 26px 22px;
	border-top: 1px solid rgba(182, 106, 60, .62);
	border-bottom: 1px solid rgba(182, 106, 60, .62);
	color: var(--soft-charcoal);
	font-family: var(--font-heading);
	font-size: clamp(21px, 2.2vw, 28px);
	line-height: 1.25;
	font-style: italic;
	text-align: center;
}

.koster-quote p {
	margin: 0;
}

/* Pagination */
.koster-pagination {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: max-content;
	max-width: 100%;
	gap: 6px;
	margin: 8px auto 0;
	padding-top: 8px;
	overflow-x: auto;
	scrollbar-width: none;
}

.koster-pagination::-webkit-scrollbar {
	display: none;
}

.koster-pagination a,
.koster-pagination span {
	min-width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 10px;
	border: 0;
	border-bottom: 1px solid transparent;
	background: transparent;
	color: var(--soft-charcoal);
	font-size: 12px;
	line-height: 1;
	font-weight: 700;
	text-decoration: none;
}

.koster-pagination a:hover {
	color: var(--road-clay);
	border-bottom-color: rgba(182, 106, 60, .45);
}

.koster-pagination [aria-current="page"] {
	color: var(--road-clay);
	border-bottom-color: var(--road-clay);
}

.koster-pagination__direction {
	flex: 0 0 40px;
	min-width: 40px !important;
	padding: 0 !important;
}

.koster-pagination__direction .raw-icon {
	font-size: 17px;
	line-height: 1;
}

.koster-pagination__direction--prev {
	margin-right: 6px;
}

.koster-pagination__direction--next {
	margin-left: 6px;
}

.koster-pagination__dots {
	color: var(--muted-text) !important;
}

.koster-seo {
	margin-top: 32px;
	margin-bottom: 0;
}

@media (max-width: 1099px) {
	.koster-page {
		padding-left: 18px;
		padding-right: 18px;
	}

	.koster-filters {
		margin-left: -18px;
		margin-right: -18px;
		overflow: hidden;
	}

	.koster-filters__list {
		overflow-x: auto;
		padding: 0 18px 10px;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.koster-filters__list::-webkit-scrollbar {
		display: none;
	}

	.koster-filter {
		flex: 0 0 auto;
	}

	.koster-archive__layout {
		display: block;
	}

	.koster-preview {
		display: none;
	}

	.koster-story-row.is-active {
		background: linear-gradient(90deg, rgba(182, 106, 60, .07), transparent 72%);
		box-shadow: inset 2px 0 0 var(--road-clay);
	}

	.koster-story-row__button {
		min-height: 76px;
		grid-template-columns: 40px minmax(0, 1fr) 24px;
		gap: 10px;
		padding: 13px 12px 13px 14px;
	}

	.koster-story-row.is-active .koster-story-row__button {
		box-shadow: none;
		background: transparent;
	}

	.koster-story-row__number {
		font-size: 34px;
		line-height: .9;
		padding-top: 3px;
	}

	.koster-story-row__title {
		font-size: 18px;
		line-height: 1.12;
	}

	.koster-story-row__meta {
		margin-top: 6px;
		font-size: 10px;
		line-height: 1.2;
	}

	.koster-story-row__date {
		display: none !important;
	}

	.koster-story-row.is-active .koster-story-row__date {
		display: inline-flex !important;
	}

	.koster-story-row__status {
		display: none;
	}

	.koster-story-row__arrow {
		width: 20px;
		height: 20px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		justify-self: end;
		font-size: 18px;
		line-height: 1;
		transition: transform .2s ease;
	}

	.koster-story-row.is-active .koster-story-row__arrow {
		transform: rotate(180deg);
	}

	.koster-story-panel {
		display: grid;
		grid-template-rows: 0fr;
		visibility: hidden;
		opacity: 0;
		transition: grid-template-rows .22s ease, opacity .18s ease, visibility 0s linear .22s;
	}

	.koster-story-row.is-active .koster-story-panel {
		grid-template-rows: 1fr;
		visibility: visible;
		opacity: 1;
		transition: grid-template-rows .22s ease, opacity .18s ease, visibility 0s;
	}
}

@media (max-width: 920px) {
	.koster-hero {
		min-height: 238px;
	}

	.koster-hero .hero__content {
		max-width: 520px;
		padding: 24px 18px 26px;
	}

	.koster-hero h1 {
		font-size: 42px;
	}

	.koster-hero .hero__lead {
		max-width: 430px;
		font-size: 14px;
	}

	.koster-hero__description {
		max-width: 360px;
		font-size: 11px;
	}
}

@media (max-width: 640px) {
	.koster-page {
		padding: 0 14px 28px;
	}

	.koster-hero {
		min-height: 218px;
	}

	.koster-hero .hero__img {
		object-position: 64% center;
	}

	.koster-hero::before {
		background:
				linear-gradient(90deg, rgba(11, 17, 16, .91) 0%, rgba(11, 17, 16, .72) 55%, rgba(11, 17, 16, .28) 100%),
				linear-gradient(180deg, rgba(11, 17, 16, .08), rgba(11, 17, 16, .46));
	}

	.koster-hero .hero__content {
		padding: 18px 14px 20px;
	}

	.koster-hero h1 {
		font-size: 34px;
	}

	.koster-hero .hero__lead {
		max-width: 330px;
		margin-top: 8px;
		font-size: 12px;
		line-height: 1.42;
	}

	.koster-hero__description {
		max-width: 290px;
		margin-top: 8px;
		font-size: 10px;
		line-height: 1.45;
	}

	.koster-filters {
		margin-left: -14px;
		margin-right: -14px;
		padding-top: 11px;
	}

	.koster-filters__list {
		gap: 8px;
		padding-left: 14px;
		padding-right: 14px;
	}

	.koster-filter {
		min-height: 36px;
		padding: 0 13px;
		font-size: 10px;
	}

	.koster-hint {
		margin-bottom: 8px;
		font-size: 10px;
	}

	.koster-story-row__button {
		grid-template-columns: 38px minmax(0, 1fr) 20px;
		min-height: 74px;
		gap: 9px;
		padding: 13px 10px 13px 12px;
	}

	.koster-story-row__number {
		font-size: 31px;
	}

	.koster-story-row__tag {
		font-size: 8px;
	}

	.koster-story-row__title {
		font-size: 16px;
	}

	.koster-story-panel__content {
		padding: 0 10px 20px 12px;
	}

	.koster-story-panel__image {
		width: 100%;
		aspect-ratio: 16 / 10;
		object-fit: cover;
	}

	.koster-story-panel__teaser {
		margin-top: 14px;
		font-size: 13px;
		line-height: 1.55;
	}

	.koster-story-panel__link {
		margin-top: 12px;
	}

	.koster-quote {
		margin-top: 22px;
		padding: 20px 10px;
		font-size: 19px;
	}

	.koster-pagination {
		gap: 2px;
		margin-top: 4px;
		padding-left: 0;
		padding-right: 0;
	}

	.koster-pagination a,
	.koster-pagination span {
		flex: 0 0 40px;
		padding: 0 7px;
	}

	.koster-pagination__direction {
		min-width: 40px !important;
	}

	.koster-pagination__direction--prev {
		margin-right: 2px;
	}

	.koster-pagination__direction--next {
		margin-left: 2px;
	}

}

@media (prefers-reduced-motion: reduce) {
	.koster-preview__placeholder-image {
		animation: none;
	}

	.koster-preview,
	.koster-story-panel,
	.koster-story-row__arrow,
	.koster-preview__link .raw-icon,
	.koster-story-panel__link .raw-icon,
	.koster-filter {
		transition: none !important;
	}
}

/* Likes in archive metadata */
.koster-preview__likes .raw-icon,
.koster-story-row__likes .raw-icon {
	color: var(--road-clay);
}

.koster-preview__likes,
.koster-story-row__likes {
	font-variant-numeric: tabular-nums;
}
