/*
Theme Name: SSP Piste
Description: Lightweight theme for Snowsport Professionals. Piste-map colours, self-hosted Barlow, no page builder.
Version: 1.0.0
Author: Snowsport Professionals
Requires PHP: 8.0
Text Domain: ssp
*/

/* ---------- Fonts (self-hosted, no Google requests) ---------- */
@font-face { font-family: "Barlow"; src: url(fonts/barlow-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/barlow-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(fonts/barlow-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/barlow-condensed-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(fonts/barlow-condensed-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--bg: #f6f9fb;          /* packed snow */
	--surface: #ffffff;
	--tint: #e9f4fa;        /* shaded snow, tinted with the logo blue */
	--ink: #003058;         /* logo navy */
	--muted: #4f6478;
	--line: #cfdfea;
	--navy: #003058;        /* logo navy: buttons, sign text */
	--navy-ink: #ffffff;
	--sky: #5bbde9;         /* logo sky blue: accents, handbook sign */
	--sky-ink: #003058;
	--blue: #0b6ea6;        /* logo blue, darkened for readable links */
	--blue-ink: #ffffff;
	--red: #c62f3a;         /* red piste */
	--red-ink: #ffffff;
	--black: #003058;       /* black piste */
	--focus: #f0a400;       /* piste-marker amber */
	--radius: 6px;
	--wrap: 72rem;
	--font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, system-ui, sans-serif;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #06182b;
		--surface: #0c2238;
		--tint: #091d31;
		--ink: #e6f0f7;
		--muted: #9db2c6;
		--line: #1d3a56;
		--navy: #5bbde9;
		--navy-ink: #002540;
		--sky: #5bbde9;
		--sky-ink: #002540;
		--blue: #6fc6ee;
		--blue-ink: #0b1420;
		--red: #f0727a;
		--red-ink: #1a0b0d;
		--black: #e6f0f7;
		color-scheme: dark;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1.0625rem/1.6 var(--font);
	-webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 {
	font-family: var(--display);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.005em;
	text-wrap: balance;
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 1.3rem + 1vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Piste markers: red = problem, blue = exercise, black = article */
.marker { display: inline-block; width: 0.7em; height: 0.7em; border-radius: 50%; vertical-align: 0.05em; flex: none; }
.marker--blue { background: var(--blue); }
.marker--red { background: var(--red); }
.marker--black { background: var(--black); border-radius: 1px; transform: rotate(45deg) scale(0.85); }

.eyebrow {
	font-family: var(--display);
	font-weight: 600;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--muted);
	margin-bottom: 0.6rem;
	display: flex; align-items: center; gap: 0.5rem;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--blue); }

/* ---------- Buttons ---------- */
.button, button[type="submit"], input[type="submit"], .um .um-button {
	display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
	font: 600 1.05rem/1 var(--display);
	text-transform: uppercase; letter-spacing: 0.06em;
	padding: 0.85rem 1.3rem;
	border-radius: var(--radius);
	border: 2px solid var(--navy);
	background: var(--navy); color: var(--navy-ink);
	text-decoration: none; cursor: pointer;
}
.button:hover, button[type="submit"]:hover, input[type="submit"]:hover { filter: brightness(1.08); }
.button--red { background: var(--red); border-color: var(--red); color: var(--red-ink); }
.button--ghost { background: transparent; color: var(--navy); }
.text-link { font-weight: 600; }

/* ---------- Header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand__logo { width: 2.9rem; height: 2.9rem; display: block; }
.brand__name { font: 700 1.35rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.brand__name span { color: var(--muted); font-weight: 600; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

.nav-toggle > summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; font: 600 1rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 1.2rem; height: 2px; background: currentColor; position: relative; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.primary-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.5rem 1.25rem 1rem; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 0.7rem 0; font: 600 1.2rem/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.primary-nav li:last-child a { border-bottom: 0; }
.primary-nav a:hover, .primary-nav .current-menu-item a { color: var(--blue); }

@media (min-width: 60rem) {
	.nav-toggle > summary { display: none; }
	.nav-toggle { display: block; }
	.nav-toggle:not([open]) > .primary-nav { display: block; }
	.primary-nav { position: static; padding: 0; border: 0; background: none; }
	.primary-nav ul { display: flex; gap: 1.6rem; }
	.primary-nav a { border: 0; padding: 0.4rem 0; font-size: 1.05rem; }
}

.account { position: relative; }
.account__button { display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; font: 600 0.95rem/1 var(--font); color: var(--ink); }
.account__button:hover { border-color: var(--blue); }
.account__button svg { width: 1.15rem; height: 1.15rem; }
.account__avatar { width: 1.6rem; height: 1.6rem; border-radius: 50%; }
.account__panel { position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / 0.12); padding: 0.4rem; }
.account__list { list-style: none; margin: 0; padding: 0; }
.account__list a { display: block; padding: 0.55rem 0.75rem; border-radius: 4px; color: var(--ink); text-decoration: none; }
.account__list a:hover { background: var(--tint); color: var(--blue); }
@media (max-width: 30rem) { .account__label { display: none; } .brand__name span { display: none; } }

/* ---------- Intro ---------- */
.intro { background: var(--surface); padding-block: clamp(2rem, 5vw, 4rem); }
.intro__inner { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 60rem) { .intro__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 36rem); gap: 3.5rem; } }
.intro__title { font-size: clamp(2.3rem, 1.5rem + 3.4vw, 4rem); text-transform: uppercase; letter-spacing: 0.01em; max-width: 14ch; margin-bottom: 0.4em; }
.intro__lede { font-size: 1.2rem; color: var(--muted); max-width: 44ch; }
.intro__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.intro__photo { margin: 0; }
.intro__photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.intro__photo figcaption { margin-top: 0.4rem; font-size: 0.85rem; color: var(--muted); text-align: right; }

/* ---------- Hero (handbook search) ---------- */
.hero { background: var(--tint); border-block: 1px solid var(--line); scroll-margin-top: 1rem; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero__inner { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 60rem) { .hero__inner { grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; } }
.hero__title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); text-transform: uppercase; letter-spacing: 0.01em; max-width: 14ch; margin-bottom: 0.4em; }
.hero__lede { font-size: 1.2rem; color: var(--muted); max-width: 40ch; }

.hero-search { display: grid; gap: 0.75rem; margin-top: 1.75rem; max-width: 46rem; }
@media (min-width: 44rem) { .hero-search { grid-template-columns: 1.2fr 1fr auto; align-items: end; } }
.hero-search__field { display: grid; gap: 0.3rem; }
.hero-search label { font: 600 0.9rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
select, input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="password"], textarea {
	font: inherit; color: var(--ink); background: var(--bg);
	border: 1.5px solid var(--line); border-radius: var(--radius);
	padding: 0.7rem 0.8rem; width: 100%; max-width: 100%;
}
select:focus, input:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
.hero-search .button { height: 3.05rem; }

.quick-picks { list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quick-picks a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.95rem; color: var(--ink); text-decoration: none; background: var(--bg); }
.quick-picks a::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--red); }
.quick-picks a:hover { border-color: var(--red); color: var(--red); }

/* Piste sign: the handbook at a glance, styled like a resort trail sign */
.piste-sign { background: var(--sky); color: var(--sky-ink); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.piste-sign__head { font: 700 1.3rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 2px solid currentColor; padding-bottom: 0.7rem; margin-bottom: 0.4rem; }
.piste-sign dl { margin: 0; }
.piste-sign dl div { display: flex; justify-content: space-between; align-items: baseline; padding: 0.45rem 0; border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.piste-sign dt { font-size: 0.95rem; }
.piste-sign dd { margin: 0; font: 700 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.piste-sign__link { display: inline-block; margin-top: 0.9rem; color: inherit; font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--tint { background: var(--tint); border-block: 1px solid var(--line); }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.section__head h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0; }
.section__head a { font-weight: 600; }

.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card:hover { border-color: var(--blue); }
.card__link { color: var(--ink); text-decoration: none; display: flex; flex-direction: column; gap: 0.75rem; }
.card__img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; }
.card__title { font: 700 1.4rem/1.1 var(--display); display: flex; align-items: center; gap: 0.5rem; }
.card__link:hover .card__title { color: var(--blue); }
.card__meta { margin: 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.card__text { margin: 0; color: var(--muted); font-size: 0.98rem; }
.tags { list-style: none; margin: auto 0 0; padding: 0.3rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { font-size: 0.82rem; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); }
.tag--red { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); }

.split { display: grid; gap: 2rem; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; } }
.split__main p { max-width: 58ch; }
.bodies { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bodies li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem 0.8rem; display: flex; gap: 0.45rem; align-items: baseline; }
.bodies strong { font: 700 1.1rem/1 var(--display); letter-spacing: 0.03em; }
.bodies span { color: var(--muted); font-size: 0.9rem; }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; }
.callout h2 { font-size: 1.6rem; }

.article-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 56rem) { .article-list:not(.article-list--full) { grid-template-columns: repeat(3, 1fr); gap: 2rem; border-top: 0; } .article-list:not(.article-list--full) .article-row { border-top: 3px solid var(--black); border-bottom: 0; } }
.article-row { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.article-row__link { color: var(--ink); text-decoration: none; }
.article-row__title { font: 700 1.4rem/1.15 var(--display); }
.article-row__link:hover .article-row__title { color: var(--blue); }
.article-row__meta { margin: 0.3rem 0 0.4rem; color: var(--muted); font-size: 0.88rem; }
.article-row__text { margin: 0; color: var(--muted); max-width: 70ch; }

.join { background: var(--ink); color: var(--bg); }
.join__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; }
.join h2 { margin-bottom: 0.3rem; }
.join p { margin: 0; opacity: 0.85; }
.join__actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.join .button { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.join .text-link { color: var(--bg); }

/* ---------- Pages & articles ---------- */
.page-head { padding-block: clamp(2rem, 5vw, 3.25rem) 1.25rem; }
.page-head h1 { max-width: 22ch; }
.page-head__lede { color: var(--muted); font-size: 1.15rem; max-width: 55ch; }
.prose { max-width: calc(44rem + 2.5rem); padding-bottom: 4rem; }
.entry--wide .wrap:last-child { padding-bottom: 4rem; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: 4px; }
.prose blockquote { margin: 1.5em 0; padding-left: 1.2rem; border-left: 3px solid var(--blue); color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.35em; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; }
.entry__media img { display: block; width: 100%; max-height: 32rem; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; }
.wp-block-image, figure { margin: 1.5em 0; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }
.post-password-form input[type="password"] { max-width: 20rem; margin-block: 0.5rem; }

.pagination, .nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 2rem 0 4rem; }
.page-numbers { padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.page-numbers.current { background: var(--navy); color: var(--navy-ink); border-color: var(--navy); }

.search-form { display: flex; gap: 0.5rem; max-width: 30rem; margin-top: 1.5rem; }

.comments { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { margin-bottom: 1.5rem; }
.comment-meta { font-size: 0.9rem; color: var(--muted); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 0.4rem; }

/* ---------- Exercise Handbook plugin (inherit theme) ---------- */
.ssp-handbook, .ssp-ex-form { --ssp-accent: var(--blue); --ssp-border: var(--line); --ssp-muted: var(--muted); --ssp-chip: var(--tint); --ssp-error: var(--red); }
.ssp-handbook { padding-bottom: 4rem; }
.ssp-hb-filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.ssp-hb-group summary { font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ssp-hb-card { background: var(--surface); border-color: var(--line) !important; }
.ssp-hb-card:hover { border-color: var(--blue) !important; }
.ssp-hb-title { font-family: var(--display); font-size: 1.4rem !important; color: var(--ink); }
.ssp-hb-card > a:hover .ssp-hb-title { color: var(--blue); }
.ssp-hb-symptoms { color: var(--red); font-size: 0.92rem; }
.ssp-ex-terms, .ssp-ex-details { margin-bottom: 1.5rem; }
.ssp-ex-terms p { margin: 0 0 0.3rem; }
.ssp-ex-details h3 { font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue); margin-top: 1.4em; }
.ssp-ex-back { margin-top: 2.5rem; font-weight: 600; }

/* ---------- Ultimate Member tweaks ---------- */
.um { font-family: var(--font) !important; }
.um input[type="submit"].um-button, .um a.um-button { background: var(--navy) !important; }
.um a.um-button.um-alt, .um input[type="submit"].um-button.um-alt { background: var(--tint) !important; color: var(--ink) !important; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 3rem; font-size: 0.97rem; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.site-footer__name { font: 700 1.3rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.site-footer__about p:last-child { color: var(--muted); max-width: 32ch; }
.site-footer__heading { font: 600 0.95rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--blue); text-decoration: underline; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-block: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.88rem; }
.site-footer__legal p { margin: 0; }
.piste-key { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.piste-key span { display: inline-flex; align-items: center; gap: 0.4rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
