/*
Theme Name: CockatooMind Shell
Theme URI: https://cockatoomind.com
Author: CockatooMind
Author URI: https://cockatoomind.com
Description: The deliberately bare frame around a CockatooMind workspace. It renders the plugin's pages full-bleed - no menus, widgets, sidebars, comments or post navigation - and carries the tenant's own brand colour and logo instead of any identity of its own.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sydtech
Tags: one-column, full-width-template, accessibility-ready, translation-ready
*/

/* -----------------------------------------------------------------------------
 * HOW THIS STYLESHEET BEHAVES AROUND THE PLUGIN
 *
 * Every rule the shell puts on a *shared* element (h1, p, input, a...) is
 * wrapped in :where(), which forces its specificity to zero. The WD Quote
 * plugin's own CSS - whatever selector it uses, however weak - therefore always
 * wins on its own surfaces, and the shell only decides what an element looks
 * like when nobody else has an opinion. Rules on .sydtech-* classes are the
 * shell's own components and are written normally.
 *
 * Colour comes in through custom properties that functions.php overrides
 * per tenant. The values below are the fallbacks for a tenant who has not set
 * a brand colour; the default accent is the plugin workspace's own primary so
 * an unbranded install still reads as one product.
 * -------------------------------------------------------------------------- */

:root {
	color-scheme: light dark;

	/* All five are overwritten per tenant by the inline block functions.php
	   prints; these are hand-picked values that pass the same checks, for the
	   moment before that block exists (a cached page, an inactive plugin). */
	--sydtech-accent: #0d8ac6;        /* raw brand colour: tints, borders      */
	--sydtech-accent-solid: #0a6a99;  /* a fill white text clears 4.5:1 on     */
	--sydtech-on-accent: #ffffff;     /* the ink for that fill                 */
	--sydtech-link: #0a6a99;          /* 5.4:1 on the light canvas             */
	/* Published, not consumed here: the tenant's mark, for the console pages
	   and anything else that wants it. The 404 card uses a real <img> instead,
	   because a background image has no alt text. */
	--sydtech-brand-logo: none;

	--sydtech-canvas: #f5f7fa;
	--sydtech-surface: #ffffff;
	--sydtech-ink: #111827;
	--sydtech-ink-2: #4b5563;         /* 6.8:1 on canvas                       */
	--sydtech-line: #e4e7ec;

	--sydtech-radius: 12px;
	--sydtech-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	--sydtech-measure: 62ch;
	--sydtech-tap: 44px;
	--sydtech-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--sydtech-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
	:root {
		--sydtech-accent-solid: #63bbe6;
		--sydtech-on-accent: #0f172a;
		--sydtech-link: #63bbe6;      /* 8.6:1 on the dark canvas              */

		--sydtech-canvas: #0e1420;    /* mirrored in functions.php - keep in sync */
		--sydtech-surface: #161d2b;
		--sydtech-ink: #e7eaf0;
		--sydtech-ink-2: #a3adbe;
		--sydtech-line: #2a3446;
		--sydtech-shadow: 0 10px 30px rgba(0, 0, 0, .45);
	}
}

/* ------------------------------------------------------------------ base --- */

/* The plugin sets border-box per element wherever it depends on it and has
   always run under host themes that set it globally, so this matches what its
   CSS was written against. Specificity 0 - any plugin rule still wins. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

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

/* No display:flex on <body>: the plugin and its dialogs append their own
   children here, and turning the body into a flex container would silently
   disable margin collapsing underneath them. A short page simply ends where
   its content ends - there is no chrome to hold up. */
body {
	margin: 0;
	background: var(--sydtech-canvas);
	color: var(--sydtech-ink);
	font-family: var(--sydtech-font);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

/* Only <img>. <svg> and <canvas> are deliberately left alone: the schedule
   drawings and the 3D viewer size themselves and a blanket height:auto
   collapses them. */
:where(img) {
	max-width: 100%;
	height: auto;
}

:where(a) {
	color: var(--sydtech-link);
}

:where(h1, h2, h3, h4, h5, h6) {
	margin: 0 0 .5em;
	line-height: 1.25;
	font-weight: 650;
	text-wrap: balance;
}

:where(h1) {
	font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.05rem);
}

:where(p, ul, ol, dl, blockquote, pre, figure, table) {
	margin: 0 0 1rem;
}

:where(code, kbd, samp, pre) {
	font-family: var(--sydtech-font-mono);
	font-size: .92em;
}

:where(hr) {
	height: 0;
	margin: 2rem 0;
	border: 0;
	border-top: 1px solid var(--sydtech-line);
}

/* font:inherit alone - not colour. Inheriting the shell's ink would put light
   dark-mode text inside the plugin's white inputs. The 16px it carries is also
   what stops iOS zooming on focus. */
:where(input, select, textarea, button) {
	font: inherit;
}

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

/* ------------------------------------------------- the shell's own parts --- */

/* Rendered by index.php only. The plugin's public quote wrapper opens its own
   <main id="wdq-quote-main"> after get_header(), so header.php must not, and
   there is no chrome on that page to skip past either. */
.sydtech-skip {
	position: absolute;
	top: 0;
	left: -9999px;
	z-index: 100000;
	padding: 10px 18px;
	border-radius: 0 0 var(--sydtech-radius) 0;
	background: var(--sydtech-accent-solid);
	color: var(--sydtech-on-accent);
	font-weight: 600;
	text-decoration: none;
}

.sydtech-skip:focus {
	left: 0;
}

.sydtech-footer {
	padding: 28px 16px 36px;
	text-align: center;
}

.sydtech-poweredby {
	margin: 0;
	color: var(--sydtech-ink-2);
	font-size: 12px;
	letter-spacing: .02em;
}

/* The 404 card, and anything else the shell itself has to render. */
.sydtech-panel {
	max-width: var(--sydtech-measure);
	margin: 12vh auto 6vh;
	padding: 36px clamp(20px, 5vw, 44px);
	border: 1px solid var(--sydtech-line);
	border-radius: var(--sydtech-radius);
	background: var(--sydtech-surface);
	box-shadow: var(--sydtech-shadow);
	text-align: center;
}

.sydtech-panel__logo {
	display: block;
	max-height: 56px;
	width: auto;
	margin: 0 auto 22px;
}

.sydtech-panel__eyebrow {
	display: block;
	margin: 0 0 10px;
	color: var(--sydtech-ink-2);
	font: 600 12px/1 var(--sydtech-font-mono);
	letter-spacing: .16em;
	text-transform: uppercase;
}

.sydtech-panel__title {
	margin: 0 0 10px;
	font-size: 1.5rem;
}

.sydtech-panel__body {
	margin: 0 0 24px;
	color: var(--sydtech-ink-2);
}

.sydtech-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--sydtech-tap);
	padding: 0 24px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: var(--sydtech-accent-solid);
	color: var(--sydtech-on-accent);
	font-weight: 600;
	text-decoration: none;
}

.sydtech-button:hover,
.sydtech-button:focus {
	filter: brightness(.93);
	color: var(--sydtech-on-accent);
}

/* --------------------------------------------------- plugin-surface guard --- */

/* The plugin's surfaces are light-only by design - every card inside them
   paints its own white ground. Under a dark shell they would inherit light ink
   onto white, so re-assert dark ink (and a light form-control scheme) at their
   roots. Zero specificity, so the plugin overrides it the moment it grows a
   dark theme of its own.

   The first four roots exist today. .wdq-console is the console's expected
   root class (07 §2) and is listed ahead of it: if WDQ_Console names its
   wrapper something else, add that name here or the console reads light-on-
   white in dark mode. */
@media (prefers-color-scheme: dark) {
	:where(.wdq-workspace,
		.wdq-workspace-unlocked,
		.wdq-workspace-locked,
		.wdq-public-page-wrapper,
		.sheet,
		.wdq-console) {
		color: #111827;
		color-scheme: light;
	}
}

/* ----------------------------------------------------- media & behaviour --- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
}

/* A printed quote carries the tenant's identity, never the platform's - and
   never the dark palette. */
@media print {
	:root {
		color-scheme: light;
	}

	body {
		background: #fff;
		color: #000;
	}

	.sydtech-skip,
	.sydtech-footer {
		display: none !important;
	}
}
