/**
 * AdDesk front end.
 *
 * Two jobs: keep a slot the size it says it is, and make the advertiser
 * dashboard legible in a theme we have never seen.
 *
 * Deliberately few opinions. Colours come from currentColor and the theme's
 * own background wherever possible, because a plugin that paints its own
 * palette onto somebody else's site looks like a plugin.
 */

/* ------------------------------------------------------------------ zones */

.addesk-zone {
	display: block;
	margin-inline: auto;
	text-align: center;
	line-height: 0;
}

.addesk-zone img,
.addesk-creative {
	max-width: 100%;
	height: auto;
	display: block;
	margin-inline: auto;
}

.addesk-link {
	display: block;
	line-height: 0;
}

/* The unsold slot. Reads as an invitation, not as a broken image. */
.addesk-house {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: inherit;
	height: 100%;
	line-height: 1.4;
	text-decoration: none;
	border: 1px dashed currentColor;
	border-radius: 4px;
	opacity: 0.45;
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: opacity 0.15s ease;
}

.addesk-house:hover,
.addesk-house:focus {
	opacity: 0.75;
}

.addesk-zone--placeholder {
	border: 1px dashed currentColor;
	border-radius: 4px;
	opacity: 0.5;
	padding: 1.25rem;
	line-height: 1.4;
}

/*
 * A skyscraper beside a narrow screen is a skyscraper on top of the
 * content. Hide the tall portrait formats where there is no column for
 * them rather than letting them stack.
 */
@media (max-width: 1200px) {
	.addesk-zone--skyscraper,
	.addesk-zone--halfpage {
		display: none;
	}
}

/* -------------------------------------------------------------- dashboard */

.addesk-dash {
	max-width: 48rem;
	margin-inline: auto;
}

.addesk-dash__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}

.addesk-dash__head h3 {
	margin: 0;
}

.addesk-dash__out {
	font-size: 0.875rem;
	opacity: 0.7;
}

.addesk-dash__signin {
	border: 1px solid;
	border-color: color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 8px;
	padding: 1.5rem;
}

.addesk-dash__signin h3 {
	margin-top: 0;
}

.addesk-dash__signin input[type="email"] {
	min-width: min(20rem, 100%);
	margin-right: 0.5rem;
}

.addesk-dash__ok,
.addesk-dash__error {
	border-left: 4px solid;
	padding: 0.75rem 1rem;
	margin-bottom: 1.25rem;
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.addesk-dash__ok {
	border-color: #3f8a22;
}

.addesk-dash__error {
	border-color: #d2232a;
}

.addesk-dash__note {
	font-size: 0.8125rem;
	opacity: 0.65;
	margin-top: 1.5rem;
	line-height: 1.5;
}

/* ------------------------------------------------------------------ cards */

.addesk-card {
	display: flex;
	gap: 1.25rem;
	flex-wrap: wrap;
	padding: 1.25rem 0;
	border-top: 1px solid;
	border-color: color-mix(in srgb, currentColor 14%, transparent);
}

.addesk-card__art {
	flex: 0 0 auto;
	width: min(180px, 100%);
}

.addesk-card__art img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	display: block;
}

.addesk-card__body {
	flex: 1 1 18rem;
	min-width: 0;
}

.addesk-card__body h4 {
	margin: 0 0 0.35rem;
}

.addesk-card__where,
.addesk-card__when {
	margin: 0 0 0.35rem;
	font-size: 0.875rem;
	opacity: 0.75;
}

.addesk-card__size {
	font-variant-numeric: tabular-nums;
	opacity: 0.7;
}

.addesk-card__left {
	display: inline-block;
	margin-left: 0.5rem;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	font-size: 0.8125rem;
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.addesk-card--live .addesk-card__left {
	background: color-mix(in srgb, #3f8a22 18%, transparent);
}

/* ---------------------------------------------------------------- figures */

.addesk-figures {
	display: flex;
	gap: 2rem;
	flex-wrap: wrap;
	list-style: none;
	margin: 0.9rem 0 0;
	padding: 0;
}

.addesk-figures li {
	margin: 0;
}

.addesk-figures__n {
	display: block;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.addesk-figures__l {
	display: block;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.6;
	margin-top: 0.15rem;
}

/* ------------------------------------------------------------------ table */

.addesk-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.25rem 0;
	font-size: 0.9375rem;
}

.addesk-table th,
.addesk-table td {
	text-align: left;
	padding: 0.6rem 0.75rem 0.6rem 0;
	border-bottom: 1px solid;
	border-color: color-mix(in srgb, currentColor 12%, transparent);
}

.addesk-table th {
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.6;
	font-weight: 600;
}

.addesk-table td:not(:first-child),
.addesk-table th:not(:first-child) {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* ----------------------------------------------------------- booking form */

.addesk-book__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0 1.25rem;
}

.addesk-book__grid p {
	margin: 0 0 1rem;
}

.addesk-book label {
	display: block;
	font-weight: 600;
	font-size: 0.875rem;
	margin-bottom: 0.25rem;
}

.addesk-book input[type="text"],
.addesk-book input[type="email"],
.addesk-book input[type="url"],
.addesk-book input[type="date"],
.addesk-book select,
.addesk-book textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/*
 * The screen-reader-text helper, in case the theme does not ship one. A
 * label that is visually hidden in one theme and missing entirely in
 * another is how a form becomes unusable without a mouse.
 */
.addesk-dash .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------- payment */

.addesk-book__pay {
	border: 1px solid;
	border-color: color-mix(in srgb, currentColor 18%, transparent);
	border-radius: 6px;
	padding: 1rem 1.25rem;
	margin: 0 0 1.25rem;
}

.addesk-book__pay legend {
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0 0.4rem;
}

.addesk-book__pay label {
	display: block;
	font-weight: 400;
	margin-bottom: 0.5rem;
}

/* A test-mode badge, so nobody takes a sandbox payment for a real one. */
.addesk-book__test {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0.05rem 0.4rem;
	border-radius: 999px;
	font-size: 0.6875rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: color-mix(in srgb, #f2c200 35%, transparent);
}

.addesk-book__pay .addesk-dash__note {
	margin-top: 0.5rem;
}
