/*
Theme Name: Livsbogen
Theme URI: https://livsbogen.dk
Author: Livsbogen
Author URI: https://livsbogen.dk
Description: Et bare-bones tema til Livsbogen-pluginnet. Litterært, mobil-først, dansk. Fraunces og Newsreader. Cremet papirfarve. Designet til at lade plugin og indhold styre udseendet uden at temaet blander sig.
Version: 1.4.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: livsbogen-theme
Tags: serif, minimal, danish, blog, custom-menu, custom-logo, footer-widgets
*/

/* ==========================================================================
   1. Variables og base reset
   ========================================================================== */

:root {
	--lb-paper:        #f6efe1;
	--lb-paper-deep:   #ede4d0;
	--lb-paper-soft:   #faf5e9;
	--lb-ink:          #1a1814;
	--lb-ink-soft:     #5a544a;
	--lb-ink-faint:    #75695e;
	--lb-accent:       #8e2e1c;
	--lb-accent-deep:  #6b1f10;
	--lb-line:         #c9bfa8;
	--lb-line-faint:   #ebe2cc;

	--lb-font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
	--lb-font-body:    'Newsreader', 'Iowan Old Style', Georgia, serif;

	--lb-radius:       8px;
	--lb-radius-lg:    14px;
	--lb-max:          900px;
	--lb-max-narrow:   680px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: var(--lb-font-body);
	font-size: 17px;
	line-height: 1.6;
	color: var(--lb-ink);
	background: var(--lb-paper);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

@media (min-width: 720px) {
	body { font-size: 18px; }
}

img, video, svg {
	max-width: 100%;
	height: auto;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--lb-font-display);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--lb-ink);
	margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a {
	color: var(--lb-accent);
	text-decoration: none;
	transition: color 0.15s ease;
}
a:hover { color: var(--lb-accent-deep); }

/* Underline only for inline content links, not nav/buttons */
.lb-page-content a,
.lb-page-content a:visited {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

::selection { background: var(--lb-accent); color: #fdfaf3; }

/* ==========================================================================
   2. Skip link (a11y)
   ========================================================================== */

.lb-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: 12px 20px;
	background: var(--lb-ink);
	color: var(--lb-paper);
	border-radius: 0 0 var(--lb-radius) 0;
}
.lb-skip-link:focus {
	left: 0;
	color: var(--lb-paper);
}

/* ==========================================================================
   3. Site header
   ========================================================================== */

.lb-site-header {
	background: var(--lb-paper);
	border-bottom: 1px solid var(--lb-line-faint);
	position: relative;
	z-index: 10;
}

.lb-site-header-inner {
	max-width: var(--lb-max);
	margin: 0 auto;
	padding: 18px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

@media (min-width: 720px) {
	.lb-site-header-inner { padding: 22px 32px; }
}

.lb-site-logo {
	font-family: var(--lb-font-display);
	font-size: 1.45rem;
	font-weight: 500;
	color: var(--lb-ink);
	letter-spacing: -0.01em;
	font-variation-settings: "opsz" 24, "SOFT" 100;
	text-decoration: none;
	flex-shrink: 0;
}
.lb-site-logo:hover { color: var(--lb-accent); }

.lb-site-logo img {
	max-height: 40px;
	width: auto;
	display: block;
}

.lb-site-nav {
	display: flex;
	align-items: center;
	gap: 6px;
}

.lb-site-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 4px;
	align-items: center;
}

.lb-site-menu a {
	display: inline-block;
	padding: 8px 14px;
	color: var(--lb-ink-soft);
	font-size: 0.95rem;
	border-radius: var(--lb-radius);
	transition: color 0.15s ease, background-color 0.15s ease;
}
.lb-site-menu a:hover,
.lb-site-menu .current-menu-item > a {
	color: var(--lb-ink);
	background: var(--lb-paper-deep);
}

.lb-site-nav-link {
	padding: 8px 14px;
	color: var(--lb-ink-soft);
	font-size: 0.95rem;
	border-radius: var(--lb-radius);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.lb-site-nav-link svg {
	flex-shrink: 0;
	opacity: 0.85;
}
.lb-site-nav-link:hover {
	color: var(--lb-ink);
	background: var(--lb-paper-deep);
}
.lb-site-nav-link:hover svg {
	opacity: 1;
}

/* Which-account chip shown on every page for logged-in users. */
.lb-site-nav-user {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	color: var(--lb-ink-soft);
	font-size: 0.95rem;
	white-space: nowrap;
}
.lb-site-nav-user svg {
	flex-shrink: 0;
	opacity: 0.85;
}
.lb-site-nav-user-name {
	max-width: 12ch;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lb-site-nav-cta {
	padding: 8px 16px;
	background: var(--lb-accent);
	color: #fdfaf3;
	border-radius: var(--lb-radius);
	font-size: 0.95rem;
	font-weight: 500;
	transition: all 0.15s ease;
	white-space: nowrap;
}
.lb-site-nav-cta:hover {
	background: var(--lb-accent-deep);
	color: #fff;
	transform: translateY(-1px);
}

@media (max-width: 540px) {
	.lb-site-menu { display: none; }
	.lb-site-nav-user {
		padding: 8px 6px;
		font-size: 0.85rem;
	}
	.lb-site-nav-user-name {
		max-width: 8ch;
	}
	/* Keep nav links visible on mobile, but show only their icons.
	   We hide the visible text label with the standard "visually-hidden"
	   technique so screen readers still announce the link text, and
	   the aria-label on the link itself is the canonical accessible name. */
	.lb-site-nav-link {
		padding: 8px 10px;
		gap: 0;
	}
	.lb-site-nav-link svg {
		width: 18px;
		height: 18px;
		opacity: 1;
	}
	.lb-site-nav-label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
}

/* ==========================================================================
   4. Site footer
   ========================================================================== */

.lb-site-footer {
	margin-top: auto;
	background: var(--lb-paper-soft);
	border-top: 1px solid var(--lb-line-faint);
	color: var(--lb-ink-soft);
	font-size: 0.95rem;
}

.lb-site-footer-widgets {
	padding: 48px 0 32px;
}
.lb-site-footer-widgets-inner {
	max-width: var(--lb-max);
	margin: 0 auto;
	padding: 0 20px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}
@media (min-width: 540px) {
	.lb-site-footer-widgets-inner { grid-template-columns: repeat(2, 1fr); padding: 0 32px; }
}
@media (min-width: 880px) {
	.lb-site-footer-widgets-inner { grid-template-columns: repeat(3, 1fr); }
}

.lb-footer-widget-title {
	font-family: var(--lb-font-display);
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--lb-ink);
	margin: 0 0 14px;
	font-variation-settings: "opsz" 18;
}

.lb-footer-widget ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.lb-footer-widget li {
	margin: 0 0 6px;
}
.lb-footer-widget a {
	color: var(--lb-ink-soft);
}
.lb-footer-widget a:hover {
	color: var(--lb-accent);
}

.lb-site-footer-bottom {
	max-width: var(--lb-max);
	margin: 0 auto;
	padding: 22px 20px;
	border-top: 1px solid var(--lb-line-faint);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	font-size: 0.88rem;
	color: var(--lb-ink-faint);
}
@media (min-width: 720px) {
	.lb-site-footer-bottom { padding: 22px 32px; }
}
.lb-site-footer-bottom p { margin: 0; }

/* If no widgets, less padding */
.lb-site-footer:not(:has(.lb-site-footer-widgets)) .lb-site-footer-bottom {
	border-top: 0;
	padding: 32px 20px;
}

/* ==========================================================================
   5. Page templates
   ========================================================================== */

/* Front page: full bleed, no max-width container, content drives layout */
.lb-front-page { width: 100%; }
.lb-front-page > * { width: 100%; }

/* Standard page wrapper */
.lb-page {
	max-width: var(--lb-max-narrow);
	margin: 0 auto;
	padding: 56px 20px 80px;
}
@media (min-width: 720px) {
	.lb-page { padding: 80px 32px 120px; }
}

.lb-page-header { margin-bottom: 32px; }
.lb-page-title {
	font-family: var(--lb-font-display);
	font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.015em;
	color: var(--lb-ink);
	margin: 0;
	font-variation-settings: "opsz" 144, "SOFT" 50;
}

.lb-page-content {
	font-size: 1.05rem;
	line-height: 1.7;
}
.lb-page-content h2 {
	font-size: 1.7rem;
	margin-top: 1.6em;
	font-variation-settings: "opsz" 36;
}
.lb-page-content h3 {
	font-size: 1.3rem;
	margin-top: 1.4em;
	font-variation-settings: "opsz" 24;
}
.lb-page-content blockquote {
	margin: 1.6em 0;
	padding: 8px 24px;
	border-left: 3px solid var(--lb-accent);
	font-style: italic;
	font-family: var(--lb-font-display);
	color: var(--lb-ink-soft);
	font-variation-settings: "opsz" 18;
}
.lb-page-content img {
	border-radius: var(--lb-radius);
	margin: 1.5em 0;
}
.lb-page-content ul, .lb-page-content ol {
	padding-left: 1.5em;
}
.lb-page-content li { margin-bottom: 0.4em; }

/* Article meta (single posts) */
.lb-page-meta {
	font-size: 0.9rem;
	color: var(--lb-ink-faint);
	margin: 8px 0 0;
	font-style: italic;
	font-family: var(--lb-font-display);
	font-variation-settings: "opsz" 18;
}

/* ==========================================================================
   6. Empty / 404
   ========================================================================== */

.lb-empty {
	max-width: var(--lb-max-narrow);
	margin: 0 auto;
	padding: 80px 20px;
	text-align: center;
}
.lb-empty h1 {
	font-size: clamp(2rem, 4vw + 0.8rem, 2.8rem);
	font-weight: 400;
	margin-bottom: 0.4em;
}
.lb-empty p {
	color: var(--lb-ink-soft);
	font-size: 1.05rem;
	margin-bottom: 1.4em;
}

/* Rigere 404-side: bog-metafor med "blank side". */
.lb-404 {
	max-width: var(--lb-max-narrow);
	margin: 0 auto;
	padding: 64px 20px 100px;
	text-align: center;
}
@media (min-width: 720px) {
	.lb-404 { padding: 96px 24px 128px; }
}

/* Illustration: stort, svagt "404" med en åben bog ovenpå. */
.lb-404-art {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
	color: var(--lb-accent);
}
.lb-404-code {
	font-family: var(--lb-font-display);
	font-size: clamp(6rem, 22vw, 11rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.04em;
	color: var(--lb-line);
	opacity: 0.55;
	user-select: none;
}
.lb-404-book {
	position: absolute;
	width: clamp(120px, 34vw, 190px);
	height: auto;
	color: var(--lb-accent);
	filter: drop-shadow(0 6px 14px rgba(142, 46, 28, 0.14));
}
/* Den "blanke" højreside blinker blidt for at understrege metaforen. */
.lb-404-book path:last-of-type {
	animation: lb-404-page 4.5s ease-in-out infinite;
}
@keyframes lb-404-page {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.45; }
}
@media (prefers-reduced-motion: reduce) {
	.lb-404-book path:last-of-type { animation: none; }
}

.lb-404-title {
	font-family: var(--lb-font-display);
	font-size: clamp(2rem, 4vw + 0.8rem, 2.9rem);
	font-weight: 400;
	margin: 0.2em 0 0.35em;
}
.lb-404-lead {
	color: var(--lb-ink-soft);
	font-size: 1.1rem;
	line-height: 1.6;
	max-width: 30em;
	margin: 0 auto 1.8em;
}

.lb-404-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	margin-bottom: 1.6em;
}
.lb-404-alt {
	color: var(--lb-ink-faint);
	font-size: 0.98rem;
	margin: 0;
}
.lb-404-alt a {
	color: var(--lb-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--lb-line);
	transition: border-color 0.18s ease, color 0.18s ease;
}
.lb-404-alt a:hover {
	color: var(--lb-accent-deep);
	border-bottom-color: var(--lb-accent-deep);
}

/* ==========================================================================
   7. Buttons (theme-level, used in 404 etc.)
   ========================================================================== */

.lb-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: var(--lb-radius);
	font-family: var(--lb-font-body);
	font-size: 1rem;
	font-weight: 500;
	background: var(--lb-accent);
	color: #fdfaf3;
	text-decoration: none;
	border: 1px solid var(--lb-accent);
	transition: all 0.18s ease;
	cursor: pointer;
}
.lb-btn:hover {
	background: var(--lb-accent-deep);
	border-color: var(--lb-accent-deep);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(142, 46, 28, 0.2);
}

/* Sekundær "ghost"-knap: samme form, papir-baggrund, blækkant. */
.lb-btn-ghost {
	background: transparent;
	color: var(--lb-ink);
	border-color: var(--lb-line);
}
.lb-btn-ghost:hover {
	background: var(--lb-paper-deep);
	color: var(--lb-ink);
	border-color: var(--lb-ink);
	box-shadow: none;
}

/* ==========================================================================
   8. WordPress core / Gutenberg compatibility
   ========================================================================== */

/* alignwide / alignfull for Gutenberg */
.lb-page-content .alignwide {
	margin-left: -40px;
	margin-right: -40px;
	max-width: calc(100% + 80px);
}
.lb-page-content .alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
}

.lb-page-content .wp-block-image figcaption {
	font-size: 0.88rem;
	color: var(--lb-ink-faint);
	font-style: italic;
	text-align: center;
	margin-top: 8px;
}

/* Hide title display on pages where the_title shouldn't show */
.lb-front-page .lb-page-title { display: none; }

/* ==========================================================================
   9. Teksteksempel-sider (landing pages under /teksteksempler/)
   ========================================================================== */

/* Eksempeltekst-kort: en færdig erindringstekst i en blød ramme. */
.lb-example-card {
	background: var(--lb-paper-soft);
	border: 1px solid var(--lb-line-faint);
	border-left: 3px solid var(--lb-accent);
	border-radius: var(--lb-radius-lg);
	padding: 26px 22px;
	margin: 1.8em 0;
}
@media (min-width: 720px) {
	.lb-example-card { padding: 34px 38px; }
}
.lb-example-kicker {
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--lb-accent);
	margin: 0 0 8px;
}
.lb-page-content .lb-example-card h3 {
	margin-top: 0;
	font-size: 1.5rem;
	font-variation-settings: "opsz" 36, "SOFT" 50;
}
.lb-example-card p:last-child { margin-bottom: 0; }

/* Skriveråd- og spørgsmålslister. */
.lb-page-content .lb-tips-list,
.lb-page-content .lb-question-list {
	list-style: none;
	padding-left: 0;
}
.lb-tips-list li,
.lb-question-list li {
	position: relative;
	padding-left: 28px;
	margin-bottom: 0.9em;
}
.lb-tips-list li::before,
.lb-question-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.6em;
	width: 14px;
	height: 2px;
	background: var(--lb-accent);
}
.lb-question-list li {
	font-family: var(--lb-font-display);
	font-style: italic;
	color: var(--lb-ink-soft);
	font-variation-settings: "opsz" 18;
}

/* Kort-grid på hub-/index-siderne. */
.lb-topic-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin: 1.6em 0;
}
@media (min-width: 600px) {
	.lb-topic-grid { grid-template-columns: repeat(2, 1fr); }
}
.lb-topic-card {
	display: block;
	background: var(--lb-paper-soft);
	border: 1px solid var(--lb-line-faint);
	border-radius: var(--lb-radius-lg);
	padding: 22px;
	color: var(--lb-ink);
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.lb-page-content a.lb-topic-card,
.lb-page-content a.lb-topic-card:visited {
	text-decoration: none;
	color: var(--lb-ink);
}
a.lb-topic-card:hover {
	border-color: var(--lb-accent);
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(26, 24, 20, 0.07);
}
.lb-page-content .lb-topic-card-title {
	margin: 0 0 6px;
	font-size: 1.25rem;
	font-variation-settings: "opsz" 24;
}
a.lb-topic-card:hover .lb-topic-card-title { color: var(--lb-accent); }
.lb-topic-card-desc {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--lb-ink-soft);
}
.lb-topic-card-soon {
	opacity: 0.65;
	border-style: dashed;
}

/* Afsluttende CTA-boks. */
.lb-cta-box {
	background: var(--lb-paper-deep);
	border-radius: var(--lb-radius-lg);
	padding: 34px 22px;
	margin: 2.5em 0 0;
	text-align: center;
}
@media (min-width: 720px) {
	.lb-cta-box { padding: 44px 40px; }
}
.lb-page-content .lb-cta-box h2 { margin-top: 0; }
.lb-cta-box p {
	max-width: 34em;
	margin-left: auto;
	margin-right: auto;
}
.lb-cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
	margin: 1.4em 0 0;
}
.lb-page-content .lb-cta-actions a,
.lb-page-content .lb-cta-actions a:visited {
	text-decoration: none;
}

/* ==========================================================================
   10. Search form & comments (minimal)
   ========================================================================== */

.search-form {
	display: flex;
	gap: 8px;
}
.search-form input[type="search"] {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid var(--lb-line);
	border-radius: var(--lb-radius);
	background: var(--lb-paper-soft);
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--lb-ink);
}
.search-form input[type="search"]:focus {
	outline: none;
	border-color: var(--lb-accent);
}
.search-form button {
	padding: 10px 18px;
	background: var(--lb-ink);
	color: var(--lb-paper);
	border: 0;
	border-radius: var(--lb-radius);
	cursor: pointer;
	font-family: inherit;
}
