/*
 * Word Finder Suite - front-end styles.
 * Original, independently written; scoped under .wfs- to avoid clashing
 * with theme styles, and left deliberately simple so the theme's own
 * typography/colors carry through.
 */

.wfs-hero {
	--wfs-accent: #0c2910;
	--wfs-accent-hover: #163d1c;
	--wfs-accent-secondary: #d8422f;
	--wfs-accent-gold: #f5af22;
	--wfs-border: #ddd3ba;
	--wfs-text-muted: #5b655e;
	--wfs-hero-bg: #fef3e1;
	background: var(--wfs-hero-bg);
	border-radius: 0.6rem;
	padding: 2.5rem 1.5rem 3rem;
	margin: 0 0 2rem;
}

.wfs-hero__inner {
	max-width: 40rem;
	margin: 0 auto;
	text-align: center;
}

.wfs-hero__title {
	font-size: 2.1rem;
	font-weight: 700;
	margin: 0 0 0.5rem;
}

.wfs-solver {
	text-align: left;
}

.wfs-solver__form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.wfs-solver__subtitle {
	text-align: center;
	font-size: 0.95rem;
	font-style: italic;
	color: var(--wfs-text-muted);
	margin: 0 0 0.5rem;
}

.wfs-solver__label {
	font-size: 0.9rem;
	color: var(--wfs-text-muted);
}

.wfs-solver__row {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.wfs-solver__input,
.wfs-solver__select,
.wfs-solver__advanced-grid input {
	border: 1px solid var(--wfs-border);
	border-radius: 0.4rem;
	padding: 0.6rem 0.8rem;
	font-size: 1.1rem;
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}

.wfs-solver__input,
.wfs-solver__select {
	flex: 1 1 12rem;
}

.wfs-solver__advanced-grid input {
	flex: none;
	height: auto;
}

.wfs-solver__input:focus,
.wfs-solver__select:focus,
.wfs-solver__advanced-grid input:focus {
	outline: none;
	border-color: var(--wfs-accent-secondary);
	box-shadow: 0 0 0 3px rgba(216, 66, 47, 0.15);
}

.wfs-solver__submit {
	box-sizing: border-box;
	background: var(--wfs-accent);
	background-image: none;
	color: #fff;
	border: none;
	border-radius: 0.4rem;
	padding: 0.6rem 1.4rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

/*
 * Explicitly own :hover, :focus, :focus-visible and :active here (not just
 * :hover) -- the active theme styles bare <button> elements with its own
 * background-on-focus rule, and a class-only base rule loses to a
 * type+pseudo-class theme selector once the button has focus without
 * hover, which flipped this to the theme's accent color. Matching all
 * interaction states in one rule keeps this at brand green in every case.
 */
.wfs-solver__submit:hover,
.wfs-solver__submit:focus,
.wfs-solver__submit:focus-visible,
.wfs-solver__submit:active {
	background: var(--wfs-accent-hover);
	background-image: none;
	color: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(12, 41, 16, 0.22);
}

.wfs-solver__submit--block {
	width: 100%;
	margin-top: 0.75rem;
}

.wfs-solver__advanced-card {
	background: #fff;
	border: 1px solid var(--wfs-border);
	border-radius: 0.6rem;
	padding: 1rem 1.25rem 1.25rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wfs-solver__advanced-toggle {
	cursor: pointer;
	color: var(--wfs-accent);
	font-size: 0.9rem;
	font-weight: 600;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
}

.wfs-solver__advanced-toggle::-webkit-details-marker {
	display: none;
}

.wfs-solver__advanced-toggle-icon {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 0.32rem solid transparent;
	border-right: 0.32rem solid transparent;
	border-top: 0.4rem solid var(--wfs-accent);
	transition: transform 0.15s ease;
}

.wfs-solver__advanced-card[open] > .wfs-solver__advanced-toggle .wfs-solver__advanced-toggle-icon {
	transform: rotate(180deg);
}

.wfs-solver__advanced-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem;
	margin-top: 0.9rem;
}

.wfs-solver__advanced-grid-full {
	grid-column: 1 / -1;
}

.wfs-solver__advanced-grid label,
.wfs-solver__advanced-grid-full {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.85rem;
	color: var(--wfs-text-muted);
}

.wfs-solver__results {
	text-align: left;
}

.wfs-solver__summary {
	display: inline-flex;
	align-items: center;
	font-weight: 700;
	font-size: 0.95rem;
	margin-bottom: 1.25rem;
	padding: 0.45rem 1rem;
	background: #fff;
	color: var(--wfs-accent);
	border: 1.5px solid var(--wfs-accent-secondary);
	border-radius: 2rem;
	box-shadow: 0 2px 8px rgba(12, 41, 16, 0.1);
}

.wfs-solver__group-heading {
	background: linear-gradient(100deg, var(--wfs-accent) 0%, var(--wfs-accent-secondary) 100%);
	color: #fff;
	padding: 0.6rem 1rem;
	border-radius: 0.6rem 0.6rem 0 0;
	margin: 1.5rem 0 0;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.2px;
	box-shadow: 0 4px 12px rgba(12, 41, 16, 0.2);
	position: relative;
	z-index: 1;
}

.wfs-solver__group-heading:first-of-type {
	margin-top: 0;
}

/* Standalone card (e.g. SEO list pages with no preceding group heading). */
.wfs-solver__word-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.25rem;
	margin: 0 0 1.25rem;
	padding: 1.1rem 1.25rem 1.2rem;
	background: #fff;
	border: 1px solid var(--wfs-border);
	border-radius: 0.6rem;
	box-shadow: 0 6px 16px rgba(12, 41, 16, 0.08), 0 1px 3px rgba(216, 66, 47, 0.06);
}

/* When it directly follows a group heading, fuse into one continuous card. */
.wfs-solver__group-heading + .wfs-solver__word-list {
	margin-top: 0;
	border-top: none;
	border-radius: 0 0 0.6rem 0.6rem;
}

.wfs-solver__word a {
	color: var(--wfs-accent);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s ease;
}

.wfs-solver__word a:hover {
	color: var(--wfs-accent-secondary);
	text-decoration: underline;
}

.wfs-solver__word sub {
	color: var(--wfs-accent-gold);
	font-weight: 600;
	font-size: 0.7em;
}

.wfs-solver__empty {
	color: var(--wfs-text-muted);
	font-style: italic;
}

.wfs-related-lengths,
.wfs-breadcrumbs {
	font-size: 0.85rem;
	color: var(--wfs-text-muted);
	margin: 1rem 0;
}

.wfs-breadcrumbs a,
.wfs-related-lengths a {
	color: var(--wfs-accent);
	text-decoration: none;
}

.wfs-related-lengths ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	padding: 0;
	margin: 0.4rem 0 0;
}

@media (max-width: 480px) {
	.wfs-hero {
		padding: 1.75rem 1rem 2rem;
	}
	.wfs-hero__title {
		font-size: 1.6rem;
	}
	.wfs-solver__row {
		flex-direction: column;
	}
	.wfs-solver__submit {
		width: 100%;
	}
	.wfs-solver__advanced-grid {
		grid-template-columns: 1fr;
	}
}
