/*
Theme Name: Dawid Toppa
Theme URI: https://dawid.toppa.de/
Author: Dawid Toppa
Description: Schlanker Nachbau des Entrance-Layouts für dawid.toppa.de. Eine CSS- und eine JS-Datei, ohne jQuery, Bootstrap, Icon-Schrift und Slider. Darkmode eingebaut, Widgets und Menü werden von Entrance übernommen.
Version: 1.0.1
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dawid-toppa
Update URI: false
*/

/* --------------------------------------------------------------------------
 * Farben – hell und dunkel
 * ----------------------------------------------------------------------- */
:root {
	--page: #fff;
	--surface: #f5f5f5;
	--border: #eee;
	--border-2: #ddd;
	--text: #333;
	--text-2: #555;
	--muted: #767676;
	--link: #1e73be;
	--accent: #1e73be;
	--accent-hover: #185f9e;
	--font: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
	color-scheme: light;
}

/* Echtes Schwarz: Auf OLED-Bildschirmen bleiben diese Pixel aus. Text ist
   bewusst kein reines Weiß, das würde auf Schwarz überstrahlen. */
html.dtm-dark {
	--page: #000;
	--surface: #121417;
	--border: #24282d;
	--border-2: #30353b;
	--text: #dadee3;
	--text-2: #b3b9c0;
	--muted: #9aa1a9;
	--link: #5aa9f0;
	color-scheme: dark;
}

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

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

body {
	margin: 0;
	font: 14px/1.7 var(--font);
	color: var(--text);
	background: var(--page);
}

a {
	color: var(--link);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

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

iframe,
embed,
object {
	max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.6em;
	font-weight: 600;
	line-height: 1.3;
	color: var(--text);
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	top: 8px;
	left: 8px;
	z-index: 100;
	width: auto;
	height: auto;
	padding: 10px 16px;
	clip: auto;
	color: #fff;
	background: var(--accent);
}

.container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 20px;
}

/* --------------------------------------------------------------------------
 * Kopf
 * ----------------------------------------------------------------------- */
.site-header {
	padding-top: 40px;
}

.header-inner {
	position: relative;
	text-align: center;
}

.site-title {
	margin: 0;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.2;
}

.site-title a {
	color: var(--text-2);
}

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

.site-description {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--muted);
}

/* Darkmode-Umschalter */
.dtm-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0 0;
	padding: 7px 14px 7px 11px;
	font: inherit;
	font-size: 13px;
	line-height: 1;
	color: var(--text-2);
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: 999px;
	cursor: pointer;
	transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.dtm-toggle[hidden] {
	display: none;
}

.dtm-toggle:hover,
.dtm-toggle:focus-visible {
	color: #fff;
	background: var(--accent);
	border-color: var(--accent);
}

.dtm-toggle svg,
.menu-toggle svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.dtm-icon-sun,
html.dtm-dark .dtm-icon-moon {
	display: none;
}

html.dtm-dark .dtm-icon-sun {
	display: block;
}

@media (min-width: 768px) {
	.dtm-toggle {
		position: absolute;
		top: 50%;
		right: 20px;
		margin: 0;
		transform: translateY(-50%);
	}
}

/* --------------------------------------------------------------------------
 * Hauptmenü
 * ----------------------------------------------------------------------- */
#mainnav {
	margin-top: 30px;
	margin-bottom: 30px;
}

#mainmenu,
#mainmenu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

#mainmenu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

#mainmenu li {
	position: relative;
}

#mainmenu > li > a {
	display: block;
	padding: 0 20px;
	font-size: 13px;
	font-weight: 700;
	line-height: 40px;
	text-transform: uppercase;
	color: var(--text-2);
}

#mainmenu > li > a:hover,
#mainmenu > li:hover > a,
#mainmenu > li:focus-within > a,
#mainmenu > .current_page_item > a,
#mainmenu > .current_page_ancestor > a,
#mainmenu > .current_page_parent > a,
#mainmenu > .current-menu-item > a,
#mainmenu > .current-menu-ancestor > a {
	color: #fff;
	background: var(--accent);
	text-decoration: none;
}

/* Pfeil bei Einträgen mit Untermenü */
#mainmenu > .page_item_has_children > a::after,
#mainmenu > .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-left: 8px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: translateY(-3px) rotate(45deg);
}

/* Verborgene Untermenüs liegen weit links außerhalb – sonst ragen die der
   rechten Menüpunkte über den Rand und die Seite lässt sich seitlich schieben. */
#mainmenu ul {
	position: absolute;
	top: 100%;
	left: -9999px;
	z-index: 50;
	width: 222px;
	text-align: left;
	background: var(--accent);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.15s, visibility 0.15s;
}

#mainmenu li:hover > ul,
#mainmenu li:focus-within > ul {
	left: 0;
	visibility: visible;
	opacity: 1;
}

/* Die beiden letzten Menüpunkte klappen nach links auf. */
#mainmenu > li:nth-last-child(-n+2):hover > ul,
#mainmenu > li:nth-last-child(-n+2):focus-within > ul {
	right: 0;
	left: auto;
}

#mainmenu ul a {
	display: block;
	padding: 9px 20px;
	font-size: 13px;
	line-height: 1.5;
	color: #fff;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

#mainmenu ul a:hover,
#mainmenu ul .current_page_item > a,
#mainmenu ul .current-menu-item > a {
	background: rgba(0, 0, 0, 0.14);
	text-decoration: none;
}

.menu-toggle {
	display: none;
}

/* --------------------------------------------------------------------------
 * Raster: Inhalt und Seitenleiste
 * ----------------------------------------------------------------------- */
.breadcrumb {
	margin: 0 0 20px;
	font-size: 12px;
	color: var(--muted);
}

.breadcrumb a {
	color: var(--muted);
}

.breadcrumb .sep {
	margin: 0 2px;
}

.layout {
	display: grid;
	gap: 40px;
	margin-bottom: 50px;
}

@media (min-width: 900px) {
	.layout.has-sidebar {
		grid-template-columns: minmax(0, 1fr) 340px;
	}
}

.site-content {
	min-width: 0;
}

/* --------------------------------------------------------------------------
 * Titel und Meta
 * ----------------------------------------------------------------------- */
.page-title,
.entry .entry-title {
	margin: 0 0 12px;
	font-size: 40px;
	font-weight: 300;
	line-height: 1.2;
}

.page-title {
	margin-bottom: 30px;
}

.archive-description {
	margin: -18px 0 30px;
	color: var(--text-2);
}

.entry-meta {
	margin: 0 0 20px;
	font-size: 12px;
	color: var(--muted);
}

.entry-meta a {
	color: var(--muted);
}

.entry-meta a:hover {
	color: var(--accent);
}

.entry-meta .sep {
	margin: 0 7px;
}

/* --------------------------------------------------------------------------
 * Einzelner Beitrag, Seite
 * ----------------------------------------------------------------------- */
.entry .entry-image {
	margin: 0 0 20px;
}

.entry .entry-image img {
	display: block;
	width: 100%;
	aspect-ratio: 9 / 4;
	object-fit: cover;
}

.entry-content {
	font-size: 15px;
	line-height: 1.75;
}

.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.2em;
}

.entry-content h2 {
	margin: 1.6em 0 0.6em;
	font-size: 28px;
	font-weight: 500;
}

.entry-content h3 {
	margin: 1.4em 0 0.5em;
	font-size: 22px;
	font-weight: 500;
}

.entry-content h4 {
	margin: 1.3em 0 0.5em;
	font-size: 18px;
}

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

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
}

.entry-content li {
	margin-bottom: 0.3em;
}

.entry-content a[href$=".jpg"] img,
.entry-content a[href$=".jpeg"] img,
.entry-content a[href$=".png"] img,
.entry-content a[href$=".webp"] img {
	cursor: zoom-in;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

blockquote {
	margin: 1.5em 0;
	padding: 0.2em 0 0.2em 1.2em;
	font-style: italic;
	color: var(--text-2);
	border-left: 3px solid var(--accent);
}

code,
kbd {
	padding: 0.1em 0.35em;
	font-family: var(--mono);
	font-size: 0.9em;
	background: var(--surface);
	border-radius: 3px;
}

pre {
	padding: 14px 16px;
	overflow-x: auto;
	font-family: var(--mono);
	font-size: 13px;
	line-height: 1.6;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
}

pre code {
	padding: 0;
	background: none;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

th,
td {
	padding: 8px 10px;
	text-align: left;
	border: 1px solid var(--border);
}

th {
	background: var(--surface);
}

hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--border);
}

figure {
	margin: 0 0 1.2em;
}

figcaption,
.wp-caption-text,
.wp-element-caption {
	margin-top: 6px;
	font-size: 12px;
	text-align: center;
	color: var(--muted);
}

.alignleft {
	float: left;
	margin: 0.3em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: 0.3em 0 1em 1.5em;
}

.aligncenter {
	display: block;
	margin-right: auto;
	margin-left: auto;
}

.tags {
	font-size: 13px;
	color: var(--muted);
}

.page-links {
	margin: 20px 0;
	font-size: 13px;
}

/* Vorheriger / nächster Beitrag */
.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin: 40px 0;
	padding: 20px 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
}

.post-navigation .nav-next {
	grid-column: 2;
	text-align: right;
}

.post-navigation a:hover {
	text-decoration: none;
}

.nav-label {
	display: block;
	margin-bottom: 4px;
	font-size: 11px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
}

.nav-title {
	font-weight: 600;
	color: var(--text);
}

.post-navigation a:hover .nav-title {
	color: var(--accent);
}

/* --------------------------------------------------------------------------
 * Abschnittstitel – wie die Widget-Titel
 * ----------------------------------------------------------------------- */
.widgettitle,
.section-title {
	margin: 0 0 20px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--text);
	border-bottom: 1px solid var(--border);
}

.widgettitle span,
.section-title span {
	display: inline-block;
	margin-bottom: -1px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--accent);
}

/* Überschrift eines Block-Widgets genauso darstellen */
.widget_block > .wp-block-heading:first-child {
	margin: 0 0 20px;
	padding-bottom: 10px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	background:
		linear-gradient(var(--accent), var(--accent)) 0 100% / 60px 1px no-repeat,
		linear-gradient(var(--border), var(--border)) 0 100% / 100% 1px no-repeat;
}

/* --------------------------------------------------------------------------
 * Beitragskarten (Startseite, weitere Beiträge)
 * ----------------------------------------------------------------------- */
.latest,
.related {
	margin: 0 0 40px;
}

.related {
	margin-top: 40px;
}

.cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.card-image {
	position: relative;
	margin-bottom: 10px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--surface);
}

.card-thumb,
.card-thumb img {
	display: block;
	width: 100%;
	height: 100%;
}

.card-thumb img {
	object-fit: cover;
	transition: transform 0.3s;
}

.card:hover .card-thumb img {
	transform: scale(1.05);
}

.badge {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
	padding: 2px 8px;
	font-size: 11px;
	line-height: 1.6;
	color: #fff;
	background: var(--accent);
}

.badge:hover {
	background: var(--accent-hover);
	text-decoration: none;
}

.card-title {
	margin: 0 0 4px;
	font-size: 15px;
	line-height: 1.4;
}

.card-title a,
.entry-list .entry-title a {
	color: var(--text);
}

.card-title a:hover,
.entry-list .entry-title a:hover {
	color: var(--accent);
	text-decoration: none;
}

.card-date {
	font-size: 12px;
	color: var(--muted);
}

.more-link {
	margin: 16px 0 0;
	font-size: 13px;
	font-weight: 600;
	text-align: right;
}

/* --------------------------------------------------------------------------
 * Beitragsliste (Blog, Kategorien, Suche)
 * ----------------------------------------------------------------------- */
.entry-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px;
	margin-bottom: 30px;
	padding-bottom: 30px;
	border-bottom: 1px solid var(--border);
}

.entry-list.has-post-thumbnail {
	grid-template-columns: 200px minmax(0, 1fr);
}

.entry-list .entry-image {
	position: relative;
	align-self: start;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--surface);
}

.entry-thumb,
.entry-thumb img {
	display: block;
	width: 100%;
	height: 100%;
}

.entry-thumb img {
	object-fit: cover;
	transition: transform 0.3s;
}

.entry-list .entry-image:hover img {
	transform: scale(1.05);
}

.entry-list .entry-title {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.35;
}

.entry-list .entry-meta {
	margin-bottom: 10px;
}

.entry-summary {
	font-size: 13px;
	color: var(--text-2);
}

.entry-summary p {
	margin: 0 0 12px;
}

.readmore {
	display: inline-block;
	padding: 4px 12px;
	font-size: 12px;
	color: var(--text-2);
	background: var(--surface);
	border: 1px solid var(--border-2);
	border-radius: 2px;
}

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

/* Seitenzahlen */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.page-numbers {
	display: inline-block;
	min-width: 34px;
	padding: 0 10px;
	font-size: 13px;
	line-height: 34px;
	text-align: center;
	color: var(--text-2);
	border: 1px solid var(--border-2);
}

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

.page-numbers.dots {
	border-color: transparent;
}

/* --------------------------------------------------------------------------
 * Seitenleiste und Widgets
 * ----------------------------------------------------------------------- */
#sidebar .widgets {
	margin: 0;
	padding: 0;
	list-style: none;
}

.widget {
	margin: 0 0 40px;
	font-size: 13px;
}

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

.widget li li,
.widget > ul > li,
.widget .menu > li {
	padding: 6px 0;
	border-bottom: 1px solid var(--border);
}

.widget li > a {
	color: var(--text-2);
}

.widget li > a:hover {
	color: var(--accent);
}

.widget img {
	display: block;
}

/* --------------------------------------------------------------------------
 * Formulare
 * ----------------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	padding: 8px 10px;
	font: inherit;
	font-size: 14px;
	color: var(--text);
	background: var(--page);
	border: 1px solid var(--border-2);
	border-radius: 2px;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--accent);
	outline: none;
	box-shadow: 0 0 0 2px rgba(30, 115, 190, 0.25);
}

input[type="submit"],
.search-submit {
	display: inline-block;
	padding: 8px 18px;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	background: var(--accent);
	border: 0;
	border-radius: 2px;
	cursor: pointer;
}

input[type="submit"]:hover,
.search-submit:hover {
	background: var(--accent-hover);
}

.search-form {
	display: flex;
	gap: 6px;
}

.search-form .search-field {
	flex: 1;
}

/* --------------------------------------------------------------------------
 * Kommentare
 * ----------------------------------------------------------------------- */
.comments {
	margin-top: 40px;
}

.comment-list,
.comment-list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.comment-list {
	margin-bottom: 30px;
}

.comment-list .children {
	padding-left: 30px;
}

.comment-body {
	padding: 16px 0;
	border-bottom: 1px solid var(--border);
}

.comment-author .avatar {
	float: left;
	margin-right: 10px;
	border-radius: 50%;
}

.comment-author .fn {
	font-style: normal;
	font-weight: 600;
	color: var(--text);
}

.comment-author .says {
	display: none;
}

.comment-metadata,
.reply {
	font-size: 12px;
}

.comment-metadata a {
	color: var(--muted);
}

.comment-content {
	clear: both;
	padding-top: 6px;
}

.comment-form p {
	margin: 0 0 14px;
}

.comment-form label {
	display: block;
	margin-bottom: 4px;
	font-size: 13px;
}

.comment-form .comment-form-cookies-consent label {
	display: inline;
}

.comment-notes,
.logged-in-as {
	font-size: 13px;
	color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Fuß
 * ----------------------------------------------------------------------- */
#footer-widget {
	padding: 40px 0 0;
	border-top: 1px solid var(--border);
}

.footer-columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 40px;
}

#bottom {
	padding: 20px 0;
	font-size: 13px;
	color: var(--muted);
	border-top: 1px solid var(--border);
}

.bottom-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px;
}

#bottom p {
	margin: 0;
}

#bottom a {
	color: var(--muted);
}

/* --------------------------------------------------------------------------
 * Bildansicht
 * ----------------------------------------------------------------------- */
.lightbox {
	max-width: 96vw;
	max-height: 96vh;
	padding: 0;
	overflow: visible;
	background: transparent;
	border: 0;
	cursor: zoom-out;
}

.lightbox::backdrop {
	background: rgba(0, 0, 0, 0.88);
}

.lightbox img {
	display: block;
	width: auto;
	max-width: 96vw;
	height: auto;
	max-height: 90vh;
}

.lightbox-close {
	position: fixed;
	top: 10px;
	right: 16px;
	font-size: 36px;
	line-height: 1;
	color: #fff;
	background: none;
	border: 0;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
 * Tablet und Handy
 * ----------------------------------------------------------------------- */
@media (max-width: 767px) {
	.site-header {
		padding-top: 24px;
	}

	.site-title {
		font-size: 28px;
	}

	#mainnav {
		margin: 20px auto;
	}

	.js .menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 10px;
		font: inherit;
		font-size: 13px;
		font-weight: 700;
		text-transform: uppercase;
		color: #fff;
		background: var(--accent);
		border: 0;
		cursor: pointer;
	}

	.js #mainnav:not(.is-open) #mainmenu {
		display: none;
	}

	#mainmenu {
		flex-direction: column;
		border: 1px solid var(--border);
		border-top: 0;
	}

	#mainmenu > li > a {
		padding: 10px 15px;
		line-height: 1.4;
		border-bottom: 1px solid var(--border);
	}

	#mainmenu > .page_item_has_children > a::after,
	#mainmenu > .menu-item-has-children > a::after {
		display: none;
	}

	#mainmenu ul {
		position: static;
		width: auto;
		background: none;
		box-shadow: none;
		visibility: visible;
		opacity: 1;
	}

	#mainmenu ul a {
		padding: 8px 15px 8px 30px;
		color: var(--text-2);
		border-top: 0;
		border-bottom: 1px solid var(--border);
	}

	#mainmenu ul a:hover {
		color: #fff;
		background: var(--accent);
	}

	.page-title,
	.entry .entry-title {
		font-size: 28px;
	}

	.entry-content h2 {
		font-size: 23px;
	}

	.entry-content h3 {
		font-size: 19px;
	}

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

@media (max-width: 599px) {
	/* Karten als kompakte Liste: kleines Bild links, Titel rechts */
	.cards {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.card {
		display: grid;
		grid-template-columns: 110px minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		column-gap: 14px;
	}

	.card-image {
		grid-row: 1 / span 2;
		margin: 0;
		aspect-ratio: 4 / 3;
	}

	.card-title,
	.card-date {
		grid-column: 2;
	}

	.card .badge {
		display: none;
	}

	.entry-list.has-post-thumbnail {
		grid-template-columns: 110px minmax(0, 1fr);
		gap: 14px;
	}

	.entry-list .entry-title {
		font-size: 16px;
	}

	.entry-list .entry-summary {
		display: none;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.post-navigation .nav-next {
		grid-column: 1;
	}

	.alignleft,
	.alignright {
		float: none;
		margin: 0 0 1em;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
	}
}
