/*
 * SSCN Touren – layout only. Fonts, colours, buttons and form fields come
 * from the website's theme; borders and tints derive from currentColor.
 */

.sscn-touren {
	--sscn-line: color-mix(in srgb, currentColor 18%, transparent);
	--sscn-tint: color-mix(in srgb, currentColor 6%, transparent);
	--sscn-gap: 0.75rem;
}

.sscn-touren * {
	box-sizing: border-box;
}

/*
 * Fallback for themes that don't style form fields. :where() has no
 * specificity, so any rule of the theme wins over these.
 */
:where(.sscn-touren) :where(input, select, textarea, button, .button) {
	font: inherit;
}

:where(.sscn-touren) :where(input[type="text"], input[type="number"], input[type="date"], input[type="search"], input[type="password"], select, textarea) {
	padding: 0.4em 0.55em;
}

:where(.sscn-touren) :where(button, .button) {
	padding: 0.35em 0.9em;
	cursor: pointer;
}

:where(.sscn-touren) :where(a.button) {
	display: inline-block;
	border: 1px solid currentColor;
	border-radius: 3px;
	text-decoration: none;
}

.sscn-touren h2 {
	margin-top: 0.5em;
}

.sscn-userbar {
	font-size: 0.875em;
	opacity: 0.8;
	margin-bottom: 1em;
	text-align: right;
}

.sscn-notice {
	padding: 0.6em 0.9em;
	border-left: 4px solid currentColor;
	background: var(--sscn-tint);
}

.sscn-notice-error {
	border-left-color: #b32d2e;
}

.sscn-hint,
.sscn-field small {
	font-size: 0.875em;
	opacity: 0.75;
}

.sscn-status {
	font-size: 0.875em;
}

/* Tabs and actions */
.sscn-tabs,
.sscn-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: var(--sscn-gap);
}

.sscn-tabs button {
	opacity: 0.65;
}

.sscn-tabs button.is-active {
	opacity: 1;
	font-weight: bold;
}

.sscn-actions select {
	width: auto;
}

/* List of tours */
.sscn-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--sscn-line);
}

.sscn-list li {
	margin: 0;
	border-bottom: 1px solid var(--sscn-line);
}

.sscn-list a {
	display: grid;
	grid-template-columns: 7.5em 1fr auto;
	gap: 0.25rem 0.75rem;
	align-items: baseline;
	padding: 0.6em 0.25em;
	color: inherit;
	text-decoration: none;
}

.sscn-list a:hover,
.sscn-list a:focus-visible {
	background: var(--sscn-tint);
}

.sscn-list .is-future {
	opacity: 0.7;
}

.sscn-date {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.sscn-list .sscn-date {
	white-space: normal;
}

.sscn-list .sscn-date > span {
	white-space: nowrap;
}

.sscn-title {
	font-weight: 600;
}

.sscn-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.25rem;
}

.sscn-chip {
	font-size: 0.75em;
	padding: 0.1em 0.5em;
	border: 1px solid var(--sscn-line);
	border-radius: 1em;
	white-space: nowrap;
}

.sscn-chip-done {
	border-color: #2e7d32;
	color: #2e7d32;
}

.sscn-chip-open {
	border-color: #b26a00;
	color: #b26a00;
}

.sscn-chip-cancelled {
	text-decoration: line-through;
}

/* One tour */
.sscn-section {
	margin: 1.5em 0;
	padding-top: 1em;
	border-top: 1px solid var(--sscn-line);
}

.sscn-field label {
	display: block;
}

.sscn-field label > span {
	display: block;
	font-weight: 600;
	margin-bottom: 0.2em;
}

.sscn-form .sscn-check label {
	display: flex;
	gap: 0.5em;
	align-items: center;
}

.sscn-form input[type="text"],
.sscn-form input[type="number"],
.sscn-form input[type="date"],
.sscn-form select,
.sscn-form textarea,
.sscn-upload input[type="text"] {
	width: 100%;
	max-width: 32rem;
}

.sscn-details {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 0 1rem;
}

.sscn-details > .sscn-field:has(textarea) {
	grid-column: 1 / -1;
}

.sscn-details textarea {
	max-width: none;
}

.sscn-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.3em 1em;
}

.sscn-facts dt {
	font-weight: 600;
}

.sscn-facts dd {
	margin: 0;
	white-space: pre-line;
}

.sscn-people {
	list-style: none;
	margin: 0.5em 0;
	padding: 0;
	columns: 14rem;
	column-gap: 1rem;
}

.sscn-people li {
	break-inside: avoid;
	margin: 0;
	padding: 0.15em 0;
}

.sscn-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.75em 0;
}

.sscn-inline input {
	flex: 1 1 12rem;
	max-width: 24rem;
}

.sscn-merge {
	align-items: center;
}

.sscn-merge select {
	flex: 1 1 12rem;
	max-width: 20rem;
}

/* Photos */
.sscn-photos {
	list-style: none;
	margin: 1em 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
	gap: var(--sscn-gap);
}

.sscn-photos li {
	margin: 0;
}

.sscn-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	background: var(--sscn-tint);
	cursor: zoom-in;
	overflow: hidden;
}

.sscn-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sscn-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-size: 0.8em;
}

.sscn-photo-meta {
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	font-size: 0.8em;
	margin-top: 0.25em;
}

.sscn-photo-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em 0.75em;
	align-items: center;
}

.sscn-link {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

.sscn-progress {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.875em;
}

.sscn-progress progress {
	vertical-align: middle;
	width: 8rem;
}

.sscn-lightbox {
	max-width: 96vw;
	max-height: 96vh;
	padding: 0.5rem;
	border: 0;
	text-align: center;
}

.sscn-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.sscn-lightbox img {
	max-width: 100%;
	max-height: calc(96vh - 4rem);
	display: block;
	margin: 0 auto;
}

/* Tables */
.sscn-table {
	border-collapse: collapse;
	width: 100%;
	max-width: 40rem;
}

.sscn-table th,
.sscn-table td {
	text-align: left;
	padding: 0.35em 0.5em;
	border-bottom: 1px solid var(--sscn-line);
}

.sscn-ranking td:nth-child(n+3),
.sscn-ranking th:nth-child(n+3),
.sscn-ranking td:first-child,
.sscn-ranking th:first-child {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.sscn-table .is-inactive {
	opacity: 0.6;
}

@media (max-width: 600px) {
	.sscn-list a {
		grid-template-columns: 1fr;
	}

	.sscn-chips {
		justify-content: flex-start;
	}

	.sscn-userbar {
		text-align: left;
	}
}
