/* Greenpeg Wellness — theme styles */

/* ---------- Fonts (self-hosted) ---------- */
@font-face { font-family: "Montech"; src: url("../fonts/montech-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montech"; src: url("../fonts/montech-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Robout"; src: url("../fonts/robout-light.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Robout"; src: url("../fonts/robout-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Robout"; src: url("../fonts/robout-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Robout"; src: url("../fonts/robout-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--gww-green: #2AC940;
	--gww-green-bright: #34F74E;
	--gww-teal: #2AC9AC;
	--gww-forest: #354837;
	--gww-ink: #28332A;
	--gww-sun: #F4E139;
	--gww-mint: #C4FFD0;
	--gww-grey: #B7B7B7;
	--gww-slate: #495057;

	--gww-bg: #F5F8F3;
	--gww-surface: #FFFFFF;
	--gww-border: #DCE3DA;
	--gww-focus: 0 0 0 3px rgba(42, 201, 64, .45);
	--gww-radius: 14px;
	--gww-shadow: 0 1px 2px rgba(40, 51, 42, .06), 0 8px 24px -12px rgba(40, 51, 42, .25);
	--gww-hero-overlay: .65;

	--gww-note-0: #C4FFD0;
	--gww-note-1: #FAF0A0;
	--gww-note-2: #BDEFE5;
	--gww-note-3: #A8EDB3;
	--gww-note-4: #FFFFFF;

	--gww-font: "Robout", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--gww-display: "Montech", "Robout", system-ui, sans-serif;
}

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

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

body {
	margin: 0;
	font-family: var(--gww-font);
	font-weight: 400;
	color: var(--gww-ink);
	background: var(--gww-bg);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

.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;
}

.gww-skip {
	position: absolute; left: 16px; top: -100px; z-index: 1000;
	padding: 10px 16px; border-radius: 8px; background: var(--gww-sun); color: var(--gww-ink);
	font-weight: 600; text-decoration: none;
}
.gww-skip:focus { top: 16px; }

.gww {
	background:
		radial-gradient(circle at 1px 1px, rgba(53, 72, 55, .09) 1px, transparent 0) 0 0 / 22px 22px,
		var(--gww-bg);
	min-height: 100vh;
}

/* ---------- Hero ---------- */
.gww-hero {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	background: var(--gww-ink);
	color: #fff;
	padding: clamp(40px, 7vw, 88px) 16px clamp(64px, 9vw, 112px);
}
.gww-hero::after { /* soft brand glow when there's no image */
	content: "";
	position: absolute; right: -10%; bottom: -60%; z-index: -1;
	width: 520px; height: 520px; border-radius: 50%;
	background: radial-gradient(circle, rgba(42, 201, 64, .35), transparent 65%);
	pointer-events: none;
}
.gww-hero.has-image::after { display: none; }
.gww-hero__img {
	position: absolute; inset: 0; z-index: -2;
	width: 100%; height: 100%; object-fit: cover; object-position: center;
}
.gww-hero.has-image::before { /* overlay keeps the headline readable on any photo */
	content: "";
	position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(100deg,
		rgba(40, 51, 42, calc(var(--gww-hero-overlay) + .15)) 0%,
		rgba(40, 51, 42, var(--gww-hero-overlay)) 45%,
		rgba(40, 51, 42, calc(var(--gww-hero-overlay) - .2)) 100%);
}

.gww-hero__inner { max-width: 1320px; margin: 0 auto; }
.gww-hero__logo { margin-bottom: 28px; }
.gww-hero__logo img { display: block; height: 40px; width: auto; }
.gww-hero__eyebrow {
	margin: 0 0 14px; font-family: var(--gww-font); font-size: 13px; font-weight: 700;
	letter-spacing: .14em; text-transform: uppercase; color: var(--gww-green-bright);
}
.gww-hero__title {
	font-family: var(--gww-display); font-weight: 700;
	font-size: clamp(38px, 6.2vw, 72px); line-height: 1.02; letter-spacing: -.01em;
	margin: 0 0 18px; max-width: 13ch; color: #fff;
}
.gww-hero__subtitle {
	margin: 0 0 26px; font-size: clamp(16px, 2vw, 19px); font-weight: 300;
	max-width: 52ch; color: #E3ECE4;
}
.gww-hero__stat {
	display: inline-flex; gap: 6px; align-items: baseline; margin: 0;
	padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .16); font-size: 14px; color: #E3ECE4;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.gww-hero__stat [data-gww-count] { font-weight: 700; color: var(--gww-mint); font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.gww-main {
	max-width: 1320px; margin: -48px auto 0; padding: 0 16px 56px;
	display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr);
	position: relative; z-index: 2;
}
@media (min-width: 1060px) {
	.gww-main { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
	.gww-composer { position: sticky; top: 24px; }
}

/* ---------- Composer ---------- */
.gww-composer {
	background: var(--gww-surface); border-radius: var(--gww-radius);
	box-shadow: var(--gww-shadow); border: 1px solid var(--gww-border);
	padding: 24px;
}
.gww-composer__title { font-family: var(--gww-display); font-weight: 700; font-size: 24px; margin: 0 0 18px; }

.gww-field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.gww-field label, .gww-field legend { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.gww-optional { font-weight: 400; color: var(--gww-slate); }
.gww input[type="text"], .gww input[type="search"], .gww input[type="password"], .gww textarea {
	width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
	color: var(--gww-ink); background: #FBFCFA;
	border: 1px solid var(--gww-border); border-radius: 10px; padding: 11px 13px;
	transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.gww textarea { resize: vertical; min-height: 112px; }
.gww input::placeholder, .gww textarea::placeholder { color: #7D857F; }
.gww input:focus, .gww textarea:focus { outline: none; border-color: var(--gww-green); box-shadow: var(--gww-focus); }
.gww [aria-invalid="true"] { border-color: #C0392B !important; }

.gww-counter { margin: 6px 0 0; font-size: 12px; text-align: right; color: var(--gww-slate); font-variant-numeric: tabular-nums; }
.gww-counter.is-near { color: #9A6B00; }
.gww-counter.is-over { color: #C0392B; font-weight: 600; }

.gww-swatches__list { display: flex; gap: 10px; }
.gww-swatch {
	position: relative; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
	border: 1px solid rgba(40, 51, 42, .2); background: var(--gww-note-bg); transition: transform .15s;
}
.gww-swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.gww-swatch:hover { transform: scale(1.08); }
.gww-swatch:has(input:checked) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gww-ink); }
.gww-swatch:has(input:focus-visible) { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gww-green); }

.gww-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.gww-form__error {
	margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; font-size: 14px;
	background: #FDECEA; color: #8E2A1F; border: 1px solid #F5C6C0;
}

/* ---------- Buttons ---------- */
.gww-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
	font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
	transition: background-color .15s, transform .1s, opacity .15s;
}
.gww-btn:focus-visible { outline: none; box-shadow: var(--gww-focus); }
.gww-btn:active { transform: translateY(1px); }
.gww-btn[disabled] { opacity: .6; cursor: progress; }
/* Ink text on brand green: white on #2AC940 fails WCAG contrast. */
.gww-btn--primary { width: 100%; background: var(--gww-green); color: var(--gww-ink); }
.gww-btn--primary:hover { background: var(--gww-green-bright); }
.gww-btn--ghost { background: transparent; color: var(--gww-ink); border: 1px solid var(--gww-border); }
.gww-btn--ghost:hover { background: #EEF3EC; }

.gww-link {
	background: none; border: 0; padding: 0; font: inherit; color: var(--gww-forest);
	text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.gww-link:focus-visible { outline: none; box-shadow: var(--gww-focus); border-radius: 4px; }

/* ---------- Board ---------- */
.gww-board { min-width: 0; }
@media (min-width: 1060px) { .gww-board { padding-top: 64px; } }
.gww-board__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.gww-board__title { font-family: var(--gww-display); font-weight: 700; font-size: 28px; margin: 0; }
.gww-search { flex: 1 1 200px; max-width: 300px; }
.gww .gww-search input { background: var(--gww-surface); border-radius: 999px; padding-left: 16px; }

/* The notice board itself: green felt in a dark frame. */
.gww-corkboard {
	position: relative;
	min-height: 360px;
	padding: 34px 24px 28px;
	border-radius: 18px;
	border: 10px solid var(--gww-ink);
	background:
		radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .06), transparent 40%),
		repeating-radial-gradient(circle at 30% 40%, rgba(0, 0, 0, .025) 0 1px, transparent 1px 3px),
		repeating-radial-gradient(circle at 70% 70%, rgba(255, 255, 255, .02) 0 1px, transparent 1px 4px),
		var(--gww-forest);
	box-shadow:
		inset 0 2px 10px rgba(0, 0, 0, .35),
		inset 0 0 0 1px rgba(255, 255, 255, .05),
		0 18px 40px -24px rgba(40, 51, 42, .6);
}
@media (max-width: 559px) {
	.gww-corkboard { padding: 26px 14px 18px 14px; border-width: 8px; }
}

.gww-notes { position: relative; min-height: 120px; }

.gww-threads {
	position: absolute; inset: 0; width: 100%; height: 100%;
	z-index: 2; pointer-events: none; overflow: visible;
}
.gww-threads--under { z-index: 0; }
.gww-thread { fill: none; stroke: var(--gww-sun); stroke-width: 2; stroke-linecap: round; }
.gww-thread--shadow { stroke: rgba(0, 0, 0, .35); stroke-width: 2.5; transform: translate(1px, 2px); }
.gww-thread.is-drawing { animation: gww-draw .7s ease-out both; }
.gww-pin-shadow { fill: rgba(0, 0, 0, .35); }
@keyframes gww-draw { to { stroke-dashoffset: 0; } }

.gww-note {
	--gww-tilt: 0deg;
	--gww-origin: 50% 14px;
	position: absolute; top: 0; left: 0; z-index: 1;
	padding: 30px 18px 16px;
	border-radius: 3px 3px 12px 3px;
	background: var(--gww-note-bg); color: var(--gww-ink);
	box-shadow: 0 1px 1px rgba(0, 0, 0, .15), 0 12px 20px -12px rgba(0, 0, 0, .55);
	transform: rotate(var(--gww-tilt));
	transform-origin: var(--gww-origin); /* rotate around the pin so the thread stays attached */
	transition: box-shadow .2s ease;
}
.gww-note:hover { box-shadow: 0 2px 3px rgba(0, 0, 0, .15), 0 20px 28px -14px rgba(0, 0, 0, .6); }
.gww-c0 { --gww-note-bg: var(--gww-note-0); }
.gww-c1 { --gww-note-bg: var(--gww-note-1); }
.gww-c2 { --gww-note-bg: var(--gww-note-2); }
.gww-c3 { --gww-note-bg: var(--gww-note-3); }
.gww-c4 { --gww-note-bg: var(--gww-note-4); }

.gww-note__to { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--gww-forest); overflow-wrap: anywhere; }
.gww-note__msg { margin: 0 0 14px; font-size: 16px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.gww-note__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--gww-slate); }
.gww-note__from { font-weight: 600; color: var(--gww-forest); overflow-wrap: anywhere; }
.gww-note__time { white-space: nowrap; }

.gww-note.is-new { animation: gww-pin .55s cubic-bezier(.2, .9, .3, 1.3) both; }
.gww-note.is-mine { outline: 3px solid var(--gww-green-bright); outline-offset: 3px; }
.gww-note.is-leaving { opacity: 0; transition: opacity .25s; }
@keyframes gww-pin {
	from { opacity: 0; transform: translateY(-18px) scale(.95) rotate(var(--gww-tilt)); }
	to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--gww-tilt)); }
}

.gww-note__remove {
	position: absolute; top: 6px; right: 6px; display: none;
	min-height: 30px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
	font: inherit; font-size: 13px; font-weight: 600; background: var(--gww-ink); color: #fff;
}
.gww[data-mod="on"] .gww-note__remove { display: inline-flex; align-items: center; }
.gww-note__remove:focus-visible { outline: none; box-shadow: var(--gww-focus); }

/* Loading skeleton */
.gww[data-state="loading"] .gww-notes::before {
	content: ""; display: block; height: 180px; border-radius: 8px;
	background: linear-gradient(90deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.14) 50%, rgba(255,255,255,.06) 100%) 0 0 / 200% 100%;
	animation: gww-shimmer 1.2s linear infinite;
}
@keyframes gww-shimmer { to { background-position: -200% 0; } }

.gww-empty { text-align: center; padding: 48px 20px; color: #DCE7DD; }
.gww-empty p { margin: 0; }
.gww-empty__title { font-family: var(--gww-display); font-weight: 600; font-size: 22px; color: #fff; margin-bottom: 6px !important; }
.gww-load-error { text-align: center; color: #fff; }
.gww-load-error .gww-link { color: var(--gww-sun); }

/* ---------- Footer ---------- */
.gww-footer {
	max-width: 1320px; margin: 0 auto; padding: 24px 16px 40px;
	display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
	border-top: 1px solid var(--gww-border); font-size: 14px; color: var(--gww-slate);
}
.gww-footer p { margin: 0; }
.gww-footer__mod { font-size: 13px; color: var(--gww-slate); }

/* ---------- Dialog ---------- */
.gww-dialog {
	border: 0; border-radius: var(--gww-radius); padding: 0; width: min(420px, calc(100vw - 32px));
	box-shadow: 0 24px 60px -20px rgba(40, 51, 42, .5); color: var(--gww-ink); font-family: var(--gww-font);
}
.gww-dialog::backdrop { background: rgba(40, 51, 42, .55); }
.gww-dialog__form { padding: 24px; }
.gww-dialog h2 { font-family: var(--gww-display); font-weight: 700; margin: 0 0 6px; font-size: 22px; }
.gww-dialog p { margin: 0 0 16px; color: var(--gww-slate); }
.gww-dialog__actions { display: flex; gap: 10px; justify-content: flex-end; }
.gww-dialog__actions .gww-btn--primary { width: auto; }

/* ---------- Toast ---------- */
.gww-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 1000;
	transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
	max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 999px;
	background: var(--gww-ink); color: #fff; font-size: 15px; font-weight: 600;
	box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .4);
	transition: opacity .2s, transform .2s;
}
.gww-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Fallback pages (index.php) ---------- */
.gww-basic__bar { background: var(--gww-ink); padding: 18px 16px; }
.gww-basic__home { color: #fff; text-decoration: none; font-weight: 600; }
.gww-basic__home:hover { color: var(--gww-green-bright); }
.gww-basic__main { max-width: 760px; margin: 0 auto; padding: 48px 16px 80px; }
.gww-basic__main h1 { font-family: var(--gww-display); font-weight: 700; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; }
.gww-basic__content a { color: var(--gww-forest); }

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