/*
 * Reyting — Народный рейтинг. Site chrome and premium details.
 * Palette & type scale come from theme.json; this file styles the header,
 * footer, hero, cards, buttons and blends the PeopleRank plugin into the
 * purple identity. Colours reference theme.json presets (--wp--preset--*).
 */

:root {
	--rey-ink: var(--wp--preset--color--contrast, #171320);
	--rey-muted: var(--wp--preset--color--muted, #6b6577);
	--rey-line: var(--wp--preset--color--line, #e7e3f0);
	--rey-primary: var(--wp--preset--color--primary, #6d28d9);
	--rey-primary-strong: var(--wp--preset--color--primary-strong, #591fb0);
	--rey-primary-soft: var(--wp--preset--color--primary-soft, #ede9fe);
	--rey-dark: var(--wp--preset--color--dark, #1c1526);
	--rey-gold: var(--wp--preset--color--gold, #c8a24a);
	--rey-shadow-sm: 0 1px 2px rgba(23, 19, 32, .05), 0 1px 3px rgba(23, 19, 32, .05);
	--rey-shadow-md: 0 4px 12px rgba(23, 19, 32, .07), 0 12px 28px rgba(23, 19, 32, .08);
	--rey-shadow-lg: 0 10px 24px rgba(76, 29, 149, .12), 0 24px 56px rgba(23, 19, 32, .14);
}

/* ---- Root polish -------------------------------------------------------- */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	background: var(--wp--preset--color--base, #fff);
	/* Repaint the plugin's accent in the theme's purple everywhere it renders. */
	--pr-accent: var(--rey-primary);
}

:where(h1, h2, h3) { text-wrap: balance; }
:where(p, li) { text-wrap: pretty; }

.rey-lead {
	color: var(--rey-muted);
	font-size: 1.15rem;
	line-height: 1.6;
}

/* Content links get a refined underline (offset from the baseline). */
.rey-main :where(p, li) a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	text-decoration-color: color-mix(in srgb, var(--rey-primary) 40%, transparent);
	transition: text-decoration-color .15s ease;
}
.rey-main :where(p, li) a:hover { text-decoration-color: var(--rey-primary); }

/* Images carry a hairline edge for consistent depth. */
.rey-main img,
.rey-card img {
	outline: 1px solid rgba(0, 0, 0, .08);
	outline-offset: -1px;
}

/* ---- Header ------------------------------------------------------------- */
.rey-header {
	position: sticky;
	top: 0;
	z-index: 100;
	padding-top: .85rem;
	padding-bottom: .85rem;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
	backdrop-filter: saturate(120%);
}
.rey-header,
.rey-header a { color: #fff; }
.rey-brand { gap: .6rem; }
.rey-header .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--serif, Georgia, serif);
	font-weight: 700;
	font-size: 1.35rem;
	letter-spacing: -.01em;
	text-decoration: none;
}
.rey-header .wp-block-site-logo img { border-radius: 8px; }

.rey-nav .wp-block-navigation-item__content {
	color: rgba(255, 255, 255, .82);
	font-weight: 500;
	padding: 4px 2px;
	position: relative;
	transition: color .15s ease;
}
.rey-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -3px;
	height: 2px;
	background: var(--rey-gold);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .18s ease;
}
.rey-nav .wp-block-navigation-item:hover .wp-block-navigation-item__content,
.rey-nav .current-menu-item .wp-block-navigation-item__content { color: #fff; }
.rey-nav .wp-block-navigation-item:hover .wp-block-navigation-item__content::after { transform: scaleX(1); }
/* Mobile overlay menu inherits the dark chrome. */
.rey-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--rey-dark);
}
.rey-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { color: #fff; }

/* ---- Hero --------------------------------------------------------------- */
.rey-hero {
	color: #fff;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
.rey-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(60% 90% at 85% 10%, rgba(255, 255, 255, .12), transparent 60%),
		radial-gradient(50% 80% at 10% 100%, rgba(200, 162, 74, .16), transparent 60%);
	pointer-events: none;
}
.rey-hero :where(h1, p) { color: #fff; }
.rey-eyebrow {
	text-transform: uppercase;
	letter-spacing: .16em;
	font-size: .8rem;
	font-weight: 600;
	color: var(--rey-gold);
	margin-bottom: .4rem;
}
.rey-hero-title {
	max-width: 15ch;
	margin-inline: auto;
	line-height: 1.08;
}
.rey-hero-sub {
	max-width: 40rem;
	margin-inline: auto;
	margin-top: 1rem;
	font-size: 1.2rem;
	line-height: 1.6;
	color: rgba(255, 255, 255, .86);
}
.rey-hero .wp-block-buttons { margin-top: 1.8rem; }

/* ---- Buttons ------------------------------------------------------------ */
.wp-block-button__link {
	box-shadow: 0 1px 2px rgba(23, 19, 32, .12);
	transition: background-color .15s ease, box-shadow .15s ease, transform .08s ease, color .15s ease;
	will-change: transform;
}
.wp-block-button__link:active { transform: scale(.96); }

.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--rey-primary);
	border: 1.5px solid currentColor;
	box-shadow: none;
}
.is-style-outline .wp-block-button__link:hover {
	background: var(--rey-primary);
	color: #fff;
	border-color: var(--rey-primary);
}

/* Light button on dark/gradient surfaces. */
.rey-btn-light .wp-block-button__link {
	background: #fff;
	color: var(--rey-ink);
}
.rey-btn-light .wp-block-button__link:hover {
	background: var(--rey-primary-soft);
	color: var(--rey-primary-strong);
}
/* Ghost button on dark/gradient surfaces. */
.rey-btn-ghost.is-style-outline .wp-block-button__link {
	color: #fff;
	border-color: rgba(255, 255, 255, .55);
}
.rey-btn-ghost.is-style-outline .wp-block-button__link:hover {
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border-color: #fff;
}

/* ---- Section rhythm ----------------------------------------------------- */
.rey-section .rey-lead { text-align: center; margin-top: .4rem; }
.rey-values { border-top: 1px solid var(--rey-line); border-bottom: 1px solid var(--rey-line); background: var(--wp--preset--color--surface, #faf9fc); }
.rey-value { text-align: center; padding: 1rem; }
.rey-value-ic {
	font-size: 2rem;
	line-height: 1;
	margin: 0 auto .6rem;
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 16px;
	background: var(--rey-primary-soft);
}
.rey-value h3 { margin: 0 0 .35rem; }
.rey-value .rey-lead { font-size: 1rem; }

/* ---- Cards -------------------------------------------------------------- */
.rey-cards { gap: 1.25rem; }
.rey-card {
	background: #fff;
	border: 1px solid var(--rey-line);
	border-radius: 16px;
	padding: 14px;
	box-shadow: var(--rey-shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
	height: 100%;
}
.rey-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--rey-shadow-md);
	border-color: color-mix(in srgb, var(--rey-primary) 30%, var(--rey-line));
}
/* Full-bleed image to the card top keeps the corners concentric. */
.rey-card .wp-block-post-featured-image {
	margin: -14px -14px 12px;
}
.rey-card .wp-block-post-featured-image img {
	border-radius: 15px 15px 0 0;
	width: 100%;
	object-fit: cover;
	outline: none;
}
.rey-card .wp-block-post-title { margin: 0 0 .35rem; line-height: 1.25; }
.rey-card .wp-block-post-title a { color: var(--rey-ink); text-decoration: none; transition: color .15s ease; }
.rey-card:hover .wp-block-post-title a { color: var(--rey-primary); }
.rey-card .wp-block-post-excerpt { color: var(--rey-muted); font-size: .95rem; line-height: 1.55; margin: 0; }
.rey-card .wp-block-post-excerpt__more-text { display: none; }

/* ---- Archive / listing head -------------------------------------------- */
.rey-archive-head { margin-bottom: 2rem; text-align: center; }
.rey-archive-head .rey-lead { margin-top: .5rem; }

/* ---- CTA band ----------------------------------------------------------- */
.rey-cta :where(h2) { color: #fff; }
.rey-cta-sub { color: rgba(255, 255, 255, .82); max-width: 40rem; margin: .6rem auto 1.4rem; text-align: center; }

/* ---- 404 ---------------------------------------------------------------- */
.rey-404 .has-huge-font-size { color: var(--rey-primary); line-height: .9; margin-bottom: 0; }
.rey-404 .wp-block-search { max-width: 26rem; margin: 2rem auto 0; }

/* ---- Footer ------------------------------------------------------------- */
.rey-footer {
	color: rgba(255, 255, 255, .72);
	padding-top: var(--wp--preset--spacing--60, 4.5rem);
	padding-bottom: var(--wp--preset--spacing--40, 2rem);
}
.rey-footer a { color: rgba(255, 255, 255, .72); text-decoration: none; transition: color .15s ease; }
.rey-footer a:hover { color: #fff; }
.rey-footer .wp-block-site-title a { color: #fff; font-family: var(--wp--preset--font-family--serif, Georgia, serif); font-size: 1.3rem; }
.rey-footer-tag { margin-top: .6rem; line-height: 1.6; color: rgba(255, 255, 255, .6); }
.rey-footer-top { gap: 2.5rem; margin-bottom: 2.5rem; }
.rey-footer h4 { color: #fff; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .8rem; }
.rey-footer-list { list-style: none; margin: 0; padding: 0; }
.rey-footer-list li { margin: .4rem 0; }
.rey-footer-sep { border: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.rey-copy { color: rgba(255, 255, 255, .5); margin-top: 1.4rem; }

/* ---- Search block ------------------------------------------------------- */
.wp-block-search__input {
	border: 1px solid var(--rey-line);
	border-radius: 10px;
	font-size: 16px;
}
.wp-block-search .wp-block-search__button { border-radius: 10px; }

/* ---- Blend the PeopleRank plugin into the purple identity --------------- */
.pr-rating,
.pr-nominee-content,
.pr-nominee-page,
.pr-reviews,
.pr-longread,
.pr-authorbox { --pr-accent: var(--rey-primary); }

/* Rating / nominee big text uses the serif reading style of the theme. */
.pr-longread { font-family: var(--wp--preset--font-family--sans, sans-serif); }
.pr-longread :where(h2, h3) { font-family: var(--wp--preset--font-family--serif, Georgia, serif); }

/* Tabular figures wherever the plugin shows counts, so they don't jitter. */
.pr-nrow-votes,
.pr-nratings-count,
.pr-count,
.pr-votes { font-variant-numeric: tabular-nums; }

/* ---- Motion restraint --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.rey-card,
	.wp-block-button__link,
	.rey-nav .wp-block-navigation-item__content::after,
	.rey-main :where(p, li) a { transition: none; }
	.rey-card:hover { transform: none; }
	.wp-block-button__link:active { transform: none; }
}
