/**
 * Layout and page-specific styles.
 */

@import url('./common.css');
@import url('./components/buttons.css');
@import url('./components/layout.css');
@import url('./components/form.css');
@import url('./components/post-card.css');

/* Base typography */
body {
	font-family: var(--font-primary);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
.h1 {
	font-size: 52px;
	line-height: 1;
	color: var(--color-bg-deepest);
	margin: 0 0 14px;
	text-transform: uppercase;
	font-weight: 700;
}

h2,
.h2 {
	font-size: 40px;
	line-height: 1.2;
	margin: 0 0 18px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--color-bg-deepest);
}

h3,
.h3 {
	font-size: 24px;
	line-height: 1.2;
	margin: 0 0 8px;
	font-weight: 700;
	text-transform: uppercase;
}

.site-main ul {
	font-weight: 400;
	font-size: 18px;
	line-height: 136%;
	color: var(--color-bg-deepest);
	margin: 0;
	padding-left: 14px;
	list-style: none;
}

.site-main ul li {
	position: relative;
	margin-bottom: 8px;
}

.site-main ul li::before {
	content: "";
	position: absolute;
	left: -14px;
	top: 0.55em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--color-purple-deep);
}

.site-main ul li:last-child {
	margin-bottom: 0;
}

.wp-block-table {
	margin: 0 0 20px;
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	border: none;
}

.wp-block-table th,
.wp-block-table td {
	border: none;
	border-bottom: 1px solid var(--color-neutral-200);
}

@media screen and (max-width: 768px) {
	.wp-block-table.ct-table-scroll-mobile {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.wp-block-table.ct-table-scroll-mobile table {
		min-width: 720px;
	}
}

@media screen and (max-width: 1200px) {
	h1 {
		font-size: 40px;
	}
}

@media screen and (max-width: 1024px) {
	h2 {
		font-size: 28px;
		margin: 0 0 12px;
	}
}

@media screen and (max-width: 768px) {
	h1 {
		font-size: 26px;
		margin: 0 0 6px;
	}

	h2 {
		font-size: 24px;
		margin: 0 0 12px;
	}

	h3 {
		font-size: 20px;
	}

	ul {
		font-size: 14px;
		padding-left: 14px;
	}

	.site-main ul {
		font-size: 16px;
		padding-left: 10px;
	}

	.site-main ul li {
		margin-bottom: 6px;
	}

	.site-main ul li::before {
		width: 4px;
		height: 4px;
	}
}

/* Sticky footer layout */
.page-content {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background-color: var(--color-light-100);
	overflow: hidden;
}

.page-content__top {
	flex: 1 0 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

/* ─── Post tags (categories) ─────────────────────────────────────────────── */

.ct-post-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.ct-post-tag {
	font-weight: 500;
	font-size: 16px;
	line-height: 140%;
	color: var(--color-bg-medium);
	padding: 8px 18px;
	background: var(--color-white);
	border-radius: 30px;
}

@media (max-width: 768px) {
	.ct-post-tag {
		font-size: 14px;
		padding: 6px 12px;
	}
}


/* ─── Modal form ─────────────────────────────────────────────────────────── */

.ct-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ct-modal[hidden] {
	display: none;
}

html.ct-modal-open {
	overflow: hidden;
}

.ct-modal__overlay {
	position: absolute;
	inset: 0;
	background: var(--color-bg-deepest-a60);
	cursor: pointer;
}

.ct-modal__dialog {
	position: relative;
	z-index: 1;
	width: 900px;
	max-width: calc(100% - 32px);
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: var(--color-white);
	border-radius: 40px;
	padding: 40px;
	overflow: hidden;
}

.ct-modal__photo {
	position: absolute;
	right: 0;
	top: 0;
	height: 100%;
	width: auto;
	pointer-events: none;
	user-select: none;
}

.ct-modal__content {
	position: relative;
	z-index: 1;
	max-width: 425px;
}

.ct-modal__contacts {
	display: none;
}

.ct-modal__close {
	position: absolute;
	top: 28px;
	right: 28px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 12px;
	height: 12px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--color-bg-deepest);
	transition: opacity 0.2s ease;
}

.ct-modal__close:hover {
	opacity: 0.6;
}

.ct-modal__close::before,
.ct-modal__close::after {
	content: '';
	position: absolute;
	width: 12px;
	height: 1px;
	background: currentColor;
	border-radius: 1px;
}

.ct-modal__close::before {
	transform: rotate(45deg);
}

.ct-modal__close::after {
	transform: rotate(-45deg);
}

.ct-modal__title {
	margin: 0 0 5px;
	font-weight: 700;
	font-size: 40px;
	line-height: 120%;
	text-transform: uppercase;
	color: var(--color-bg-deepest);
}

.ct-modal__text {
	margin: 0 0 32px;
	font-weight: 500;
	font-size: 16px;
	line-height: 140%;
	color: var(--color-bg-deepest);
}

.ct-modal .ct-form .ff-message-success {
	min-height: 150px;
}

@media (max-width: 768px) {
	.ct-modal__dialog {
		width: 100%;
		max-width: 100%;
		border-radius: 20px;
		padding: 24px 16px;
	}

	.ct-modal__close {
		top: 18px;
		right: 18px;
	}

	.ct-modal__photo {
		display: none;
	}

	.ct-modal__content {
		max-width: 100%;
	}

	.ct-modal__title {
		font-size: 24px;
	}

	.ct-modal__text {
		font-size: 14px;
		margin-bottom: 24px;
		max-width: 235px;
	}

	.ct-modal .ct-form .ff-message-success {
		min-height: 0;
		margin-bottom: 20px;
	}

	.ct-modal__contacts {
		display: flex;
		flex-direction: column;
	}

	.ct-modal__contacts .ct-modal__contact-phone {
		font-weight: 500;
		font-size: 16px;
		line-height: 120%;
		color: var(--color-bg-deepest);
		margin-bottom: 2px;
		display: block;
		text-decoration: none;
	}

	.ct-modal__contacts .ct-modal__contact-address {
		font-weight: 500;
		font-size: 12px;
		line-height: 120%;
		color: var(--color-bg-deepest);
		margin-bottom: 5px;
		display: block;
	}

	.ct-modal__contacts a.ct-modal__contact-address {
		text-decoration: underline;
		transition: 0.2s ease;
	}

	.ct-modal__contacts a.ct-modal__contact-address:hover {
		text-decoration: none;
	}

	.ct-modal__contacts .ct-modal__contact-working-hours {
		display: block;
		font-weight: 400;
		font-size: 12px;
		line-height: 120%;
		color: #24232E99;
	}
}
