/*
Theme Name: Raceskinning
Description: Theme im Stil der alten WoltLab-Seite von raceskinning.de – dunkel, blau/orange, mit Setup-Shop (Easy Digital Downloads).
Version: 1.3.1
Requires PHP: 7.4
Text Domain: raceskinning
*/

:root {
	--rs-bg: #3a3a3a;
	--rs-band: #2e2e2e;
	--rs-card: #444;
	--rs-card-hover: #4b4b4b;
	--rs-line: #555;
	--rs-header: #1b80b3;
	--rs-orange: #f67829;
	--rs-orange-dark: #d9641c;
	--rs-link: #6cc4f2;
	--rs-text: #c4c8cc;
	--rs-muted: #9aa0a6;
	--rs-footer: #1e1e1e;
	--rs-radius: 6px;
	--rs-max: 1200px;
	--rs-font: 'Khula', Arial, Helvetica, sans-serif;
	--rs-head: 'Jura', 'Khula', Arial, sans-serif;
}

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

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

body {
	margin: 0;
	background: var(--rs-bg);
	color: var(--rs-text);
	font: 400 15px/1.6 var(--rs-font);
}

a { color: var(--rs-link); text-decoration: none; }
a:hover { color: #9ad8f7; text-decoration: underline; }
img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
	font-family: var(--rs-head);
	font-weight: 600;
	line-height: 1.25;
	color: var(--rs-orange);
	margin: 1.4em 0 .6em;
}
h1 { font-size: 28px; }
h2 { font-size: 23px; }
h3 { font-size: 19px; }

.wrap { max-width: var(--rs-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); white-space: nowrap;
}

/* ---------- Kopfzeile ---------- */
.site-header {
	background: var(--rs-header);
	border-bottom: 3px solid var(--rs-orange);
	color: #fff;
	position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
	display: flex; align-items: center; justify-content: space-between;
	min-height: 64px; gap: 16px;
}
.site-logo { display: flex; align-items: center; }
.site-logo img { display: block; max-height: 56px; width: auto; }
.site-logo .logo-mobile { display: none; }
.site-name { font: 600 22px var(--rs-head); color: #fff; }
.custom-logo { max-height: 56px; width: auto; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a {
	display: block; padding: 8px 12px; border-radius: 4px;
	color: #fff; font-weight: 600; white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { background: rgba(0, 0, 0, .18); text-decoration: none; }
.main-nav .sub-menu { display: none; }

.header-tools { display: flex; align-items: center; gap: 6px; }
.header-tools a { color: #fff; font-weight: 600; padding: 8px 10px; border-radius: 4px; white-space: nowrap; }
.header-tools a:hover { background: rgba(0, 0, 0, .18); text-decoration: none; }
.header-tools .cart-count {
	display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
	background: var(--rs-orange); border-radius: 10px; font-size: 12px; text-align: center; line-height: 20px;
}

.menu-toggle {
	display: none; background: none; border: 0; color: #fff; cursor: pointer;
	font-size: 26px; line-height: 1; padding: 6px 8px;
}

.header-band { background: var(--rs-band); height: 28px; border-bottom-right-radius: 28px; }

/* ---------- Inhalt ---------- */
.site-main { padding: 8px 0 48px; min-height: 60vh; }
.page-title { margin-top: .8em; }

.entry {
	background: var(--rs-card);
	border-radius: var(--rs-radius);
	padding: 24px 28px;
	margin-top: 16px;
}
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1em; }
.entry-content img { border-radius: 4px; }
.entry-content .alignleft { float: left; margin: 4px 20px 12px 0; }
.entry-content .alignright { float: right; margin: 4px 0 12px 20px; }
.entry-content .aligncenter { display: block; margin: 12px auto; }
.entry-content::after { content: ''; display: table; clear: both; }
.entry-content blockquote {
	margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--rs-orange); background: rgba(0, 0, 0, .15);
}
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content td, .entry-content th { border: 1px solid var(--rs-line); padding: 6px 10px; }
.entry-content iframe, .wp-block-embed iframe { max-width: 100%; }

.entry-hero { margin: -24px -28px 20px; }
.entry-hero img { display: block; width: 100%; max-height: 460px; object-fit: cover; object-position: left top;border-radius: var(--rs-radius) var(--rs-radius) 0 0; }

.entry-meta { color: var(--rs-muted); font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entry-meta img.avatar { border-radius: 50%; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 1em 0; }
.gallery .gallery-item { margin: 0; width: auto !important; }
.gallery img { display: block; width: 100%; height: 120px; object-fit: cover; border: 0 !important; }

/* ---------- Intro auf der Startseite ---------- */
.intro {
	display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
	background: linear-gradient(120deg, #444 0%, #3d3d3d 60%, rgba(27, 128, 179, .35) 100%);
	border-left: 4px solid var(--rs-orange);
	border-radius: var(--rs-radius);
	padding: 28px 32px; margin-top: 16px;
}
.intro h1 { margin-top: 0; }
.intro .entry-content { font-size: 16px; }
.intro-actions { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Buttons ---------- */
.button, .edd-submit, input[type=submit], button[type=submit], .edd_purchase_submit_wrapper a {
	display: inline-block; cursor: pointer;
	background: var(--rs-orange) !important; color: #fff !important;
	border: 0 !important; border-radius: 4px !important;
	padding: 10px 18px !important; font: 600 15px var(--rs-font) !important;
	text-decoration: none !important; text-align: center;
}
.button:hover, .edd-submit:hover, input[type=submit]:hover, button[type=submit]:hover { background: var(--rs-orange-dark) !important; }
.button.secondary { background: transparent !important; border: 1px solid var(--rs-link) !important; color: var(--rs-link) !important; }

/* ---------- Abschnitte + Kacheln ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards.two { grid-template-columns: repeat(2, 1fr); }

.card {
	background: var(--rs-card); border-radius: var(--rs-radius); overflow: hidden;
	display: flex; flex-direction: column;
	transition: background .15s, transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s;
}
.card:hover { background: var(--rs-card-hover); transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, .35); }
.card-image { position: relative; display: block; aspect-ratio: 16 / 9; background: #333; overflow: hidden; }
.price.on-image { position: absolute; top: 10px; right: 10px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.card-more { color: var(--rs-link); font-weight: 600; }
.views { white-space: nowrap; color: var(--rs-muted); }
.hero-date .views { color: #bbb; }
.card:hover .card-more { color: var(--rs-orange); }
@media (prefers-reduced-motion: reduce) {
	.card, .card-image img { transition: none; }
	.card:hover { transform: none; }
	.card:hover .card-image img { transform: none; }
}
.card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-image img { transform: scale(1.03); }
.card-image .no-image { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--rs-muted); font: 600 18px var(--rs-head); }
.card-body { padding: 14px 16px 6px; flex: 1; }
.card-title { margin: 0 0 6px; font: 600 19px/1.3 var(--rs-head); }
.card-title a { color: var(--rs-link); }
.card-excerpt { font-size: 14px; margin: 0; }
.card-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 10px 16px; border-top: 1px solid var(--rs-line); font-size: 13px; color: var(--rs-muted);
}
.card-cat { color: var(--rs-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.price {
	background: var(--rs-orange); color: #fff; font-weight: 700; font-size: 14px;
	padding: 3px 10px; border-radius: 12px; white-space: nowrap;
}
.price.owned { background: #2e8b57; }

/* ---------- Filter-Chips (Setup-Kategorien) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.chips a {
	display: block; padding: 5px 12px; border-radius: 14px;
	background: var(--rs-card); color: var(--rs-text); font-size: 14px;
}
.chips a:hover, .chips .active a { background: var(--rs-header); color: #fff; text-decoration: none; }

/* ---------- Setup-Detailseite ---------- */
.download-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.buy-box {
	background: var(--rs-card); border-radius: var(--rs-radius); padding: 20px;
	border-top: 3px solid var(--rs-orange); position: sticky; top: 90px; margin-top: 16px;
}
.buy-box .big-price { font: 700 30px var(--rs-head); color: #fff; margin: 0 0 12px; }
.buy-box dl { margin: 16px 0 0; font-size: 14px; }
.buy-box dt { color: var(--rs-muted); }
.buy-box dd { margin: 0 0 8px; }
.buy-box .hint { font-size: 13px; color: var(--rs-muted); margin-top: 12px; }
.edd_download_purchase_form { margin: 0; }

/* ---------- Kasse (EDD-Checkout-Block) ---------- */
.edd-blocks__checkout {
	display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start;
}
.edd-blocks__checkout > .edd-blocks__logged-in { grid-column: 1 / -1; margin: 0; color: var(--rs-muted); font-size: 14px; }
.edd-blocks__checkout > .edd-blocks__cart { grid-column: 2; grid-row: 2; position: sticky; top: 90px; }
.edd-blocks__checkout > .edd-blocks__purchase-form { grid-column: 1; grid-row: 2; }

.edd-blocks-cart {
	border: 0 !important; border-radius: var(--rs-radius); overflow: hidden;
	background: rgba(0, 0, 0, .2); border-top: 3px solid var(--rs-orange) !important;
}
.edd-blocks-cart__row { padding: 14px 18px !important; border-bottom: 1px solid var(--rs-line) !important; }
.edd-blocks-cart__row:last-child { border-bottom: 0 !important; }
.edd-blocks-cart__row-header { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--rs-muted); }
.edd-blocks-cart__row-item img { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; }
.edd-blocks-cart__row-item .edd_cart_item_name { color: #fff; font-weight: 600; }
.edd_cart_total { font: 700 20px var(--rs-head); color: #fff; }
.edd_cart_discount:empty, .edd_cart_discount_row:has(.edd_cart_discount:empty) { display: none; }

.edd-blocks__checkout fieldset {
	border: 1px solid var(--rs-line) !important; border-radius: var(--rs-radius) !important;
	padding: 18px 22px 8px !important; margin: 0 0 20px;
}
.edd-blocks__checkout legend { font: 600 18px var(--rs-head); color: var(--rs-orange); padding: 0 8px; }
.edd-blocks__checkout label { color: #e6e6e6; font-weight: 600; }
.edd-blocks__checkout .edd-input { width: 100%; }
.edd-blocks__checkout .edd-description { color: var(--rs-muted) !important; font-size: 12px; margin: 4px 0 14px; }
.edd-blocks__checkout .edd-required-indicator { color: var(--rs-orange); }
#edd_purchase_submit { border: 0 !important; padding: 0 !important; max-width: 420px; }
.rs-checkout-note { color: var(--rs-muted); font-size: 13px; margin-top: 12px; max-width: 420px; }

@media (max-width: 980px) {
	.edd-blocks__checkout { grid-template-columns: 1fr; }
	.edd-blocks__checkout > .edd-blocks__cart,
	.edd-blocks__checkout > .edd-blocks__purchase-form { grid-column: 1; grid-row: auto; position: static; }
}

/* EDD-Formulare (Kasse, Login, Kaufhistorie) dunkel */
#edd_checkout_wrap, .edd_form, #edd_user_history, .edd-table { color: var(--rs-text); }
#edd_checkout_cart, .edd-table, #edd_user_history { width: 100%; border-collapse: collapse; }
#edd_checkout_cart th, #edd_checkout_cart td, #edd_user_history th, #edd_user_history td, .edd-table td, .edd-table th {
	border-bottom: 1px solid var(--rs-line); padding: 10px; background: transparent;
}
#edd_checkout_wrap fieldset, .edd_form fieldset { border: 1px solid var(--rs-line); border-radius: var(--rs-radius); padding: 16px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
	background: #2f2f2f; color: #eee; border: 1px solid var(--rs-line); border-radius: 4px; padding: 8px 10px;
	font: 15px var(--rs-font); max-width: 100%;
}
.edd-alert { border-radius: 4px; }

/* ---------- Seitennavigation ---------- */
.pagination { margin-top: 28px; text-align: center; }
.pagination .page-numbers {
	display: inline-block; min-width: 36px; padding: 6px 10px; margin: 2px;
	background: var(--rs-card); border-radius: 4px; color: var(--rs-text);
}
.pagination .current { background: var(--rs-header); color: #fff; }

/* ---------- Kommentare ---------- */
.comments-area { margin-top: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { background: var(--rs-card); border-radius: var(--rs-radius); padding: 14px 18px; margin-bottom: 12px; }

/* ---------- Fußzeile ---------- */
.site-footer { background: var(--rs-footer); color: #ccc; padding: 24px 0; font-size: 14px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: #ccc; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.cards { grid-template-columns: repeat(2, 1fr); }
	.download-layout { grid-template-columns: 1fr; }
	.buy-box { position: static; }
}
@media (max-width: 760px) {
	.menu-toggle { display: block; }
	.site-logo.has-mobile .logo-desktop { display: none; }
	.site-logo .logo-mobile { display: block; max-height: 48px; }
	.main-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--rs-header); border-bottom: 3px solid var(--rs-orange); padding: 8px 16px 12px;
	}
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; }
	.header-tools .label { display: none; }
	.cards, .cards.two { grid-template-columns: 1fr; }
	.intro { grid-template-columns: 1fr; padding: 22px; }
	.intro-actions { flex-direction: row; flex-wrap: wrap; }
	.entry { padding: 18px; }
	.entry-hero { margin: -18px -18px 16px; }
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 12px 0; }
}
