/*
Theme Name: Promobox Blog
Theme URI: https://promobox.cc/blog/
Author: Promobox
Author URI: https://promobox.cc
Description: Blog theme for Promobox — SMM marketing platform. Matches the main promobox.cc design: dark header/footer, Onest font, violet accent.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 2.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: promobox-blog
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, blog
*/

/* ===== Base ===== */
html {
	scroll-behavior: smooth;
}

a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.15em;
}

:where(.wp-site-blocks *:focus) {
	outline: none;
}

:where(.wp-site-blocks *:focus-visible) {
	outline: none;
}

/* ===== Header ===== */
/* Template part wrapper — sticky must be on this level */
.wp-block-template-part:has(.site-header) {
	position: sticky;
	top: 0;
	z-index: 30;
}

.site-header {
	background: #141414;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header--scrolled {
	background: rgba(20, 20, 20, 0.9);
	backdrop-filter: blur(30px);
	-webkit-backdrop-filter: blur(30px);
}

.header-inner {
	max-width: 1728px;
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 80px;
}

.header-logo {
	flex-shrink: 0;
	display: inline-flex;
}

.header-logo__img {
	display: block;
	height: 28px;
	width: auto;
}

.header-nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.header-nav__link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	color: #EBEBEB;
	text-decoration: none;
	font-size: 1rem;
	border-radius: 10px;
	border: 1.3px solid transparent;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.header-nav__link:hover {
	opacity: 0.9;
	color: #fff;
}

.header-nav__link--active {
	color: #fff;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.header-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 16px;
	height: 40px;
	border-radius: 9999px;
	border: 1px solid #EBEBEB;
	color: #EBEBEB;
	text-decoration: none;
	font-size: 1rem;
	font-weight: 400;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.header-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.header-burger {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	margin-left: auto;
}

/* ===== Language switcher ===== */
.lang-switcher {
	position: relative;
}

.lang-switcher [x-cloak] {
	display: none !important;
}

.lang-switcher__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: 1.3px solid transparent;
	cursor: pointer;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1;
	padding: 0 12px;
	height: 40px;
	border-radius: 10px;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.lang-switcher__globe {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.lang-switcher__label {
	font-size: 1rem;
	font-weight: 500;
}

.lang-switcher__dropdown {
	position: absolute;
	z-index: 10;
}

.lang-switcher__item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.lang-switcher__flag {
	width: 20px;
	height: 20px;
	display: block;
}

/* Dark variant — for .site-header (dark background) */
.lang-switcher--dark .lang-switcher__button {
	color: #EBEBEB;
}

.lang-switcher--dark .lang-switcher__button:hover {
	border-color: rgba(255, 255, 255, 0.3);
}

.lang-switcher--dark .lang-switcher__button.is-open {
	background: #141414;
	border-color: rgba(255, 255, 255, 1);
	border-radius: 10px 10px 0 0;
	overflow: hidden;
}

.lang-switcher--dark .lang-switcher__dropdown {
	left: 0;
	top: 100%;
	width: 100%;
	overflow: hidden;
}

.lang-switcher--dark .lang-switcher__item {
	background: #141414;
	color: #EBEBEB;
	border: 1.3px solid rgba(255, 255, 255, 1);
	border-top: 0;
	border-radius: 0 0 10px 10px;
	height: 40px;
	padding: 0 12px;
}

.lang-switcher--dark .lang-switcher__item:hover {
	background: #1a1a1a;
}

/* Light variant — for mobile menu (white background) */
.lang-switcher--light .lang-switcher__button {
	color: #22272F;
}

.lang-switcher--light .lang-switcher__dropdown {
	left: 0;
	top: calc(100% + 8px);
	width: 120px;
	background: #fff;
	border: 1px solid #EBEBEB;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	overflow: hidden;
}

.lang-switcher--light .lang-switcher__item {
	color: #22272F;
}

.lang-switcher--light .lang-switcher__item:hover {
	background: #F5F5F5;
}

.mobile-menu-lang {
	padding: 16px 24px;
	border-bottom: 1px solid #EBEBEB;
}

/* ===== Mobile Menu ===== */
.mobile-menu-overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	background: rgba(20, 20, 20, 0.8);
	display: flex;
	align-items: flex-end;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mobile-menu-overlay.is-open {
	pointer-events: auto;
	opacity: 1;
}

.mobile-menu-panel {
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 32px 32px 0 0;
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
	transform: translateY(0);
}

.mobile-menu-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 16px;
	border-bottom: 1px solid #EBEBEB;
}

.mobile-menu-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #22272F;
	padding: 4px;
}

.mobile-menu-nav {
	display: flex;
	flex-direction: column;
}

.mobile-menu-link {
	display: flex;
	align-items: center;
	padding: 24px;
	font-size: 1.125rem;
	font-weight: 600;
	color: #22272F;
	text-decoration: none;
	border-bottom: 1px solid #EBEBEB;
	transition: background 0.2s ease;
}

.mobile-menu-link:hover {
	background: #F5F5F5;
}

.mobile-menu-link--active {
	color: var(--wp--preset--color--accent);
}

.mobile-menu-auth {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding: 24px;
	border-bottom: 1px solid #EBEBEB;
}

.mobile-menu-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 13px 24px;
	border-radius: 48px;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.mobile-menu-btn--secondary {
	background: #EBEBEB;
	color: #5C5C6A;
}

.mobile-menu-btn--primary {
	background: var(--wp--preset--color--accent);
	color: #fff;
}

.mobile-menu-btn:hover {
	opacity: 0.9;
}

/* Header responsive */
@media (max-width: 1024px) {
	.header-nav,
	.header-actions {
		display: none;
	}

	.header-burger {
		display: block;
	}

	.header-inner {
		height: 64px;
		padding: 0 16px;
	}

	.header-logo__img {
		height: 24px;
	}
}

/* ===== Footer ===== */
.site-footer {
	background: linear-gradient(0deg, rgba(180, 159, 235, 0.3) 0%, rgba(20, 20, 20, 0) 69.376%), linear-gradient(90deg, #141414 0%, #141414 100%);
	color: #EBEBEB;
	font-family: var(--wp--preset--font-family--onest);
}

.footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 24px 24px;
}

.footer-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
}

.footer-copyright {
	color: #EBEBEB;
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.footer-copyright span {
	color: rgba(255, 255, 255, 0.5);
}

.footer-copyright a {
	color: #EBEBEB;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.footer-copyright a:hover {
	opacity: 0.7;
}

.footer-nav {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
}

.footer-nav a {
	color: #EBEBEB;
	text-decoration: none;
	font-size: 0.875rem;
	transition: opacity 0.2s ease;
}

.footer-nav a:hover {
	opacity: 0.7;
}

.footer-disclaimer {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.75rem;
	line-height: 1.4;
	margin: 16px 0 0;
}

/* Footer responsive */
@media (max-width: 600px) {
	.footer-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.footer-nav {
		gap: 16px;
	}
}

/* ===== Hero Card ===== */
.hero-card {
	overflow: hidden;
	transition: box-shadow 0.3s ease;
}

.hero-card:hover {
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.wp-block-post-featured-image {
	max-width: 100%;
}

.hero-card .wp-block-post-featured-image {
	overflow: hidden;
	width: 100%;
	height: 100%;
	aspect-ratio: 3 / 2 !important;
}

.hero-card__image a {
	overflow: hidden;
	border-radius: 20px;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-card__image .wp-block-post-featured-image {
	border-radius: 20px !important;
}

.hero-card .wp-block-post-featured-image img {
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.hero-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

.hero-card .wp-block-post-terms a {
	background: var(--wp--preset--color--base);
}

/* ===== Category Filter ===== */
.category-filter {
	display: flex !important;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.category-filter li {
	list-style: none !important;
}

.category-filter li a {
	display: inline-block;
	padding: 8px 18px;
	border-radius: 48px;
	background: var(--wp--preset--color--light-gray);
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: background 0.2s ease, color 0.2s ease;
}

.category-filter li a:hover,
.category-filter li.current-cat a {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* ===== Post Cards Grid — equal heights (excludes hero-query) ===== */
.wp-block-query:not(.hero-query) > .wp-block-post-template.is-layout-flow,
.wp-block-query:not(.hero-query) > .wp-block-post-template.wp-block-post-template-is-layout-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.wp-block-query:not(.hero-query) > .wp-block-post-template > li {
	list-style: none;
	margin: 0;
	display: flex;
}

.wp-block-query:not(.hero-query) > .wp-block-post-template > li > .post-card {
	flex: 1 1 auto;
	width: 100%;
}

@media (max-width: 1024px) {
	.wp-block-query:not(.hero-query) > .wp-block-post-template.is-layout-flow,
	.wp-block-query:not(.hero-query) > .wp-block-post-template.wp-block-post-template-is-layout-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.wp-block-query:not(.hero-query) > .wp-block-post-template.is-layout-flow,
	.wp-block-query:not(.hero-query) > .wp-block-post-template.wp-block-post-template-is-layout-grid {
		grid-template-columns: 1fr;
	}
}

/* ===== Post Cards ===== */
.post-card {
	transition: box-shadow 0.25s ease, transform 0.25s ease;
	overflow: hidden;
	background: var(--wp--preset--color--base);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.post-card__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	min-width: 0;
}

.post-card,
.post-card * {
	min-width: 0;
}

.post-card__body > *,
.post-card__body > * > * {
	max-width: 100%;
}

.post-card:hover {
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.07);
	transform: translateY(-3px);
}

.post-card .wp-block-post-featured-image {
	overflow: hidden;
}

.post-card .wp-block-post-featured-image img {
	aspect-ratio: 16/9;
	object-fit: cover;
	width: 100%;
	transition: transform 0.35s ease;
}

.post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

/* ===== Category / Tag Badges ===== */
.wp-block-post-terms a {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 48px;
	background: var(--wp--preset--color--light-gray);
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
	transition: background 0.2s ease, color 0.2s ease;
}

.wp-block-post-terms a:hover {
	background: var(--wp--preset--color--gray-200);
	color: var(--wp--preset--color--accent);
}

/* ===== Pagination ===== */
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.wp-block-query-pagination .page-numbers.current,
.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.wp-block-query-pagination .page-numbers:hover:not(.current),
.wp-block-query-pagination-numbers .page-numbers:hover:not(.current) {
	background: var(--wp--preset--color--light-gray);
}

/* ===== Article Layout (Single) — 3-column grid ===== */
.article-grid {
	display: grid;
	grid-template-columns: 240px 1fr 240px;
	gap: 40px;
}

.article-toc-sidebar {
	position: relative;
}

.article-toc-sticky {
	position: sticky;
	top: 100px;
}

.article-content {
	min-width: 0;
}

.article-share-sidebar {
	position: relative;
}

.sidebar-sticky {
	position: sticky;
	top: 100px;
}

.sidebar-heading {
	font-size: 0.875rem;
	font-weight: 600;
	margin: 0 0 16px;
}

/* ===== TOC ===== */
.article-toc {
	background: var(--wp--preset--color--light-gray);
	border-radius: 14px;
	padding: 20px 24px;
	margin-bottom: var(--wp--preset--spacing--50);
}

.toc-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.toc-title {
	font-weight: 600;
	font-size: 1rem;
	color: var(--wp--preset--color--contrast);
}

.toc-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--wp--preset--color--secondary);
	padding: 4px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.toc-toggle:hover {
	background: var(--wp--preset--color--gray-200);
}

.toc--collapsed .toc-toggle svg {
	transform: rotate(-90deg);
}

.toc--collapsed .toc-body {
	display: none;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 16px 0 0;
}

.toc-item {
	margin-bottom: 6px;
}

.toc-item a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.5;
	transition: color 0.2s ease;
	display: block;
	padding: 3px 0;
}

.toc-item a:hover,
.toc-item a.toc-link--active {
	color: var(--wp--preset--color--accent);
}

.toc-item--sub {
	padding-left: 20px;
}

.toc-item--sub a {
	font-size: 0.875rem;
	color: var(--wp--preset--color--tertiary);
}

.toc-item--sub a:hover {
	color: var(--wp--preset--color--accent);
}

/* ===== Author Box ===== */
.author-box .wp-block-avatar img {
	border: 2px solid var(--wp--preset--color--gray-200);
}

/* ===== Share Buttons ===== */
.share-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--wp--preset--color--light-gray);
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
	cursor: pointer;
}

.share-btn:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* ===== Single Post Featured Image ===== */
.single-featured-image {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}

.single-featured-image img {
	border-radius: 16px;
}

/* ===== Search Form ===== */
.wp-block-search__button {
	border-radius: 48px !important;
}

/* ===== 404 Page ===== */
.error-404-content {
	min-height: 50vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

/* ===== Comment Form ===== */
.wp-block-post-comments-form textarea,
.wp-block-post-comments-form input[type="text"],
.wp-block-post-comments-form input[type="email"],
.wp-block-post-comments-form input[type="url"] {
	border-radius: 10px;
	border: 1px solid var(--wp--preset--color--gray-200);
	padding: 12px 16px;
	font-family: var(--wp--preset--font-family--onest);
}

.wp-block-post-comments-form .form-submit input[type="submit"] {
	border-radius: 48px;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	border: none;
	padding: 12px 24px;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--onest);
	font-weight: 500;
	transition: background 0.2s ease;
}

.wp-block-post-comments-form .form-submit input[type="submit"]:hover {
	background: var(--wp--preset--color--accent-hover);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
	.article-grid {
		grid-template-columns: 1fr;
	}

	.article-toc-sidebar {
		order: -1;
	}

	.article-toc-sticky {
		position: static;
	}

	.article-share-sidebar {
		order: 3;
	}

	.sidebar-sticky {
		position: static;
	}
}

@media (max-width: 782px) {
	.hero-card {
		flex-direction: column !important;
	}

	.hero-card .wp-block-column {
		flex-basis: 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}

	.hero-card .wp-block-post-featured-image {
		aspect-ratio: 3 / 2 !important;
		height: auto;
	}

	.hero-card .wp-block-post-featured-image img {
		border-radius: 20px !important;
	}

	.hero-card__image .wp-block-post-featured-image {
		border-radius: 20px !important;
	}
}

@media (max-width: 600px) {
	.wp-block-post-template.is-layout-grid {
		grid-template-columns: 1fr !important;
	}

	.share-buttons {
		justify-content: flex-start;
	}
}

main.wp-block-group{
	  flex: 1 0 auto;

} 

.wp-site-blocks { /* Или другой основной контейнер вашей темы */
  display: flex;
  flex-direction: column;
  min-height: 100vh; 
}

footer {
 flex-shrink: 0;
}
