/**
 * D&Co du Milieu — Treasure Hunt, front-end styles.
 */

.dco-th {
	--dco-green: #79CD81;
	--dco-blue: #22577A;
	--dco-green-light: #E1F4E3;
	--dco-lavender: #CEDAF3;
	--dco-text: #707070;

	color: var(--dco-text);
	font-family: Quicksand, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.dco-th *,
.dco-th *::before,
.dco-th *::after {
	box-sizing: border-box;
}

/* --- Storage warning ---------------------------------------------------- */

.dco-th__notice {
	background: var(--dco-green-light);
	border-left: 4px solid var(--dco-green);
	border-radius: 6px;
	font-size: 0.95rem;
	line-height: 1.55;
	margin: 0 0 1.5rem;
	padding: 0.9rem 1.1rem;
}

/* --- Progress ----------------------------------------------------------- */

.dco-th__progress {
	background: #fff;
	border: 2px solid var(--dco-lavender);
	border-radius: 10px;
	margin: 0 0 2rem;
	padding: 1.2rem 1.4rem;
}

.dco-th__progress-count {
	color: var(--dco-blue);
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0;
}

.dco-th__fragments {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.dco-th__fragments:empty {
	margin: 0;
}

.dco-th__fragments li {
	align-items: baseline;
	background: var(--dco-green-light);
	border-radius: 999px;
	display: inline-flex;
	gap: 0.45rem;
	margin: 0;
	padding: 0.35rem 0.9rem;
}

.dco-th__fragment-riddle {
	color: var(--dco-blue);
	font-size: 0.75rem;
	font-weight: 700;
	opacity: 0.75;
	text-transform: uppercase;
}

.dco-th__fragment-value {
	color: var(--dco-blue);
	font-weight: 700;
}

.dco-th__progress-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.1rem 0 0;
}

.dco-th__save {
	background: var(--dco-blue);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	padding: 0.6rem 1.4rem;
	transition: opacity 0.15s ease;
}

.dco-th__save:hover:not( :disabled ) {
	opacity: 0.85;
}

.dco-th__save:disabled {
	background: var(--dco-lavender);
	color: #fff;
	cursor: not-allowed;
}

.dco-th__progress-help {
	font-size: 0.85rem;
}

/* --- Grid --------------------------------------------------------------- */

.dco-th__grid {
	align-items: start;
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}

@media ( min-width: 1024px ) {

	.dco-th__grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

.dco-th__riddle {
	background: #fff;
	border: 2px solid var(--dco-lavender);
	border-radius: 12px;
	padding: 1.4rem 1.5rem;
	position: relative;
}

/* --- State A: locked ---------------------------------------------------- */

.dco-th__riddle--locked {
	min-height: 220px;
	overflow: hidden;
}

.dco-th__decoy {
	color: var(--dco-text);
	filter: blur( 6px );
	font-size: 1rem;
	line-height: 1.6;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	pointer-events: none;
}

.dco-th__decoy p {
	margin: 0 0 1rem;
}

.dco-th__lock {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	inset: 0;
	justify-content: center;
	padding: 1rem;
	position: absolute;
	text-align: center;
}

.dco-th__lock .dco-th__number {
	color: var(--dco-blue);
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
}

.dco-th__lock-label {
	font-size: 0.85rem;
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.dco-th__countdown {
	color: var(--dco-blue);
	font-size: 1.5rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	margin: 0;
}

.dco-th__countdown--ready {
	font-size: 1.05rem;
}

.dco-th__lock-date {
	font-size: 0.85rem;
	margin: 0;
}

.dco-th__reload {
	background: var(--dco-green);
	border: 0;
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	font-weight: 700;
	margin-top: 0.6rem;
	padding: 0.5rem 1.2rem;
}

/* --- State B: open ------------------------------------------------------ */

.dco-th__riddle--open {
	border-color: var(--dco-blue);
}

.dco-th__number {
	color: var(--dco-blue);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0 0 0.2rem;
	text-transform: uppercase;
}

.dco-th__title {
	color: var(--dco-blue);
	font-size: 1.3rem;
	line-height: 1.3;
	margin: 0 0 0.9rem;
}

.dco-th__body {
	font-size: 1rem;
	line-height: 1.65;
}

.dco-th__body p:last-child {
	margin-bottom: 0;
}

.dco-th__images {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1rem 0 0;
}

.dco-th__image {
	border-radius: 8px;
	height: auto;
	max-width: 100%;
}

.dco-th__image--gallery {
	max-width: calc( 50% - 0.5rem );
}

.dco-th__hint {
	background: var(--dco-lavender);
	border-radius: 8px;
	margin: 1.1rem 0 0;
	padding: 0.85rem 1rem;
}

/*
 * Spoiler. The closed state is applied by the script, so a page without JS
 * simply shows the hint: `is-collapsed` is never there to blur anything.
 */
.dco-th__hint.is-collapsed {
	cursor: pointer;
}

.dco-th__hint-toggle {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	display: block;
	font: inherit;
	margin: 0;
	padding: 0;
	text-align: left;
	width: 100%;
}

.dco-th__hint-label {
	color: var(--dco-blue);
	display: block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0 0 0.3rem;
	text-transform: uppercase;
}

.dco-th__hint-toggle:focus-visible {
	outline: 2px solid var(--dco-blue);
	outline-offset: 3px;
}

.dco-th__hint-content {
	transition: filter 0.25s ease;
}

.dco-th__hint.is-collapsed .dco-th__hint-content {
	filter: blur( 5px );
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	pointer-events: none;
}

.dco-th__hint p:last-child {
	margin-bottom: 0;
}

.dco-th__form {
	margin: 1.3rem 0 0;
}

.dco-th__label {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin-bottom: 0.35rem;
	text-transform: uppercase;
}

.dco-th__field {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.dco-th__field input[type="text"] {
	background: #fff;
	border: 2px solid var(--dco-lavender);
	border-radius: 8px;
	color: var(--dco-text);
	flex: 1 1 12rem;
	font-family: inherit;
	font-size: 1rem;
	min-width: 0;
	padding: 0.55rem 0.8rem;
}

.dco-th__field input[type="text"]:focus {
	border-color: var(--dco-blue);
	outline: 2px solid transparent;
}

.dco-th__submit {
	background: var(--dco-green);
	border: 0;
	border-radius: 8px;
	color: #fff;
	cursor: pointer;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	padding: 0.55rem 1.4rem;
}

.dco-th__submit:disabled {
	cursor: wait;
	opacity: 0.6;
}

.dco-th__message {
	font-size: 0.95rem;
	margin: 0.6rem 0 0;
	min-height: 1.2em;
}

.dco-th__message.is-error {
	color: var(--dco-blue);
	font-weight: 700;
}

/* --- State C: solved ---------------------------------------------------- */

.dco-th__riddle.is-solved {
	border-color: var(--dco-green);
	border-width: 2px;
}

.dco-th__check {
	color: var(--dco-green);
	font-size: 1.1rem;
	margin-left: 0.3rem;
}

.dco-th__solved {
	background: var(--dco-green-light);
	border-radius: 10px;
	margin: 1.3rem 0 0;
	padding: 1rem 1.2rem;
	text-align: center;
}

.dco-th__solved-state {
	color: var(--dco-green);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin: 0;
	text-transform: uppercase;
}

.dco-th__fragment-label {
	font-size: 0.8rem;
	margin: 0.4rem 0 0.2rem;
}

.dco-th__fragment {
	color: var(--dco-blue);
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0;
	word-break: break-word;
}

/* --- Final section ------------------------------------------------------ */

.dco-th__final {
	background: #fff;
	border: 2px solid var(--dco-green);
	border-radius: 12px;
	margin: 2.5rem 0 0;
	padding: 1.6rem 1.7rem;
}

.dco-th__final-title {
	color: var(--dco-blue);
	margin: 0 0 0.6rem;
}

.dco-th__final-intro,
.dco-th__final-deadline {
	line-height: 1.6;
	margin: 0 0 0.6rem;
}

.dco-th__final-deadline {
	font-weight: 700;
}

.dco-th__final-form {
	margin-top: 1.2rem;
}

.dco-th__final--closed {
	border-color: var(--dco-lavender);
	text-align: center;
}

.dco-th__admin-note {
	background: #fff8e5;
	border-left: 4px solid #dba617;
	padding: 0.8rem 1rem;
}

.dco-th__empty {
	background: var(--dco-green-light);
	border-radius: 10px;
	padding: 1.5rem;
	text-align: center;
}

@media ( prefers-reduced-motion: reduce ) {

	.dco-th * {
		transition: none !important;
	}
}
