/*
Theme Name: Whistle Studio
Theme URI: https://whistlestudio.be
Author: Whistle Studio
Description: The Whistle Studio website: a calm block theme for the studio, its apps (Nestulu, Pontulu, Monulu, Notulu), the blog and help. Works with Polylang and the Whistle Studio plugin.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.2.0
License: Proprietary
Text Domain: whistle-studio
*/

/*
 * The brand (see the brand book): cream and sand pages, ink words, water
 * links, honey for one warm highlight, otters instead of photos. Fonts:
 * Source Serif 4 (headings) and Source Sans 3 (text), served from the theme
 * (assets/fonts, SIL Open Font License).
 */

/* Dark mode, "night water": the same names, darker values. theme.json holds the light ones. */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--page: #141c29;
		--wp--preset--color--band: #19222f;
		--wp--preset--color--card: #1d2838;
		--wp--preset--color--line: #2f3c50;
		--wp--preset--color--ink: #f3ede3;
		--wp--preset--color--quiet: #d8b48a;
		--wp--preset--color--accent: #8fb3d9;
		--wp--preset--color--honey: #e0b566;
		--wp--preset--color--sage: #9bb596;
	}
}

/* The site's own colour on top (functions.php sets --ws-brand per site). */
.ws-brand-bar,
.ws-announce-page {
	border-top: 4px solid var(--ws-brand, var(--wp--preset--color--honey));
}

/* The otters: the site logo, or the theme's own when none is set (functions.php). */
.wp-block-site-logo img {
	height: auto;
}
.ws-otters {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Cards: the app tiles, prices and help results. */
.is-style-card,
.ws-card {
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	padding: var(--wp--preset--spacing--40);
}

/* Each app's own colour, as a band on top of its card. */
.ws-app {
	border-top: 6px solid var(--ws-app, var(--wp--preset--color--accent));
}
.ws-app-nestulu { --ws-app: var(--wp--preset--color--honey); }
.ws-app-pontulu { --ws-app: var(--wp--preset--color--accent); }
.ws-app-monulu { --ws-app: var(--wp--preset--color--sage); }
.ws-app-notulu { --ws-app: var(--wp--preset--color--ink); }
.ws-app-kohoro { --ws-app: #a62b5f; } /* Kohoro's berry: not one of ours (kohoro.css). */

/* Buttons: ink (theme.json); outline in water; "warm" in honey, once per page. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--accent);
	border: 2px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--page);
	border-color: var(--wp--preset--color--accent);
}
.wp-block-button.is-style-warm > .wp-block-button__link {
	background: var(--wp--preset--color--honey);
	color: #22324a;
}
.wp-block-button.is-style-warm > .wp-block-button__link:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--page);
}

/* A small honey label: "New". */
.is-style-badge {
	display: inline-block;
	width: fit-content;
	padding: 0.15rem 0.7rem;
	border-radius: 999px;
	background: var(--wp--preset--color--honey);
	color: #22324a;
	font-size: 0.78rem;
	font-weight: 600;
}

/* Small capitals above a heading: "Nestulu · Help". */
.is-style-eyebrow {
	color: var(--wp--preset--color--quiet);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* A row of prices from the accounts server ([whistle_prices]). */
.ws-prices {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}
.ws-prices .ws-price-amount {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	margin: 0.25em 0;
}
.ws-prices .ws-price-trial,
.ws-quiet {
	color: var(--wp--preset--color--quiet);
	font-size: var(--wp--preset--font-size--small);
}

/* The newsletter form ([whistle_newsletter]). */
.ws-newsletter form {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
}
.ws-newsletter input[type="email"] {
	flex: 1 1 16rem;
	min-height: 2.75rem;
	padding: 0 0.9rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--page);
	color: var(--wp--preset--color--ink);
	font: inherit;
}
.ws-newsletter button {
	min-height: 2.75rem;
	padding: 0 1.25rem;
	border: 0;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--page);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.ws-newsletter button:hover {
	background: var(--wp--preset--color--accent);
}
.ws-newsletter input:focus-visible,
.ws-newsletter button:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}
.ws-newsletter .ws-hp {
	position: absolute;
	left: -10000px;
}
.ws-note {
	margin-top: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--small);
}

/* The site's menus ([whistle_menu]): a row in the header, a column below. */
.ws-menu ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}
.ws-menu a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.ws-menu a:hover,
.ws-menu a:focus-visible {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}
.ws-menu-footer ul {
	flex-direction: column;
	font-weight: 400;
}

/* "Draft: ..." on top of a legal text that still has [[...]] in it. */
.ws-draft-note {
	padding: 0.75rem 1rem;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--honey);
	color: #22324a;
	font-weight: 600;
}

/* Questions and answers on a page (details blocks). */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.75rem 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
}

/* The language switcher ([whistle_languages]). */
.ws-languages {
	display: flex;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
}
.ws-languages .is-current a {
	font-weight: 700;
	text-decoration: none;
}

/* The announcement until the launch (the plugin's announce.php). */
.ws-announce {
	box-sizing: border-box;
	max-width: 1040px;
	margin: 0 auto;
	padding: var(--wp--preset--spacing--40) 1rem var(--wp--preset--spacing--50);
	display: grid;
	gap: var(--wp--preset--spacing--50);
}
.ws-announce-top {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;
}
.ws-announce-name {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}
.ws-announce-by {
	margin-left: 0.4rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	color: var(--wp--preset--color--quiet);
}
.ws-announce-apps h3 a {
	color: inherit;
	text-decoration: none;
}
.ws-announce-apps h3 a:hover {
	color: var(--wp--preset--color--accent);
}
.ws-announce-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--50);
	align-items: center;
	background: var(--wp--preset--color--band);
	border-radius: var(--wp--custom--radius-large);
	padding: clamp(1.5rem, 5vw, 3.5rem);
}
.ws-announce-words {
	display: grid;
	gap: 1rem;
	justify-items: start;
}
.ws-announce-words h1,
.ws-announce-words p {
	margin: 0;
}
.ws-announce-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}
.ws-announce-otters {
	justify-self: center;
	width: min(100%, 320px);
}
.ws-announce-signup {
	display: grid;
	gap: 0.75rem;
	max-width: 720px;
	width: 100%;
	box-sizing: border-box;
	justify-self: center;
}
.ws-announce-signup h2,
.ws-announce-apps h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
}
.ws-announce-signup .ws-quiet {
	margin-top: 0;
}
.ws-announce-apps {
	display: grid;
	gap: var(--wp--preset--spacing--30);
}
.ws-announce-apps ul {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
}
.ws-announce-apps h3 {
	margin: 0 0 0.35rem;
}
.ws-announce-apps p {
	margin: 0;
}
.ws-announce-apps li {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.ws-announce-apps h3 {
	margin-bottom: 0;
}
.ws-app-launch {
	color: var(--wp--preset--color--quiet);
	font-size: var(--wp--preset--font-size--small);
}
/* At the foot of the card, so the links line up across a row. */
.ws-announce-apps .ws-app-visit {
	margin-top: auto;
	padding-top: 0.25rem;
}
.ws-app-visit a {
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	text-decoration-color: var(--ws-app, var(--wp--preset--color--accent));
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}
.ws-app-visit a::after {
	content: " \2192";
}
.ws-app-visit a:hover {
	color: var(--wp--preset--color--accent);
}
.ws-announce-footer {
	color: var(--wp--preset--color--quiet);
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}
.ws-announce-footer p {
	margin: 0.25rem 0;
}
@media (max-width: 720px) {
	.ws-announce-hero {
		grid-template-columns: 1fr;
	}
	.ws-announce-otters {
		grid-row: 1;
		width: min(60%, 220px);
	}
}

/* Help (/help/...), read from the accounts server. */
.ws-help-list {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
}
.ws-help-article img {
	max-width: 100%;
	height: auto;
	border-radius: var(--wp--custom--radius);
}
.ws-help-article pre {
	overflow-x: auto;
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--band);
	border-radius: var(--wp--custom--radius);
}
.ws-help-article table {
	border-collapse: collapse;
}
.ws-help-article th,
.ws-help-article td {
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--wp--preset--color--line);
}
