/**
 * Discover Page Section Styles
 *
 * CSS for Discover landing page sections (glossary, values, how-to-play, etc.).
 * Loaded conditionally when core/group blocks are present.
 *
 * @package Condor
 */

/* ==========================================================================
   Glossary Section (.glossary)
   ========================================================================== */

section.glossary {
	padding: 6rem 0;

	.section-header {
		text-align: center;
		padding-bottom: 4rem;

		.note {
			margin-top: -0.5rem;

			p {
				font-style: italic;
			}
		}
	}

	/* Terms grid */
	.terms {
		display: grid;
		gap: var(--wp--preset--spacing--40);
		grid-template-columns: repeat(1, 1fr);

		@media (min-width: 568px) {
			grid-template-columns: repeat(2, 1fr);
		}

		@media (min-width: 1024px) {
			grid-template-columns: repeat(3, 1fr);
		}
	}

	/* Individual term */
	.term-wrapper {
		width: 100%;
		border-radius: 3px;
		transition: all 0.1s ease-in;
		box-shadow: 0 0 12px rgba(179, 8, 57, 0.3);
	}

	.term {
		.label a {
			border-radius: 3px;
			display: block;
			text-align: center;
			background: var(--wp--preset--color--bright-red);
			color: var(--wp--preset--color--white);
			padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) 0.9375rem var(--wp--preset--spacing--40);
			text-transform: uppercase;
			font-style: italic;
			letter-spacing: 0.01em;

			&:hover {
				text-decoration: none;
			}
		}

		.definition {
			transition: all 0.1s ease-in;
			padding: var(--wp--preset--spacing--40);
			color: var(--wp--preset--color--black);
			display: none;
			background: var(--wp--preset--color--white);
			border-bottom-left-radius: 3px;
			border-bottom-right-radius: 3px;
		}

		/* Active state */
		&.active {
			.term-wrapper {
				box-shadow: 0 0 20px rgba(28, 134, 255, 0.3);
			}

			.label a {
				border-bottom-left-radius: 0;
				border-bottom-right-radius: 0;
			}

			.definition {
				display: block;
				width: 100%;
				box-shadow: 0 6px 12px rgba(28, 134, 255, 0.3);

				@media (min-width: 568px) {
					position: absolute;
					z-index: 10;
				}

				p,
				span {
					font-weight: 600;
				}
			}
		}
	}
}

/* ==========================================================================
   Values Section (.values)
   ========================================================================== */

section.values {
	padding: 6rem 0;

	.section-header {
		text-align: center;
		padding-bottom: 100px;
	}

	/* Individual value card */
	.value {
		display: grid;
		grid-template-columns: repeat(8, 1fr);
		gap: 0 var(--wp--preset--spacing--60);

		@media (min-width: 1024px) {
			grid-template-columns: repeat(12, 1fr);
		}

		> * {
			grid-column: 1 / -1;
		}

		+ .value {
			padding-top: 6rem;

			@media (min-width: 1024px) {
				padding-top: 10rem;
			}
		}

		/* Value info column */
		.info {
			@media (min-width: 768px) {
				grid-column: 1 / span 4;
				display: flex;
				align-items: center;
			}

			@media (min-width: 1024px) {
				grid-column: 2 / span 5;
			}

			.cta {
				padding-top: var(--wp--preset--spacing--60);
			}
		}

		/* Value photo column */
		.photo {
			@media (min-width: 768px) {
				grid-column: 5 / span 4;
			}

			@media (min-width: 1024px) {
				grid-column: 7 / span 5;
			}

			img {
				width: 100%;
				border-radius: 3px;
			}
		}
	}

	/* Alternating layout (value-2) - photo on left */
	.value-2 {
		@media (min-width: 768px) {
			.info {
				grid-column: 5 / span 4;
				grid-row: 1;
			}

			.photo {
				grid-column: 1 / span 4;
				grid-row: 1;
			}
		}

		@media (min-width: 1024px) {
			.info {
				grid-column: 7 / span 5;
			}

			.photo {
				grid-column: 2 / span 5;
			}
		}
	}
}

/* ==========================================================================
   How To Play Section (.how-to-play)
   ========================================================================== */

section.how-to-play {
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	padding: 6rem 0;

	@media (min-width: 1024px) {
		padding: 6rem 0 12rem 0;
	}

	.section-header {
		text-align: center;
	}

	/* Tiles grid */
	.tiles {
		display: grid;
		grid-template-columns: repeat(6, 1fr);
		gap: var(--wp--preset--spacing--50);

		@media (min-width: 1024px) {
			gap: var(--wp--preset--spacing--70);
		}

		.tile {
			grid-column: span 6;
			aspect-ratio: 16 / 9;
			position: relative;
			overflow: hidden;

			@media (min-width: 568px) {
				grid-column: span 3;

				/* Dealing with single orphan */
				&:last-child:nth-child(2n - 1) {
					grid-column-end: 4;
				}
			}

			@media (min-width: 768px) {
				grid-column: span 2;

				/* Dealing with 2 orphan items */
				&:last-child:nth-child(3n - 1) {
					grid-column-end: -2;
				}

				&:nth-last-child(2):nth-child(3n + 1) {
					grid-column-end: 4;
				}

				/* Dealing with single orphan */
				&:last-child:nth-child(3n - 2) {
					grid-column-end: 5;
				}
			}
		}
	}

	.cta {
		padding-top: 3rem;

		@media (min-width: 768px) {
			padding-top: 6rem;
		}
	}
}

/* ==========================================================================
   Great Plays Section (.great-plays)
   ========================================================================== */

section.great-plays {
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: 100%;
	padding: 6rem 0;

	.section-header {
		text-align: center;
		padding-bottom: var(--wp--preset--spacing--70);
	}

	/* Individual great-play card */
	.great-play {
		display: grid;
		grid-template-columns: repeat(8, 1fr);
		gap: 0 var(--wp--preset--spacing--60);

		@media (min-width: 1024px) {
			grid-template-columns: repeat(12, 1fr);
		}

		> * {
			grid-column: 1 / -1;
		}

		+ .great-play {
			padding-top: 6rem;
		}

		/* Great-play info column */
		.info {
			padding-bottom: var(--wp--preset--spacing--60);

			@media (min-width: 768px) {
				grid-column: 1 / span 4;
				display: flex;
				align-items: center;
			}

			@media (min-width: 1024px) {
				grid-column: 2 / span 4;
			}

			.headline {
				padding-bottom: var(--wp--preset--spacing--20);
			}
		}

		/* Great-play video column */
		.video {
			aspect-ratio: 3 / 4;
			position: relative;
			overflow: hidden;

			@media (min-width: 768px) {
				grid-column: 5 / span 4;
			}

			@media (min-width: 1024px) {
				grid-column: 7 / span 5;
			}

			a {
				display: block;
				width: 100%;
				height: 100%;
			}

			img {
				width: 100%;
				height: 100%;
				border-radius: 3px;
				object-fit: cover;
			}
		}
	}

	/* Alternating layout (great-play-2, great-play-4) */
	.great-play-2,
	.great-play-4 {
		@media (min-width: 768px) {
			.info {
				grid-column: 5 / span 4;
				grid-row: 1;
			}

			.video {
				grid-column: 1 / span 4;
				grid-row: 1;
			}
		}

		@media (min-width: 1024px) {
			.info {
				grid-column: 8 / span 4;
			}

			.video {
				grid-column: 2 / span 5;
			}
		}
	}
}

/* ==========================================================================
   Spirit of the Game Section (.spirit-of-the-game)
   ========================================================================== */

section.spirit-of-the-game {
	background-repeat: no-repeat;
	background-position: center center;
	background-size: cover;
	padding: 6rem 0;

	@media (min-width: 1024px) {
		padding: 16rem 0;
	}

	@media (min-width: 1280px) {
		padding: 20rem 0;
	}

	.info {
		@media (min-width: 1024px) {
			grid-column: 2 / span 8;
		}
	}

	.cta {
		padding-top: var(--wp--preset--spacing--60);
	}
}

/* ==========================================================================
   Where We Play Section (.where-we-play)
   ========================================================================== */

section.where-we-play {
	padding: 6rem 0;

	@media (min-width: 1024px) {
		padding: 10rem 0;
	}

	.section-header {
		text-align: center;
		padding-bottom: var(--wp--preset--spacing--70);
	}

	/* Location card (slider item) */
	.location {
		margin: 0 var(--wp--preset--spacing--20);
		box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
		max-width: 300px;
		width: 100%;

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

		@media (min-width: 768px) {
			max-width: 600px;
			margin: 0 var(--wp--preset--spacing--40);
		}

		@media (min-width: 1024px) {
			max-width: 800px;
		}

		@media (min-width: 1280px) {
			max-width: 1200px;
		}

		&:active,
		&:focus {
			outline: none;
		}

		.photo img {
			border-radius: 3px;
		}

		.caption {
			background: var(--wp--preset--color--white);
			padding: 12px 15px 10px 15px;
			color: var(--wp--preset--color--slate);
			border-bottom-left-radius: 3px;
			border-bottom-right-radius: 3px;

			@media (min-width: 768px) {
				position: absolute;
				border-radius: 3px;
				bottom: 1.25rem;
				left: 1.25rem;
				background: rgba(255, 255, 255, 0.9);
			}

			p {
				color: var(--wp--preset--color--blue);
				font-weight: 600;
			}
		}

		.caption-wrapper {
			max-width: 640px;
		}
	}
}

/* ==========================================================================
   This Is Ultimate Section (.this-is-ultimate)
   ========================================================================== */

section.this-is-ultimate {
	background-repeat: no-repeat;
	background-position: center bottom;
	background-size: cover;
	padding: 6rem 0;

	@media (min-width: 1024px) {
		padding: 20rem 0 16rem 0;
	}

	.section-header {
		padding-bottom: 0;
	}

	/* Video column */
	.video {
		@media (min-width: 768px) {
			grid-column: 2 / span 4;
			display: flex;
			align-items: center;
		}

		@media (min-width: 1024px) {
			grid-column: 2 / span 7;
		}

		a {
			display: block;
			box-shadow: 0 0 12px rgba(0, 0, 0, 0.25);
			border: 1px solid rgba(255, 255, 255, 0.2);
			border-radius: 2px;
		}

		img {
			border-radius: 2px;
		}
	}

	/* Info column */
	.info {
		padding-top: var(--wp--preset--spacing--70);

		@media (min-width: 768px) {
			padding-top: 0;
			grid-column: 6 / span 4;
		}

		@media (min-width: 1024px) {
			grid-column: 10 / span 4;
		}

		.cta {
			padding-top: var(--wp--preset--spacing--60);
		}
	}
}

/* ==========================================================================
   Why We Play Section (.why-we-play)
   ========================================================================== */

section.why-we-play {
	padding: 125px 0;

	.section-header {
		text-align: center;
	}

	/* Player card */
	.player {
		aspect-ratio: 9 / 16;
		max-height: 800px;
		max-width: 450px;
		position: relative;
		overflow: hidden;

		a {
			color: var(--wp--preset--color--white);
			display: block;
		}

		.info {
			position: absolute;
			z-index: 10;
			bottom: 0;
			left: 0;
			width: 100%;
			padding: 25px;
			text-align: center;

			h3 {
				font-weight: 900;
				font-size: var(--wp--preset--font-size--2-x-large);
				padding-bottom: 10px;
			}

			h4 {
				font-family: var(--wp--preset--font-family--body);
				text-transform: uppercase;
				font-size: var(--wp--preset--font-size--small);
				letter-spacing: 0.1em;
			}
		}
	}

	/* Profile overlay (modal) */
	article.profile-overlay {
		display: none;
	}

	.profile-overlay {
		.overlay-wrapper {
			max-width: 600px;
			margin: 0 auto;
		}

		.info {
			background: var(--wp--preset--color--white);
			color: var(--wp--preset--color--blue);
			border-radius: 10px;
			box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
		}

		.photo img {
			border-top-left-radius: 10px;
			border-top-right-radius: 10px;
		}

		.details {
			padding: 20px;

			@media (min-width: 768px) {
				padding: 40px;
			}

			.meta {
				padding-bottom: 20px;

				h3 {
					font-weight: 900;
					font-size: var(--wp--preset--font-size--2-x-large);
					padding-bottom: 5px;
				}

				h4 {
					font-family: var(--wp--preset--font-family--body);
					text-transform: uppercase;
					font-size: var(--wp--preset--font-size--small);
					letter-spacing: 0.1em;
					color: var(--wp--preset--color--bright-red);
				}
			}

			.copy p {
				font-size: var(--wp--preset--font-size--medium);
				line-height: 1.5em;

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

/* Profile open state */
.profile-open {
	overflow: hidden;

	.overlay {
		background: rgba(0, 0, 0, 0.9);
	}
}
