/*
 * FST Free Stuff Days: the visitor page.
 * Layout and spacing only. Fonts and colors are inherited from the theme; borders and fills are neutral
 * grays at partial opacity so they work on light and dark themes. No fixed widths.
 */

.fst-fd-page {
	margin: 1.5em 0;
}

/* Anything the page script switches on or off with the hidden attribute must stay switched off, whatever display a rule below sets. */
.fst-fd-page [hidden] {
	display: none !important;
}

.fst-fd-topline {
	margin: 0 0 1.25em;
	font-weight: 600;
}

/* Filters: search, state and the type buttons wrap onto as many rows as the width needs. */

.fst-fd-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em 1.25em;
	align-items: flex-end;
	margin: 0 0 1em;
	padding: 1em;
	border: 1px solid rgba(127, 127, 127, 0.4);
	border-radius: 0.5em;
}

.fst-fd-field {
	min-width: 0;
	margin: 0;
	padding: 0;
}

.fst-fd-field--search {
	flex: 1 1 14rem;
}

.fst-fd-field--state {
	flex: 0 1 14rem;
}

.fst-fd-field--types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	flex: 1 1 100%;
}

.fst-fd-field label {
	display: block;
	margin: 0 0 0.25em;
	font-weight: 600;
}

.fst-fd-filters input[type="search"],
.fst-fd-filters select {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	font: inherit;
}

/* Buttons: plain outlined pills; the pressed one is filled. */

.fst-fd-type-button,
.fst-fd-share,
.fst-fd-pick,
.fst-fd-btn {
	margin: 0;
	padding: 0.35em 0.9em;
	border: 1px solid rgba(127, 127, 127, 0.6);
	border-radius: 2em;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.3;
	cursor: pointer;
}

.fst-fd-type-button:hover,
.fst-fd-share:hover,
.fst-fd-pick:hover,
.fst-fd-btn:hover {
	background: rgba(127, 127, 127, 0.15);
}

/* The share list's site links look like its buttons. */
.fst-fd-page a.fst-fd-btn {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.fst-fd-type-button[aria-pressed="true"],
.fst-fd-pick[aria-pressed="true"] {
	border-color: currentcolor;
	background: rgba(127, 127, 127, 0.25);
	font-weight: 600;
}

.fst-fd-showing {
	margin: 0 0 1em;
}

/* The two groups and their cards: one column, stacked, at every width. */

.fst-fd-group {
	margin: 0 0 2em;
}

.fst-fd-group-heading {
	margin: 0 0 0.75em;
}

.fst-fd-list {
	display: flex;
	flex-direction: column;
	gap: 0.75em;
}

.fst-fd-card {
	box-sizing: border-box;
	max-width: 100%;
	margin: 0;
	padding: 0.9em 1em;
	border: 1px solid rgba(127, 127, 127, 0.4);
	border-radius: 0.5em;
	overflow-wrap: anywhere;
	scroll-margin-top: 1em;
}

.fst-fd-card > * {
	margin: 0 0 0.4em;
}

.fst-fd-card > :last-child {
	margin-bottom: 0;
}

.fst-fd-name {
	margin: 0 0 0.2em;
	font-size: 1.15em;
	line-height: 1.3;
}

.fst-fd-offer {
	font-weight: 600;
}

.fst-fd-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.9em;
	font-size: 0.95em;
}

.fst-fd-type {
	opacity: 0.75;
}

.fst-fd-fine-print,
.fst-fd-status {
	font-size: 0.9em;
}

.fst-fd-status {
	opacity: 0.8;
}

.fst-fd-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-top: 0.6em;
}

/* "Offered before, not confirmed yet": the same card, muted gray. */

.fst-fd-card--earlier {
	border-style: dashed;
	background: rgba(127, 127, 127, 0.08);
	opacity: 0.75;
}

/* Cards the filters rule out disappear, whatever display the card rule sets. */

.fst-fd-card[hidden] {
	display: none;
}

/* A card the share link points to. */

.fst-fd-card--highlight {
	outline: 3px solid currentcolor;
	outline-offset: 2px;
}

/* Share: the page's Share button, and the list that opens under a Share button on computers. */

.fst-fd-share-page {
	margin: 0 0 1em;
}

.fst-fd-share-panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 0.5em 0 0;
	padding: 0.75em;
	border: 1px solid rgba(127, 127, 127, 0.4);
	border-radius: 0.5em;
}

.fst-fd-share-panel .fst-fd-share-status {
	flex-basis: 100%;
	margin: 0;
}

.fst-fd-share-panel .fst-fd-share-status:empty,
.fst-fd-picks-status:empty {
	display: none;
}

.fst-fd-share-field {
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.25em;
	font: inherit;
}

/* My picks: shared picks (from a link) and the visitor's own, above the list. */

.fst-fd-picks {
	box-sizing: border-box;
	max-width: 100%;
	margin: 0 0 1.5em;
	padding: 1em;
	border: 2px solid rgba(127, 127, 127, 0.6);
	border-radius: 0.5em;
}

.fst-fd-picks > * + * {
	margin-top: 1.25em;
}

.fst-fd-picks-heading {
	margin: 0 0 0.5em;
	font-size: 1.25em;
	line-height: 1.3;
}

/* The script moves focus to a card's name or the picks heading (not tabbable, no ring wanted). */
.fst-fd-name:focus,
.fst-fd-picks-heading:focus {
	outline: none;
}

.fst-fd-picks-list {
	margin: 0 0 0.75em;
	padding: 0 0 0 1.5em;
}

.fst-fd-picks-item {
	margin: 0 0 0.75em;
	overflow-wrap: anywhere;
}

.fst-fd-picks-item > * {
	margin: 0 0 0.15em;
}

.fst-fd-picks-name {
	font-weight: 700;
}

.fst-fd-picks-offer {
	font-weight: 600;
}

.fst-fd-picks-when,
.fst-fd-picks-fine {
	font-size: 0.9em;
}

.fst-fd-picks-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
}

.fst-fd-picks-status {
	margin: 0.5em 0 0;
}

/* Text for screen readers only. */

.fst-fd-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/*
 * Print my picks: the script puts fst-fd-printing-picks on the body, and marks every other part of the
 * page (the theme's header, sidebar and footer too) fst-fd-print-hide, so only the picks are printed
 * and they take one page, not several blank ones. Visibility is the backstop for anything not marked.
 */

@media print {
	body.fst-fd-printing-picks .fst-fd-print-hide {
		display: none !important;
	}

	body.fst-fd-printing-picks * {
		visibility: hidden;
	}

	body.fst-fd-printing-picks .fst-fd-picks,
	body.fst-fd-printing-picks .fst-fd-picks * {
		visibility: visible;
	}

	/* Buttons are for the screen, and so are the picks someone else shared: the printout is my list. */
	body.fst-fd-printing-picks .fst-fd-picks .fst-fd-shared,
	body.fst-fd-printing-picks .fst-fd-picks .fst-fd-picks-actions,
	body.fst-fd-printing-picks .fst-fd-picks .fst-fd-picks-status {
		display: none !important;
	}

	body.fst-fd-printing-picks .fst-fd-picks {
		margin: 0;
		padding: 0;
		border: 0;
	}

	body.fst-fd-printing-picks .fst-fd-picks-item {
		break-inside: avoid;
	}
}
