/* lodin.biz v2: one stylesheet for every page (site/layout.php). */
/* Two themes. Light, "dag": the old lodin.biz's sky blue and sun yellow. Dark, "natt": a night sky.
   The sky (--sky) is drawn behind the top of every page; the rest is plain colour. */
:root {
	--bg: #f4faff; --surface: #ffffff; --text: #16202e; --muted: #5b6878; --line: #dbe6f0; --soft: #e9f2fa;
	--accent: #2747d4; --accent-ink: #1d37a8; --accent-soft: #e1e9ff; --shadow: 0 1px 2px rgba(22,32,46,.06), 0 4px 16px rgba(40,90,140,.08);
	--on-accent: #fff; --sun: #f7c928;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--radius: 14px; --gutter: clamp(16px, 4vw, 40px); --max: 1180px;
	/* the day sky: the old header's sun glow and blue haze */
	--sky:
		radial-gradient(circle at calc(100% - 150px) 110px, rgba(255,255,255,.97) 0 26px, rgba(255,244,170,.95) 44px, rgba(255,230,110,.6) 80px, rgba(255,226,100,.25) 130px, rgba(255,226,100,0) 210px),
		radial-gradient(ellipse 560px 400px at calc(100% - 380px) 190px, rgba(150,215,255,.55), rgba(150,215,255,0) 70%),
		linear-gradient(#d9f0ff, rgba(244,250,255,0) 560px);
	color-scheme: light;
}
/* dark: chosen in the header (data-theme="dark"), or the device's setting when nothing is chosen */
:root[data-theme="dark"] {
	--bg: #0b1226; --surface: #121b36; --text: #e6ebfa; --muted: #9aa5c6; --line: #232e52; --soft: #18223f;
	--accent: #8fb8ff; --accent-ink: #b5cfff; --accent-soft: #1c2a52; --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 22px rgba(0,0,0,.3);
	--on-accent: #0b1226; --sun: #f3e6b0; color-scheme: dark;
	/* the night sky: a moon where the old site had its sun; stars: Karlavagnen (the Big Dipper) left of the moon, Cassiopeia top left, a few loose ones; deep blue fading into the page */
	--sky:
		radial-gradient(circle at calc(100% - 150px) 110px, #f6efcf 0 24px, rgba(246,239,207,.35) 26px, rgba(170,195,255,.12) 70px, transparent 190px),
		radial-gradient(2.1px 2.1px at calc(100% - 330px) 58px, #fff 50%, transparent),
		radial-gradient(1.9px 1.9px at calc(100% - 324px) 104px, #fff 50%, transparent),
		radial-gradient(1.7px 1.7px at calc(100% - 384px) 118px, #fff 50%, transparent),
		radial-gradient(1.5px 1.5px at calc(100% - 396px) 80px, #fff 50%, transparent),
		radial-gradient(1.9px 1.9px at calc(100% - 446px) 72px, #fff 50%, transparent),
		radial-gradient(1.9px 1.9px at calc(100% - 492px) 64px, #fff 50%, transparent),
		radial-gradient(0.9px 0.9px at calc(100% - 497px) 56px, #dfe7ff 50%, transparent),
		radial-gradient(1.8px 1.8px at calc(100% - 546px) 94px, #fff 50%, transparent),
		radial-gradient(1.8px 1.8px at 60px 62px, #fff 50%, transparent),
		radial-gradient(1.6px 1.6px at 92px 104px, #fff 50%, transparent),
		radial-gradient(1.9px 1.9px at 126px 82px, #fff 50%, transparent),
		radial-gradient(1.5px 1.5px at 162px 118px, #fff 50%, transparent),
		radial-gradient(1.7px 1.7px at 198px 70px, #fff 50%, transparent),
		radial-gradient(1px 1px at 22% 250px, #cfd9ff 50%, transparent),
		radial-gradient(1.1px 1.1px at 41% 150px, #dfe7ff 50%, transparent),
		radial-gradient(0.9px 0.9px at 46% 320px, #cfd9ff 50%, transparent),
		radial-gradient(1px 1px at 63% 230px, #cfd9ff 50%, transparent),
		radial-gradient(0.9px 0.9px at 12% 190px, #dfe7ff 50%, transparent),
		radial-gradient(1px 1px at calc(100% - 250px) 300px, #cfd9ff 50%, transparent),
		linear-gradient(#152457, rgba(11,18,38,0) 620px);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0b1226; --surface: #121b36; --text: #e6ebfa; --muted: #9aa5c6; --line: #232e52; --soft: #18223f;
		--accent: #8fb8ff; --accent-ink: #b5cfff; --accent-soft: #1c2a52; --shadow: 0 1px 2px rgba(0,0,0,.35), 0 6px 22px rgba(0,0,0,.3);
		--on-accent: #0b1226; --sun: #f3e6b0; color-scheme: dark;
		/* the night sky: a moon where the old site had its sun; stars: Karlavagnen (the Big Dipper) left of the moon, Cassiopeia top left, a few loose ones; deep blue fading into the page */
		--sky:
			radial-gradient(circle at calc(100% - 150px) 110px, #f6efcf 0 24px, rgba(246,239,207,.35) 26px, rgba(170,195,255,.12) 70px, transparent 190px),
			radial-gradient(2.1px 2.1px at calc(100% - 330px) 58px, #fff 50%, transparent),
			radial-gradient(1.9px 1.9px at calc(100% - 324px) 104px, #fff 50%, transparent),
			radial-gradient(1.7px 1.7px at calc(100% - 384px) 118px, #fff 50%, transparent),
			radial-gradient(1.5px 1.5px at calc(100% - 396px) 80px, #fff 50%, transparent),
			radial-gradient(1.9px 1.9px at calc(100% - 446px) 72px, #fff 50%, transparent),
			radial-gradient(1.9px 1.9px at calc(100% - 492px) 64px, #fff 50%, transparent),
			radial-gradient(0.9px 0.9px at calc(100% - 497px) 56px, #dfe7ff 50%, transparent),
			radial-gradient(1.8px 1.8px at calc(100% - 546px) 94px, #fff 50%, transparent),
			radial-gradient(1.8px 1.8px at 60px 62px, #fff 50%, transparent),
			radial-gradient(1.6px 1.6px at 92px 104px, #fff 50%, transparent),
			radial-gradient(1.9px 1.9px at 126px 82px, #fff 50%, transparent),
			radial-gradient(1.5px 1.5px at 162px 118px, #fff 50%, transparent),
			radial-gradient(1.7px 1.7px at 198px 70px, #fff 50%, transparent),
			radial-gradient(1px 1px at 22% 250px, #cfd9ff 50%, transparent),
			radial-gradient(1.1px 1.1px at 41% 150px, #dfe7ff 50%, transparent),
			radial-gradient(0.9px 0.9px at 46% 320px, #cfd9ff 50%, transparent),
			radial-gradient(1px 1px at 63% 230px, #cfd9ff 50%, transparent),
			radial-gradient(0.9px 0.9px at 12% 190px, #dfe7ff 50%, transparent),
			radial-gradient(1px 1px at calc(100% - 250px) 300px, #cfd9ff 50%, transparent),
			linear-gradient(#152457, rgba(11,18,38,0) 620px);
	}
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--sky), var(--bg); background-repeat: no-repeat; color: var(--text); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap.narrow { max-width: calc(44rem + 2 * var(--gutter)); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.meta { color: var(--muted); font-size: .85rem; margin: 0; }
.meta a { color: inherit; text-decoration: none; }
.meta a:hover { color: var(--accent); text-decoration: underline; }
.dot { margin: 0 .2em; }
.eyebrow { margin: 0 0 .4rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--soft); color: var(--muted); }

/* ---- header and footer ---- */
.site-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font: 700 1.35rem/1 var(--serif); color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.head-end { display: flex; align-items: center; gap: 6px; }
.menu { display: flex; gap: 4px; }
.theme-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover { background: var(--soft); color: var(--text); }
.theme-btn svg { width: 20px; height: 20px; display: none; }
.theme-btn[data-mode="auto"] .i-auto, .theme-btn[data-mode="light"] .i-light, .theme-btn[data-mode="dark"] .i-dark { display: block; }
.theme-btn:not([data-mode]) .i-auto { display: block; }
@media (max-width: 400px) { .menu a { padding: 8px 10px; } }
.menu a { padding: 8px 14px; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.menu a:hover { background: var(--soft); color: var(--text); }
.menu a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 -2px 0 var(--sun); }
.site-foot { margin-top: 72px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.foot-row p { margin: 0; }
.foot-row a { color: inherit; }

/* ---- start page ---- */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(24px, 4vw, 40px); }
.hero h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4.6rem); max-width: 14ch; }
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--muted); max-width: 38rem; margin: 1rem 0 0; }
.lead.small { font-size: 1rem; margin-top: .6rem; }
.stats { margin: 1.4rem 0 0; font-weight: 600; }
.stats a { text-decoration: none; }
.stats a:hover { text-decoration: underline; }
.section { margin-top: clamp(32px, 5vw, 56px); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.page-head { padding-top: clamp(32px, 6vw, 64px); padding-bottom: clamp(16px, 3vw, 28px); }
.page-head h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); }

/* ---- cards ---- */
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	box-shadow: var(--shadow); color: var(--text); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.card-img { display: block; aspect-ratio: 16 / 10; background: var(--soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; flex: 1; }
.card h3 { font-size: 1.25rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card h3 a::after { content: ""; position: absolute; inset: 0; }   /* the whole card is the link */
.post-card { position: relative; }
.post-card .meta a { position: relative; z-index: 1; }
.excerpt { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.comments.meta { margin-top: auto; padding-top: 4px; }
.post-card.no-img .card-body { padding-top: 22px; }
.post-card.no-img h3 { font-size: 1.4rem; }

.post-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
@media (min-width: 900px) {
	.post-grid.home { grid-template-columns: repeat(3, 1fr); }
	/* the newest post: a row of its own, picture beside the text, height set by the picture (not by the neighbours) */
	.post-grid.home .big { grid-column: 1 / -1; flex-direction: row; }
	.post-grid.home .big .card-img { flex: 0 0 50%; aspect-ratio: 16 / 9; max-height: 340px; }
	.post-grid.home .big .card-body { justify-content: center; padding: 24px 32px; }
	.post-grid.home .big h3 { font-size: 1.7rem; }
	.post-grid.home .big .excerpt { font-size: 1.02rem; }
	.post-grid.home .big.no-img .card-body { padding: 28px 32px; }
}
.post-list { display: grid; gap: 18px; }
@media (min-width: 720px) {
	.post-list .post-card { flex-direction: row; }
	.post-list .card-img { flex: 0 0 min(38%, 340px); aspect-ratio: 4 / 3; }
	.post-list .card-body { padding: 20px 24px; }
	.post-list h3 { font-size: 1.45rem; }
}

.album-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.album-card .card-img { aspect-ratio: 4 / 3; }
.album-card .card-body { gap: 2px; padding: 12px 14px 14px; }
.album-title { font: 600 1.05rem/1.25 var(--serif); }
.album-card:hover .album-title { color: var(--accent); }

/* ---- filters and pages ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
	color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.chip span { color: var(--muted); font-weight: 500; font-size: .8rem; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip[aria-current] span { color: inherit; opacity: .75; }
.chips.small .chip { padding: 4px 11px; font-size: .82rem; }
.filters { display: grid; gap: 10px; margin-bottom: 28px; }
.filters > * { min-width: 0; }   /* grid cells may shrink, so the year row scrolls instead of widening the page */
/* a row of pills that scrolls sideways (years; on phones also the blog's categories) */
.chip-row { overflow-x: auto; flex-wrap: nowrap; padding: 2px 0 4px; scrollbar-width: none; scroll-behavior: smooth; }
.chip-row::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .chip-row.wrap-wide { flex-wrap: wrap; overflow: visible; } }
.sticky-years { position: sticky; top: 64px; z-index: 5; padding: 10px 0; margin-bottom: 8px; }
/* ‹ › buttons beside a pill row (site.js adds them when the row is wider than the page) */
.chip-scroller { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.chip-scroller .chip-row { flex: 1; min-width: 0; }
.chip-scroller.sticky-years .chip-row { padding: 2px 0; }
.scroll-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text);
	box-shadow: var(--shadow); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; line-height: 1; padding: 0 0 2px; }
.scroll-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.scroll-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.scroll-btn[hidden] { display: none; }
.year { margin-top: 28px; }
.year h2 { font-size: 1.6rem; margin-bottom: 14px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; font-weight: 600; }
.pg-nums { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pg-nums a, .pg-nums span { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; text-decoration: none; }
.pg-nums a:hover { background: var(--soft); }
.pg-nums [aria-current] { background: var(--accent); color: var(--on-accent); }
.pg-gap { color: var(--muted); }
.pg-prev, .pg-next { text-decoration: none; min-width: 5em; }
.pg-next { text-align: right; }

/* ---- a post ---- */
.post-head { padding-top: clamp(32px, 6vw, 64px); padding-bottom: 20px; }
.post-head h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); margin: .3rem 0 .9rem; }
.prose { font-size: 1.1rem; line-height: 1.7; }
.prose::after { content: ""; display: table; clear: both; }
.prose p { margin: 0 0 1.1em; }
.prose a { overflow-wrap: anywhere; }
.pic { margin: .4em 0 1.4em; }
.pic img { border-radius: 10px; background: var(--soft); }
.pic a { display: block; cursor: zoom-in; }
.pic figcaption { margin-top: .5em; color: var(--muted); font-size: .88rem; text-align: center; }
.pic-full img, .pic-center img { margin: 0 auto; }
.pic-full { margin-left: min(0px, (44rem - 100vw) / 2 + var(--gutter)); margin-right: min(0px, (44rem - 100vw) / 2 + var(--gutter)); }
@media (min-width: 900px) { .pic-full { margin-left: -4rem; margin-right: -4rem; } .pic-full img { width: 100%; } }
.pic-right, .pic-left { max-width: 46%; }
.pic-right { float: right; margin: .3em 0 1em 1.4em; }
.pic-left { float: left; margin: .3em 1.4em 1em 0; }
@media (max-width: 560px) { .pic-right, .pic-left { float: none; max-width: 100%; margin: .4em 0 1.4em; } .pic-right img, .pic-left img { margin: 0 auto; } }
.pic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: .4em 0 1.4em; clear: both; }
.pic-row .pic { margin: 0; }
.pic-row img { width: 100%; }
.code { clear: both; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: .88rem/1.55 var(--mono); margin: 0 0 1.2em; white-space: pre-wrap; }
.embed { clear: both; position: relative; aspect-ratio: 16 / 9; margin: .4em 0 1.4em; border-radius: 10px; overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.film { width: 100%; border-radius: 10px; background: #000; margin: .4em 0 1.4em; }
.map a { font-weight: 600; }

.comments { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); clear: both; }
.comments h2 { font-size: 1.4rem; margin-bottom: 16px; }
.comments ol { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 14px; }
.comments li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.comments li .meta strong { color: var(--text); }
.comment-text { margin-top: 4px; overflow-wrap: anywhere; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; clear: both; }
.post-nav a { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
	color: var(--text); text-decoration: none; font: 600 1.05rem/1.3 var(--serif); }
.post-nav a:hover { border-color: var(--accent); }
.post-nav .meta { font-family: var(--sans); font-weight: 600; }
.post-nav .older { text-align: right; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .older { text-align: left; } }

/* the admin's choice of card picture (a post page) */
.card-pick { margin-bottom: 28px; padding: 16px 18px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); }
.card-pick h2 { font: 600 1rem/1.3 var(--sans); margin-bottom: 2px; }
.pick-row { display: flex; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.pick { flex: none; width: 132px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: var(--surface); cursor: pointer; overflow: hidden; color: var(--text); font: 600 .78rem/1.2 var(--sans); }
.pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.pick span { display: block; padding: 5px 6px; }
.pick[aria-pressed="true"] { border-color: var(--accent); }
.pick[aria-pressed="true"] span { background: var(--accent); color: var(--on-accent); }
.pick:disabled { opacity: .6; }

/* ---- an album ---- */
.photo-grid { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 180px), 1fr)); }
@media (min-width: 900px) { .photo-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.tile { position: relative; }
.cover-btn { position: absolute; left: 6px; bottom: 6px; border: 0; border-radius: 999px; padding: 5px 10px; font: 600 .78rem/1.2 var(--sans);
	background: rgba(0,0,0,.6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tile:hover .cover-btn, .cover-btn:focus-visible, .cover-btn[aria-pressed="true"] { opacity: 1; }
@media (hover: none) { .cover-btn { opacity: .85; } }
.cover-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); cursor: default; }
.cover-btn:disabled { opacity: .6; }
.tile.is-cover a { outline: 3px solid var(--accent); outline-offset: -3px; }
.admin-note { margin: 0 0 14px; font-size: .9rem; }
.photo-grid a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--soft); cursor: zoom-in; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s, opacity .2s; }
.photo-grid a:hover img { transform: scale(1.04); }

/* ---- the photo viewer (site.js) ---- */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,10,.94); display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity .2s; touch-action: pinch-zoom; color: #fff; }
.lb.open { opacity: 1; }
.lb[hidden] { display: none; }   /* closed: gone, so it can't cover the page */
.lb img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); width: auto; height: auto; border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0,0,0,.5); transition: opacity .2s; -webkit-user-drag: none; user-select: none; }
.lb img.loading { opacity: .25; }
.lb button { position: absolute; border: 0; width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center; font-size: 1.6rem; line-height: 1; }
.lb button:hover { background: rgba(255,255,255,.24); }
.lb .lb-close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb .lb-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; font-size: .9rem; color: #ddd; }
.lb .lb-bar a { color: #fff; margin-left: .6em; }
@media (max-width: 640px) { .lb .lb-prev, .lb .lb-next { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; } .lb .lb-bar { padding-bottom: calc(22px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .card, .card-img img, .photo-grid img, .lb, .lb img { transition: none; } }

::selection { background: color-mix(in srgb, var(--sun) 55%, transparent); color: var(--text); }

/* ---- upload (/bilder/nytt) ---- */
.uploader { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; flex: 1; }
.field label { font-weight: 600; font-size: .92rem; }
.field input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); min-width: 0; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.field-row .field { flex: 0 1 220px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: .95rem; padding-bottom: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 32px 16px; border: 2px dashed var(--line); border-radius: var(--radius);
	background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { color: var(--accent-ink); font-size: 1.05rem; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
	color: var(--text); font: 600 .95rem/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn[hidden] { display: none; }
.notice.bad { background: color-mix(in srgb, #d33 14%, var(--surface)); color: var(--text); }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.up-list li { display: grid; grid-template-columns: 48px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
	padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.up-list img { grid-row: span 2; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.up-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.up-state { grid-column: 2; font-size: .8rem; }
.up-list progress { grid-column: 2; width: 100%; height: 4px; display: none; accent-color: var(--accent); }
.up-list li.busy progress { display: block; }
.up-list li.busy .up-state { display: none; }
.up-list li.ok .up-state { color: var(--accent-ink); }
.up-list li.fail { border-color: #d33; }
.up-list li.fail .up-state { color: #d33; }
.up-x { grid-column: 3; grid-row: 1 / span 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.up-x:hover { background: var(--soft); color: var(--text); }
.up-list li.ok .up-x, .up-list li.busy .up-x { visibility: hidden; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }

/* ---- album admin (edit, delete) ---- */
.admin-panel { margin: 0 0 18px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); }
.admin-panel summary { padding: 12px 16px; font-weight: 600; cursor: pointer; }
.admin-panel[open] summary { border-bottom: 1px dashed var(--accent); }
.admin-panel form { padding: 16px; }
.btn.danger { border-color: #c33; color: #c33; margin-left: auto; }
.btn.danger:hover { background: #c33; color: #fff; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 .72rem/1.5 var(--sans); vertical-align: middle; }
.badge[hidden] { display: none; }
.card-img { position: relative; }
.card-img .badge { position: absolute; top: 8px; left: 8px; }
.album-card.is-hidden img { opacity: .6; }
.del-btn { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
	font-size: 1.2rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.tile:hover .del-btn, .del-btn:focus-visible { opacity: 1; }
@media (hover: none) { .del-btn { opacity: .85; } }
.del-btn:hover { background: #c33; }
.tile.removing { opacity: .35; pointer-events: none; }

/* ---- the blog's editor (/blogg/skriv) ---- */
.writer textarea { font: .95rem/1.6 var(--mono); padding: 12px 14px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; background: var(--surface); color: var(--text); width: 100%; resize: vertical; min-height: 320px; }
.writer textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.field-hint { margin: 0; padding-bottom: 12px; }
.cats { border: 0; padding: 0; margin: 0; }
.cats legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.check-chip { cursor: pointer; }
.check-chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.check-chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--soft); color: var(--muted); padding: 8px 16px; font: 600 .9rem var(--sans); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface); }
.toolbar[hidden] { display: none; }
.toolbar button { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 600 .85rem var(--sans); cursor: pointer; }
.toolbar button:hover { border-color: var(--accent); color: var(--accent-ink); }
.preview { border: 1px solid var(--line); border-radius: 0 10px 10px 10px; background: var(--surface); padding: 20px 22px; min-height: 320px; }
.preview::after { content: ""; display: table; clear: both; }
.preview-title { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin-bottom: .8rem; }
.help { margin-top: 8px; }
.help summary { cursor: pointer; font-weight: 600; }
.help code { font-size: .85em; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.drafts { margin: 0 0 24px; }
.drafts ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.drafts li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.post-admin { margin: -4px 0 0; }
