/*
Theme Name: Čchan
Description: Theme for cchan.cz. Reproduces the site's former Weaver II look (one column, header image, page menu) in a small classic theme. Not on wordpress.org.
Version: 1.0.2
Requires at least: 6.0
Requires PHP: 8.1
Text Domain: cchan
License: GPL-2.0-or-later
*/

:root {
	--page-bg: #f8f8f8;
	--paper: #f9f9f0;
	--frame: #d8d8d8;
	--menu-border: #e8e8e8;
	--menu-text: #525252;
	--menu-hover-bg: #e0e0d8;
	--menu-hover-text: #808080;
	--submenu-bg: #edede5;
	--text: #333;
	--heading: #000;
	--title: #1d4710;
	--link: #265e15;
	--link-hover: #56d42f;
	--meta: #858585;
	--rule: #888;
	--font: "Bitstream Charter", Times, serif;
}

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

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

body {
	margin: 0;
	padding: 20px;
	background: var(--page-bg);
	color: var(--text);
	font: 12px/1.5 var(--font);
}

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); text-decoration: underline; }

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

h1, h2, h3, h4, h5, h6 { color: var(--heading); line-height: 1.5; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.screen-reader-text:focus {
	position: static !important;
	width: auto; height: auto;
	clip: auto;
	background: var(--paper);
	padding: 4px 8px;
}

/* Frame */
#wrapper {
	max-width: 940px;
	margin: 0 auto;
	padding: 10px;
	background: var(--paper);
	border: 1px solid var(--frame);
	border-radius: 10px;
}

/* Header */
#branding { padding-bottom: 10px; }

#site-title {
	margin: 0.22em 0 0 7%;
	font-size: 36px;
	font-weight: bold;
	font-variant: small-caps;
	line-height: 1.5;
}
#site-title a { color: var(--title); text-decoration: none; }
#site-title a:hover, #site-title a:focus { color: var(--link-hover); }

#header-image { display: block; }
#header-image img { display: block; width: 100%; height: auto; }

/* Menu */
#access {
	position: relative;
	margin: 2px 0 0 -1px;
	background: var(--paper);
	border: 1px solid var(--menu-border);
	border-radius: 0 0 7px 7px;
	font-size: 1.2em;
	font-weight: bold;
	color: var(--menu-text);
}
#access::after { content: ""; display: table; clear: both; }
#access ul { margin: 0; padding: 0; list-style: none; }
#access a {
	display: block;
	padding: 0 10px;
	color: var(--menu-text);
	line-height: 38px;
	text-decoration: none;
}
#access .current_page_item > a,
#access .current_page_ancestor > a,
#access .current-menu-item > a { color: #000; }
#access li:hover > a,
#access a:focus { background: var(--menu-hover-bg); color: var(--menu-hover-text); }

.menu-toggle { display: none; }

@media (min-width: 701px) {
	#access .menu > ul { padding-left: 13px; }
	#access li { position: relative; float: left; }
	#access ul ul {
		position: absolute;
		top: 38px;
		left: 0;
		z-index: 100;
		display: none;
		width: 188px;
		box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
	}
	#access ul ul ul { top: 0; left: 100%; }
	#access ul ul li { float: none; }
	#access ul ul a {
		width: 188px;
		padding: 10px;
		background: var(--submenu-bg);
		border: 1px solid var(--menu-border);
		font-weight: normal;
		line-height: 18px;
		color: var(--menu-text);
	}
	#access ul ul .current_page_item > a { color: #000; }
	#access ul ul li:hover > a,
	#access ul ul a:focus { background: var(--menu-hover-bg); color: var(--menu-hover-text); }
	#access li:hover > ul,
	#access li:focus-within > ul { display: block; }
}

/* Main */
#main { padding-top: 10px; }

#breadcrumbs {
	padding-left: 15px;
	font-size: 1.1em;
	line-height: 33px;
}
#breadcrumbs .current { font-weight: bold; }

#content {
	padding: 0.5em 4% 0;
	margin-bottom: 10px;
	font-size: 1.33em;
	line-height: 1.5;
}

.hentry { margin-bottom: 2em; }
.hentry + .hentry { border-top: 1px dashed #e0e0e0; padding-top: 1em; }

.entry-title {
	margin: 0 0 0.1em;
	padding-right: 40px;
	font-size: 1.5em;
	font-weight: bold;
	color: var(--heading);
}
.entry-title a { color: #204f12; text-decoration: none; }
.entry-title a:hover, .entry-title a:focus { color: var(--link-hover); }

.entry-meta { color: var(--meta); font-size: 0.85em; }
.entry-meta a { color: var(--link); }

.entry-content { padding-top: 1.625em; overflow-wrap: break-word; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content img { height: auto !important; }
.entry-content iframe { max-width: 100%; }
.entry-content [style*="white-space: pre"] { white-space: pre-wrap !important; }
.entry-content blockquote { margin: 0 3em; font-style: italic; }

/* Lists as Weaver II had them: no padding, a small left margin, discs at every level. */
.entry-content ul,
.entry-content ol { margin: 0 0 1.5em; padding: 0; list-style-position: outside; }
.entry-content ul { margin-left: 1.15em; list-style-type: disc; }
.entry-content ol { margin-left: 1.4em; list-style-type: decimal; }
.entry-content ol ol { list-style-type: upper-alpha; }
.entry-content ol ol ol { list-style-type: lower-roman; }
.entry-content ol ol ol ol { list-style-type: lower-alpha; }
.entry-content li ul,
.entry-content li ol { margin-bottom: 0; }
.entry-content dl { margin: 0 1.5em; }
.entry-content dt { font-weight: bold; }
.entry-content dd { margin: 0 0 1.5em 1.5em; }
.entry-content table {
	width: 100%;
	margin: 0 -1px 24px 0;
	border: 1px solid #e7e7e7;
	border-collapse: collapse;
	text-align: left;
}
.entry-content table { max-width: 100%; }
.entry-content td { padding: 6px 24px; border-top: 1px solid #e7e7e7; }

.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 0 auto 1em; }

.page-title { font-size: 1.2em; }

.pagination { margin: 1em 0 2em; }
.pagination .page-numbers { padding: 0 0.3em; }

.entry-footer {
	border-bottom: 1px dashed #e0e0e0;
	margin-bottom: 0;
}

/* Search form */
.search-form { display: flex; gap: 6px; max-width: 30em; margin: 1em 0; }
.search-form .search-field {
	flex: 1;
	padding: 4px 6px;
	font: inherit;
	background: #f0f0f0;
	border: 1px solid #ccc;
}
.search-form .search-submit { font: inherit; }

/* Footer */
#colophon {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	padding: 2px 36px 4px;
	border-top: 4px solid var(--rule);
	border-radius: 10px;
	background: var(--paper);
}

/* Mobile */
@media (max-width: 700px) {
	body { padding: 0; }
	#wrapper { border-radius: 0; border-left: 0; border-right: 0; }
	#site-title { margin-left: 4%; font-size: 30px; }

	.menu-toggle {
		display: block;
		width: 100%;
		padding: 0 10px;
		background: none;
		border: 0;
		color: var(--menu-text);
		font: inherit;
		line-height: 38px;
		text-align: left;
		cursor: pointer;
	}
	.menu-toggle::before { content: "☰ "; }
	.menu-toggle[aria-expanded="true"]::before { content: "✕ "; }
	.js #access .menu { display: none; }
	.js #access.toggled .menu { display: block; }
	#access .menu a { border-top: 1px solid var(--menu-border); line-height: 1.4; padding: 8px 10px; }
	#access .menu ul ul a { padding-left: 25px; font-weight: normal; }
	#access .menu ul ul ul a { padding-left: 40px; }

	#content { padding: 0.5em 3% 0; font-size: 1.25em; }
	#breadcrumbs { padding-left: 3%; line-height: 1.5; padding-top: 6px; display: block; }
	.entry-content { padding-top: 1em; }
	.entry-content [style*="margin-left"] { margin-left: 0 !important; }
	.entry-content blockquote { margin: 0 1em; }
	/* The content's tables are layout tables: stack their cells. */
	.entry-content table, .entry-content tbody, .entry-content tr, .entry-content td {
		display: block;
		width: auto !important;
	}
	.entry-content td { padding: 4px 8px; border-top: 0; }
	.entry-content .alignleft, .entry-content [style*="float: left"] { float: none !important; display: block; margin: 0 auto 1em !important; }
	#colophon { padding: 2px 3% 4px; }
}

@media print {
	body { padding: 0; background: #fff; }
	#wrapper { border: 0; max-width: none; background: #fff; }
	#access, #header-image, #breadcrumbs, #colophon { display: none; }
}
