/**
 * Federation Manager — contract cards (021).
 *
 * Loaded on wrestler profiles, which is the only place a contract card appears —
 * a contract is private business between a federation and one wrestler, so it is
 * deliberately absent from the federation's public page. Everything is scoped
 * under `.fedman-contract-card` or `.fedman-contracts` so it cannot reach the
 * surrounding theme.
 *
 * No `!important` anywhere: where the theme has to be beaten, the selector is
 * made more specific instead.
 */

.fedman-contracts {
	margin: 0 0 2rem;
}

.fedman-contracts-heading {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
	line-height: 1.3;
	letter-spacing: 0.01em;
}

.fedman-contracts-list {
	display: grid;
	gap: 1rem;
	margin: 0 0 1.75rem;
}

/* ------------------------------------------------------------------ the card */

.fedman-contract-card {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	grid-template-areas:
		"emblem body"
		"actions actions";
	gap: 0 1.25rem;
	padding: 1.25rem;
	border: 1px solid rgba(127, 127, 127, 0.28);
	border-radius: 10px;
	background: rgba(127, 127, 127, 0.05);
}

/* An exclusive contract is the one with consequences, so it is the one that
   looks different. */
.fedman-contract-card.is-exclusive {
	border-left-width: 4px;
	border-left-color: rgba(190, 60, 60, 0.75);
}

.fedman-contract-card.is-open {
	border-left-width: 4px;
	border-left-color: rgba(60, 130, 190, 0.75);
}

/* -------------------------------------------------------------- the emblem */

.fedman-contract-emblem {
	grid-area: emblem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 8px;
	background: rgba(127, 127, 127, 0.12);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
}

/*
 * A logo is shown WHOLE, with nothing behind it. The tinted square exists so the
 * initials fallback has something to sit on; behind real artwork it is just a
 * coloured box around someone's mark. Carrying an image therefore drops the
 * background, the rounded corners and the clip that went with them — the same
 * treatment `.fedman-fx-card-emblem.has-logo` gets on the federation page.
 */
.fedman-contract-emblem.has-logo {
	background: none;
	border-radius: 0;
	overflow: visible;
}

.fedman-contract-emblem img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	/* `contain`, never `cover`: cover fills the square by cutting the sides off
	   a logo that is not square, which is most of them. */
	object-fit: contain;
}

/* ---------------------------------------------------------------- the terms */

.fedman-contract-body {
	grid-area: body;
	min-width: 0;
}

.fedman-contract-title {
	margin: 0 0 0.35rem;
	font-size: 1.15rem;
	line-height: 1.25;
}

.fedman-contract-title a {
	text-decoration: none;
}

.fedman-contract-title a:hover,
.fedman-contract-title a:focus {
	text-decoration: underline;
}

.fedman-contract-kind {
	margin: 0 0 0.85rem;
	font-size: 0.9rem;
	line-height: 1.5;
	opacity: 0.85;
}

.fedman-contract-badge {
	display: inline-block;
	margin-right: 0.5rem;
	padding: 0.1rem 0.5rem;
	border-radius: 3px;
	background: rgba(127, 127, 127, 0.2);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.fedman-contract-card.is-exclusive .fedman-contract-badge {
	background: rgba(190, 60, 60, 0.18);
}

.fedman-contract-terms {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 0.65rem 1.25rem;
	margin: 0;
}

.fedman-contract-terms dt {
	margin: 0 0 0.15rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	opacity: 0.7;
}

.fedman-contract-terms dd {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.4;
}

.fedman-contract-remaining {
	display: block;
	font-size: 0.8rem;
	opacity: 0.7;
}

.fedman-contract-note {
	margin: 0.85rem 0 0;
	padding: 0.65rem 0.85rem;
	border-left: 3px solid rgba(127, 127, 127, 0.35);
	font-size: 0.9rem;
	line-height: 1.5;
}

/* -------------------------------------------------------------- the actions */

.fedman-contract-actions {
	grid-area: actions;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
	margin-top: 1.1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(127, 127, 127, 0.2);
}

.fedman-contract-actions form {
	margin: 0;
}

.fedman-contract-state {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
}

.fedman-contract-state.is-quiet {
	font-weight: 400;
	opacity: 0.7;
}

.fedman-contract-hint {
	flex: 1 1 100%;
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.4;
	opacity: 0.7;
}

/* The card carries its own buttons on the wrestler profile, where the
   federation stylesheet is not loaded. Specific enough to beat the theme's own
   button rules without reaching for !important. */
.fedman-contract-card .fedman-contract-actions .fedman-fx-btn {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	border: 1px solid rgba(127, 127, 127, 0.45);
	border-radius: 5px;
	background: rgba(127, 127, 127, 0.14);
	color: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
}

.fedman-contract-card .fedman-contract-actions .fedman-fx-btn:hover,
.fedman-contract-card .fedman-contract-actions .fedman-fx-btn:focus {
	background: rgba(127, 127, 127, 0.24);
}

.fedman-contract-card .fedman-contract-actions .fedman-fx-btn.is-quiet {
	background: none;
	font-weight: 400;
}

/* ------------------------------------------------------------------- narrow */

@media (max-width: 600px) {
	.fedman-contract-card {
		grid-template-columns: 56px minmax(0, 1fr);
		gap: 0 0.9rem;
		padding: 1rem;
	}

	.fedman-contract-emblem {
		width: 56px;
		height: 56px;
		font-size: 1.15rem;
	}

	.fedman-contract-terms {
		grid-template-columns: minmax(0, 1fr);
	}

	.fedman-contract-actions form,
	.fedman-contract-actions .fedman-fx-btn {
		width: 100%;
	}
}

/* --------------------------------------------------------------- dark theme */

@media (prefers-color-scheme: dark) {
	.fedman-contract-card {
		background: rgba(255, 255, 255, 0.04);
		border-color: rgba(255, 255, 255, 0.16);
	}

	.fedman-contract-emblem {
		background: rgba(255, 255, 255, 0.08);
	}
}
