/*
Theme Name: Enesh Portfolio
Description: Минималистичная тема-портфолио для художника-постановщика: сетка проектов с фильтром по категориям, страницы проектов с видео, управление контентом через админку.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ebp
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
	--bg: #f8f8f6;
	--fg: #161616;
	--muted: #6b6b67;
	--line: #cfcfca;
	--dark: #222222;
	--accent: #d83a2f;

	--gutter: clamp(16px, 3.9vw, 76px);
	--maxw: 1920px;
	--gap: clamp(14px, 1.3vw, 24px);
	--row-gap: clamp(28px, 3.4vw, 64px);

	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--ease: cubic-bezier(.2, .6, .2, 1);
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	font-size: 1rem;
	line-height: 1.5;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

img,
video,
iframe {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
}

h1, h2, h3, p, ul, dl, dd, figure {
	margin: 0;
	padding: 0;
}

ul {
	list-style: none;
}

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

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

.skip-link:focus {
	clip: auto;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 18px;
	top: 8px;
	left: 8px;
	z-index: 100;
	background: var(--fg);
	color: #fff;
}

.container {
	width: min(100% - (var(--gutter) * 2), var(--maxw));
	margin-inline: auto;
}

[hidden] {
	display: none !important;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header__inner {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding-block: clamp(24px, 2.6vw, 48px) clamp(16px, 1.6vw, 28px);
	border-bottom: 1px solid var(--line);
}

.site-brand__name {
	font-size: clamp(1.125rem, .9vw + .6rem, 1.5rem);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.site-brand__name a {
	text-decoration: none;
}

.site-brand__role {
	margin-top: 6px;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.site-nav__list {
	display: flex;
	gap: clamp(28px, 4vw, 72px);
	padding-top: .5em;
	margin-right: clamp(0px, 3vw, 56px);
}

.site-nav__list a {
	display: inline-block;
	padding-block: 6px;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color .2s var(--ease);
}

.site-nav__list a:hover,
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a {
	border-bottom-color: currentColor;
}

.nav-toggle {
	display: none;
	width: 44px;
	height: 44px;
	margin: -8px -10px 0 0;
	padding: 0;
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	transition: transform .25s var(--ease), background-color .25s;
}

.nav-toggle__bars {
	position: relative;
	margin: 0 auto;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after  { top: 7px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
	background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
	transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
	transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
	position: relative;
	margin-top: clamp(16px, 1.6vw, 28px);
	aspect-ratio: 3.53 / 1;
	overflow: hidden;
	background: var(--dark);
}

.hero__media {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% var(--hero-pos, 50%);
}

.hero--empty {
	display: grid;
	place-items: center;
	background: #ecece8;
	color: var(--muted);
	font-size: .875rem;
}

/* ==========================================================================
   Selected works
   ========================================================================== */
.works__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: clamp(10px, 1vw, 18px) clamp(0px, .3vw, 6px) clamp(18px, 2vw, 32px);
	border-bottom: 1px solid var(--line);
}

.works__title {
	font-size: clamp(1.75rem, 1.6vw + 1.1rem, 2.75rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.works__years {
	font-size: .75rem;
	letter-spacing: .06em;
	color: var(--muted);
	white-space: nowrap;
	margin-right: clamp(0px, 5vw, 90px);
}

/* Filters --------------------------------------------------------------- */
.filters {
	margin-block: clamp(18px, 1.9vw, 32px) clamp(18px, 1.6vw, 28px);
}

.filters__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px clamp(4px, .8vw, 14px);
}

.filters__pill {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 clamp(14px, 1.2vw, 22px);
	border-radius: 999px;
	font-size: .75rem;
	letter-spacing: .05em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--fg);
	background: transparent;
	transition: background-color .2s var(--ease), color .2s var(--ease);
}

.filters__pill:hover {
	background: rgba(22, 22, 22, .07);
}

.filters__pill.is-active,
.filters__pill[aria-current="true"] {
	background: var(--fg);
	color: #fff;
}

/* Grid ------------------------------------------------------------------ */
.grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--row-gap) var(--gap);
}

.grid__empty {
	padding-block: 48px;
	color: var(--muted);
}

.card {
	min-width: 0;
}

.card[hidden] {
	display: none;
}

.card.is-entering {
	animation: ebp-fade .35s var(--ease) both;
}

@keyframes ebp-fade {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.card__link {
	display: block;
	text-decoration: none;
}

.card__media {
	position: relative;
	display: block;
	aspect-ratio: 2.29 / 1;
	overflow: hidden;
	background: var(--dark);
}

.card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--ease);
}

.card__media--contain .card__img {
	object-fit: contain;
}

.card__play {
	position: absolute;
	right: 12px;
	bottom: 12px;
	width: 28px;
	height: 28px;
	border: 1px solid var(--accent);
	border-radius: 50%;
	opacity: .85;
	transition: transform .3s var(--ease), background-color .3s;
}

.card__play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 52%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 5px 0 5px 8px;
	border-color: transparent transparent transparent var(--accent);
}

.card__body {
	display: block;
	padding-top: 14px;
}

.card__title {
	font-size: clamp(.875rem, .35vw + .75rem, 1.0625rem);
	font-weight: 400;
	line-height: 1.3;
	letter-spacing: .01em;
	text-transform: uppercase;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	display: inline;
	transition: background-size .3s var(--ease);
}

.card__cat {
	display: block;
	margin-top: 6px;
	font-size: .6875rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

@media (hover: hover) {
	.card__link:hover .card__img {
		transform: scale(1.025);
	}
	.card__link:hover .card__play {
		transform: scale(1.15);
		background: rgba(216, 58, 47, .15);
	}
	.card__link:hover .card__title {
		background-size: 100% 1px;
	}
}

/* ==========================================================================
   Contacts + footer
   ========================================================================== */
.contacts {
	margin-top: clamp(40px, 4.4vw, 80px);
}

.contacts__inner {
	display: grid;
	grid-template-columns: 56% minmax(0, 1fr);
	gap: 32px 0;
	padding-top: clamp(32px, 3.4vw, 60px);
	border-top: 1px solid var(--line);
}

.contacts__title {
	font-size: clamp(1.75rem, 1.6vw + 1.1rem, 2.75rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.contacts__sub {
	margin-top: 14px;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.contacts__email {
	font-size: clamp(1.125rem, .5vw + 1rem, 1.5rem);
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.contacts__email a {
	text-decoration: none;
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
	transition: background-size .3s var(--ease);
}

.contacts__email a:hover {
	background-size: 100% 1px;
}

.contacts__list {
	margin-top: 14px;
}

.contacts__list a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	font-size: .8125rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: none;
}

.contacts__arrow {
	display: inline-block;
	transition: transform .25s var(--ease);
}

.contacts__list a:hover .contacts__arrow {
	transform: translate(2px, -2px);
}

.site-footer {
	padding-block: clamp(72px, 8vw, 140px) 28px;
}

.site-footer__text {
	font-size: .6875rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ==========================================================================
   Project page
   ========================================================================== */
.site-main > .container,
.project > .container,
.page > .container {
	padding-bottom: clamp(24px, 3vw, 56px);
}

.project__back {
	padding-top: clamp(20px, 2.2vw, 36px);
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.project__back a {
	display: inline-block;
	padding-block: 10px;
	text-decoration: none;
	color: var(--muted);
	transition: color .2s;
}

.project__back a:hover {
	color: var(--fg);
}

.project__head {
	padding-block: clamp(12px, 1.6vw, 28px) clamp(20px, 2.4vw, 40px);
}

.project__title {
	font-size: clamp(1.75rem, 2.2vw + 1rem, 3.25rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: .01em;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.project__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin-top: 14px;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.project__cats a {
	text-decoration: none;
}

.project__cats a:hover {
	color: var(--fg);
	text-decoration: underline;
}

.project__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px clamp(24px, 4vw, 72px);
	margin-top: clamp(20px, 2vw, 32px);
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.project__meta dt {
	font-size: .6875rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.project__meta dd {
	margin-top: 2px;
	font-size: .9375rem;
}

/* Video embeds: keep the chosen aspect ratio on any screen. */
.ebp-embed {
	position: relative;
	aspect-ratio: var(--ratio, 16 / 9);
	background: #000;
	overflow: hidden;
}

.project__video {
	max-height: 86vh;
	margin-inline: auto;
}

.ebp-embed iframe,
.ebp-embed video,
.ebp-embed .wp-video,
.ebp-embed .wp-video-shortcode {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

.ebp-embed p {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #fff;
}

.project__cover img {
	width: 100%;
}

.project__content {
	max-width: 760px;
	margin-top: clamp(28px, 3vw, 56px);
}

.project__gallery {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--gap);
	margin-top: clamp(28px, 3vw, 56px);
}

.project__shot img {
	width: 100%;
	height: auto;
}

.project__nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--gap);
	margin-top: clamp(40px, 4.6vw, 80px);
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.project__nav-link {
	display: block;
	padding-block: 8px;
	text-decoration: none;
}

.project__nav-link--next {
	grid-column: 2;
	text-align: right;
}

.project__nav-label {
	display: block;
	font-size: .6875rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.project__nav-title {
	display: block;
	margin-top: 4px;
	font-size: clamp(.9375rem, .5vw + .8rem, 1.25rem);
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.project__nav-link:hover .project__nav-title {
	text-decoration: underline;
	text-underline-offset: .2em;
}

/* Editor content --------------------------------------------------------- */
.entry-content > * + * {
	margin-top: 1.1em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	margin-top: 1.6em;
	font-weight: 500;
	line-height: 1.25;
}

.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
}

.entry-content ul { list-style: disc; }

.entry-content figure,
.entry-content .wp-block-image {
	margin-inline: 0;
}

.entry-content .alignwide {
	width: min(100vw - (var(--gutter) * 2), var(--maxw));
	max-width: none;
	margin-inline: 50%;
	transform: translateX(-50%);
}

.entry-content .alignfull {
	width: 100vw;
	max-width: none;
	margin-inline: 50%;
	transform: translateX(-50%);
}

.entry-content figcaption {
	margin-top: 8px;
	font-size: .8125rem;
	color: var(--muted);
}

.page .entry-content,
.single-post .entry-content {
	max-width: 760px;
}

/* Blog fallback */
.posts__item {
	max-width: 760px;
	padding-block: 24px;
	border-top: 1px solid var(--line);
}

.posts__title {
	font-size: 1.5rem;
	font-weight: 400;
}

.posts__title a {
	text-decoration: none;
}

.posts__date {
	margin-block: 6px 12px;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Large screens: a bit more air and a 4th column on very wide monitors. */
@media (min-width: 2100px) {
	.grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Laptops / tablets landscape */
@media (max-width: 1100px) {
	.contacts__inner {
		grid-template-columns: 1fr 1fr;
	}
}

/* Tablets: two columns */
@media (max-width: 999px) {
	.grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hero {
		aspect-ratio: 2.6 / 1;
	}
}

/* Phones landscape / small tablets */
@media (max-width: 720px) {
	.hero {
		aspect-ratio: 16 / 9;
	}

	.works__years {
		margin-right: 0;
	}

	.contacts__inner {
		grid-template-columns: 1fr;
	}

	.project__gallery {
		grid-template-columns: 1fr;
	}
}

/* Phones: one column, burger menu, horizontally scrollable filters */
@media (max-width: 599px) {
	.grid {
		grid-template-columns: 1fr;
	}

	.card__media {
		aspect-ratio: 2 / 1;
	}

	.hero {
		aspect-ratio: 4 / 3;
	}

	.works__head {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.site-header__inner {
		align-items: center;
	}

	.nav-toggle {
		display: block;
		margin: -8px -10px -8px 0;
	}

	.site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 20;
		padding: 8px 0 16px;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}

	.site-header.is-open .site-nav {
		display: block;
	}

	.site-nav__list {
		flex-direction: column;
		gap: 0;
		margin: 0;
		padding: 0;
	}

	.site-nav__list a {
		display: block;
		padding-block: 14px;
		font-size: .875rem;
		border-bottom: 0;
	}

	.filters {
		margin-inline: calc(var(--gutter) * -1);
	}

	.filters__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-inline: var(--gutter);
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

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

	.filters__list li {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}

	.project__nav {
		grid-template-columns: 1fr;
	}

	.project__nav-link--next {
		grid-column: auto;
		text-align: left;
	}
}

/* Touch devices: no sticky hover states */
@media (hover: none) {
	.card__link:active .card__img {
		transform: scale(1.015);
	}
}

/* Respect "reduce motion" */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* Anchor offset so headings aren't glued to the top */
#works,
#contacts {
	scroll-margin-top: 16px;
}

@media print {
	.site-nav,
	.nav-toggle,
	.filters {
		display: none;
	}
}
