/**
 * Common Ground — PeepSo skin
 *
 * Re-maps PeepSo's own CSS variables to the theme palette, so updates to
 * PeepSo keep working (no PeepSo files are edited). Loaded after PeepSo's CSS
 * only when PeepSo is active (see inc/peepso.php).
 * Verified against PeepSo 9.1.1.0.
 */

/* 1. Palette + type → PeepSo variables ---------------------------------- */
html body {
	--COLOR--PRIMARY: #151412;            /* ink: primary buttons */
	--COLOR--PRIMARY--SHADE: #2a2825;
	--COLOR--PRIMARY--DARK: #9a4e2d;      /* clay: hover */
	--COLOR--PRIMARY--LIGHT: #4a4640;
	--COLOR--PRIMARY--ULTRALIGHT: #ece7dd;
	--COLOR--ALT: #9a4e2d;
	--COLOR--ALT--LIGHT: #c78b6c;
	--COLOR--ALT--DARK: #7d3f24;

	--COLOR--APP: #faf8f3;                /* chalk: cards */
	--COLOR--APP--LIGHTGRAY: #f2eee6;     /* paper */
	--COLOR--APP--GRAY: #ebe6dc;
	--COLOR--APP--DARKGRAY: #d9d2c5;      /* sand */
	--COLOR--APP--DARK: #8a8378;
	--COLOR--APP--DARKER: #4a4640;

	--COLOR--HEADING: #151412;
	--COLOR--TEXT: #151412;
	--COLOR--TEXT--LIGHT: #4a4640;
	--COLOR--TEXT--LIGHTEN: #6b655c;      /* 5.4:1 on chalk */
	--COLOR--TEXT--INVERT: #faf8f3;

	/* Neutral notices instead of bright blue/green. */
	--COLOR--INFO: #4a4640;
	--COLOR--INFO--LIGHT: #8a8378;
	--COLOR--INFO--ULTRALIGHT: #f2eee6;
	--COLOR--INFO--DARK: #2a2825;
	--COLOR--SUCCESS: #3f5a45;
	--COLOR--SUCCESS--LIGHT: #7d9283;
	--COLOR--SUCCESS--ULTRALIGHT: #eef0ea;
	--COLOR--SUCCESS--DARK: #2e4333;
	--COLOR--WARNING: #9a4e2d;
	--COLOR--WARNING--LIGHT: #c78b6c;
	--COLOR--WARNING--ULTRALIGHT: #f6ebe3;
	--COLOR--WARNING--DARK: #7d3f24;

	--COLOR--GRADIENT: none;
	--COLOR--GRADIENT--ONE: #151412;
	--COLOR--GRADIENT--TWO: #151412;

	--FONT-SIZE: 16px;
	--LINE-HEIGHT: 1.55;
	--PS-FONT-FAMILY: var(--wp--preset--font-family--display, inherit);

	--BORDER-RADIUS: 3px;
	--BOX-SHADOW: 0 0 0 1px #d9d2c5;
	--BOX-SHADOW--MD: 0 0 0 1px #d9d2c5, 0 20px 40px -30px rgba(21, 20, 18, 0.35);
	--BOX-SHADOW--XL: 0 0 0 1px #d9d2c5, 0 30px 60px -40px rgba(21, 20, 18, 0.35);
	--DIVIDER: #d9d2c5;
	--DIVIDER--LIGHT: #e4ded3;
	--DIVIDER--LIGHTEN: #ece7dd;

	--c-ps-btn-action-color: #faf8f3;
	--c-ps-btn-action-color-hover: #faf8f3;
	--c-ps-postbox-type-bg: #f2eee6;
	--c-ps-navbar-bg: #faf8f3;
	--c-ps-navbar-font-size: 15px;
	--c-ps-post-font-size: 16px;
}

/* 2. Page frame: PeepSo pages use the normal page template ------------- */

/* PeepSo already provides its own navigation and headings, so the big
   page title is shrunk to a quiet section label on community pages. */
body.peepso .cg-page-head,
body:has(#peepso-wrap) .cg-page-head {
	padding-top: clamp(1.5rem, 4vw, 2.5rem);
	padding-bottom: 1rem;
	margin-bottom: 1.5rem !important;
	border-bottom-width: 1px;
}

body.peepso .cg-page-title,
body:has(#peepso-wrap) .cg-page-title {
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

/* Give the community a comfortable reading width (wider than articles). */
.cg-page-content > #peepso-wrap,
.cg-page-content > .peepso,
.cg-page-content > .ps-page,
.cg-page-content #peepso-wrap {
	max-width: 960px !important;
	margin-inline: auto !important;
}

/* 3. Details ------------------------------------------------------------- */

#peepso-wrap,
.ps-landing,
.pso-member {
	font-family: var(--wp--preset--font-family--display, inherit);
}

#peepso-wrap a:not(.ps-btn):not(.pso-btn) {
	text-decoration: none;
}

#peepso-wrap a:focus-visible,
#peepso-wrap button:focus-visible,
#peepso-wrap input:focus-visible,
#peepso-wrap textarea:focus-visible,
#peepso-wrap select:focus-visible {
	outline: 2px solid #9a4e2d;
	outline-offset: 2px;
}

/* Square-ish, calm buttons that match the theme's. */
#peepso-wrap .ps-btn,
#peepso-wrap .pso-btn {
	border-radius: 2px;
	font-weight: 600;
}

/* Post author names and headings in the display face. */
#peepso-wrap .ps-post__author,
#peepso-wrap .ps-focus__name,
#peepso-wrap .pso-member-name__link {
	font-weight: 700;
	letter-spacing: -0.01em;
}

/* Landing / login / registration boxes. */
.ps-landing,
.ps-register,
.ps-login {
	border-radius: 3px;
}

/* Login banner: documentary tone + a calm dark overlay for legible text. */
.ps-landing__cover {
	filter: grayscale(1) sepia(0.18) contrast(1.05);
	background-position: center 60% !important;
}

.ps-landing__cover-inner {
	background: linear-gradient(to top, rgba(21, 20, 18, 0.78), rgba(21, 20, 18, 0.15) 70%) !important;
}

.ps-landing__title {
	font-weight: 800;
	letter-spacing: -0.02em;
	font-variation-settings: "wdth" 108;
}

.ps-landing__action .ps-btn,
.ps-landing .ps-btn--join {
	background: #faf8f3 !important;
	color: #151412 !important;
	border: 0 !important;
}

/* Photos posted by members keep their colours — only theme imagery is toned. */
