/**
 * Cover Block Styles
 *
 * CSS for cover blocks and hero photo sections.
 * Loaded conditionally when core/cover blocks are present.
 *
 * @package Condor
 */

/* ==========================================================================
   Hero Photo (.hero-photo)
   ========================================================================== */

.hero-photo {
	position: relative;
	overflow: hidden;

	/* Gradient fallback background */
	&.gradient {
		background: linear-gradient(90deg, #1CB5E0 0%, var(--wp--preset--color--blue) 100%);
	}

	/* Photo container with responsive aspect ratios */
	& .photo {
		position: relative;
		aspect-ratio: 4 / 3;

		@media (min-width: 568px) {
			aspect-ratio: 16 / 9;
		}

		@media (min-width: 768px) {
			aspect-ratio: 16 / 7;
			max-height: 800px;
		}

		& img {
			width: 100%;
			height: 100%;
			object-fit: cover;
			object-position: top center;
		}
	}

	/* Info overlay */
	& .info {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 5;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;

		& .usau-block {
			width: 100%;
		}

		/* Sub-headline styling */
		& .sub-headline h2 {
			color: var(--wp--preset--color--white);
			text-transform: uppercase;
			letter-spacing: 0.05em;
			font-family: var(--wp--preset--font-family--heading);
			font-style: italic;
			font-weight: 900;
			font-size: var(--wp--preset--font-size--medium);
			line-height: 1em;
			display: inline-block;
			background: var(--wp--preset--color--blue);
			padding: 10px;
		}

		/* Headline positioning at tablet-landscape */
		@media (min-width: 1024px) {
			& .headline {
				grid-column: 2 / span 7;
				padding-right: 2rem;
				text-align: left;
			}
		}
	}
}

.hero-photo__sub-headline {
	color: var(--wp--preset--color--white);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-family: var(--wp--preset--font-family--heading);
	font-style: italic;
	font-weight: 900;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1em;
	display: inline-block;
	background: var(--wp--preset--color--blue);
	padding: 10px;
}

/* Headline-small variant */
.hero-photo.headline-small {

	& .sub-headline h2,
	& .hero-photo__sub-headline {
		font-size: var(--wp--preset--font-size--small);

		@media (min-width: 768px) {
			font-size: var(--wp--preset--font-size--medium);
		}
	}

	& .headline h1.cover-title,
	& .hero-photo__headline {
		font-size: var(--wp--preset--font-size--4-x-large);

		@media (min-width: 768px) {
			font-size: var(--wp--preset--font-size--5-x-large);
		}
	}
}

/* ==========================================================================
   Cover Block (.cover)
   ========================================================================== */

section.cover {
	position: relative;
	overflow: hidden;

	&.aligncenter {
		max-width: 1200px;
		margin: 0 auto;
	}

	/* Photo container with responsive aspect ratios */
	& .photo {
		position: relative;
		aspect-ratio: 4 / 4;

		@media (min-width: 568px) {
			aspect-ratio: 16 / 9;
		}

		@media (min-width: 768px) {
			aspect-ratio: 16 / 7;
			max-height: 800px;
		}

		&.half {

			@media (min-width: 768px) {
				max-height: 400px;
			}
		}

		&.half .info-wrapper {

			@media (min-width: 768px) {
				max-width: 890px;
			}
		}

		& img {
			width: 100%;
			height: 100%;
			object-fit: cover;
			object-position: top center;
		}

		/* Color overlay */
		&.color-overlay::after {
			content: '';
			display: block;
			width: 100%;
			height: 100%;
			position: absolute;
			top: 0;
			right: 0;
			bottom: 0;
			left: 0;
		}

		&.color-overlay.red::after {
			background: rgba(179, 8, 57, 0.75);
		}

		&.color-overlay.blue::after {
			background: rgba(0, 43, 92, 0.75);
		}

		&.color-overlay.white::after {
			background: rgba(255, 255, 255, 0.75);
		}

		&.color-overlay img {
			filter: saturate(20%);
		}
	}

	/* Info overlay */
	& .info {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 5;
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		color: var(--wp--preset--color--white);
		text-align: center;

		& .headline {
			width: 100%;
		}

		& h1.cover-title {
			font-size: var(--wp--preset--font-size--5-x-large);
			letter-spacing: -0.005em;
			color: var(--wp--preset--color--white);
			font-family: var(--wp--preset--font-family--heading-condensed, var(--wp--preset--font-family--heading));
			font-weight: 800;
			font-style: italic;
			text-transform: uppercase;
			line-height: 1em;
			text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
		}

		& .copy {
			padding-top: 1rem;
		}

		& .copy > * {
			font-weight: bold;
		}

		& .copy br {
			display: none;

			@media (min-width: 768px) {
				display: block;
			}
		}

		& .cta {
			width: 100%;
			text-align: center;
			padding-top: 3rem;
		}

		& .cta.multiple {
			display: flex;
			align-items: center;
			justify-content: center;
		}

		& .cta.multiple .btn {
			margin: 0 1rem;
		}
	}

	& .info-wrapper {
		max-width: 690px;
		margin: 0 auto;
		padding: 0 1.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-wrap: wrap;
	}

	/* White overlay variant */
	& .white .info h1.cover-title {
		color: var(--wp--preset--color--blue);
	}

	& .white .copy * {
		color: var(--wp--preset--color--blue);
	}

	& .white .cta a {
		color: var(--wp--preset--color--bright-red);
		border-color: var(--wp--preset--color--bright-red);
		font-weight: bold;
		border-width: 3px;

		&:hover {
			color: var(--wp--preset--color--white);
			background: var(--wp--preset--color--bright-red);
			border-color: var(--wp--preset--color--bright-red);
		}
	}
}
