/* filmdatabase.dk: dark "cinema" by default, light when the system prefers it. */

:root {
	--bg: #0f1115;
	--bg-raised: #171a21;
	--bg-sunk: #0b0c10;
	--line: #262a34;
	--text: #e8e6e3;
	--muted: #9aa0ab;
	--accent: #f5b301;
	--accent-text: #1a1300;
	--link: #ffd166;
	--dot: #343946;
	--notice-bg: #2a2410;
	--notice-line: #5c4a0f;
	--radius: 12px;
	--shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	color-scheme: dark;
}

@media (prefers-color-scheme: light) {
	:root {
		--bg: #f6f5f2;
		--bg-raised: #ffffff;
		--bg-sunk: #ecebe6;
		--line: #dedcd5;
		--text: #1d1f24;
		--muted: #646a75;
		--accent: #c98a00;
		--accent-text: #ffffff;
		--link: #8a5a00;
		--dot: #d8d6cf;
		--notice-bg: #fff6dc;
		--notice-line: #ecd48a;
		--shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
		color-scheme: light;
	}
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

main {
	flex: 1;
	padding-top: 2rem;
	padding-bottom: 3rem;
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

h1, h2, h3 {
	line-height: 1.2;
	letter-spacing: -0.01em;
}

h1 {
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	margin: 0 0 0.5rem;
}

h2 {
	font-size: 1.25rem;
	margin: 2rem 0 0.8rem;
}

h3 {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--muted);
	margin: 1.5rem 0 0.6rem;
}

.wrap {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

.muted {
	color: var(--muted);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Test instance banner */
.dev {
	background: #b3261e;
	color: #fff;
	text-align: center;
	font-weight: 600;
	padding: 0.3rem;
	font-size: 0.9rem;
}

/* Header */
.top {
	position: sticky;
	top: 0;
	z-index: 10;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}

.top-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 64px;
	flex-wrap: wrap;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.logo {
	color: var(--text);
	font-weight: 800;
	font-size: 1.3rem;
	letter-spacing: -0.02em;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.logo:hover {
	text-decoration: none;
}


.logo-img {
	width: 2rem;
	height: 2rem;
}


.logo .dk {
	color: var(--accent);
}

.nav {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nav a {
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--link);
	border: 1px solid var(--accent);
	border-radius: 999px;
	padding: 0.3rem 0.9rem;
	line-height: 1.4;
}

.nav a:hover {
	background: var(--accent);
	color: var(--accent-text);
	text-decoration: none;
}

/* The admin button (visitors on the local network only) */
.nav a.admin {
	color: var(--accent-text);
	background: var(--accent);
}

.nav a.admin:hover {
	filter: brightness(1.1);
}

.search {
	display: flex;
	flex: 1;
	min-width: 220px;
	max-width: 420px;
	margin-left: auto;
}

.search input {
	flex: 1;
	min-width: 0;
	font: inherit;
	font-size: 0.95rem;
	color: var(--text);
	background: var(--bg-sunk);
	border: 1px solid var(--line);
	border-right: 0;
	border-radius: 999px 0 0 999px;
	padding: 0.45rem 1rem;
	outline: none;
}

.search input:focus {
	border-color: var(--accent);
}

.search button {
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--accent-text);
	background: var(--accent);
	border: 0;
	border-radius: 0 999px 999px 0;
	padding: 0.45rem 1.1rem;
	cursor: pointer;
}

.search.big {
	max-width: 640px;
	margin: 1rem 0 1.5rem;
}

.search.big input, .search.big button {
	font-size: 1.1rem;
	padding: 0.7rem 1.2rem;
}

.lang {
	line-height: 1.4;
	font-weight: 600;
	font-size: 0.9rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.3rem 0.8rem;
	color: var(--text);
}

.lang {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	cursor: pointer;
	user-select: none;
	list-style: none;
}

.lang::-webkit-details-marker {
	display: none;
}

.caret {
	color: var(--muted);
	font-size: 0.8em;
}

/* The language menu (a <details>: no script) */
.lang-menu {
	position: relative;
}

.lang-menu[open] .lang {
	border-color: var(--accent);
}

.lang-list {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 20;
	min-width: 170px;
	margin: 0;
	padding: 0.35rem;
	list-style: none;
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: var(--shadow);
}

.lang-option {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.7rem;
	border-radius: 8px;
	color: var(--text);
	font-size: 0.95rem;
}

a.lang-option:hover {
	background: var(--bg-sunk);
	text-decoration: none;
}

.lang-option.current {
	font-weight: 700;
}

.check {
	margin-left: auto;
	color: var(--accent);
}

.flag {
	width: 20px;
	height: 14px;
	border-radius: 2px;
	object-fit: cover;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.lang:hover {
	border-color: var(--accent);
	text-decoration: none;
}

/* Footer */
.bottom {
	border-top: 1px solid var(--line);
	padding: 1.5rem 0;
	font-size: 0.9rem;
}

.bottom p {
	margin: 0.2rem 0;
}

/* Front page */
.hero {
	padding: 1.5rem 0 0.5rem;
	max-width: 760px;
}

.hero h1 {
	font-size: clamp(1.7rem, 4vw, 2.5rem);
}

.intro {
	color: var(--muted);
	font-size: 1.05rem;
}

.counts {
	display: inline-block;
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.3rem 1rem;
	font-size: 0.9rem;
	color: var(--muted);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.cards.two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--text);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
	border-color: var(--accent);
	text-decoration: none;
}

.poster {
	aspect-ratio: 16 / 10;
	background: var(--bg-sunk);
	display: grid;
	place-items: center;
	overflow: hidden;
}

.poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.initial {
	font-size: 3rem;
	font-weight: 800;
	color: var(--dot);
}

.card-body {
	padding: 0.7rem 0.9rem 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.card-title {
	font-weight: 650;
	line-height: 1.3;
}

.card-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	color: var(--muted);
	font-size: 0.85rem;
}

.columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-top: 1rem;
}

.panel {
	background: var(--bg-raised);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 0.4rem 1.3rem 1.2rem;
}

.panel h2 {
	margin-top: 1rem;
}

/* Lists of films */
.films {
	list-style: none;
	margin: 0;
	padding: 0;
}

.films li {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.5rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--line);
}

.films li:last-child {
	border-bottom: 0;
}

.films li .rating {
	margin-left: auto;
	align-self: center;
}

.films .character {
	flex-basis: 100%;
	color: var(--muted);
	font-size: 0.9rem;
}

.films.list {
	columns: 2 340px;
	column-gap: 2.5rem;
}

.films.list li {
	break-inside: avoid;
}

/* The rating: eight Walk of Fame stars */
.rating {
	display: inline-flex;
	gap: 1px;
	vertical-align: middle;
}

.star {
	width: 13px;
	height: 13px;
	background: url("/stars/star-off-dec41757b702c68a94b699e83e5ab57e.svg") center / contain no-repeat;
}

.star.on {
	background-image: url("/stars/star-on-75d5a8f83c830c1dc54410714d03ad7e.svg");
}

.big-rating {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}

.big-rating .star {
	width: 24px;
	height: 24px;
}

.big-rating .rating {
	gap: 3px;
}

/* A-Z */
.letters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 1rem 0 1.5rem;
}

.letters a {
	min-width: 2.3rem;
	text-align: center;
	padding: 0.35rem 0.6rem;
	border-radius: 8px;
	background: var(--bg-raised);
	border: 1px solid var(--line);
	color: var(--text);
	font-weight: 600;
}

.letters a:hover, .letters a.current {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--accent-text);
	text-decoration: none;
}

/* Film and person pages */
.entity-head {
	display: flex;
	gap: 1.8rem;
	align-items: flex-end;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.entity-image img {
	display: block;
	max-width: min(100%, 360px);
	max-height: 260px;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	object-fit: cover;
}

.entity-image.portrait img {
	max-width: 200px;
	max-height: 280px;
}

.entity-title {
	flex: 1;
	min-width: 260px;
}

.subtitle {
	color: var(--muted);
	margin: 0.2rem 0;
	font-size: 1.05rem;
}

.entity-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 2.5rem;
	align-items: start;
}

@media (max-width: 860px) {
	.entity-body {
		grid-template-columns: minmax(0, 1fr);
	}
}

.prose {
	max-width: 70ch;
}

.prose p {
	margin: 0 0 1em;
}

.review .prose {
	font-size: 1.08rem;
	line-height: 1.75;
}

.notice {
	background: var(--notice-bg);
	border: 1px solid var(--notice-line);
	border-radius: 8px;
	padding: 0.6rem 0.9rem;
	max-width: 70ch;
	font-size: 0.95rem;
}

.notice a {
	margin-left: 0.3rem;
}

.facts dl {
	margin: 0;
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1rem;
}

.facts dt {
	color: var(--muted);
	font-size: 0.9rem;
}

.facts dd {
	margin: 0;
}

/* People (cast, relations, search) */
.people {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 0.5rem;
}

.facts .people, .panel .people {
	grid-template-columns: 1fr;
}

.people a {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.4rem 0.5rem;
	border-radius: 10px;
	color: var(--text);
}

.people a:hover {
	background: var(--bg-raised);
	text-decoration: none;
}

.people a:hover .name {
	color: var(--link);
}

.person-text {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
	min-width: 0;
}

.person-text .muted {
	font-size: 0.88rem;
}

.avatar {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--bg-sunk);
	border: 1px solid var(--line);
	display: grid;
	place-items: center;
	font-weight: 700;
	color: var(--muted);
}

.avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.gallery figure {
	margin: 0;
}

.gallery img {
	width: 100%;
	border-radius: 8px;
	display: block;
}

.gallery figcaption {
	color: var(--muted);
	font-size: 0.85rem;
	margin-top: 0.3rem;
}

/* Errors */
.error-page {
	text-align: center;
	padding-top: 4rem;
}

.error-code {
	font-size: 5rem;
	font-weight: 800;
	color: var(--accent);
	margin: 0;
	line-height: 1;
}

@media (max-width: 640px) {
	body {
		font-size: 16px;
	}

	.top-row {
		gap: 0.6rem 0.5rem;
	}

	.logo {
		font-size: 1.05rem;
		gap: 0.35rem;
	}

	.logo-img {
		width: 1.6rem;
		height: 1.6rem;
	}

	.nav a, .lang {
		padding: 0.25rem 0.65rem;
		font-size: 0.85rem;
	}

	/* Logo and language on the first row, the buttons on the second, the
	   search on the third. */
	.lang-menu {
		order: 1;
		margin-left: auto;
	}

	.nav {
		order: 2;
		flex-basis: 100%;
	}

	.search {
		order: 3;
		max-width: none;
		flex-basis: 100%;
		margin-left: 0;
	}

	.entity-image img {
		max-width: 100%;
	}
}

/* Narrow phones: the language button is just its flag (the name is still
   there for screen readers). */
@media (max-width: 420px) {
	summary.lang .lang-name {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.lang {
		padding: 0.3rem 0.5rem;
	}
}
