/*
Theme Name: SSN Dawn
Theme URI: https://ssnmentalhealth.co.uk
Author: South Staffordshire Network for Mental Health
Description: Custom theme for SSN Mental Health. Sunrise palette, accordion guidance on the homepage and the office stress review.
Version: 1.0.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: ssn-dawn
*/

:root {
	--dawn: #F7F5FB;
	--lilac: #E4DEF5;
	--lilac-deep: #C7BDE6;
	--sky: #CFE3F5;
	--sky-deep: #9CC7EA;
	--blush: #F8D9D6;
	--peach: #FFDCC2;
	--sun-soft: #F7C873;
	--sun: #F2A33A;
	--rose: #E07A82;
	--ink: #2A2850;
	--ink-2: #56547A;
	--line: #DCD6EC;
	--white: #FFFFFF;

	--serif: "Young Serif", Georgia, "Times New Roman", serif;
	--sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.25rem;
	--step-2: 1.5rem;
	--step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
	--step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.25rem);
	--step-5: clamp(2.6rem, 1.7rem + 3.8vw, 4.25rem);

	--wrap: 72rem;
	--narrow: 46rem;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
	margin: 0;
	background: var(--dawn);
	color: var(--ink);
	font-family: var(--sans);
	font-size: var(--step-0);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
	font-family: var(--serif);
	font-weight: 400;
	line-height: 1.15;
	margin: 0 0 .6em;
	letter-spacing: -0.01em;
	text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1.1em; }

a { color: var(--ink); text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--white); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--narrow) + var(--gutter) * 2); }

/* Buttons and links */
.btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 3rem; padding: .75rem 1.5rem;
	border-radius: 999px; border: 2px solid var(--ink);
	font: 700 var(--step-0)/1.2 var(--sans);
	text-decoration: none; cursor: pointer;
	transition: background-color .2s, color .2s, transform .2s;
}
.btn--primary { background: var(--ink); color: var(--white); }
.btn--primary:hover { background: #3B3870; }
.btn--quiet { background: transparent; color: var(--ink); }
.btn--quiet:hover { background: var(--white); }
.btn:active { transform: translateY(1px); }

.text-link { font-weight: 700; }

/* Header */
.site-header { padding-block: 1.1rem; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--serif); font-size: 1.25rem; }
.brand__full { font-size: .8125rem; color: var(--ink-2); }

.nav__list { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.nav__list a { display: block; padding: .5rem .85rem; border-radius: 999px; text-decoration: none; font-weight: 700; }
.nav__list a:hover, .nav__list .current-menu-item a { background: var(--white); }
.nav-toggle { display: none; }

@media (max-width: 52rem) {
	.brand__full { display: none; }
	.nav-toggle {
		display: inline-flex; min-height: 2.75rem; padding: .5rem 1.1rem; border-radius: 999px;
		border: 2px solid var(--ink); background: transparent; color: var(--ink); font: 700 1rem var(--sans); cursor: pointer;
	}
	.nav { display: none; position: absolute; left: var(--gutter); right: var(--gutter); top: 4.5rem; z-index: 20;
		background: var(--white); border-radius: 1.25rem; padding: .75rem; box-shadow: 0 18px 40px -20px rgba(42, 40, 80, .35); }
	.nav.is-open { display: block; }
	.nav__list { flex-direction: column; }
	.nav__list a { padding: .85rem 1rem; }
	.site-header__inner { position: relative; }
}

/* Hero */
.hero { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 5rem); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero__title { font-size: var(--step-5); line-height: 1.05; max-width: 15ch; margin-bottom: .45em; }
.hero__lede { font-size: var(--step-1); color: var(--ink-2); max-width: 36ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero__art img { width: 100%; max-width: 520px; margin-inline: auto; }
.hero__art { animation: rise 1.4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (max-width: 52rem) {
	.hero__grid { grid-template-columns: 1fr; }
	.hero__art { order: -1; max-width: 250px; margin-inline: auto; }
}

/* Review teaser */
.teaser { background: var(--lilac); padding-block: clamp(2.5rem, 6vw, 4.5rem); border-radius: 2.5rem 2.5rem 0 0; }
.teaser__grid { display: grid; grid-template-columns: minmax(0, 18rem) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.teaser__dial { width: 100%; }
.teaser__dial path { fill: none; stroke-width: 18; stroke-linecap: round; }
.teaser__needle { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; transform-origin: 110px 116px; transform: rotate(-60deg); transition: transform 1.6s cubic-bezier(.3, 1.4, .5, 1); }
.teaser:hover .teaser__needle { transform: rotate(28deg); }
.teaser__text { max-width: 38rem; }
.teaser__text p { color: var(--ink-2); font-size: var(--step-1); }
@media (max-width: 40rem) {
	.teaser__grid { grid-template-columns: 1fr; }
	.teaser__dial { max-width: 14rem; }
}

/* Latest accordion */
.latest { background: var(--white); padding-block: clamp(3rem, 7vw, 5.5rem); }
.latest__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.latest__head h2 { margin: 0; }

.acc { display: grid; grid-template-columns: 11rem 1fr; gap: 0 1.75rem; padding-block: 2rem; border-top: 1px solid var(--line); }
.acc:last-child { border-bottom: 1px solid var(--line); }
.acc__art { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .9rem; }
.acc__meta { font-size: var(--step--1); color: var(--ink-2); margin-bottom: .4rem; }
.acc__title { font-size: var(--step-2); margin-bottom: .4rem; }
.acc__excerpt { color: var(--ink-2); margin-bottom: .9rem; }
.acc__toggle {
	display: inline-flex; align-items: center; gap: .5rem; padding: .45rem 0; background: none; border: 0;
	font: 700 var(--step-0) var(--sans); color: var(--ink); cursor: pointer;
	text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.acc__toggle svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s; }
.acc__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.acc__label-close { display: none; }
.acc__toggle[aria-expanded="true"] .acc__label-open { display: none; }
.acc__toggle[aria-expanded="true"] .acc__label-close { display: inline; }
.acc__panel { grid-column: 2; display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s ease; }
.acc__panel.is-open { grid-template-rows: 1fr; }
.acc__panel-inner { overflow: hidden; }
.acc__panel.is-open .acc__panel-inner { padding-top: 1.25rem; }
.acc__permalink { margin-top: 1.5rem; }
@media (max-width: 40rem) {
	.acc { grid-template-columns: 1fr; }
	.acc__art { margin-bottom: 1rem; }
	.acc__panel { grid-column: 1; }
}

/* Promise */
.promise { padding-block: clamp(3rem, 7vw, 5rem); }
.promise__title { margin-bottom: 2rem; }
.promise__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.promise__item svg { width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; }
.promise__item h3 { font-size: var(--step-1); }
.promise__item p { color: var(--ink-2); margin: 0; }
@media (max-width: 48rem) { .promise__grid { grid-template-columns: 1fr; } }

/* Urgent help and footer */
.urgent { background: var(--blush); padding-block: 2rem; }
.urgent__inner { display: grid; grid-template-columns: auto 1fr; gap: .5rem 2rem; align-items: baseline; }
.urgent__title { font-size: var(--step-1); margin: 0; }
.urgent p { margin: 0; }
.urgent a { font-weight: 700; }
@media (max-width: 48rem) { .urgent__inner { grid-template-columns: 1fr; } }

.site-footer { background: var(--ink); color: #E9E6F7; padding-top: 3.5rem; }
.site-footer a { color: var(--white); text-decoration-color: var(--sun-soft); }
.site-footer :focus-visible { outline-color: var(--sun-soft); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.site-footer__name { font-family: var(--serif); font-size: var(--step-1); color: var(--white); }
.site-footer__heading { font-family: var(--sans); font-weight: 700; font-size: var(--step-0); color: var(--sun-soft); margin-bottom: .8rem; }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.site-footer__base { border-top: 1px solid rgba(255, 255, 255, .15); padding-block: 1.5rem; font-size: var(--step--1); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer__base p { margin: 0; }
@media (max-width: 48rem) { .site-footer__grid { grid-template-columns: 1fr; } }

/* Page heads, lists, single */
.page-head { padding-block: clamp(2.5rem, 6vw, 4rem) 1.5rem; }
.page-head__lede { font-size: var(--step-1); color: var(--ink-2); max-width: 40ch; }
.page-body { padding-bottom: 4rem; }

.post-list { padding-bottom: 4rem; }
.post-row { display: grid; grid-template-columns: 14rem 1fr; gap: 1.75rem; padding-block: 2rem; border-top: 1px solid var(--line); }
.post-row__art img { border-radius: .9rem; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-row__title { font-size: var(--step-2); }
.post-row__title a { text-decoration: none; }
.post-row__title a:hover { text-decoration: underline; text-decoration-color: var(--sun); }
@media (max-width: 40rem) { .post-row { grid-template-columns: 1fr; gap: 1rem; } }

.single__head { padding-top: clamp(2.5rem, 6vw, 4rem); }
.single__head h1 { font-size: var(--step-4); }
.single__art { margin: 1rem auto 2.5rem; }
.single__art img { width: 100%; border-radius: 1.5rem; aspect-ratio: 16 / 7; object-fit: cover; }
.single__cta { margin-block: 3rem 5rem; padding: 2rem; background: var(--lilac); border-radius: 1.5rem; }
.single__cta h2 { font-size: var(--step-2); }

/* Prose */
.prose { font-size: 1.125rem; line-height: 1.7; }
.prose > * { max-width: 68ch; }
.prose h2 { font-size: var(--step-2); margin-top: 2em; scroll-margin-top: 1.5rem; }
.prose h3 { font-size: var(--step-1); margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--sun); }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 4px solid var(--sun-soft); font-family: var(--serif); font-size: var(--step-1); }

.contact-list { list-style: none; padding: 0 !important; display: grid; gap: 1.25rem; }
.contact-list strong { display: block; font-size: var(--step--1); color: var(--ink-2); font-weight: 700; }

/* Stress review */
.review { margin-block: 1rem 3rem; }
.review__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: clamp(1.5rem, 5vw, 3.5rem); align-items: start; }
.review__card { background: var(--white); border-radius: 1.75rem; padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: 0 30px 60px -40px rgba(42, 40, 80, .35); }
.review__progress { font-size: var(--step--1); color: var(--ink-2); margin-bottom: .5rem; }
.review__bar { height: 6px; background: var(--lilac); border-radius: 99px; overflow: hidden; margin-bottom: 1.75rem; }
.review__bar span { display: block; height: 100%; background: var(--sun); border-radius: 99px; transition: width .4s ease; }
.review__area { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); margin-bottom: .35rem; }
.review fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.review legend { font-family: var(--serif); font-size: var(--step-3); line-height: 1.2; margin-bottom: 1.5rem; padding: 0; }
.review__options { display: grid; gap: .6rem; }
.review__option { position: relative; }
.review__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.review__option label {
	display: flex; align-items: center; gap: .85rem; padding: .85rem 1.1rem; border: 2px solid var(--line); border-radius: 1rem;
	font-weight: 700; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.review__option label::before { content: ""; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--ink-2); flex: none; transition: box-shadow .15s, background .15s; }
.review__option input:hover + label { border-color: var(--sky-deep); }
.review__option input:checked + label { border-color: var(--ink); background: var(--dawn); }
.review__option input:checked + label::before { background: var(--sun); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--white); }
.review__option input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 2px; }
.review__nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.review__back { background: none; border: 0; font: 700 var(--step-0) var(--sans); color: var(--ink); cursor: pointer; padding: .5rem 0; text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 4px; }
.review__back[disabled] { visibility: hidden; }
.review__note { font-size: var(--step--1); color: var(--ink-2); margin-top: 1rem; }

.dial { position: sticky; top: 1.5rem; text-align: center; }
.dial svg { width: 100%; overflow: visible; }
.dial__track { fill: none; stroke: var(--lilac); stroke-width: 22; stroke-linecap: round; }
.dial__zone { fill: none; stroke-width: 22; stroke-linecap: round; opacity: .18; transition: opacity .6s ease; }
.dial.is-result .dial__zone { opacity: 1; }
.dial__fill { fill: none; stroke: var(--lilac-deep); stroke-width: 22; stroke-linecap: round; transition: stroke-dashoffset .5s ease, opacity .4s; }
.dial.is-result .dial__fill { opacity: 0; }
.dial__sun { fill: var(--sun-soft); transition: transform 1s ease; }
.dial__needle { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.dial.is-result .dial__needle { opacity: 1; }
.dial__hub { fill: var(--ink); }
.dial__ticks text { font: 700 11px var(--sans); fill: var(--ink-2); }
.dial__score { font-family: var(--serif); font-size: clamp(3rem, 8vw, 4.5rem); line-height: 1; margin: .5rem 0 .25rem; }
.dial__band { margin: 0; }
.dial__band { font-weight: 700; font-size: var(--step-1); }
.dial__caption { font-size: var(--step--1); color: var(--ink-2); max-width: 22ch; margin: .5rem auto 0; }

.result { margin-top: 0; }
.result h2 { font-size: var(--step-3); }
.result__lede { font-size: var(--step-1); color: var(--ink-2); }
.areas { display: grid; gap: 1rem; margin: 2rem 0; padding: 0; list-style: none; }
.areas li { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: 1rem; align-items: center; }
.areas__meter { height: 10px; background: var(--lilac); border-radius: 99px; overflow: hidden; }
.areas__meter span { display: block; height: 100%; border-radius: 99px; width: 0; transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.areas__val { font-weight: 700; text-align: right; }
@media (max-width: 34rem) { .areas li { grid-template-columns: 1fr 3rem; } .areas__meter { grid-column: 1 / -1; grid-row: 2; } }
.tips { display: grid; gap: 1.25rem; margin: 2rem 0; }
.tip { padding: 1.5rem; border-radius: 1.25rem; background: var(--dawn); border-left: 6px solid var(--sun-soft); }
.tip h3 { font-size: var(--step-1); }
.tip ul { margin: 0 0 1rem; padding-left: 1.2em; }
.tip li { margin-bottom: .35rem; }
.tip li::marker { color: var(--sun); }
.result__help { background: var(--blush); border-radius: 1.25rem; padding: 1.5rem; margin-top: 2rem; }
.result__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

@media (max-width: 52rem) {
	.review__layout { grid-template-columns: 1fr; }
	.dial { position: static; order: -1; max-width: 22rem; margin-inline: auto; }
}

/* Stress review page uses the wide container */
body:has(.review) .page-head .wrap--narrow,
body:has(.review) .page-body { max-width: var(--wrap); }
.prose > .review { max-width: none; }
.prose .result > h2:first-child { margin-top: 0; }
.prose .tip h3 { margin-top: 0; }
