/* SMM Date Selector — front end */

.smm-ds {
	--smm-ds-week-a: #eaf7e4;
	--smm-ds-week-b: #c2e0b8;
	--smm-ds-week-a-band: #f7fcf5;
	--smm-ds-week-b-band: #e4f1df;
	--smm-ds-busy: #f3b8b2;
	--smm-ds-busy-line: #c9584c;
	--smm-ds-proposed: #e0a220;
	--smm-ds-ink: #2b3a2b;
	--smm-ds-line: rgba(0, 0, 0, .12);
	--smm-ds-radius: 6px;

	max-width: 900px;
	margin: 0 0 2em;
	color: var(--smm-ds-ink);
}

.smm-ds *,
.smm-ds *::before,
.smm-ds *::after {
	box-sizing: border-box;
}

.smm-ds-notice {
	padding: .75em 1em;
	background: #f6f6f6;
	border-left: 4px solid #bbb;
}

.smm-ds-period {
	margin: 0 0 1em;
}

.smm-ds-closed {
	padding: .6em .9em;
	background: #fdf3e0;
	border-left: 4px solid var(--smm-ds-proposed);
	margin: 0 0 1em;
}

.smm-ds-heading {
	margin: 1.4em 0 .2em;
}

.smm-ds-hint {
	margin: 0 0 1em;
	font-size: .9em;
	opacity: .8;
}

.smm-ds-title {
	margin: 0 0 .4em;
}

/* ---------- signed in / login gate ---------- */

.smm-ds-identity {
	margin: 0 0 1em;
	padding: .6em .9em;
	background: var(--smm-ds-week-a);
	border-left: 4px solid #4b7f3f;
	border-radius: 0 var(--smm-ds-radius) var(--smm-ds-radius) 0;
}

.smm-ds-identity-note {
	opacity: .8;
	font-size: .9em;
}

.smm-ds--gate {
	padding: 1.2em 1.4em;
	background: #f7fcf5;
	border: 1px solid var(--smm-ds-line);
	border-radius: var(--smm-ds-radius);
}

.smm-ds .smm-ds-login {
	display: inline-block;
	padding: .55em 1.4em;
	border-radius: var(--smm-ds-radius);
	background: #4b7f3f;
	border: 1px solid #3d6a33;
	color: #fff;
	font-weight: 600;
	text-decoration: none;
}

/* ---------- the poll chooser ---------- */

.smm-ds-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid var(--smm-ds-line);
	border-radius: var(--smm-ds-radius);
	overflow: hidden;
}

.smm-ds-list-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .6em;
	margin: 0;
	padding: .8em 1em;
	background: var(--smm-ds-week-a-band);
	border-bottom: 1px solid var(--smm-ds-line);
}

.smm-ds-list-item:nth-child(even) {
	background: var(--smm-ds-week-b-band);
}

.smm-ds-list-item:last-child {
	border-bottom: 0;
}

.smm-ds-list-link {
	text-decoration: none;
	display: flex;
	flex-direction: column;
	gap: .15em;
	min-width: 12em;
}

.smm-ds-list-name {
	font-weight: 700;
	font-size: 1.05em;
}

.smm-ds-list-period {
	font-size: .85em;
	opacity: .8;
}

.smm-ds-list-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em;
	font-size: .85em;
}

.smm-ds-list-count {
	opacity: .7;
}

.smm-ds-tag {
	display: inline-block;
	padding: .15em .7em;
	border-radius: 999px;
	font-weight: 600;
	font-size: .9em;
}

.smm-ds-tag--done {
	background: #cfe8c7;
	color: #29521f;
}

.smm-ds-tag--todo {
	background: #fbe3c0;
	color: #7a4a10;
}

.smm-ds-tag--closed {
	background: #e4e4e4;
	color: #555;
}

/* ---------- name / email fields ---------- */

.smm-ds-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
}

.smm-ds-field {
	flex: 1 1 240px;
	margin: 0 0 .5em;
}

.smm-ds-field label {
	display: block;
	font-weight: 600;
	margin-bottom: .25em;
}

.smm-ds-field input,
.smm-ds-field textarea {
	width: 100%;
	padding: .5em .6em;
	border: 1px solid #bbb;
	border-radius: var(--smm-ds-radius);
	font: inherit;
}

.smm-ds-field--note {
	flex-basis: 100%;
	margin-top: 1em;
}

.smm-ds-lookup {
	margin: .5em 0 0;
	padding: .6em .9em;
	background: #eef4fb;
	border-left: 4px solid #5b8dc8;
	border-radius: 0 var(--smm-ds-radius) var(--smm-ds-radius) 0;
}

.smm-ds-lookup button {
	margin-left: .5em;
}

/* ---------- legend ---------- */

.smm-ds-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	list-style: none;
	margin: 0 0 .75em;
	padding: 0;
	font-size: .85em;
}

.smm-ds-legend li {
	display: flex;
	align-items: center;
	gap: .4em;
	margin: 0;
}

.smm-ds-swatch {
	width: 1.1em;
	height: 1.1em;
	border-radius: 3px;
	border: 1px solid var(--smm-ds-line);
	display: inline-block;
}

.smm-ds-swatch--free {
	background: var(--smm-ds-week-b);
}

.smm-ds-swatch--busy {
	background: var(--smm-ds-busy);
}

.smm-ds-swatch--proposed {
	background: #fff;
	box-shadow: inset 0 0 0 2px var(--smm-ds-proposed);
}

/* ---------- the calendar strip ---------- */

.smm-ds-strip {
	border: 1px solid var(--smm-ds-line);
	border-radius: var(--smm-ds-radius);
	padding: .4em;
	background: #fff;
	overflow: hidden;
}

.smm-ds-headings,
.smm-ds-week {
	display: flex;
	align-items: center;
	gap: .5em;
	padding: 2px .25em;
}

.smm-ds-week--a {
	background: var(--smm-ds-week-a-band);
}

.smm-ds-week--b {
	background: var(--smm-ds-week-b-band);
}

.smm-ds-week-label {
	flex: 0 0 5.5em;
	font-size: .75em;
	line-height: 1.2;
	opacity: .7;
	text-align: right;
	white-space: nowrap;
}

.smm-ds-headings-days,
.smm-ds-days {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	min-width: 0;
}

.smm-ds-heading {
	text-align: center;
	font-size: .75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .6;
	padding: .2em 0;
}

.smm-ds-heading.is-weekend {
	opacity: .9;
}

/* day boxes */

.smm-ds-day {
	position: relative;
	display: block;
	margin: 0;
	min-width: 0;
}

.smm-ds-day--blank {
	visibility: hidden;
}

.smm-ds-check {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

.smm-ds-day-face {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 2.9em;
	padding: .3em .1em;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, .08);
	line-height: 1.1;
	font-size: .95em;
	transition: background-color .08s linear, box-shadow .08s linear;
}

.smm-ds-week--a .smm-ds-day-face {
	background: var(--smm-ds-week-a);
}

.smm-ds-week--b .smm-ds-day-face {
	background: var(--smm-ds-week-b);
}

.smm-ds-day-num {
	font-weight: 600;
	font-size: 1em;
}

.smm-ds-day-month {
	font-size: .6em;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .75;
}

.smm-ds-day-star {
	position: absolute;
	top: 1px;
	right: 3px;
	font-size: .6em;
	color: var(--smm-ds-proposed);
	line-height: 1;
}

.smm-ds-day.is-weekend .smm-ds-day-num {
	opacity: .75;
}

.smm-ds-day.is-proposed .smm-ds-day-face {
	box-shadow: inset 0 0 0 2px var(--smm-ds-proposed);
}

.smm-ds-day.is-today .smm-ds-day-face::after {
	content: "";
	position: absolute;
	inset: 2px;
	border: 1px dashed rgba(0, 0, 0, .45);
	border-radius: 3px;
	pointer-events: none;
}

/* selected = NOT available */

.smm-ds-check:checked + .smm-ds-day-face {
	background: var(--smm-ds-busy);
	border-color: var(--smm-ds-busy-line);
}

.smm-ds-check:checked + .smm-ds-day-face .smm-ds-day-num {
	text-decoration: line-through;
	text-decoration-color: var(--smm-ds-busy-line);
	opacity: 1;
}

.smm-ds-check:focus-visible + .smm-ds-day-face,
.smm-ds-check:focus + .smm-ds-day-face {
	outline: 2px solid #2a6fb5;
	outline-offset: 1px;
}

.smm-ds-check:disabled + .smm-ds-day-face {
	opacity: .75;
}

/* Interaction: a touch starting on a day drags, touches elsewhere scroll. */
label.smm-ds-day {
	cursor: pointer;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

label.smm-ds-day:hover .smm-ds-day-face {
	filter: brightness(.97);
}

.smm-ds.is-dragging label.smm-ds-day:hover .smm-ds-day-face {
	filter: none;
}

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

.smm-ds-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin: 1em 0 0;
}

.smm-ds-count {
	margin: 0;
	font-weight: 600;
}

.smm-ds-buttons {
	display: flex;
	gap: .5em;
}

.smm-ds button {
	font: inherit;
	cursor: pointer;
	padding: .55em 1.1em;
	border-radius: var(--smm-ds-radius);
	border: 1px solid #7aa06f;
	background: #fff;
	color: #2b3a2b;
}

.smm-ds .smm-ds-submit {
	background: #4b7f3f;
	border-color: #3d6a33;
	color: #fff;
	font-weight: 600;
}

.smm-ds .smm-ds-submit[disabled],
.smm-ds .smm-ds-clear[disabled] {
	opacity: .5;
	cursor: not-allowed;
}

.smm-ds-message,
.smm-ds-flash {
	margin: 1em 0 0;
	padding: .7em 1em;
	border-radius: var(--smm-ds-radius);
	background: #e7f3e3;
	border-left: 4px solid #4b7f3f;
}

.smm-ds-message.is-error,
.smm-ds-flash.is-error {
	background: #fbeceb;
	border-left-color: #c9584c;
}

/* ---------- results ---------- */

.smm-ds-results {
	margin-top: 2em;
	padding-top: 1em;
	border-top: 2px solid var(--smm-ds-line);
}

.smm-ds-results h3 {
	margin-top: 0;
}

.smm-ds-names {
	opacity: .75;
}

.smm-ds-public-list {
	list-style: none;
	margin: 0 0 1.2em;
	padding: 0;
}

.smm-ds-public-list li {
	padding: .4em .6em;
	border-bottom: 1px solid var(--smm-ds-line);
	display: flex;
	flex-wrap: wrap;
	gap: .5em;
	align-items: baseline;
}

.smm-ds-public-date {
	font-weight: 600;
	min-width: 9em;
}

.smm-ds-public-score {
	background: var(--smm-ds-week-b);
	border-radius: 999px;
	padding: .1em .7em;
	font-size: .85em;
}

.smm-ds-public-away {
	font-size: .85em;
	opacity: .7;
}

.smm-ds-star {
	color: var(--smm-ds-proposed);
}

/* heat strip */

.smm-ds-strip--heat .smm-ds-day-face {
	min-height: 2.6em;
	background: #eee;
}

.smm-ds-day-score {
	font-size: .65em;
	font-weight: 700;
	opacity: .8;
}

.smm-ds-heat-0 .smm-ds-day-face { background: #f0cfcb; }
.smm-ds-heat-1 .smm-ds-day-face { background: #f2e0c4; }
.smm-ds-heat-2 .smm-ds-day-face { background: #e9eec2; }
.smm-ds-heat-3 .smm-ds-day-face { background: #d2e9c5; }
.smm-ds-heat-4 .smm-ds-day-face { background: #aedca4; }

.smm-ds-strip--heat .is-proposed .smm-ds-day-face {
	box-shadow: inset 0 0 0 2px var(--smm-ds-proposed);
}

.smm-ds-heat-key {
	font-size: .85em;
	opacity: .75;
	margin: .5em 0 0;
}

/* ---------- small screens ---------- */

@media (max-width: 600px) {
	.smm-ds-week-label {
		flex-basis: 4em;
		font-size: .65em;
	}

	.smm-ds-day-face {
		min-height: 2.5em;
		font-size: .85em;
	}

	.smm-ds-actions {
		justify-content: flex-start;
	}
}

@media (max-width: 380px) {
	.smm-ds-week-label {
		display: none;
	}
}
