/*!
Theme Name: macrolook_wp
Author: macrolook
Description: Собственная тема macrolook (ядро сайта и рабочих систем).
Version: 2.0.0
Requires PHP: 8.1
Text Domain: macrolook_wp
*/

/*
 * Корневой файл стилей темы. Подключается на всех страницах сайта
 * и рабочего кабинета (inc/theme-setup.php → wp_enqueue_style).
 *
 * 1. Шрифты
 * 2. Токены (CSS-переменные)
 * 3. Сброс и базовые элементы
 * 4. Формы
 * 5. Общие компоненты (кнопки, контейнеры, списки)
 * 6. Контент WordPress (записи, выравнивание, доступность)
 *
 * Бывший root.css целиком перенесён сюда (разделы 2, 4, 5),
 * отдельно он больше не подключается.
 */

/* ── 1. Шрифты ─────────────────────────────────────────────── */

@font-face {
	font-family: "montserrat";
	src: url("/wp-content/themes/macrolook_wp/fonts/montserrat.woff2") format("woff2"),
		url("/wp-content/themes/macrolook_wp/fonts/montserrat.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "hibana";
	src: url("/wp-content/themes/macrolook_wp/fonts/hibana.woff2") format("woff2"),
		url("/wp-content/themes/macrolook_wp/fonts/hibana.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* ── 2. Токены ─────────────────────────────────────────────── */

:root {
	--orange: #E57431;
	--green: #ACE272;
	--blue: #7CD8E5;
	--main-back: #1d1d1d;
	--gray: gray;
	--white: white;
	--glass_background: rgba(128, 128, 128, 0.1);
	--glass_background_brighter: rgba(160, 160, 160, 0.1);
	--glass_background_hover: rgba(160, 160, 160, 0.14); /* кликабельное стекло при наведении и поле в фокусе */
	--glass_background_alt: rgba(128, 128, 128, 0.14); /* второй оттенок строк таблицы */
	--glass_background_row_in: rgba(160, 160, 160, 0.05); /* светлая строка таблицы внутри стеклянного контейнера (тёмная — прозрачная) */
	--blur_background: blur(8px);
	--border_radius_big: 30px;
	--border_radius_small: 15px;
	--border_orange: 1px solid #E57431;
	--border_white: 1px solid white;
	--button_padding: 10px 20px;
	--transition_short: all 0.1s ease;
	--cont_padding_desktop: 15%;
	--cont_padding_phone: 8%;
	--cont_padding_tiny: 2%;
	--p_font_size_desktop: 15px;
	--p_font_size_phone: 10px;
	--h1_font_size_desktop: 70px;
	--h2_font_size_desktop: 40px;
	--h3_font_size_desktop: 2em;
}

/* ── 3. Сброс и базовые элементы ───────────────────────────── */

*,
*::before,
*::after {
	box-sizing: inherit;
}

* {
	-webkit-tap-highlight-color: transparent;
}

*:focus {
	outline: none;
}

html {
	box-sizing: border-box;
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
	overflow-x: hidden;
	/* Место под полосу прокрутки зарезервировано всегда: ширина страницы и шапка не прыгают, когда полоса
	   появляется/исчезает (короткая страница, открытый поп-ап блокирует прокрутку). На телефонах полоса поверх, ничего не меняется. */
	scrollbar-gutter: stable;
}

/* Подложки поп-апов со своей прокруткой: резерв с обеих сторон, чтобы окно не дёргалось влево-вправо при смене высоты содержимого */
.mu-pop, .modal-overlay, .ml-icrop, .acc-pop-up-cont, .warn-pop-up-cont, .ml-raw-pop, .ml-pop-cont, .pop_up_overlay, .pop-up_position {
	scrollbar-gutter: stable both-edges;
}

body {
	margin: 0 !important;
	position: relative;
	background-color: #1d1d1d;
}

body,
button,
input,
select,
optgroup,
textarea {
	color: white;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}

::selection {
	background: #E57431;
	color: #fff;
}

header,
footer {
	margin: 0;
	padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: white;
	font-family: hibana;
	font-weight: normal;
	margin-bottom: 0em;
}

label,
p {
	color: var(--white);
}

a {
	color: white;
	background-color: transparent;
	text-decoration: none;
}

a:hover {
	color: #E57431;
}

a,
button {
	touch-action: manipulation;
}

a,
button,
input,
textarea,
a:focus,
a:active,
button:focus,
button:active,
input:focus,
input:active,
textarea:focus,
textarea:active {
	outline: none;
}

b,
strong {
	font-weight: bolder;
}

dfn,
cite,
em,
i {
	font-style: italic;
}

small {
	font-size: 80%;
}

big {
	font-size: 125%;
}

sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

abbr[title] {
	border-bottom: none;
	text-decoration: underline dotted;
}

abbr,
acronym {
	border-bottom: 1px dotted #666;
	cursor: help;
}

mark,
ins {
	background: #fff9c0;
	text-decoration: none;
}

blockquote {
	margin: 0 1.5em;
}

address {
	margin: 0 0 1.5em;
}

code,
kbd,
samp {
	font-family: monospace, monospace;
	font-size: 1em;
}

code,
kbd,
tt,
var {
	font-family: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}

pre {
	background: #eee;
	font-family: "Courier 10 Pitch", courier, monospace;
	font-size: 1em;
	line-height: 1.6;
	margin-bottom: 1.6em;
	max-width: 100%;
	overflow: auto;
	padding: 1.6em;
}

hr {
	box-sizing: content-box;
	overflow: visible;
	background-color: #ccc;
	border: 0;
	height: 1px;
	margin-bottom: 1.5em;
}

ul {
	list-style: disc;
}

li > ul,
li > ol {
	margin-bottom: 0;
}

dt {
	font-weight: 700;
}

dd {
	margin: 0 1.5em 1.5em;
}

img {
	border-style: none;
	height: auto;
	max-width: 100%;
}

embed,
iframe,
object {
	max-width: 100%;
}

figure {
	margin: 0em 0;
}

table {
	margin: 0 0 1.5em;
	width: 100%;
}

summary {
	display: list-item;
}

/* ── 4. Формы ──────────────────────────────────────────────── */

button,
input,
optgroup,
select,
textarea {
	margin: 0;
}

button,
input {
	overflow: visible;
}

button,
select {
	text-transform: none;
}

button {
	border: none;
	border-radius: 30px;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
	-webkit-appearance: button;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}

fieldset {
	padding: 0.35em 0.75em 0.625em;
}

legend {
	box-sizing: border-box;
	color: inherit;
	display: table;
	max-width: 100%;
	padding: 0;
	white-space: normal;
}

progress {
	vertical-align: baseline;
}

/* Поля ввода: стекло, скругление, белый текст (бывший root.css). */
input,
textarea {
	border-radius: var(--border_radius_small) !important;
	background: var(--glass_background);
	color: var(--white) !important;
	padding: 10px !important;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea {
	border: none;
	outline: none;
}

textarea {
	width: 100%;
	overflow: auto;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
	height: auto;
}

[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

/* Чекбокс: круглый, оранжевый в отмеченном состоянии. */
[type="checkbox"],
[type="radio"] {
	box-sizing: border-box;
	padding: 0;
}

input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background-color: #fff;
	cursor: pointer;
	outline: none;
	border: none;
	transition: background-color 0.2s ease;
}

input[type="checkbox"]:checked {
	background-color: var(--orange);
}

/* Обводка только при навигации с клавиатуры: после клика мышью не залипает */
input[type="checkbox"]:focus-visible {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.checkbox-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* ── 5. Общие компоненты ───────────────────────────────────── */

/* Нумерованный список-карточка. */
ol {
	list-style: decimal;
	background-color: rgba(128, 128, 128, 0.1);
	backdrop-filter: blur(8px);
	padding: 20px 20px 20px 35px;
	border-radius: 30px;
	counter-reset: list;
	color: white;
	margin: 1rem 0 0 0;
}

.list_number {
	color: white;
	counter-increment: list;
	list-style-type: none;
	margin: 15px 0 15px 0;
}

.list_number:before {
	content: counter(list);
	margin-right: 12px;
	background: #4d4d4d;
	display: inline-block;
	text-align: center;
	line-height: 32px;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: white;
}

/*
 * Кнопки-пилюли (брендбук macrolook.ru/design, блок «Кнопки»):
 *   .orange_butt — акцентная (= .btn--accent): оранжевая, при наведении белая;
 *   .psebutton   — контурная (= .btn--outline): белый контур, при наведении оранжевый.
 * Правило бренда: белое кликабельное → оранжевое, оранжевое → белое; переход 0.25s.
 * Размер (padding, font-size) задаёт контекст страницы, форму и цвета — только здесь.
 * Наведение — только на устройствах с мышью (на тач-экранах оно «залипает»),
 * фокус с клавиатуры (:focus-visible) выглядит так же, как наведение.
 */
.psebutton,
.orange_butt {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 20px;
	border-radius: 100px;
	font-family: montserrat, sans-serif;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, fill 0.25s ease;
}

/* Толщина рамки: 1.5px из брендбука рисуется чётко только на экранах
   с плотностью 2x+. На обычных мониторах полпикселя размывается и «шакалит»,
   поэтому там целые 2px. Оранжевая кнопка берёт ту же толщину,
   чтобы пары «оранжевая + контурная» были одной высоты. */
:root {
	--button_border: 2px;
}

@media (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) {
	:root {
		--button_border: 1.5px;
	}
}

.psebutton {
	background: none;
	border: var(--button_border) solid var(--white);
	color: var(--white);
	fill: var(--white);
}

.psebutton:focus-visible {
	border-color: var(--orange);
	color: var(--orange);
	fill: var(--orange);
}

@media (hover: hover) {
	.psebutton:hover {
		border-color: var(--orange);
		color: var(--orange);
		fill: var(--orange);
	}
}

/* Нажатие (в т.ч. на телефоне): контур красится вместе с текстом.
   На тач-экранах «залипший» :hover после касания не оставляет
   полуоранжевую кнопку (оранжевый текст из a:hover при белой рамке). */
.psebutton:active {
	border-color: var(--orange);
	color: var(--orange);
	fill: var(--orange);
	transition-duration: 0s;
}

@media (hover: none) {
	.psebutton:not(:active):hover {
		color: var(--white);
		fill: var(--white);
	}
}

.psebutton_gray {
	background: var(--glass_background);
	color: white;
	padding: 10px 20px;
	border-radius: 30px;
	font-size: 1rem;
	outline: none;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
}

.psebutton_gray:hover {
	color: var(--orange);
	border: none;
	background-color: var(--glass_background_brighter);
}

/* У оранжевой кнопки видимой рамки нет НИКОГДА — ни при наведении,
   ни в фокусе, ни в паре с .psebutton (class="psebutton orange_butt"),
   у которой своя оранжевая рамка при наведении. Рамка есть только
   прозрачная, ради высоты, равной контурной .psebutton. */
.orange_butt {
	background: var(--orange);
	border: var(--button_border) solid transparent;
	color: var(--white);
	fill: var(--white);
}

.orange_butt,
.orange_butt:hover,
.orange_butt:focus,
.orange_butt:focus-visible,
.orange_butt:active {
	border-color: transparent !important;
}

.orange_butt:focus-visible,
.orange_butt:active {
	background: var(--white);
	color: var(--orange);
	fill: var(--orange);
}

@media (hover: hover) {
	.orange_butt:hover {
		background: var(--white);
		color: var(--orange);
		fill: var(--orange);
	}
}

.psebutton:disabled,
.orange_butt:disabled,
.psebutton[aria-disabled="true"],
.orange_butt[aria-disabled="true"] {
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

.white_butt {
	background: white;
	color: #1d1d1d;
	border: solid 1px transparent;
	transition: all 0.1s ease;
	cursor: pointer;
	border-radius: 100px;
	padding: 8px 15px;
	align-items: center;
	justify-content: center;
	display: flex;
}

.white_butt:hover {
	background: #1d1d1d;
	border: solid 1px var(--white);
	color: white;
}

/* Контейнеры */
.small_cont {
	border-radius: var(--border_radius_big);
	background: var(--glass_background);
	padding: 10px;
	display: flex;
	flex-direction: column;
	max-width: 600px;
	min-width: 300px;
}

.medium_cont {
	border-radius: var(--border_radius_big);
	background: var(--main-back);
	padding: 10px;
	display: flex;
	flex-direction: column;
	height: fit-content;
	min-width: 300px;
}

.pagecont {
	padding: 200px 15% 200px 15%;
	display: flex;
	flex-direction: column;
	gap: 20px;
	align-items: center;
}

@media screen and (max-width: 768px) {
	.pagecont {
		padding: 200px 8% 200px 8%;
	}
}

.unselect {
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* ── 6. Контент WordPress ──────────────────────────────────── */

.entry-header,
.entry-content,
.entry-footer {
	margin: 0 !important;
	padding: 0 !important;
}

.sticky {
	display: block;
}

.post,
.page {
	margin: 0 0 1.5em;
}

.updated:not(.published) {
	display: none;
}

.page-content,
.entry-content,
.entry-summary {
	margin: 1.5em 0 0;
}

.page-links {
	clear: both;
	margin: 0 0 1.5em;
}

.gallery-item {
	display: inline-block;
	text-align: center;
	width: 100%;
}

/* Текст только для экранных читалок. */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* Выравнивание картинок из редактора (используется в записях блога). */
.alignleft {
	float: left;
	margin-right: 1.5em;
	margin-bottom: 1.5em;
}

.alignright {
	float: right;
	margin-left: 1.5em;
	margin-bottom: 1.5em;
}

.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.5em;
}
