/**
 * Button Styles
 *
 * Height-driven button system. Base typography set in theme.json,
 * CSS handles sizing, layout, and variant overrides.
 *
 * Sizes: sm (28px) · md (36px, default) · lg (40px)
 * Colors: filled-red (default) · filled-blue · outline-red · outline-blue ·
 *         outline-gray · filled-white · outline-white · ghost
 *
 * @package Condor
 */

/* ==========================================================================
   Base Button — height-driven layout
   theme.json provides: font-family, font-size, font-weight, letter-spacing,
   text-transform, line-height, border-radius, default colors.
   CSS adds: height, display, alignment, transitions.
   ========================================================================== */

:root :where(.wp-block-button__link) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 36px;
	padding: 0 16px;
	background-color: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
	border: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;

	&:hover {
		background-color: var(--wp--preset--color--bright-red);
		text-decoration: none;
	}
}

/* ==========================================================================
   Size Variants
   ========================================================================== */

:root :where(.wp-block-button.is-style-small .wp-block-button__link) {
	height: 28px;
	padding: 0 10px;
	font-size: 13px;
}

:root :where(.wp-block-button.is-style-large .wp-block-button__link) {
	height: 40px;
	padding: 0 24px;
}

/* ==========================================================================
   Color Variants — Filled
   Default (no style class) = Filled Red, set via theme.json.
   ========================================================================== */

/* Filled Blue */
:root :where(.wp-block-button.is-style-filled-blue .wp-block-button__link) {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
	border: none;

	&:hover {
		background: #003d82;
	}
}

/* Filled White (for dark backgrounds) */
:root :where(.wp-block-button.is-style-filled-white .wp-block-button__link) {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--blue);
	border: none;

	&:hover {
		background: rgba(255, 255, 255, 0.85);
	}
}

/* ==========================================================================
   Color Variants — Outline (1px border)
   ========================================================================== */

/* Outline Red */
:root :where(.wp-block-button.is-style-outline-red .wp-block-button__link) {
	background: transparent;
	color: var(--wp--preset--color--red);
	border: 1px solid var(--wp--preset--color--red);

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

/* Outline Blue */
:root :where(.wp-block-button.is-style-outline-blue .wp-block-button__link) {
	background: transparent;
	color: var(--wp--preset--color--blue);
	border: 1px solid var(--wp--preset--color--blue);

	&:hover {
		background: var(--wp--preset--color--blue);
		color: var(--wp--preset--color--white);
	}
}

/* Outline Gray */
:root :where(.wp-block-button.is-style-outline-gray .wp-block-button__link) {
	background: transparent;
	color: var(--wp--preset--color--charcoal);
	border: 1px solid var(--wp--preset--color--light-gray);

	&:hover {
		border-color: var(--wp--preset--color--mid-gray);
		color: var(--wp--preset--color--slate);
	}
}

/* Outline White (for dark backgrounds) */
:root :where(.wp-block-button.is-style-outline-white .wp-block-button__link) {
	background: transparent;
	color: var(--wp--preset--color--white);
	border: 1px solid rgba(255, 255, 255, 0.4);

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

/* ==========================================================================
   Ghost — text only, no background or border
   ========================================================================== */

:root :where(.wp-block-button.is-style-ghost .wp-block-button__link) {
	background: transparent;
	color: var(--wp--preset--color--blue);
	border: none;
	padding: 0;
	height: auto;

	&:hover {
		color: var(--wp--preset--color--red);
	}
}

/* ==========================================================================
   Shape Variants — Rounded
   ========================================================================== */

:root :where(.wp-block-button.is-style-rounded .wp-block-button__link) {
	border-radius: 25px;
}

/* ==========================================================================
   Legacy Aliases
   Map old solid-* names to new filled styles so existing patterns don't break.
   ========================================================================== */

/* solid-red → same as default (filled red from theme.json) */
:root :where(.wp-block-button.is-style-solid-red .wp-block-button__link) {
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
	border: none;

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

/* solid-blue → filled-blue */
:root :where(.wp-block-button.is-style-solid-blue .wp-block-button__link) {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
	border: none;

	&:hover {
		background: #003d82;
	}
}

/* ==========================================================================
   Legacy .btn Classes
   Preserved for any classic theme markup still in use.
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 16px;
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border: none;
	border-radius: 0;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	cursor: pointer;

	&.white {
		color: var(--wp--preset--color--white);
		border: 1px solid rgba(255, 255, 255, 0.4);
		background: transparent;

		&:hover,
		&.active {
			border-color: var(--wp--preset--color--white);
		}
	}

	&.black {
		color: var(--wp--preset--color--slate);
		border: 1px solid var(--wp--preset--color--slate);
		background: transparent;

		&:hover,
		&.active {
			background: var(--wp--preset--color--black);
			color: var(--wp--preset--color--citrine);
		}
	}

	&.red {
		color: var(--wp--preset--color--red);
		border: 1px solid var(--wp--preset--color--red);
		background: transparent;

		&:hover,
		&.active {
			background: var(--wp--preset--color--red);
			color: var(--wp--preset--color--white);
		}
	}

	&.blue {
		color: var(--wp--preset--color--blue);
		border: 1px solid var(--wp--preset--color--blue);
		background: transparent;

		&:hover,
		&.active {
			background: var(--wp--preset--color--blue);
			color: var(--wp--preset--color--white);
		}
	}

	&.solid-red {
		color: var(--wp--preset--color--white);
		background: var(--wp--preset--color--red);

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

/* ==========================================================================
   Underline Links (.underline) — for CTA/anchor links
   ========================================================================== */

a.underline,
.cta .underline {
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	font-weight: 500;
	font-size: 14px;
	text-decoration: none;

	&:hover {
		text-decoration: none;
	}

	&.blue {
		border-color: var(--wp--preset--color--blue);
		color: var(--wp--preset--color--blue);
	}

	&.red {
		border-color: var(--wp--preset--color--red);
		color: var(--wp--preset--color--red);
	}
}

/* ==========================================================================
   Play Video Button Style
   Pill-shaped button with play icon for video triggers
   ========================================================================== */

:root :where(.wp-block-button.is-style-play-video .wp-block-button__link) {
	color: var(--wp--preset--color--white);
	border: 2px solid var(--wp--preset--color--white);
	background: transparent;
	border-radius: 30px;
	height: auto;
	padding: 0.75em 15px 0.75em 35px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 14px 14px;
	background-position: 12px center;

	@media (min-width: 768px) {
		padding: 0.75em 25px 0.75em 55px;
		font-size: 1.25rem;
		background-size: 20px 20px;
		background-position: 22px center;
	}

	&:hover {
		background-color: var(--wp--preset--color--white);
		color: var(--wp--preset--color--blue);
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23002B5C'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	}
}

/* Play Video Button: Blue variant (for light backgrounds) */
:root :where(.wp-block-button.is-style-play-video-blue .wp-block-button__link) {
	color: var(--wp--preset--color--blue);
	border: 1px solid var(--wp--preset--color--blue);
	background: transparent;
	border-radius: 30px;
	padding-left: 35px;
	padding-right: 15px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23002B5C'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: 14px 14px;
	background-position: 12px center;

	@media (min-width: 768px) {
		padding-left: 55px;
		padding-right: 25px;
		font-size: 1.25rem;
		background-size: 20px 20px;
		background-position: 22px center;
	}

	&:hover {
		background-color: var(--wp--preset--color--blue);
		color: var(--wp--preset--color--white);
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
	}
}

/* ==========================================================================
   Video Trigger Button Style
   Circular play button that triggers video modal.
   ========================================================================== */

.wp-block-button.is-style-video-trigger .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	padding: 0;
	background: rgba(255, 255, 255, 0.1);
	border: 3px solid var(--wp--preset--color--white);
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
	cursor: pointer;
	transition: all 0.3s ease-in-out;
	font-size: 0 !important;
	color: transparent !important;
	text-indent: -9999px;
	overflow: hidden;

	&::before {
		content: '';
		display: block;
		width: 0;
		height: 0;
		margin-left: 4px;
		text-indent: 0;
		border-style: solid;
		border-width: 10px 0 10px 18px;
		border-color: transparent transparent transparent var(--wp--preset--color--white);
		transition: border-color 0.2s ease-in-out;
	}

	&:hover {
		background: rgba(255, 255, 255, 0.2);
		box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);

		&::before {
			border-left-color: var(--wp--preset--color--bright-red);
		}
	}

	&:focus {
		outline: 2px solid var(--wp--preset--color--white);
		outline-offset: 4px;
	}
}

.hero-video .wp-block-button.is-style-video-trigger .wp-block-button__link {
	width: 5rem;
	height: 5rem;

	&::before {
		border-width: 12px 0 12px 22px;
	}
}
