/*
Theme Name:   Stylee Mag
Theme URI:    https://stylee.ru/
Description:  Лёгкая тема журнала stylee.ru. Сетка на CSS Grid, ноль JS-зависимостей: ни jQuery, ни bootstrap, ни masonry, ни иконочных шрифтов. Блоки перехода — «читайте также», «новое на сайте», рубрики — часть темы, а не плагинов.
Author:       stylee.ru
Version:      1.0.0
Requires PHP: 8.0
Text Domain:  stylee-mag
*/

/* ==========================================================================
   Токены
   ========================================================================== */

:root {
	--paper:       #f4f1ea;
	--paper-card:  #fffdfa;
	--paper-deep:  #eae4d9;
	--ink:         #17130f;
	--ink-soft:    #5f554a;
	--ink-faint:   #8d8377;
	--accent:      #8a2b2e;
	--accent-lift: #a8383a;
	--rule:        rgba(23, 19, 15, 0.13);
	--rule-strong: rgba(23, 19, 15, 0.26);

	--display: 'Prata', Georgia, 'Times New Roman', serif;
	--body:    'Golos Text', -apple-system, 'Segoe UI', Arial, sans-serif;

	--wrap:    1240px;
	--gap:     clamp(1.25rem, 2.5vw, 2.25rem);
	--radius:  3px;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: clamp(1rem, 0.96rem + 0.18vw, 1.06rem);
	line-height: 1.7;
	font-feature-settings: 'kern' 1, 'liga' 1;
	-webkit-font-smoothing: antialiased;
}

img,
picture,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

/*
 * stylee-seo.php оборачивает картинки в <picture> ради WebP. Обёртка рвёт
 * цепочку высоты: height:100% у <img> считается от <picture>, у которого
 * высота auto, и картинка перестаёт заполнять контейнер с заданной
 * пропорцией — снизу остаётся полоса фона.
 */
.card__thumb picture,
.hero__thumb picture {
	display: block;
	width: 100%;
	height: 100%;
}

a {
	color: var(--accent);
	text-underline-offset: 0.18em;
}

a:hover {
	color: var(--accent-lift);
}

h1, h2, h3, h4 {
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.015em;
	margin: 0 0 0.5em;
	color: var(--ink);
}

p {
	margin: 0 0 1.2em;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ink);
	color: #fff;
	padding: 0.75rem 1.25rem;
	z-index: 100;
}

.skip-link:focus {
	left: 0;
}

.wrap {
	width: min(100% - 2.5rem, var(--wrap));
	margin-inline: auto;
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.site-header {
	background: var(--ink);
	color: #fdfbf7;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding-block: clamp(1.25rem, 3vw, 2.25rem);
	flex-wrap: wrap;
}

.site-title {
	font-family: var(--display);
	font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
	line-height: 1;
	margin: 0;
	letter-spacing: -0.02em;
}

.site-title a {
	color: #fdfbf7;
	text-decoration: none;
}

.site-title a:hover {
	color: #fff;
}

.site-description {
	margin: 0.45rem 0 0;
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	color: rgba(253, 251, 247, 0.62);
}

.site-search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border-bottom: 1px solid rgba(253, 251, 247, 0.3);
	padding-bottom: 0.35rem;
}

.site-search input {
	background: none;
	border: 0;
	color: #fdfbf7;
	font-family: var(--body);
	font-size: 0.85rem;
	width: clamp(9rem, 18vw, 14rem);
	padding: 0.15rem 0;
}

.site-search input::placeholder {
	color: rgba(253, 251, 247, 0.45);
}

.site-search input:focus {
	outline: none;
}

.site-search button {
	background: none;
	border: 0;
	color: rgba(253, 251, 247, 0.75);
	cursor: pointer;
	padding: 0;
	display: flex;
}

.site-search button:hover {
	color: #fff;
}

/* Навигация по рубрикам — основной способ уйти вглубь сайта с любой страницы. */
.site-nav {
	background: #0f0c0a;
	border-top: 1px solid rgba(253, 251, 247, 0.08);
}

.nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(1rem, 2.4vw, 2rem);
	list-style: none;
	margin: 0;
	padding: 0.85rem 0;
}

.nav__list a {
	color: rgba(253, 251, 247, 0.78);
	text-decoration: none;
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	white-space: nowrap;
	border-bottom: 1px solid transparent;
	padding-bottom: 0.25rem;
	transition: color 0.2s, border-color 0.2s;
}

.nav__list a:hover,
.nav__list .is-current a {
	color: #fff;
	border-bottom-color: var(--accent-lift);
}

/* ==========================================================================
   Каркас страницы
   ========================================================================== */

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 3.5rem);
	padding-block: clamp(2rem, 5vw, 3.5rem);
	align-items: start;
}

@media (min-width: 62rem) {
	.layout {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
}

.page-head {
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
	padding-bottom: 1.1rem;
	border-bottom: 2px solid var(--ink);
}

.page-head__title {
	font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.9rem);
	margin: 0;
}

.page-head__desc {
	margin: 0.6rem 0 0;
	color: var(--ink-soft);
	font-size: 0.95rem;
}

.empty {
	color: var(--ink-soft);
}

/* ==========================================================================
   Лид-блок: иерархия вместо десяти одинаковых карточек
   ========================================================================== */

.lead {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gap);
	margin-bottom: var(--gap);
}

@media (min-width: 48rem) {
	.lead {
		grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
		align-items: stretch;
	}
}

/* Два соседних материала делят высоту героя поровну. */
.lead__side {
	display: grid;
	grid-template-rows: 1fr 1fr;
	gap: var(--gap);
	min-width: 0;
}

.lead__side .card {
	height: 100%;
}

.hero {
	display: flex;
	flex-direction: column;
	background: var(--paper-card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
	transition: border-color 0.3s ease;
}

.hero:hover {
	border-color: var(--rule-strong);
}

.hero__thumb {
	display: block;
	overflow: hidden;
	background: var(--paper-deep);
	aspect-ratio: 3 / 2;
}

.hero__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hero:hover .hero__thumb img {
	transform: scale(1.03);
}

.hero__body {
	display: flex;
	flex-direction: column;
	padding: clamp(1.25rem, 2.6vw, 2rem);
}

/*
 * В две колонки герой растягивается по высоте двух соседних карточек. Лишнюю
 * высоту должна забирать картинка: если её отдать текстовому блоку, meta с
 * margin-top:auto уезжает вниз и внутри карточки повисает пустота.
 */
@media (min-width: 48rem) {
	.hero__thumb {
		aspect-ratio: auto;
		flex: 1;
		min-height: 17rem;
	}

	.hero__body {
		flex: 0 0 auto;
	}
}

.hero__kicker {
	align-self: flex-start;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	color: var(--accent);
	text-decoration: none;
	margin-bottom: 0.7rem;
}

.hero__kicker:hover {
	text-decoration: underline;
}

.hero__title {
	font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.4rem);
	line-height: 1.12;
	margin: 0 0 0.7rem;
}

.hero__title a {
	color: var(--ink);
	text-decoration: none;
	background-image: linear-gradient(var(--accent), var(--accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0% 1px;
	transition: background-size 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.25s;
}

.hero__title a:hover {
	color: var(--accent);
	background-size: 100% 1px;
}

.hero__excerpt {
	color: var(--ink-soft);
	font-size: clamp(0.94rem, 0.9rem + 0.2vw, 1.02rem);
	line-height: 1.65;
	margin: 0 0 1.2rem;
	max-width: 46ch;
}

/* ==========================================================================
   Сетка карточек — Grid вместо абсолютного позиционирования
   ========================================================================== */

.grid--cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
	gap: var(--gap);
}

/*
 * Карточка на ховере не приподнимается: сдвиг вверх спорил с наездом
 * картинки внутри неё — два одновременных движения в разные стороны.
 * Остаётся только зум кадра и потемнение рамки.
 */
.card {
	display: flex;
	flex-direction: column;
	background: var(--paper-card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	overflow: hidden;
	transition: border-color 0.3s ease;
}

.card:hover {
	border-color: var(--rule-strong);
}

.card__thumb {
	display: block;
	overflow: hidden;
	background: var(--paper-deep);
	aspect-ratio: 3 / 2;
}

.card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card:hover .card__thumb img {
	transform: scale(1.045);
}

.card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: clamp(1rem, 1.8vw, 1.4rem);
}

.card__kicker {
	align-self: flex-start;
	font-size: 0.63rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	text-decoration: none;
	margin-bottom: 0.6rem;
}

.card__kicker:hover {
	text-decoration: underline;
}

.card__title {
	font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.28rem);
	line-height: 1.25;
	margin: 0 0 0.5rem;
}

.card__title a {
	color: var(--ink);
	text-decoration: none;
	background-image: linear-gradient(var(--accent), var(--accent));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0% 1px;
	transition: background-size 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.25s;
}

.card__title a:hover {
	color: var(--accent);
	background-size: 100% 1px;
}

.card__excerpt {
	color: var(--ink-soft);
	font-size: 0.88rem;
	line-height: 1.6;
	margin: 0 0 1rem;
}

/* margin-top:auto прижимает мету к низу — карточки разной длины выравниваются. */
.card__meta {
	margin-top: auto;
	padding-top: 0.75rem;
	border-top: 1px solid var(--rule);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ink-faint);
	display: flex;
	flex-wrap: wrap;
	gap: 0.2rem 0.5rem;
	align-items: baseline;
}

/* Дата и время чтения переносятся целиком, а не рвутся посреди строки. */
.card__meta time,
.card__meta .meta-read {
	white-space: nowrap;
}

.card__meta .sep {
	color: var(--rule-strong);
}

/* --- компактная карточка для колонки --- */

.card--compact {
	border: 0;
	background: none;
	border-radius: 0;
}

.card--compact .card__link {
	display: grid;
	grid-template-columns: 5.25rem minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
	text-decoration: none;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--rule);
}

.card--compact .card__thumb {
	border-radius: 2px;
	aspect-ratio: 1 / 1;
}

.card--compact .card__body {
	padding: 0;
}

.card--compact .card__title {
	font-size: 0.92rem;
	line-height: 1.3;
	color: var(--ink);
	margin: 0 0 0.3rem;
	transition: color 0.2s;
}

.card--compact .card__link:hover .card__title {
	color: var(--accent);
}

.card--compact .card__date {
	font-size: 0.65rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

/* ==========================================================================
   Запись
   ========================================================================== */

.crumbs {
	font-size: 0.75rem;
	color: var(--ink-faint);
	margin-bottom: 1.25rem;
}

.crumbs a {
	color: var(--ink-soft);
	text-decoration: none;
}

.crumbs a:hover {
	color: var(--accent);
	text-decoration: underline;
}

.entry__head {
	margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.entry__kicker {
	display: inline-block;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	color: var(--accent);
	text-decoration: none;
	margin-bottom: 0.9rem;
}

.entry__title {
	font-size: clamp(1.9rem, 1.25rem + 2.9vw, 3.25rem);
	line-height: 1.08;
	margin: 0 0 0.8rem;
}

.entry__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	align-items: center;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-faint);
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--rule);
}

.entry__hero {
	margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
}

.entry__hero img {
	width: 100%;
	border-radius: var(--radius);
}

.entry__hero figcaption {
	margin-top: 0.6rem;
	font-size: 0.78rem;
	color: var(--ink-faint);
}

.entry__content {
	font-size: clamp(1.03rem, 0.99rem + 0.22vw, 1.14rem);
	line-height: 1.78;
	color: #211c17;
}

.entry__content > * {
	max-width: 44rem;
}

.entry__content img,
.entry__content picture,
.entry__content figure {
	max-width: 100%;
	border-radius: var(--radius);
	margin-block: 1.8em;
}

.entry__content h2 {
	font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem);
	margin-top: 2em;
	margin-bottom: 0.6em;
}

.entry__content h3 {
	font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.5rem);
	margin-top: 1.7em;
	margin-bottom: 0.5em;
}

.entry__content ul,
.entry__content ol {
	padding-left: 1.3em;
	margin-bottom: 1.4em;
}

.entry__content li {
	margin-bottom: 0.5em;
}

.entry__content blockquote {
	margin: 2em 0;
	padding-left: 1.4rem;
	border-left: 2px solid var(--accent);
	font-family: var(--display);
	font-size: 1.2em;
	line-height: 1.45;
}

.entry__content a {
	text-decoration: underline;
}

.entry__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rule);
}

.entry__tags a {
	font-size: 0.72rem;
	color: var(--ink-soft);
	text-decoration: none;
	background: var(--paper-deep);
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
}

.entry__tags a:hover {
	background: var(--ink);
	color: var(--paper);
}

/* ==========================================================================
   Переходы: соседние записи, «читайте также»
   ========================================================================== */

.post-nav {
	display: grid;
	gap: 1rem;
	margin-top: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 40rem) {
	.post-nav {
		grid-template-columns: 1fr 1fr;
	}
}

.post-nav__item {
	display: block;
	padding: 1.1rem 1.25rem;
	background: var(--paper-card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	text-decoration: none;
	transition: border-color 0.25s, transform 0.25s;
}

.post-nav__item:hover {
	border-color: var(--rule-strong);
	transform: translateY(-2px);
}

.post-nav__item--next {
	text-align: right;
}

.post-nav__label {
	display: block;
	font-size: 0.63rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 0.35rem;
}

.post-nav__title {
	display: block;
	font-family: var(--display);
	font-size: 1.02rem;
	line-height: 1.25;
	color: var(--ink);
}

.block {
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.block__title {
	font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.8rem);
	padding-bottom: 0.7rem;
	margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
	border-bottom: 2px solid var(--ink);
}

/* ==========================================================================
   Боковая колонка
   ========================================================================== */

.sidebar__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(1.75rem, 3vw, 2.5rem);
}

@media (min-width: 62rem) {
	.sidebar__inner {
		position: sticky;
		top: 1.5rem;
	}
}

.widget-title {
	font-size: 1.1rem;
	padding-bottom: 0.6rem;
	margin: 0 0 0.9rem;
	border-bottom: 2px solid var(--ink);
}

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

.cat-list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--rule);
	text-decoration: none;
	color: var(--ink);
	font-size: 0.92rem;
	transition: color 0.2s;
}

.cat-list a:hover,
.cat-list .is-current a {
	color: var(--accent);
}

.cat-list__count {
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--ink-faint);
	font-variant-numeric: tabular-nums;
}

.stack {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Пагинация
   ========================================================================== */

.pagination {
	margin-top: clamp(2rem, 4vw, 3rem);
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	height: 2.4rem;
	padding: 0 0.6rem;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	font-size: 0.85rem;
	font-weight: 500;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.pagination .page-numbers:hover {
	border-color: var(--ink);
}

.pagination .page-numbers.current {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--paper);
}

.pagination .page-numbers.dots {
	border-color: transparent;
}

/* ==========================================================================
   Подвал
   ========================================================================== */

.site-footer {
	margin-top: clamp(3rem, 6vw, 5rem);
	background: var(--ink);
	color: rgba(253, 251, 247, 0.72);
	font-size: 0.9rem;
}

.site-footer__inner {
	display: grid;
	gap: 2rem;
	padding-block: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 48rem) {
	.site-footer__inner {
		grid-template-columns: 1fr 1.5fr;
	}
}

.site-footer__title {
	font-family: var(--display);
	font-size: 1.5rem;
	color: #fdfbf7;
	margin: 0 0 0.35rem;
}

.site-footer__desc {
	margin: 0;
	font-size: 0.82rem;
	color: rgba(253, 251, 247, 0.55);
}

.site-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer__nav a {
	color: rgba(253, 251, 247, 0.8);
	text-decoration: none;
	font-size: 0.82rem;
}

.site-footer__nav a:hover {
	color: #fff;
	text-decoration: underline;
}

/* Копирайт слева, информеры справа; на узком экране — в столбик. */
.site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1px solid rgba(253, 251, 247, 0.12);
	padding-block: 1.1rem;
	font-size: 0.75rem;
	color: rgba(253, 251, 247, 0.45);
}

.site-footer__legal p {
	margin: 0;
}

.site-counters {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.site-counters img {
	display: block;
	/*
	 * Информеры рисуются на светлом фоне и на тёмном подвале выглядят
	 * вырезанными прямоугольниками. Приглушаем, пока на них не навели.
	 */
	opacity: 0.55;
	border-radius: 2px;
	transition: opacity 0.25s ease;
}

.site-counters a:hover img,
.site-counters a:focus-visible img {
	opacity: 1;
}

/* ==========================================================================
   Движение
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ==========================================================================
   Печать
   ========================================================================== */

@media print {
	.site-header,
	.site-nav,
	.sidebar,
	.post-nav,
	.block--related,
	.site-footer,
	.pagination {
		display: none;
	}

	body {
		background: #fff;
		color: #000;
	}

	.layout {
		display: block;
	}
}
