/* Category Post Headers – front end
 * @author NDemokratia developer team
 */

.cph-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	width: 100%;
	min-height: var(--cph-height, 320px);
	margin: 0 0 1.5em;
	border-radius: 6px;
	background: #111;
	color: var(--cph-text, #fff);
	isolation: isolate;
}

.cph-header.cph-full-width {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
}

.cph-header.cph-no-image {
	background: #1d2327;
}

.cph-header__media {
	position: absolute;
	inset: 0;
	z-index: -2;
	display: block;
}

.cph-header__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	margin: 0;
	max-width: none;
}

.cph-header__overlay {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--cph-overlay, rgba(0, 0, 0, .35));
}

/* Full image: the whole picture, full width, natural height - never cropped. */
.cph-header.cph-fit-full {
	display: block;
	min-height: 0;
	background: none;
	/* Kills the stray line box the out-of-flow children would otherwise leave
	   under the image, so the header is exactly as tall as the picture. */
	font-size: 0;
	line-height: 0;
}

.cph-header.cph-fit-full .cph-header__media {
	position: static;
	z-index: auto;
}

.cph-header.cph-fit-full .cph-header__image {
	width: 100%;
	height: auto;
	object-fit: fill;
}

.cph-header.cph-fit-full .cph-header__overlay {
	z-index: 1;
}

.cph-header.cph-fit-full .cph-header__inner {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	width: 100%;
	max-width: none;
	font-size: 1rem;
	line-height: 1.5;
}

.cph-header.cph-fit-full .cph-header__link {
	z-index: 3;
}

.cph-header.cph-fit-full.cph-no-image {
	display: flex;
	min-height: var(--cph-height, 320px);
	background: #1d2327;
}

.cph-header.cph-fit-full.cph-no-image .cph-header__inner {
	position: relative;
	inset: auto;
}

.cph-header__link {
	position: absolute;
	inset: 0;
	z-index: 2;
	text-indent: -9999px;
	overflow: hidden;
}

.cph-header__inner {
	position: relative;
	z-index: 1;
	max-width: 900px;
	padding: 32px 24px;
	text-align: center;
}

.cph-header.cph-align-left .cph-header__inner {
	text-align: left;
	margin-right: auto;
	width: 100%;
}

.cph-header.cph-align-right .cph-header__inner {
	text-align: right;
	margin-left: auto;
	width: 100%;
}

.cph-header__title {
	margin: 0;
	font-size: clamp(1.6rem, 4vw, 2.6rem);
	font-weight: 700;
	line-height: 1.2;
	color: inherit;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.cph-header__subtitle {
	margin: .5em 0 0;
	font-size: clamp(1rem, 2vw, 1.2rem);
	opacity: .92;
	color: inherit;
}

.cph-header__extra {
	margin-top: .8em;
	color: inherit;
}

.cph-header__button {
	display: inline-block;
	margin-top: 1.2em;
	padding: .7em 1.6em;
	border: 2px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
	transition: background-color .2s ease, color .2s ease;
}

.cph-header__button:hover,
.cph-header__button:focus {
	background: currentColor;
	color: #111;
}

@media (max-width: 767px) {
	.cph-header {
		min-height: var(--cph-height-mobile, 200px);
	}

	.cph-header.cph-fit-full {
		min-height: 0;
	}

	.cph-header.cph-fit-full.cph-no-image {
		min-height: var(--cph-height-mobile, 200px);
	}

	.cph-header__inner {
		padding: 24px 16px;
	}
}
