/* AFFU site styles. Loaded after main.css; edit here, not in main.css.
   Themes: light is the default. <html data-theme="dark"> (assets/js/theme.js) switches to dark.
   main.css still has the old dark colours hard-coded; the rules below override them with tokens. */

/* ---------- Tokens ---------- */
:root {
	color-scheme: light;

	--bg: #ffffff;                 /* .wrapper.style1 sections */
	--surface: #f6f3fa;            /* .wrapper.style2 sections */
	--card: #ffffff;               /* news cards */
	--text: #3f3a47;
	--muted: #6a6374;
	--heading: #1d1823;
	--text-strong: #1d1823;        /* <b>, news titles */
	--link: #6d28d9;
	--link-hover: #4c1d95;
	--cta-bg: #E0A43A;             /* membership button: ochre in both themes */
	--cta-hover: #C98A1E;
	--cta-text: #1d1823;
	--accent: #6d28d9;
	--ring: #E0A43A;               /* ochre ring around the round section images (paintings + logo cross) */
	--ring-edge: rgba(0, 0, 0, 0.06);
	--line: #e6dfee;
	--shadow: 0 1px 2px rgba(29, 24, 35, 0.06), 0 6px 20px rgba(29, 24, 35, 0.06);
	--header-bg: rgba(29, 24, 35, 0.94);   /* dark in both themes, same hue as the footer */
	--header-text: #ffffff;
	--header-accent: #F2C14E;               /* ochre hover/focus on the dark header */
	--footer-bg: #1d1823;
	--embed-filter: none;
	--partner-tile: #ffffff;       /* tile behind each partner logo */

	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-head: "Scope One", Georgia, serif;
	--radius: 0.75rem;
	--space-2: 0.5rem;
	--space-3: 1rem;
	--space-4: 1.5rem;
}

:root[data-theme="dark"] {
	color-scheme: dark;

	--bg: #121212;
	--surface: #1F1B24;
	--card: #27222e;
	--text: #c9c4cf;
	--muted: #a49dae;
	--heading: #ece7f2;
	--text-strong: #ffffff;
	--link: #bb86fc;
	--link-hover: #F2C14E;
	--accent: #bb86fc;
	--ring-edge: rgba(255, 255, 255, 0.25);
	--line: rgba(255, 255, 255, 0.12);
	--shadow: none;
	--header-bg: rgba(13, 12, 16, 0.92);
	--footer-bg: #0d0c10;
	--embed-filter: brightness(0.85);
	--partner-tile: #ece8f1;       /* light tiles keep the dark logos visible */
}

/* ---------- Base type and colours (override the template) ---------- */
body {
	background-color: var(--bg);
	color: var(--text);
}

body, input, select, textarea {
	font-family: var(--font-body);
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
	font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	font-weight: 400;
	line-height: 1.25;
}

strong, b {
	font-weight: 600;
}

.wrapper.style1 {
	background-color: var(--bg);
	color: var(--text);
}

.wrapper.style2 {
	background-color: var(--surface);
	color: var(--text);
}

.wrapper.style1 a,
.wrapper.style2 a {
	color: var(--link);
}

.wrapper.style1 a:hover,
.wrapper.style2 a:hover {
	color: var(--link-hover);
}

.wrapper.style1 :is(strong, b),
.wrapper.style2 :is(strong, b) {
	color: var(--text-strong);
}

/* bold text inside a link keeps the link colour (">> Ansök om medlemsskap! <<") */
.wrapper.style1 a :is(strong, b),
.wrapper.style2 a :is(strong, b) {
	color: inherit;
}

.wrapper.style1 :is(h1, h2, h3, h4, h5, h6),
.wrapper.style2 :is(h1, h2, h3, h4, h5, h6) {
	color: var(--heading);
}

.image,
.wrapper.style1 .image,
.wrapper.style2 .image {
	box-shadow: 0 0 0 7px var(--ring), 0 0 0 8px var(--ring-edge);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Header ---------- */
#header {
	background: var(--header-bg);
	color: var(--header-text);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* index.html: the banner starts under the header; the header is see-through while over it (site.js) */
body.has-banner {
	padding-top: 0;
}

#header.is-over-banner {
	background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
	box-shadow: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

#header a:focus-visible,
#header button:focus-visible {
	outline-color: var(--header-accent);
}

#header > .logo img {
	width: auto;
	height: 90%;
}

/* Nav: "Menu" button (off-canvas #menu) on small screens, inline links from 900px
   (below that the 7 links run into the logo) */
.nav-links {
	display: none;
}

.nav-menu {
	display: inline-block;
}

@media screen and (min-width: 56.25em) {
	.nav-links { display: inline-block; }
	.nav-menu { display: none; }
}

.nav-links a,
.nav-menu a {
	transition: color 0.2s ease-in-out;
	display: inline-block;
	padding: 0 0.7em;
	text-decoration: none;
	color: var(--header-text);
}

.nav-links a:hover,
.nav-menu a:hover {
	color: var(--header-accent);
}

/* Theme switch (moon in light mode, sun in dark mode) on the dark header; resets the template's button style */
#header .theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0 0.75rem 0 0.25rem;
	padding: 0;
	vertical-align: middle;
	line-height: 1;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	background: transparent;
	color: var(--header-text) !important;   /* main.css forces button { color: #000 !important } */
}

#header .theme-toggle::after {   /* 44px tap area */
	content: "";
	position: absolute;
	inset: -2px;
}

#header .theme-toggle:hover,
#header .theme-toggle:active {
	background: rgba(255, 255, 255, 0.12);
	color: var(--header-accent) !important;
}

#header .theme-toggle[hidden],
.theme-toggle .ti-sun,
:root[data-theme="dark"] .theme-toggle .ti-moon {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .ti-sun {
	display: block;
}

/* ---------- Banner: WebP (277 KB) with the JPEG as fallback; 70% of the screen on phones ---------- */
#banner {
	background-image: url("../../images/banner.jpg");
	background-image: image-set(url("../../images/banner.webp") type("image/webp"), url("../../images/banner.jpg") type("image/jpeg"));
	min-height: 24rem;
	height: 70vh !important;
	height: 70svh !important;
}

@media screen and (min-width: 48em) {
	#banner {
		height: 100vh !important;
	}
}

/* ---------- Images ---------- */
/* width/height attributes only reserve the aspect ratio, CSS sets the size */
img, video {
	max-width: 100%;
	height: auto;
}

/* ---------- News (#news, nyhetsarkiv.html): cards, date above the text on phones ---------- */
.news-list {
	display: grid;
	gap: var(--space-3);
	margin: 0 0 var(--space-3) 0;
}

.news-item {
	padding: 1rem 1.25rem;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.news-date {
	margin: 0 0 0.25rem 0;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}

/* Title is <h4> on index.html, <h3> in the archive (beats .wrapper.style2 h4) */
.news-list .news-item .news-title {
	margin: 0 0 0.25rem 0;
	font-family: var(--font-body);
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.4;
	color: var(--text-strong);
}

.news-text img,
.news-text video {
	border-radius: 0.375rem;
}

/* Paragraphs inside a news card (newer items use <p> instead of <br/>) */
.news-text p {
	margin: 0 0 0.75em 0;
}

/* Thumbnails: small gap between them */
.news-text .links {
	display: inline-block;
	margin: 0.25rem 0.25rem 0 0;
}

@media screen and (min-width: 48em) {
	.news-item {
		display: grid;
		grid-template-columns: minmax(6.5rem, 1fr) 3fr;
		column-gap: 1.25rem;
		align-items: baseline;
	}
}

/* Thumbnail next to a video (2025-05-23): top-aligned, with a gap */
.news-text .thumb-beside {
	margin-right: 50px;
}

.news-text .thumb-beside img {
	vertical-align: top;
}

/* Text links styled as small pill buttons: "Äldre nyheter" → archive, calendar agenda */
.more-link,
.cal-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	margin-top: var(--space-2);
	padding: 0.55em 1.1em;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--card);
	text-decoration: none;
	font-weight: 600;
}

.more-link::after {
	content: "→";
}

.cal-link::after {
	content: "↗";
}

/* Primary button: membership application (Google Form) in #member */
.wrapper.style1 a.cta,
.wrapper.style2 a.cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	min-height: 2.75rem;
	padding: 0.7em 1.4em;
	border-radius: 999px;
	background: var(--cta-bg);
	color: var(--cta-text);
	font-weight: 600;
	text-decoration: none;
	box-shadow: var(--shadow);
	transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.wrapper.style1 a.cta::after,
.wrapper.style2 a.cta::after {
	content: "→";
}

.wrapper.style1 a.cta:hover,
.wrapper.style2 a.cta:hover {
	background: var(--cta-hover);
	color: var(--cta-text);
	transform: translateY(-1px);
}

/* QR code to the membership form (#member): only from 48em, phones use the button */
.qr {
	display: none;
	margin: var(--space-4) 0 0 0;
}

.qr img {
	display: block;
	width: 160px;
	padding: 0;
	border-radius: var(--radius);
	background: #ffffff;   /* transparent SVG: keep it scannable in dark mode */
	box-shadow: var(--shadow);
}

.qr figcaption {
	margin-top: var(--space-2);
	font-size: 0.85em;
	color: var(--muted);
}

@media screen and (min-width: 48em) {
	.qr { display: block; }
}

/* ---------- Board photos (#about): 2 columns on phones, 4 from 48em ---------- */
.board {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-4);
}

.flex.flex-4.board .col {
	width: auto;
}

.board img {
	width: 100%;
	max-width: 10rem;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.board p {
	margin: var(--space-2) 0 0 0;
	font-size: 0.9em;
	line-height: 1.45;
	color: var(--muted);
}

@media screen and (min-width: 48em) {
	.board {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.board img {
		width: 7.5rem;
	}
}

/* ---------- Calendar (#calendar): 4:3 embed, dimmed in dark mode ---------- */
.cal-embed {
	position: relative;
	padding-bottom: 75%;
	height: 0;
	overflow: hidden;
	border-radius: var(--radius);
	border: 1px solid var(--line);
	background: var(--surface);
}

.cal-embed iframe {
	border: 0;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	filter: var(--embed-filter);
}

/* ---------- Partners (#partners): logo tiles in a grid that wraps on small screens ---------- */
.flex.flex-7 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
	gap: var(--space-4) 2rem;
	align-items: center;
}

.flex.flex-7 .col.colc7 {
	width: auto;
	min-height: 6rem;
	padding: 0.75rem;
	border-radius: var(--radius);
	background: var(--partner-tile);
	box-shadow: var(--shadow);
}

.flex-7 img {
	width: auto;
	max-height: 4.5rem;
	object-fit: contain;
}

/* white logos (Uppsala kommun, Studiefrämjandet) turned black for the light tiles */
.invert-light {
	filter: invert(1);
}

/* ---------- Footer: stays dark in both themes ---------- */
#footer {
	background-color: var(--footer-bg);
}

/* ---------- News archive (nyhetsarkiv.html): one collapsible <details> per year ---------- */
.archive-title {
	font-size: 1.75em;
	margin-bottom: 1em;
}

.news-year {
	margin-bottom: var(--space-2);
}

.news-year > summary {
	cursor: pointer;
	list-style: none;
	padding: 0.5em 0;
}

.news-year > summary::-webkit-details-marker {
	display: none;
}

.news-year > summary::before {
	content: "▸";
	display: inline-block;
	width: 1.25em;
	color: var(--accent);
}

.news-year[open] > summary::before {
	content: "▾";
}

.news-year > summary h2 {
	display: inline;
	font-size: 1.25em;
	margin: 0;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
