* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

p {
	margin: 0;
}

:root {
	--hex-size: 350px;
	--gap: 5px;
	--bg-color: #e9e9e7;
	--orange: #f16e23;
	--gradient-start: #ff5858;
	--gradient-end: #ffb199;
}

html {
	background: var(--bg-color);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
	font-size: 16px;
}

body {
	overflow-x: hidden;
	background:#dddddd;
}

.site-content {
	background:#dddddd;
}
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--hex-size: 300px;
	--gap: 15px;
	--bg-color: #e9e9e7;
	--orange: #f16e23;
	--gradient-start: #ff5858;
	--gradient-end: #ffb199;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.heading {
	text-align: center;
	font-size: 2.5rem;
	font-weight: 600;
	color: #4d4d4d;
	margin-bottom: 10px;
	opacity: 0;
	transform: translateY(-20px);
	animation: fadeInDown 0.6s ease-out 0.2s forwards;
}

@keyframes fadeInDown {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.gallery {
	display: grid;
	grid-template-columns: repeat(3, var(--hex-size));
	justify-content: center;
	gap: var(--gap);
	/* padding: calc(var(--hex-size) * 0.25) 0; */
	margin: 0 auto;
	max-width: 100%;
	position: relative;
	transform: translateX(calc(var(--hex-size) * 0.25));
}

.gallery-item {
	position: relative;
	width: var(--hex-size);
	height: calc(var(--hex-size) * 0.866);
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
	background: white;
	cursor: pointer;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: visible;
	opacity: 0;
	transform: scale(0.8) rotate(5deg);
	animation: galleryItemAppear 0.6s ease-out forwards;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 4px 15px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
	--col-offset: 0;
	--row-offset: 0;
	--extra-offset: 0;
	margin-top: calc(var(--hex-size) * 0.866 * (var(--col-offset) + var(--row-offset) + var(--extra-offset)));
	margin-bottom: 0;
}
.gallery-item_logo {
	max-width: 40%;
}

.topic-panel-wrapper {
	display: flex;
  flex-direction: column;
  align-items: flex-start;
}

@keyframes galleryItemAppear {
	from {
		opacity: 0;
		transform: scale(0.8) rotate(5deg);
	}
	to {
		opacity: 1;
		transform: scale(1) rotate(0deg);
	}
}

.gallery-item:nth-child(1) { animation-delay: 0.3s; }
.gallery-item:nth-child(2) { animation-delay: 0.4s; }
.gallery-item:nth-child(3) { animation-delay: 0.5s; }
.gallery-item:nth-child(4) { animation-delay: 0.6s; }
.gallery-item:nth-child(5) { animation-delay: 0.7s; }
.gallery-item:nth-child(6) { animation-delay: 0.8s; }
.gallery-item:nth-child(7) { animation-delay: 0.9s; }
.gallery-item:nth-child(8) { animation-delay: 1s; }
.gallery-item:nth-child(9) { animation-delay: 1.1s; }
.gallery-item:nth-child(10) { animation-delay: 1.2s; }
.gallery-item:nth-child(11) { animation-delay: 1.3s; }
.gallery-item:nth-child(12) { animation-delay: 1.4s; }

/* Смещение второго блока в каждом ряду на 25% влево */
.gallery-item:nth-child(3n-1) {
	--col-offset: 0.5;
	--extra-offset: 0.05;
	transform: translateX(calc(var(--hex-size) * -0.25)) scale(0.8) rotate(5deg);
	animation: galleryItemAppearShifted 0.6s ease-out forwards;
}

/* Смещение третьего блока в каждом ряду на 50% влево (25% + 25%) */
.gallery-item:nth-child(3n) {
	transform: translateX(calc(var(--hex-size) * -0.5)) scale(0.8) rotate(5deg);
	animation: galleryItemAppearShiftedThird 0.6s ease-out forwards;
}

/* Смещение рядов 2, 3 и 4 вверх на 40% */
.gallery-item:nth-child(4),
.gallery-item:nth-child(5),
.gallery-item:nth-child(6),
.gallery-item:nth-child(7),
.gallery-item:nth-child(8),
.gallery-item:nth-child(9),
.gallery-item:nth-child(10),
.gallery-item:nth-child(11),
.gallery-item:nth-child(12) {
	--row-offset: -0.5;
}

@keyframes galleryItemAppearShifted {
	from {
		opacity: 0;
		transform: translateX(calc(var(--hex-size) * -0.25)) scale(0.8) rotate(5deg);
	}
	to {
		opacity: 1;
		transform: translateX(calc(var(--hex-size) * -0.25)) scale(1) rotate(0deg);
	}
}

@keyframes galleryItemAppearShiftedThird {
	from {
		opacity: 0;
		transform: translateX(calc(var(--hex-size) * -0.5)) scale(0.8) rotate(5deg);
	}
	to {
		opacity: 1;
		transform: translateX(calc(var(--hex-size) * -0.5)) scale(1) rotate(0deg);
	}
}

.gallery-item a {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: white;
	position: relative;
	z-index: 2;
}

.gallery-item figure {
	text-align: center;
	padding: 20px;
	z-index: 3;
	position: relative;
	opacity: 0;
	visibility: hidden;
}

.gallery-item h2 {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 10px;
	color: white;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
	letter-spacing: 0.5px;
}

.gallery-item figure p {
	font-size: 0.9rem;
	line-height: 1.5;
	color: white;
	opacity: 0.95;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.gallery-image {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 60%;
	height: 60%;
	object-fit: contain;
	opacity: 1;
	transition: opacity 0.3s ease;
	z-index: 2;
	clip-path: inherit;
}

.gallery-item:hover .gallery-image {
	opacity: 0;
	visibility: hidden;
}

/* Контент при наведении - картинка и текст */
.gallery-item::before {
	content: '';
	position: absolute;
	top: calc(100% + 15px);
	left: 50%;
	transform: translateX(-50%);
	width: calc(var(--hex-size) * 1.8);
	max-width: 90vw;
	height: 200px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: 16px 16px 0 0;
	opacity: 0;
	visibility: hidden;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 101;
	pointer-events: none;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 10px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item::after {
	content: '';
	position: absolute;
	top: calc(100% + 215px);
	left: 50%;
	transform: translateX(-50%);
	width: calc(var(--hex-size) * 1.8);
	max-width: 90vw;
	padding: 25px;
	background: white;
	border-radius: 0 0 16px 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 10px 25px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 100;
	pointer-events: none;
	color: #333;
	font-size: 0.95rem;
	line-height: 1.6;
	text-align: center;
}

.gallery-item:hover::before {
	opacity: 1;
	visibility: visible;
	top: calc(100% + 20px);
}

.gallery-item:hover::after {
	opacity: 1;
	visibility: visible;
	top: calc(100% + 220px);
}

.gallery-item:hover {
	transform: scale(1.08) translateY(-5px);
	z-index: 10;
	filter: drop-shadow(0 15px 35px rgba(241, 110, 35, 0.5));
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2), 0 8px 20px rgba(241, 110, 35, 0.3);
}

/* Сохранение смещения при hover для второго и третьего блоков */
.gallery-item:nth-child(3n-1):hover {
	transform: translateX(calc(var(--hex-size) * -0.25)) scale(1.08) translateY(-5px);
}

.gallery-item:nth-child(3n):hover {
	transform: translateX(calc(var(--hex-size) * -0.5)) scale(1.08) translateY(-5px);
}

.gallery-item a {
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover a {
	transform: scale(1.02);
}


/* Градиент остается по умолчанию, при наведении показывается фоновое изображение */

/* Фоновые изображения */
.gallery__img {
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	position: relative;
	background-image: none !important;
}

.gallery-item.gallery__img:hover {
	background-image: 
		linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)),
		var(--bg-image) !important;
}

.gallery-item:hover figure {
	opacity: 1;
	visibility: visible;
}


.gallery__img_1 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/N_Klops.jpg);
}
.gallery-item.gallery__img_1::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/N_Klops.jpg) !important;
}
.gallery-item.gallery__img_1::after {
	content: 'интернет-сайт Калининградской области.';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_2 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg);
}
.gallery-item.gallery__img_2::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg) !important;
}
.gallery-item.gallery__img_2::after {
	content: 'рассказывает обо всём, что делает жизнь калининградцев интереснее';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_3 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/KV.jpg);
}
.gallery-item.gallery__img_3::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/KV.jpg) !important;
}
.gallery-item.gallery__img_3::after {
	content: 'Королевские ворота\Aжурнал для тех, кто успешно развивает свое дело, строит карьеру и вносит весомый вклад в развитие региона.';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_4 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/RADIOKP.jpg);
}
.gallery-item.gallery__img_4::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/RADIOKP.jpg) !important;
}
.gallery-item.gallery__img_4::after {
	content: 'Радио Комсомольская правда\Aсетевая информационно-разговорная радиостанция.';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_5 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/KP.jpg);
}
.gallery-item.gallery__img_5::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/KP.jpg) !important;
}
.gallery-item.gallery__img_5::after {
	content: 'КП\AFront-end developer in learning mode';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_6 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg);
}
.gallery-item.gallery__img_6::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg) !important;
}
.gallery-item.gallery__img_6::after {
	content: 'Страна Калининград\A#OpenSource rocks! Making awesome things';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_7 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/YAO.jpg);
}
.gallery-item.gallery__img_7::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/YAO.jpg) !important;
}
.gallery-item.gallery__img_7::after {
	content: 'Янтарный Оттиск\ACSS and SVG lover : ) In Russian';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_8 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/afisha.jpg);
}
.gallery-item.gallery__img_8::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/afisha.jpg) !important;
}
.gallery-item.gallery__img_8::after {
	content: 'Клопс Афиша\Afront/design Pirineo';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_9 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/KPRU.jpg);
}
.gallery-item.gallery__img_9::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/KPRU.jpg) !important;
}
.gallery-item.gallery__img_9::after {
	content: 'Комсомольская правда\AFreelance front-end Web developer & speaker';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_10 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/KD.jpg);
}
.gallery-item.gallery__img_10::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/KD.jpg) !important;
}
.gallery-item.gallery__img_10::after {
	content: 'Калининградские Дома\ALa magia del puro JS y CSS en su mínima y expresión';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_11 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/ANTENNA.jpg);
}
.gallery-item.gallery__img_11::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/ANTENNA.jpg) !important;
}
.gallery-item.gallery__img_11::after {
	content: 'Антенна\AWriter & Developer. SVG guru, policy nut, science nerd, & music fan';
	white-space: pre-line;
	padding-top: 220px;
}

.gallery__img_12 { 
	--bg-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg);
}
.gallery-item.gallery__img_12::before {
	background-image: url(/wp-content/themes/reboot/assets/images/img/BB.jpg) !important;
}
.gallery-item.gallery__img_12::after {
	content: 'Бренд\ATan a gusto en la cama, ocho de la mañana y suena el despertador…';
	white-space: pre-line;
	padding-top: 220px;
}


/* Topic page styles */
.topic {
	position: relative;
	min-height: 100vh;
	background: var(--bg-color);
	opacity: 0;
	animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.topic-aside-wrapper {
	position: relative;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px;
	opacity: 0;
	transform: translateX(-50px);
	animation: slideInRight 0.8s ease-out 0.2s forwards;
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-100%);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.topic-bg {
	position: relative;
	width: 100%;
	height: 400px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
	animation: zoomIn 1.2s ease-out;
	margin-bottom: 30px;
}

@keyframes zoomIn {
	from {
		transform: scale(1.1);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

.topic-aside-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 90%;
	max-width: 600px;
	opacity: 0;
	animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translate(-50%, calc(-50% + 30px));
	}
	to {
		opacity: 1;
		transform: translate(-50%, -50%);
	}
}

.topic-aside-content h3 {
	color: white;
	font-size: 1.5rem;
	margin-bottom: 20px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.kv-grad {
	background: linear-gradient(135deg, rgba(255, 88, 88, 0.9), rgba(255, 177, 153, 0.9));
	padding: 30px;
	border-radius: 10px;
	text-align: center;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: block;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.kv-grad:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.kv-grad p {
	margin: 0;
	text-decoration: none;
}

.cit {
	color: white;
	font-size: 1.2rem;
	font-weight: 600;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	margin: 0;
}

.topic-content-wrapper {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 40px 40px 40px;
	opacity: 0;
	transform: translateX(-50px);
	animation: slideInRight 0.8s ease-out 0.4s forwards;
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(50px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

.topic-content {
	background: white;
	border-radius: 16px;
	padding: 40px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
	transform: translateY(20px);
	animation: fadeInUpContent 0.6s ease-out 0.8s forwards;
}

@keyframes fadeInUpContent {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.topic-panel-img {
	float: left;
	margin-right: 30px;
	margin-bottom: 20px;
	opacity: 0;
	transform: scale(0.8);
	animation: scaleIn 0.5s ease-out 1s forwards;
}

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.8);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.topic-panel-img img {
	max-width: 200px;
	height: auto;
	transition: transform 0.3s ease;
}

.topic-panel-img img:hover {
	transform: scale(1.05);
}

.topic-panel-cinfo {
	    display: flex;
    flex-direction: column;
    align-items: center;
	margin-bottom: 30px;
	opacity: 0;
	animation: fadeIn 0.5s ease-out 1.2s forwards;
}

.topic-panel-cinfo p {
	margin-bottom: 15px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.topic-panel-cinfo a {
	color: var(--orange);
	text-decoration: none;
}

.topic-panel-cinfo a:hover {
	text-decoration: underline;
}

.button_brand {
	display: inline-block;
	padding: 10px 20px;
	background: var(--orange);
	color: white;
	border-radius: 5px;
	text-decoration: none;
	margin-top: 10px;
	transition: all 0.3s ease;
	transform: scale(1);
}

.button_brand:hover {
	background: #d85a1a;
	transform: scale(1.05);
	box-shadow: 0 4px 15px rgba(241, 110, 35, 0.4);
}

.clr {
	clear: both;
}

.topic-panel-content {
	margin-top: 30px;
	opacity: 0;
	animation: fadeIn 0.6s ease-out 1.4s forwards;
	text-align: left;
    cursor: auto;
}

.topic-panel-content > * {
	opacity: 0;
	transform: translateY(15px);
	animation: fadeInUpItem 0.5s ease-out forwards;
}

.topic-panel-content > *:nth-child(1) { animation-delay: 1.6s; }
.topic-panel-content > *:nth-child(2) { animation-delay: 1.7s; }
.topic-panel-content > *:nth-child(3) { animation-delay: 1.8s; }
.topic-panel-content > *:nth-child(4) { animation-delay: 1.9s; }
.topic-panel-content > *:nth-child(5) { animation-delay: 2s; }
.topic-panel-content > *:nth-child(6) { animation-delay: 2.1s; }

@keyframes fadeInUpItem {
	from {
		opacity: 0;
		transform: translateY(15px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.topic-panel-content h3 {
	color: #333;
	font-size: 1.5rem;
	margin: 30px 0 20px 0;
}

.topic-panel-content p {
	line-height: 1.8;
	color: #555;
	margin-bottom: 20px;
}

.numcirc {
	list-style: none;
	display: flex;
	gap: 30px;
	margin: 30px 0;
	flex-wrap: wrap;
}

.numcirc li {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 1;
	min-width: 150px;
}

.numcirc li span {
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 10px;
	transition: transform 0.3s ease;
}

.numcirc li:hover span {
	transform: scale(1.1);
}

.numcirc li p {
	margin: 0;
	color: #666;
	font-size: 1rem;
	font-weight: 900;
}

.persons {
	list-style: none;
	display: flex;
	gap: 30px;
	margin: 30px 0;
	flex-wrap: wrap;
}

.persons li {
	text-align: center;
	flex: 1;
	min-width: 150px;
}

.persons li img {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 10px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.persons li:hover img {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.persons li p {
	margin: 5px 0;
	font-weight: 600;
	color: #333;
}

.persons li span {
	display: block;
	color: #666;
	font-size: 0.9rem;
}

.topic-panel-content .icon {
	vertical-align: middle;
	margin-right: 8px;
}

.topic-more {
	padding: 40px;
	text-align: center;
	max-width: 1200px;
	margin: 0 auto;
	opacity: 0;
	animation: fadeIn 0.5s ease-out 2.2s forwards;
}

.btn {
	display: inline-block;
	padding: 15px 40px;
	background: var(--orange);
	color: white;
	text-decoration: none;
	border-radius: 5px;
	font-weight: 600;
	transition: all 0.3s ease;
	transform: scale(1);
	box-shadow: 0 4px 15px rgba(241, 110, 35, 0.3);
	margin: 0 10px;
}

.btn:hover {
	background: #d85a1a;
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(241, 110, 35, 0.5);
}

.btn:active {
	transform: scale(0.98);
}

.btn-back {
	background: #666;
	box-shadow: 0 4px 15px rgba(102, 102, 102, 0.3);
}

.btn-back:hover {
	background: #555;
	box-shadow: 0 6px 20px rgba(102, 102, 102, 0.5);
}

.u-outline {
	outline: none;
}

/* Page transition effect */
body {
	transition: opacity 0.3s ease;
	overflow-x: hidden;
}

body.page-transition {
	opacity: 0;
}

/* Loading animation for gallery */
@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* Smooth scroll behavior */
html {
	scroll-behavior: smooth;
}

/* Responsive styles for topic pages */
@media (max-width: 900px) {
	.topic-aside-wrapper {
		padding: 20px;
	}
	
	.topic-bg {
		height: 300px;
	}
	
	.topic-content-wrapper {
		padding: 0 20px 20px 20px;
	}
	
	.topic-more {
		padding: 20px;
	}
	
	.topic-panel-img {
		float: none;
		text-align: center;
		margin: 0 auto 20px;
	}
	
	.numcirc,
	.persons {
		flex-direction: column;
	}
	
	/* Уменьшаем задержки анимаций на мобильных */
	.topic-panel-content > *:nth-child(1) { animation-delay: 1.2s; }
	.topic-panel-content > *:nth-child(2) { animation-delay: 1.3s; }
	.topic-panel-content > *:nth-child(3) { animation-delay: 1.4s; }
	.topic-panel-content > *:nth-child(4) { animation-delay: 1.5s; }
	.topic-panel-content > *:nth-child(5) { animation-delay: 1.6s; }
	.topic-panel-content > *:nth-child(6) { animation-delay: 1.7s; }
	
	.topic-more {
		animation-delay: 1.8s;
	}
}

@media (max-width: 900px) {
	.topic-aside-wrapper {
		padding: 20px;
	}
	
	.topic-bg {
		height: 300px;
	}
	
	.topic-content-wrapper {
		padding: 0 20px 20px 20px;
	}
	
	.topic-more {
		padding: 20px;
	}
	
	.topic-panel-img {
		float: none;
		text-align: center;
		margin: 0 auto 20px;
	}
	
	.numcirc,
	.persons {
		flex-direction: column;
	}
	
	/* Уменьшаем задержки анимаций на мобильных */
	.topic-panel-content > *:nth-child(1) { animation-delay: 1.2s; }
	.topic-panel-content > *:nth-child(2) { animation-delay: 1.3s; }
	.topic-panel-content > *:nth-child(3) { animation-delay: 1.4s; }
	.topic-panel-content > *:nth-child(4) { animation-delay: 1.5s; }
	.topic-panel-content > *:nth-child(5) { animation-delay: 1.6s; }
	.topic-panel-content > *:nth-child(6) { animation-delay: 1.7s; }
	
	.topic-more {
		animation-delay: 1.8s;
	}
}

.circle-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  line-height: 1;
  box-sizing: border-box;
  min-width: 180px; 
  min-height: 180px; 
}
/* Responsive gallery adjustments */

/* Адаптивность */


@media (max-width: 1200px) {
	:root {
		--hex-size: 240px;
		--gap: 20px;
	}
}

@media (max-width: 900px) {
	:root {
		--hex-size: 200px;
		--gap: 16px;
	}
}

@media (max-width: 640px) {
	:root {
		--hex-size: 180px;
		--gap: 14px;
	}

	.gallery {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--gap);
		justify-items: center;
		padding: 0 10px 40px;
		transform: none;
	}

	.gallery-item {
		--col-offset: 0 !important;
		--row-offset: 0 !important;
		--extra-offset: 0 !important;
		margin-top: 0;
		width: 100%;
		height: auto;
		clip-path: none;
		border-radius: 16px;
		padding: 24px 18px;
		box-shadow: 0 8px 25px rgba(0,0,0,0.1);
		opacity: 1;
		transform: none;
		animation: none;
	}

	.gallery-item img,
	.gallery-item .gallery-image {
		position: static;
		transform: none;
		width: 140px;
		height: 140px;
		margin-bottom: 14px;
		clip-path: none;
	}

	.gallery-item figure {
	display: none;
	}

	.gallery-item h2 {
		color: #333;
		text-shadow: none;
	}

	.gallery-item figure p {
		color: #555;
		display: block;
		margin-top: 8px;
	}

	.gallery-item:nth-child(3n-1),
	.gallery-item:nth-child(3n) {
		transform: none;
		animation: none;
	}
	
		.gallery-item::after {
		display: none;
	
	}

	.gallery-item::before {
		display: none;
	}

	.gallery-item:nth-child(3n-1):hover {
		transform: none;
	}
	.gallery-item:nth-child(3n):hover {
		transform: none;
	}
}

@media (max-width: 600px) {
	
	
	.heading {
		font-size: 1.5rem;
		margin-bottom: 30px;
	}
	
	.gallery-item h2 {
		font-size: 1rem;
		margin-bottom: 5px;
	}
	
	.gallery-item figure {
		padding: 10px;
	}
	
	.gallery-item figure p {
		font-size: 0.7rem;
		display: none;
	}
	
	.gallery-item::after {
		width: calc(var(--hex-size) * 2);
		padding: 20px;
	}

}

@media (max-width: 400px) {
	:root {
		--hex-size: 130px;
	}
	
	.gallery-item h2 {
		font-size: 0.9rem;
	}
}