/*
Theme Name: XCity Simple
Description: Simple two-column theme: header, letter menu, post list + sidebar, footer.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: xcity-simple
*/

:root {
	--bg: #f4f5f7;
	--surface: #ffffff;
	--text: #1f2328;
	--muted: #6b7280;
	--border: #e5e7eb;
	--accent: #d0021b;
	--accent-dark: #a00016;
	--radius: 8px;
	--gap: 24px;
	--max: 1140px;
	--sidebar: 338px; /* 300px banner + 18px padding each side + border */
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

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

.wrap {
	max-width: var(--max);
	margin: 0 auto;
	padding: 0 16px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
}

/* ---------- Header ---------- */

.site-header {
	background: var(--surface);
	border-bottom: 1px solid var(--border);
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-top: 14px;
	padding-bottom: 14px;
}

.logo { flex: none; margin: 0; line-height: 0; }
.logo img { display: block; width: 200px; height: auto; }

.header-banner { flex: 0 1 728px; min-width: 0; line-height: 0; }
.header-banner img { display: block; width: 100%; height: auto; margin-left: auto; }

/* ---------- Letter menu ---------- */

.site-nav {
	background: var(--text);
}

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: block;
	min-width: 34px;
	padding: 10px 10px;
	color: #e5e7eb;
	font-weight: 600;
	font-size: 14px;
	text-align: center;
}

.site-nav a:hover,
.site-nav .current a {
	background: var(--accent);
	color: #fff;
	text-decoration: none;
}

/* ---------- Layout ---------- */

.site-main .wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--sidebar);
	gap: var(--gap);
	padding-top: var(--gap);
	padding-bottom: var(--gap);
}

.content,
.sidebar .widget {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.content { padding: 20px 24px; }

.page-title {
	margin: 0 0 12px;
	font-size: 20px;
	line-height: 1.3;
}

.page-title small {
	color: var(--muted);
	font-size: 13px;
	font-weight: 400;
}

/* ---------- Post list ---------- */

.post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.post-list li {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px solid var(--border);
}

.post-list li:last-child { border-bottom: 0; }

.post-list a {
	color: var(--text);
	font-weight: 600;
	overflow-wrap: anywhere;
}

.post-list a:hover { color: var(--accent); }

.post-list time {
	flex: none;
	color: var(--muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.empty { color: var(--muted); }

/* ---------- Pagination ---------- */

.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 20px;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 36px;
	padding: 6px 10px;
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text);
	text-align: center;
	font-size: 14px;
}

.pagination a.page-numbers:hover {
	border-color: var(--accent);
	color: var(--accent);
	text-decoration: none;
}

.pagination .current {
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

.pagination .dots { border-color: transparent; }

/* ---------- Single ---------- */

.entry-header { margin-bottom: 16px; }

.entry-title {
	margin: 0;
	font-size: 26px;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.entry-title small {
	color: var(--muted);
	font-size: 14px;
	font-weight: 400;
}

.entry-meta {
	margin-top: 6px;
	color: var(--muted);
	font-size: 13px;
}

.entry-content > :first-child { margin-top: 0; }
.entry-content > :last-child { margin-bottom: 0; }

.password-list { margin-top: 8px; }

.password-item {
	padding: 14px 0;
	border-top: 1px solid var(--border);
	overflow-wrap: anywhere;
}

.password-item:first-child { border-top: 0; padding-top: 0; }

.password-item .posted {
	display: block;
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 13px;
}

.password-item p { margin: 0 0 6px; }

.btn {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 6px;
	background: var(--accent);
	color: #fff;
	font-weight: 600;
}

.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

/* ---------- Sidebar ---------- */

.sidebar .widget {
	margin-bottom: var(--gap);
	padding: 16px 18px;
}

.sidebar .widget:last-child { margin-bottom: 0; }

.sidebar .widget-title,
.sidebar .widget h2 {
	margin: 0 0 10px;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.sidebar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sidebar li {
	padding: 5px 0;
	border-bottom: 1px solid var(--border);
}

.sidebar li:last-child { border-bottom: 0; }

.sidebar p { margin: 0 0 14px; }
.sidebar p:last-child { margin-bottom: 0; }

.howto a {
	color: var(--accent);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.side-banner { line-height: 0; }
.side-banner img { display: block; width: 300px; max-width: 100%; height: auto; }

.feed-list { margin-bottom: 10px !important; }
.feed-list li { padding: 6px 0; line-height: 1.4; }
.feed-list a { font-weight: 600; }

.feed-more { text-align: right; }
.feed-more a { text-decoration: underline; }

/* Rotating link colours (same as the old theme) */
.color-1, .color-9  { color: blue; }
.color-2, .color-10 { color: deeppink; }
.color-3 { color: red; }
.color-4 { color: green; }
.color-5 { color: purple; }
.color-6 { color: brown; }
.color-7 { color: black; }
.color-8 { color: orange; }

/* ---------- Search form ---------- */

.search-form { display: flex; }

.search-form label { flex: 1; }

.search-field {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--border);
	border-right: 0;
	border-radius: 6px 0 0 6px;
	font: inherit;
}

.search-field:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.search-submit {
	padding: 8px 14px;
	border: 0;
	border-radius: 0 6px 6px 0;
	background: var(--accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.search-submit:hover { background: var(--accent-dark); }

/* ---------- Footer ---------- */

.site-footer {
	background: var(--surface);
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 13px;
}

.site-footer .wrap {
	padding-top: 20px;
	padding-bottom: 20px;
	text-align: center;
}

.site-footer p { margin: 0 0 6px; }
.site-footer p:last-child { margin-bottom: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
	.site-main .wrap { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
	.site-header .wrap { flex-direction: column; align-items: center; }
	.header-banner { flex-basis: auto; width: 100%; }
	.content { padding: 16px; }
	.post-list li { flex-direction: column; gap: 0; }
	.entry-title { font-size: 22px; }
	.site-nav a { min-width: 30px; padding: 8px 6px; }
}
