/*
	MMEA Fest site styles (loaded after Pico + compat.css)

	ink    #16243a  header band, headings
	teal   #1597b8  links and primary actions (from the MMEA logo)
	paper  #ffffff  content
	page   #eef1f4  background
	gold   #c8962e  awards
*/

:root {
	--fest-ink: #16243a;
	--fest-teal: #1597b8;
	--fest-teal-dark: #0f7591;
	--fest-page: #eef1f4;
	--fest-line: #dde3ea;
	--fest-muted: #5b6b7d;
	--fest-gold: #c8962e;
	--pico-font-family-sans-serif: "Archivo", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--pico-font-family: var(--pico-font-family-sans-serif);
	--pico-color: #1d2a3a;
	--pico-muted-color: var(--fest-muted);
	--pico-h1-color: var(--fest-ink);
	--pico-h2-color: var(--fest-ink);
	--pico-h3-color: var(--fest-ink);
	--pico-h4-color: var(--fest-ink);
	--pico-h5-color: var(--fest-ink);
	--pico-h6-color: var(--fest-ink);
	--pico-primary: var(--fest-teal-dark);
	--pico-primary-background: var(--fest-teal);
	--pico-primary-border: var(--fest-teal);
	--pico-primary-hover: var(--fest-ink);
	--pico-primary-hover-background: var(--fest-teal-dark);
	--pico-primary-hover-border: var(--fest-teal-dark);
	--pico-primary-focus: rgba(21, 151, 184, 0.3);
	--pico-primary-underline: rgba(15, 117, 145, 0.45);
	--fest-blue: var(--fest-teal);
}

html, body {
	background: var(--fest-page);
	min-height: 100%;
}
body { font-variation-settings: "wdth" 100; }

/* ---------- Header band ---------- */
.site-bar {
	background: var(--fest-ink);
	color: #fff;
	position: relative;
	padding-bottom: 12px;
}
/* film-strip edge: the one decorative touch */
.site-bar::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 3px;
	height: 6px;
	background: radial-gradient(circle at 7px 3px, rgba(255,255,255,0.28) 2.2px, transparent 2.6px) 0 0 / 14px 6px repeat-x;
}
.site-bar-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0.6rem 1rem;
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
}
.site-brand { display: flex; align-items: center; gap: 0.6rem; color: #fff; text-decoration: none; }
.site-brand img { background: #fff; border-radius: 50%; padding: 2px; }
.site-name {
	font-size: 1.45rem;
	font-weight: 800;
	font-variation-settings: "wdth" 70;
	letter-spacing: 0.01em;
	line-height: 1;
}
.site-nav { display: flex; justify-content: flex-start; gap: 0.25rem; flex-wrap: wrap; flex: 1; }
.site-nav a { margin: 0; }
.site-nav a {
	color: #cfe0ee;
	text-decoration: none;
	padding: 0.35rem 0.7rem;
	border-radius: 4px;
	font-weight: 500;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--fest-teal); border-radius: 0; }
.site-user { display: flex; align-items: center; gap: 0.9rem; margin-left: auto; }
.site-user-name { font-weight: 600; line-height: 1.15; text-align: right; }
.site-user-name small { display: block; font-weight: 400; color: #a9bccd; font-size: 0.8em; }
.site-logout {
	color: #fff;
	border: 1px solid rgba(255,255,255,0.35);
	padding: 0.3rem 0.75rem;
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.9em;
}
.site-logout:hover { background: #fff; color: var(--fest-ink); }
@media (max-width: 700px) {
	.site-nav { order: 3; flex-basis: 100%; }
	.site-user-name small { display: none; }
}

/* ---------- Page frame ---------- */
#wrap { margin-top: 1.25rem; border-radius: 6px; box-shadow: none; }
.page-title {
	font-size: 2.1rem;
	font-weight: 800;
	font-variation-settings: "wdth" 72;
	line-height: 1.05;
	margin: 0.5rem 0 1.25rem;
	color: var(--fest-ink);
}
h1, h2, h3, h4, h5 { font-variation-settings: "wdth" 88; }
p { color: #33414f; }

/* ---------- Category chips ---------- */
.chips { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.4rem; margin: 0 0 1.25rem; padding: 0; }
.chips a { margin: 0; }
.chips a {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--fest-line);
	border-radius: 999px;
	text-decoration: none;
	color: var(--fest-ink);
	background: #fff;
	font-size: 0.92em;
}
.chips a span { color: var(--fest-muted); font-size: 0.85em; }
.chips a:hover { border-color: var(--fest-teal); }
.chips a[aria-current="page"] { background: var(--fest-ink); border-color: var(--fest-ink); color: #fff; }
.chips a[aria-current="page"] span { color: #a9bccd; }

/* ---------- Video grid ---------- */
.video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5rem 1.1rem;
	margin: 0 0 2rem;
	clear: both;
}
.video-tile { margin: 0; }
.video-tile a { text-decoration: none; color: var(--fest-ink); display: block; }
.video-tile .thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: #dfe6ee;
	border-radius: 4px;
}
.video-tile a:hover .thumb { outline: 3px solid var(--fest-teal); outline-offset: 2px; }
.video-tile .tile-title { display: block; font-weight: 600; margin-top: 0.45rem; line-height: 1.25; }
.video-tile .tile-meta { display: block; color: var(--fest-muted); font-size: 0.82em; margin-top: 0.15rem; }
.award { color: var(--fest-gold); font-weight: 700; }
.section-title { font-size: 1.35rem; margin: 1.5rem 0 0.75rem; }

/* thumbnails inside tables */
table .thumb { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: #dfe6ee; display: block; }
.videolist .videothumb { width: 130px; }
.videolist .edit { width: 90px; }
.videolist td { vertical-align: middle; }
.videolist h5 { margin: 0; font-size: 1rem; }

/* ---------- Status labels ---------- */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.8em; font-weight: 600; white-space: nowrap; }
.badge.ok { background: #e3f3e8; color: #1e6b3a; }
.badge.todo { background: #fff2d6; color: #7a5300; }
.badge.bad { background: #fde6e4; color: #9b1c1c; }
.badge.wait { background: #eef1f4; color: var(--fest-muted); }

/* ---------- Link checker on the entry form ---------- */
.link-status { margin: -0.4rem 0 1rem; padding: 0.6rem 0.8rem; border-radius: 4px; font-size: 0.92em; display: none; }
.link-status.ok { display: block; background: #e3f3e8; color: #1e6b3a; }
.link-status.warn { display: block; background: #fff2d6; color: #7a5300; }
.link-status.error { display: block; background: #fde6e4; color: #9b1c1c; }
.link-status.busy { display: block; background: #eef1f4; color: var(--fest-muted); }
.link-preview { margin: 0 0 1rem; }
.link-preview .video-wrap { max-width: 100%; }
.help { color: var(--fest-muted); font-size: 0.85em; margin: -0.5rem 0 1rem; }
.cat-info { background: #f4f7fa; border-left: 3px solid var(--fest-teal); padding: 0.5rem 0.8rem; margin: -0.4rem 0 1rem; font-size: 0.9em; }
.cat-info h4 { display: none; }
.cat-info p, .cat-info ul { margin: 0.2rem 0; }

/* ---------- Home page ---------- */
.home { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; align-items: start; padding: 1rem 0.5rem; clear: both; }
.home-intro h1 { font-size: 2.6rem; font-weight: 800; font-variation-settings: "wdth" 70; line-height: 1; margin: 0.25rem 0 0.75rem; }
.home-intro .lede { font-size: 1.08rem; max-width: 34em; }
.home-login { background: #f6f8fa; border: 1px solid var(--fest-line); border-radius: 6px; padding: 1.25rem 1.25rem 0.5rem; }
.home-login h2 { font-size: 1.2rem; margin-top: 0; }
.archive-years { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; margin: 0.25rem 0 0; padding: 0; }
.archive-years a { text-decoration: none; font-weight: 600; }
@media (max-width: 767px) { .home { grid-template-columns: 1fr; gap: 1.5rem; } }

/* ---------- Judge score boxes ---------- */
.col_2 .judge-box {
	background-color: #f2f5fc;
	min-height: 225px;
	padding: 0.5rem;
	border-radius: 6px;
	border: 1px solid var(--fest-line);
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--fest-teal); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
