@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Old+Standard+TT:wght@400;700&display=swap");

:root {
	--ink: #000000d9;
	--ink-faded: #00000088;
	--rule: #000;
	--link-faint: #00000040;
	--link-strong: #00000080;
	--bg: rgb(254, 243, 199);
	--row-hover: #00000010;
	--row-active: #00000018;
	--unread-dot: #d00;
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0000000d; }
::-webkit-scrollbar-thumb { background: #0000000d; }
::-webkit-scrollbar-thumb:hover { background: #000; }

html, body, main { height: 100%; }
html, body { background-color: var(--bg); }

@media screen and (min-width: 740px) {
	html, body { overflow: hidden; }
}

html {
	font-family: "IBM Plex Mono", monospace;
	font-size: 14px;
	line-height: 1.2em;
	color: var(--ink);
}

body { margin: 0; }

h1, h2, h3, h4 {
	font-family: "Old Standard TT", serif;
	margin: 0;
	display: inline-block;
}
h1, h2 { font-size: 1.75rem; font-weight: 400; }
h3 { font-size: 1.25rem; font-weight: 400; }
h4 { font-size: 1rem; font-weight: 700; }

a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: var(--link-faint);
	text-decoration-thickness: 1px;
	cursor: pointer;
}
a:hover { text-decoration-color: var(--link-strong); }

p { margin: 0.5rem 0; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 500; }
small { font-size: 0.9rem; }

ul { margin: 0; padding: 0; list-style: none; }
li { position: relative; }

button {
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

/* === Layout (samme skelet som termik) === */
#page { width: 100%; }
@media screen and (min-width: 740px) {
	#page { height: 100vh; display: flex; flex-direction: column; }
}

header#header {
	padding: 2rem 0;
	border-bottom: 1px solid var(--rule);
	z-index: 2;
}
@media screen and (min-width: 740px) {
	header#header { padding: 3rem 0; }
}
header#header .flex { align-items: flex-end; }
header#header .column { padding: 0 2rem; }
@media screen and (min-width: 740px) {
	header#header .column { padding: 0 3rem; }
}
.header-meta p { color: var(--ink-faded); }
.header-meta a { margin-left: 0.5rem; }

main {
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.flex { display: flex; flex-wrap: wrap; }
main > .flex { flex: 1; overflow-y: auto; }
@media screen and (min-width: 740px) {
	main > .flex { overflow: hidden; }
}

.column { width: 100%; }
@media screen and (min-width: 740px) {
	.column { height: 100%; }
	#inbox { width: 38%; }
	#reader { width: 62%; }
}

@media screen and (min-width: 740px) {
	.scroll {
		overflow-y: scroll;
		-webkit-overflow-scrolling: touch;
	}
	#inbox { border-right: 1px solid var(--rule); }
}

/* === Indbakke === */
.inbox-list .empty {
	padding: 2rem;
	color: var(--ink-faded);
}
@media screen and (min-width: 740px) {
	.inbox-list .empty { padding: 3rem; }
}

.inbox-list li.row {
	display: block;
	padding: 1.25rem 2rem;
	border-bottom: 1px solid var(--rule);
	cursor: pointer;
	color: inherit;
	text-decoration: none;
	position: relative;
	transition: background-color 0.1s;
}
@media screen and (min-width: 740px) {
	.inbox-list li.row { padding: 1.25rem 3rem; }
}
.inbox-list li.row:hover { background-color: var(--row-hover); }
.inbox-list li.row.active { background-color: var(--row-active); }

.inbox-list .row .top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.4rem;
}
.inbox-list .row .date {
	font-size: 0.8rem;
	color: var(--ink-faded);
	white-space: nowrap;
	flex-shrink: 0;
}
.inbox-list .row .source-pill {
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.15rem 0.4rem;
	border: 1px solid var(--rule);
	border-radius: 2px;
	color: var(--ink);
	background: transparent;
}
.inbox-list .row .source-foljeton {
	background: rgba(0, 0, 0, 0.04);
}
.inbox-list .row .source-atlas {
	background: rgba(0, 0, 0, 0.85);
	color: var(--bg);
	border-color: transparent;
}
.inbox-list .row .source-frios {
	background: #c41e3a;
	color: var(--bg);
	border-color: transparent;
}
.inbox-list .row .source-better-offline {
	background: #1f4d3a;
	color: var(--bg);
	border-color: transparent;
}
.inbox-list .row .source-effectively-wild {
	background: #1a3a5c;
	color: var(--bg);
	border-color: transparent;
}

.inbox-list .row .title {
	font-family: "Old Standard TT", serif;
	font-size: 1.1rem;
	line-height: 1.25;
	margin-bottom: 0.25rem;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.inbox-list .row .preview {
	font-size: 0.85rem;
	color: var(--ink-faded);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Ulæst-tilstand */
.inbox-list li.row.unread .title {
	font-weight: 700;
}
.inbox-list li.row.unread::before {
	content: "";
	position: absolute;
	left: 0.75rem;
	top: 1.45rem;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background: var(--unread-dot);
}
@media screen and (min-width: 740px) {
	.inbox-list li.row.unread::before { left: 1.5rem; }
}

.inbox-list li.row.read .title { color: var(--ink-faded); }
.inbox-list li.row.read .preview { opacity: 0.7; }

/* === Læser-rude === */
#reader { padding: 0; }
#reader-empty {
	padding: 3rem 2rem;
	color: var(--ink-faded);
	font-style: italic;
}
@media screen and (min-width: 740px) {
	#reader-empty { padding: 4rem 3rem; }
}

#article {
	padding: 2rem;
}
@media screen and (min-width: 740px) {
	#article { padding: 3rem 3rem 6rem; max-width: 44rem; }
}

.article-header {
	border-bottom: 1px solid var(--rule);
	padding-bottom: 1.5rem;
	margin-bottom: 2rem;
}
.article-header .kicker {
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faded);
	margin-bottom: 0.5rem;
}
.article-header .date {
	font-size: 0.85rem;
	color: var(--ink-faded);
	margin-bottom: 0.5rem;
	display: block;
}
.article-header h2 {
	display: block;
	font-size: 2.25rem;
	line-height: 1.1;
}
.article-header .byline {
	font-size: 0.9rem;
	color: var(--ink-faded);
	margin-top: 0.5rem;
}

.atlas-figure {
	margin: 1.5rem 0;
}
.atlas-figure figcaption {
	font-size: 0.8rem;
	color: var(--ink-faded);
	margin-top: 0.5rem;
	font-style: italic;
}
.atlas-excerpt {
	font-size: 1.1rem;
	line-height: 1.55;
	margin: 1.5rem 0;
	font-family: "Old Standard TT", serif;
}

/* Podcast-afspiller */
.podcast-player {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	margin: 1.5rem 0 2rem;
	padding: 1.5rem;
	border: 1px solid var(--rule);
	background: rgba(0, 0, 0, 0.03);
}
@media screen and (max-width: 600px) {
	.podcast-player { flex-direction: column; gap: 1rem; padding: 1rem; }
}
.podcast-cover {
	width: 140px;
	height: 140px;
	flex-shrink: 0;
	object-fit: cover;
	display: block;
}
.podcast-controls {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.podcast-controls audio {
	width: 100%;
	display: block;
}
.podcast-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: 0.85rem;
}
.podcast-actions a {
	text-decoration: none;
	border-bottom: 1px solid var(--link-faint);
}
.podcast-actions a:hover { border-bottom-color: var(--link-strong); }
.podcast-description {
	font-size: 0.95rem;
	line-height: 1.55;
	margin-top: 1rem;
}
.podcast-description p:first-child { margin-top: 0; }

.section {
	margin-bottom: 3rem;
}
.section-label {
	font-family: "IBM Plex Mono", monospace;
	font-size: 0.8rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ink);
	border-bottom: 1px solid var(--rule);
	padding-bottom: 0.5rem;
	margin-bottom: 1.5rem;
	display: block;
}

.post {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px dashed var(--link-faint);
}
.post:last-child {
	border-bottom: 0;
	margin-bottom: 0;
	padding-bottom: 0;
}
.post-title {
	font-family: "Old Standard TT", serif;
	font-size: 1.4rem;
	line-height: 1.2;
	margin-bottom: 0.5rem;
	display: block;
}
.post-title a {
	text-decoration: none;
	border-bottom: 1px solid var(--link-faint);
}
.post-title a:hover { border-bottom-color: var(--link-strong); }
.post-link {
	margin-top: 0.75rem;
	font-size: 0.85rem;
}
.post-link a {
	text-decoration: none;
	border-bottom: 1px solid var(--link-faint);
}
.post-link a:hover { border-bottom-color: var(--link-strong); }
.post-meta {
	font-size: 0.8rem;
	color: var(--ink-faded);
	margin-bottom: 0.75rem;
}
.post-meta a {
	text-decoration: none;
	border-bottom: 1px solid var(--link-faint);
}
.post-image {
	max-width: 100%;
	height: auto;
	margin: 1rem 0;
	display: block;
}
.post-teaser {
	font-size: 0.95rem;
	line-height: 1.55;
}
.post-teaser p { margin: 0.5em 0; }
.post-teaser p:first-child { margin-top: 0; }
.post-teaser p:last-child { margin-bottom: 0; }

.post-tags {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	color: var(--ink-faded);
}
.post-tags a {
	text-decoration: none;
	border-bottom: 1px solid var(--link-faint);
	margin-right: 0.4rem;
}

/* === Paginering === */
#inbox-pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 2rem;
	border-top: 1px solid var(--rule);
	font-size: 0.8rem;
	color: var(--ink-faded);
	gap: 1rem;
}
@media screen and (min-width: 740px) {
	#inbox-pagination { padding: 1rem 3rem; }
}
#inbox-pagination button {
	color: var(--ink);
	text-decoration: underline;
	text-decoration-color: var(--link-faint);
	text-decoration-thickness: 1px;
}
#inbox-pagination button:hover { text-decoration-color: var(--link-strong); }
#inbox-pagination button:disabled {
	color: var(--ink-faded);
	text-decoration: none;
	cursor: default;
}

#reader.loading::after {
	content: "Henter…";
	display: block;
	padding: 3rem;
	color: var(--ink-faded);
	font-style: italic;
}
