/*
 Theme Name:   BlogHash Pro Child
 Author:       Maria
 Template:     bloghash-pro
*/

/* ==========================================================================
   Пункт 2. Скрыть шапку раздела (бежевый блок .page-header с заголовком и
   хлебными крошками, фон rgba(247,229,183,0.35)) на всех архивах и разделах.
   На singular и главной он не трогается.
   ========================================================================== */
body.archive .page-header {
	display: none !important;
}

/* ==========================================================================
   Пункт 4. Блок «Скриншоты и видео» (.games_gallery_wrap, display:flex).
   Видео вставляют через <iframe> (YouTube/VK) внутри <p>. Для него не было
   правил (в отличие от .wp-video и .gallery-item), поэтому ряд разъезжался.
   Выравниваем по верху и приводим видео к размеру элементов галереи 300x170.
   ========================================================================== */
.games_gallery_wrap {
	align-items: flex-start !important;
}
.games_gallery_wrap > p {
	margin: 0 !important;
	flex: 0 0 auto !important;
	line-height: 0;
}
.games_gallery_wrap iframe {
	width: 300px !important;
	min-width: 300px !important;
	height: 170px !important;
	max-width: 100%;
	border: 0;
	display: block;
}

/* ==========================================================================
   Пункт 6. Превью постов в горизонтальной ленте (главная/архивы). У картинок
   был min-height: 30rem без максимума, поэтому вертикальные изображения
   растягивали карточку. Фиксируем высоту и обрезаем через object-fit, чтобы
   все превью были одинаковыми независимо от размера исходника.
   ========================================================================== */
.bloghash-blog-horizontal .bloghash-article .entry-media,
.bloghash-blog-horizontal .bloghash-article .entry-media .entry-image-link {
	height: 300px !important;
	min-height: 300px !important;
	max-height: 300px !important;
}
.bloghash-blog-horizontal .bloghash-article .entry-media img {
	width: 100% !important;
	height: 300px !important;
	min-height: 300px !important;
	max-height: 300px !important;
	object-fit: cover !important;
}

/* ==========================================================================
   Пункт 1. Форма добавления материала с фронта [vg_submit_form].
   ========================================================================== */
.vg-submit-form p {
	margin-bottom: 20px;
}
.vg-submit-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
}
.vg-submit-form input[type="text"],
.vg-submit-form input[type="number"],
.vg-submit-form input[type="file"],
.vg-submit-form select,
.vg-submit-form textarea {
	display: block;
	width: 100%;
	max-width: 560px;
	height: auto !important;      /* убираем фикс. height:36px темы, из-за него текст обрезался */
	min-height: 48px;
	margin-top: 6px;
	padding: 12px 14px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 8px;
	background: #fff;
	font: inherit;
	line-height: 1.4;            /* тема наследует крупный line-height, фиксируем */
	color: inherit;
	box-sizing: border-box;
}
.vg-submit-form textarea {
	min-height: 120px;
}
.vg-submit-form .vg-check {
	display: block;
	font-weight: 400;
	margin: 0 0 8px;
}
.vg-submit-form .vg-check input {
	display: inline-block;
	width: auto;
	max-width: none;
	margin: 0 8px 0 0;
	padding: 0;
}
/* Honeypot (антиспам): прячем поле от людей, боты его заполняют. */
.vg-submit-form .vg-hp {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.vg-submit-notice {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
}
.vg-submit-notice.vg-ok {
	background: #e6f6ec;
	color: #1c7c3f;
}
.vg-submit-notice.vg-err {
	background: #fdeaea;
	color: #b32020;
}

/* ==========================================================================
   Пункт 8 (этап 1). Адаптив каталога игр (.catalog_content). На десктопе
   3 колонки, на планшете и телефоне уменьшаем, чтобы карточки не были тесными.
   ========================================================================== */
@media (max-width: 991px) {
	.catalog_content {
		grid-template-columns: 1fr 1fr !important;
	}
}

/* Кнопка "Показать ещё" под каталогом (пункт 8, этап 1). */
#vg-loadmore-wrap {
	text-align: center;
	margin-top: 24px;
}

/* На мобильном фильтр (сайдбар) поднимаем над каталогом. */
@media (max-width: 991px) {
	body.tax-gamescat .bloghash-container.bloghash-card__boxed {
		display: flex !important;
		flex-direction: column !important;
	}
	body.tax-gamescat #primary {
		order: 2 !important;
	}
	body.tax-gamescat #secondary {
		order: 1 !important;
	}
}

/* Прелоадер (спиннер) при фильтрации и подгрузке. */
#vg-games-results {
	position: relative;
}
#vg-games-results.vg-is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.55);
	z-index: 5;
}
#vg-games-results.vg-is-loading::before {
	content: "";
	position: absolute;
	top: 40px;
	left: 50%;
	width: 40px;
	height: 40px;
	margin-left: -20px;
	border: 4px solid rgba(0, 0, 0, 0.12);
	border-top-color: #e6006e;
	border-radius: 50%;
	animation: vg-spin 0.7s linear infinite;
	z-index: 6;
}
@keyframes vg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Сообщение "ничего не найдено" на всю ширину каталога. */
.catalog_content .vg-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 30px 0;
	font-size: 1.1em;
}
