/* Pre-Workshop Community Survey — loaded only on the survey page. */

/* --- Likert tables ------------------------------------------------------- */

.survey-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5em;
}

.survey-table th,
.survey-table td {
	padding: .6em .75em;
	border-bottom: 1px solid #ddd;
	vertical-align: middle;
	text-align: left;
} 

.survey-table thead th {
	border-bottom-width: 2px;
	font-weight: 600;
	white-space: nowrap;
}

/* wpautop wraps cell contents in <p>; drop the stray margins. */
.survey-table p {
	margin: 0;
} 

.survey-table .survey-num {
	width: 2.5em;
	text-align: center;
	color: #666;
}

.survey-table .survey-scale {
	width: 15em;
}

/* The five radios share the cell width equally. CF7 nests the radio group in
   an inline .wpcf7-form-control-wrap, so that wrapper has to become a block
   for the flex container below it to fill the cell. */
.survey-table .survey-scale .wpcf7-form-control-wrap {
	display: block;
}

.survey-table .survey-scale .wpcf7-radio {
	display: flex;
}

.survey-table .survey-scale .wpcf7-list-item {
	flex: 1 1 0;
	margin: 0;
	text-align: center;
}

/* The header numbers must line up with those radios. A <th> has to stay a
   table cell, so it cannot be the flex container itself: five equal
   inline-block columns reproduce the same geometry instead. The `> p >`
   variant covers the case where wpautop is left enabled. */
.survey-table thead .survey-scale > span,
.survey-table thead .survey-scale > p > span {
	display: inline-block;
	width: 20%;
	text-align: center;
}

.survey-table .survey-scale label {
	display: block;
	cursor: pointer;
	padding: .25em 0;
}

/* The numeric label is redundant next to the column header on wide screens,
   but kept in the markup for screen readers and for the stacked layout below. */
.survey-table .survey-scale .wpcf7-list-item-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* --- About You ----------------------------------------------------------- */

.survey-choice {
	border: 0;
	padding: 0;
	margin: 0 0 1.5em;
}

.survey-choice legend {
	font-weight: 600;
	margin-bottom: .4em;
	padding: 0;
}

.survey-choice .wpcf7-list-item {
	display: block;
	margin: 0 0 .3em;
}

.survey-choice .wpcf7-list-item label {
	cursor: pointer;
}

.survey-choice-inline .wpcf7-list-item {
	display: inline-block;
	margin: 0 1.25em .3em 0;
}

.wpcf7 form.wpcf7-form p.submit-button {
	margin-top: 1.5em !important;
} 
 
/* --- Scale legend -------------------------------------------------------- */

.survey-scale-legend {
	margin-bottom: 1.5em;
}

/* --- Tablet: give the statement column back some room -------------------- */

@media (max-width: 900px) {

	.survey-table th,
	.survey-table td {
		padding: .5em .35em;
	}

	.survey-table .survey-scale {
		width: 10em;
	}

	.survey-table .survey-num {
		width: 1.8em;
	}
}

/* --- Stacked layout on narrow screens ------------------------------------ */

@media (max-width: 782px) {

	.survey-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
	}

	.survey-table tr {
		display: block;
		padding: .75em 0;
		border-bottom: 1px solid #ddd;
	}

	.survey-table td {
		display: block;
		border: 0;
		padding: .15em 0;
	}

	.survey-table .survey-num {
		width: auto;
		text-align: left;
		font-weight: 600;
	}

	/* The "#" column header is hidden here, so the bare digit reads as loose
	   text. Prefix it with the label carried on the cell itself. */
	.survey-table .survey-num[data-label]::before {
		content: attr(data-label) " ";
	}

	.survey-table .survey-scale {
		width: auto;
		margin-top: .4em;
	}

	/* Keep the five radios grouped instead of spread across the whole screen. */
	.survey-table .survey-scale .wpcf7-radio {
		max-width: 20em;
	}

	/* Numbers must be visible again once the header is gone. */
	.survey-table .survey-scale .wpcf7-list-item-label {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
		clip-path: none;
		display: block;
		font-size: .85em;
	}
}
