/* CSS Custom Properties */
:root {
	--primary-font: 'Georgia', 'Times New Roman', serif;
	--secondary-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
	--text-color: #2d3142;
	--background-color: #faf6f0;
	--paper-texture: #f5f1e8;
	--accent-color: #8b4513;
	--muted-color: #6b705c;
	--border-color: #e8dcc6;
	--dialogue-color: #1f2937;
	--reading-width: 80ch;
	--line-height: 1.7;
	--font-size-base: 1.125rem;
	--shadow-light: 0 2px 4px rgba(139, 69, 19, 0.1);
}

@media (prefers-color-scheme: dark) {
	:root {
		--text-color: #d6d3d1;
		--background-color: #292524;
		--paper-texture: #1c1917;
		--accent-color: #d97706;
		--muted-color: #a8a29e;
		--border-color: #44403c;
		--dialogue-color: #f5f5f4;
	}
}

/* Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: var(--primary-font);
	font-size: var(--font-size-base);
	line-height: var(--line-height);
	color: var(--text-color);
	background: linear-gradient(45deg, var(--background-color) 0%, var(--paper-texture) 100%);
	background-attachment: fixed;
	transition: all 0.3s ease;
}

body::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image:
		radial-gradient(circle at 20% 50%, rgba(120, 119, 122, 0.03) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(120, 119, 122, 0.03) 0%, transparent 50%),
		radial-gradient(circle at 40% 80%, rgba(120, 119, 122, 0.03) 0%, transparent 50%);
	pointer-events: none;
	z-index: -1;
}

/* Layout */
.container {
	max-width: var(--reading-width);
	margin: 0 auto;
	padding: 2rem 1.5rem;
	min-height: 100vh;
	background: var(--paper-texture);
	box-shadow: var(--shadow-light);
	border-left: 1px solid var(--border-color);
	border-right: 1px solid var(--border-color);
	position: relative;
}

/* Headers - Shared styles */
.story-header,
.site-header {
	text-align: center;
	margin-bottom: 3rem;
	border-bottom: 2px solid var(--border-color);
	padding-bottom: 2rem;
	position: relative;
}

.site-header {
	margin-bottom: 4rem;
	padding-bottom: 3rem;
}

.story-header::after,
.site-header::after {
	content: '❦';
	position: absolute;
	bottom: -0.75rem;
	left: 50%;
	transform: translateX(-50%);
	background: var(--paper-texture);
	color: var(--accent-color);
	padding: 0 1rem;
	font-size: 1.5rem;
}

.site-header::after {
	font-size: 2rem;
}

.back-button {
	position: absolute;
	left: 0;
	top: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	background: var(--paper-texture);
	border: 1px solid var(--border-color);
	border-radius: 6px;
	color: var(--accent-color);
	text-decoration: none;
	font-family: var(--secondary-font);
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-light);
}

.back-button:hover {
	background: var(--accent-color);
	color: var(--paper-texture);
	border-color: var(--accent-color);
	transform: translateX(-3px);
	box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.back-button::before {
	content: '←';
	font-size: 1.2rem;
	line-height: 1;
}

.story-title,
.site-title {
	font-weight: 400;
	color: var(--accent-color);
	letter-spacing: -0.02em;
	text-shadow: 0 1px 2px rgba(0,0,0,0.1);
	margin-bottom: 1rem;
}

.story-title {
	font-size: 2.5rem;
}

.site-title {
	font-size: 3rem;
	font-weight: 300;
	margin-bottom: 0.5rem;
	text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-tagline {
	font-family: var(--secondary-font);
	font-size: 1.1rem;
	color: var(--muted-color);
	font-style: italic;
	margin-bottom: 1rem;
}

.site-description {
	font-size: 1rem;
	color: var(--text-color);
	max-width: 50ch;
	margin: 0 auto;
	line-height: 1.6;
}

/* Meta information */
.story-meta {
	font-family: var(--secondary-font);
	font-size: 0.875rem;
	color: var(--muted-color);
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	font-style: italic;
	margin-bottom: 1rem;
}

.story-meta span {
	position: relative;
}

.story-meta span:not(:last-child)::after {
	content: '⋄';
	margin-left: 1rem;
	opacity: 0.6;
}

/* Story content */
.story-content {
	font-size: var(--font-size-base);
	line-height: var(--line-height);
}

.story-content p {
	margin-bottom: 1.5rem;
	text-align: justify;
	hyphens: auto;
}

.story-content p:first-child::first-letter {
	font-size: 4em;
	font-weight: 400;
	float: left;
	line-height: 0.8;
	margin: 0.1em 0.15em 0 0;
	color: var(--accent-color);
	text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.story-content em {
	font-style: italic;
	color: var(--accent-color);
}

.story-content strong {
	font-weight: 600;
	color: var(--dialogue-color);
}

.story-content blockquote {
	margin: 2rem 0;
	padding: 1.5rem;
	border-left: 4px solid var(--accent-color);
	background: var(--background-color);
	font-style: italic;
	color: var(--muted-color);
	border-radius: 0 4px 4px 0;
	box-shadow: var(--shadow-light);
}

hr {
    /* 1. Use the HR's border for a guaranteed line */
    border: none;
    border-top: 2px dotted var(--accent-color); 
    
    /* 2. Style and center the line */
    margin: 3rem auto;
    width: 50%;
    height: 0; 
    position: relative;
    text-align: center;
}

hr::before {
    /* 3. The star element sits over the dotted line */
    content: '✶';
    font-size: 1.5rem;
    color: var(--accent-color);
    background: var(--paper-texture); /* This cuts out the dotted line */
    padding: 0 1rem;
    position: relative;
    /* Adjust vertical position to center the star over the line */
    top: -1em; 
    z-index: 1; /* Ensures the star is always on top */
    font-family: var(--primary-font);
}

/* Czech dialogue styling - not needed */
.dialogue-quote {
	color: var(--dialogue-color);
	font-weight: 500;
}

.dialogue,
.speaker {
	display: none;
}

/* Controls */
.reading-controls,
.site-controls {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 100;
	display: flex;
	gap: 0.5rem;
	opacity: 0.7;
	transition: opacity 0.3s ease;
}

.reading-controls:hover,
.site-controls:hover {
	opacity: 1;
}

.control-btn,
.category-btn {
	background: var(--paper-texture);
	border: 1px solid var(--border-color);
	color: var(--text-color);
	padding: 0.5rem;
	border-radius: 6px;
	cursor: pointer;
	font-family: var(--secondary-font);
	font-size: 0.75rem;
	transition: all 0.2s ease;
	box-shadow: var(--shadow-light);
}

.control-btn:hover,
.category-btn:hover,
.category-btn.active {
	background: var(--accent-color);
	color: var(--paper-texture);
	border-color: var(--accent-color);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(139, 69, 19, 0.2);
}

.category-btn {
	padding: 0.5rem 1rem;
	border-radius: 20px;
	text-decoration: none;
	font-size: 0.875rem;
}

/* Reading progress */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 0%;
	height: 4px;
	background: linear-gradient(90deg, var(--accent-color), var(--muted-color));
	z-index: 101;
	transition: width 0.1s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Stories grid */
.stories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 2rem;
	margin-bottom: 3rem;
}

.story-card {
	background: var(--background-color);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	padding: 2rem;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-light);
	position: relative;
	overflow: hidden;
}

.story-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--accent-color), var(--muted-color));
	opacity: 0;
	transition: opacity 0.3s ease;
}

.story-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 25px rgba(0,0,0,0.15);
	border-color: var(--accent-color);
}

.story-card:hover::before {
	opacity: 1;
}

.story-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.story-card .story-title {
	font-size: 1.5rem;
	line-height: 1.3;
	margin-bottom: 0.5rem;
}

.story-excerpt {
	color: var(--text-color);
	line-height: 1.6;
	margin-bottom: 1rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.story-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.story-tag {
	font-family: var(--secondary-font);
	font-size: 0.75rem;
	background: var(--paper-texture);
	color: var(--muted-color);
	padding: 0.25rem 0.75rem;
	border-radius: 12px;
	border: 1px solid var(--border-color);
}

/* Categories */
.categories {
	margin-bottom: 3rem;
	text-align: center;
}

.categories-title {
	font-size: 1.2rem;
	color: var(--accent-color);
	margin-bottom: 1rem;
	font-weight: 400;
}

.category-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
}

/* Footer */
.site-footer {
	text-align: center;
	padding: 2rem 0;
	border-top: 1px solid var(--border-color);
	color: var(--muted-color);
	font-family: var(--secondary-font);
	font-size: 0.875rem;
}

.site-footer a {
	color: var(--accent-color);
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {

	.back-button {
		position: static;
		margin-bottom: 1rem;
	}

	.container {
		padding: 1.5rem 1rem;
		border-left: none;
		border-right: none;
		box-shadow: none;
	}

	.story-title {
		font-size: 2rem;
	}

	.site-title {
		font-size: 2.5rem;
	}

	.site-tagline {
		font-size: 1rem;
	}

	.story-meta {
		font-size: 0.8rem;
		gap: 0.5rem;
	}

	.story-meta span:not(:last-child)::after {
		margin-left: 0.5rem;
	}

	.story-content {
		font-size: 1rem;
	}

	.reading-controls,
	.site-controls {
		position: static;
		justify-content: center;
		margin-bottom: 2rem;
		opacity: 1;
	}

	.stories-grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.story-card {
		padding: 1.5rem;
	}

	.category-filters {
		gap: 0.5rem;
	}

	.category-btn {
		padding: 0.4rem 0.8rem;
		font-size: 0.8rem;
	}
}

@media (max-width: 480px) {
	:root {
		--font-size-base: 1rem;
		--line-height: 1.6;
	}

	.story-title {
		font-size: 1.75rem;
	}

	.site-title {
		font-size: 2rem;
	}

	.story-content p:first-child::first-letter {
		font-size: 3em;
	}

	.story-meta {
		flex-direction: column;
		gap: 0.25rem;
	}

	.story-meta span:not(:last-child)::after {
		display: none;
	}
}

/* Print Styles */
@media print {
	.reading-controls,
	.reading-progress,
	.site-controls,
	.categories {
		display: none;
	}

	body {
		font-size: 12pt;
		line-height: 1.4;
		background: white;
	}

	body::before {
		display: none;
	}

	.container {
		max-width: none;
		margin: 0;
		padding: 0;
		box-shadow: none;
		border: none;
		background: white;
	}

	.story-content p {
		text-align: left;
		hyphens: none;
	}

	.stories-grid {
		grid-template-columns: 1fr;
	}

	.story-card {
		break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ddd;
		margin-bottom: 1rem;
	}
}


/* Footer - Fixed styling */
.story-footer {
	text-align: center;
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 2px solid var(--border-color);
	position: relative;
}

.story-footer::after {
	content: '⁂';
	position: absolute;
	top: -0.75rem;
	left: 50%;
	transform: translateX(-50%);
	background: var(--paper-texture);
	color: var(--accent-color);
	padding: 0 1rem;
	font-size: 1.5rem;
}

.footer-para {
	margin-bottom: 1.5rem;
	color: var(--text-color);
	font-family: var(--primary-font);
	font-size: 1rem;
}

.social-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.social-share a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 5px;
	color: #fff;
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1;
	transition: opacity .15s ease;
}

.social-share a:hover { 
	opacity: .85; 
}

/* SVG icons as background images */
.social-share a::before {
	content: '';
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	display: block;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

/* Mastodon icon */
.social-share a[aria-label="Share on Mastodon"]::before {
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M23.268 5.313c-.35-2.578-2.617-4.61-5.304-5.004C17.51.242 15.792 0 11.813 0h-.03c-3.98 0-4.835.242-5.288.309C3.882.692 1.496 2.518.917 5.127.64 6.412.61 7.837.661 9.143c.074 1.874.088 3.745.26 5.611.118 1.24.325 2.47.62 3.68.55 2.237 2.777 4.098 4.96 4.857 2.336.792 4.849.923 7.256.38.265-.061.527-.132.786-.213.585-.184 1.27-.39 1.774-.753a.057.057 0 0 0 .023-.043v-1.809a.052.052 0 0 0-.02-.041.053.053 0 0 0-.046-.01 20.282 20.282 0 0 1-4.709.545c-2.73 0-3.463-1.284-3.674-1.818a5.593 5.593 0 0 1-.319-1.433.053.053 0 0 1 .066-.054c1.517.363 3.072.546 4.632.546.376 0 .75 0 1.125-.01 1.57-.044 3.224-.124 4.768-.422.038-.008.077-.015.11-.024 2.435-.464 4.753-1.92 4.989-5.604.008-.145.03-1.52.03-1.67.002-.512.167-3.63-.024-5.545zm-3.748 9.195h-2.561V8.29c0-1.309-.55-1.976-1.67-1.976-1.23 0-1.846.79-1.846 2.35v3.403h-2.546V8.663c0-1.56-.617-2.35-1.848-2.35-1.112 0-1.668.668-1.67 1.977v6.218H4.822V8.102c0-1.31.337-2.35 1.011-3.12.696-.77 1.608-1.164 2.74-1.164 1.311 0 2.302.5 2.962 1.498l.638 1.06.638-1.06c.66-.999 1.65-1.498 2.96-1.498 1.13 0 2.043.395 2.74 1.164.675.77 1.012 1.81 1.012 3.12z"/></svg>');
}

/* Facebook/Spybook icon */
.social-share a[aria-label="Share on Spybook"]::before {
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M22.675 0h-21.35C.595 0 0 .593 0 1.326v21.348C0 23.406.595 24 1.325 24H12.82v-9.294H9.692v-3.622h3.128V8.413c0-3.1 1.893-4.788 4.659-4.788 1.325 0 2.464.099 2.795.143v3.24l-1.918.001c-1.504 0-1.795.715-1.795 1.763v2.31h3.588l-.467 3.622h-3.121V24h6.116C23.405 24 24 23.406 24 22.674V1.326C24 .593 23.405 0 22.675 0z"/></svg>');
}

/* Twitter/NaziPub icon */
.social-share a[aria-label="Share on NaziPub"]::before {
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M23.954 4.569c-.885.392-1.83.656-2.825.775 1.014-.609 1.794-1.574 2.163-2.724-.951.564-2.005.974-3.127 1.195-.897-.958-2.178-1.555-3.594-1.555-2.72 0-4.924 2.204-4.924 4.924 0 .386.045.762.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.423.726-.666 1.571-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.247-2.228-.616v.062c0 2.385 1.697 4.374 3.946 4.827-.413.112-.849.171-1.296.171-.317 0-.626-.03-.927-.086.627 1.956 2.445 3.379 4.6 3.419-1.68 1.319-3.809 2.107-6.115 2.107-.398 0-.79-.023-1.17-.068 2.179 1.397 4.768 2.213 7.557 2.213 9.054 0 14.004-7.496 14.004-13.986 0-.21 0-.423-.015-.634.962-.695 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>');
}

/* LinkedIn icon */
.social-share a[aria-label="Share on LinkedIn"]::before {
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M4.98 3.5C4.98 4.88 3.88 6 2.5 6S0 4.88 0 3.5 1.1 1 2.5 1 4.98 2.12 4.98 3.5zM.2 8.2h4.6V24H.2V8.2zm7.8 0h4.4v2.2h.1c.6-1.2 2-2.5 4.1-2.5 4.4 0 5.2 2.9 5.2 6.7V24h-4.6v-7.6c0-1.8-.1-4.1-2.5-4.1-2.5 0-2.9 2-2.9 4v7.7H8V8.2z"/></svg>');
}

/* Reddit icon */
.social-share a[aria-label="Share on Reddit"]::before {
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="white" d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"/></svg>');
}

/* Social network colors */
.social-share a[aria-label="Share on Spybook"] { background: #3b5998; }
.social-share a[aria-label="Share on NaziPub"] { background: #1da1f2; }
.social-share a[aria-label="Share on LinkedIn"] { background: #0077b5; }
.social-share a[aria-label="Share on Reddit"] { background: #ff4500; }
.social-share a[aria-label="Share on Mastodon"] { background: #6364ff; }

/* Hide text on small screens */
@media (max-width: 500px) {
	.social-share a { font-size: 0; }
	.social-share a span { display: none; }
}
