/*
Theme Name: Spani Alerts
Theme URI: https://spanialerts.co.za
Author: Webgap
Description: "The form, filled in properly." Independent help with government jobs and pay. Blue ballpoint on white forms, with a red stamp on the closing date. See docs/design-brief.md.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: spanialerts
*/

:root {
	--sa-ink: var(--wp--preset--color--ink);
	--sa-muted: var(--wp--preset--color--ink-muted);
	--sa-line: var(--wp--preset--color--line);
	--sa-form: var(--wp--preset--color--form);
	--sa-sheet: var(--wp--preset--color--sheet);
	--sa-blue: var(--wp--preset--color--ballpoint);
	--sa-blue-soft: var(--wp--preset--color--ballpoint-soft);
	--sa-red: var(--wp--preset--color--stamp);
	--sa-pink: var(--wp--preset--color--pink);
	--sa-display: var(--wp--preset--font-family--display);
}

/* ---------- Base ---------- */
body { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, h5, h6 { font-stretch: 112%; text-wrap: balance; }
h3, h4 { font-stretch: 106%; font-weight: 760; }
p, li { text-wrap: pretty; }
:where(.entry-content) { max-width: 100%; }
::selection { background: var(--sa-blue-soft); }
:focus-visible { outline: 3px solid var(--sa-blue); outline-offset: 2px; }
a:focus-visible { border-radius: 2px; }
img { height: auto; max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.screen-reader-text:not(:focus) {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 20; }
.site-header__bar { background: var(--sa-sheet); border-bottom: 1px solid var(--sa-line); }
.site-header__inner { padding-block: 0.75rem; gap: 1.5rem; }
.site-header__brand .spani-brand__logo { height: 2.375rem; }

/* Main menu (spani/site-nav): link list on wide screens, a Menu disclosure on phones. No JS. */
.spani-nav { font-size: 0.9375rem; font-weight: 600; }
.spani-nav ul { list-style: none; margin: 0; padding: 0; }
.spani-nav a { color: var(--sa-ink); text-decoration: none; }
.spani-nav a:hover, .spani-nav a[aria-current="page"] { color: var(--sa-blue); text-decoration: underline; text-underline-offset: 0.2em; }
.spani-nav__list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.25rem 1.25rem; }
.spani-nav__mobile { display: none; }
@media (max-width: 899px) {
	.spani-nav__list { display: none; }
	.spani-nav__mobile { display: block; }
	.spani-nav__mobile > summary {
		list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
		min-height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--sa-line); border-radius: 4px; background: var(--sa-sheet);
	}
	.spani-nav__mobile > summary::-webkit-details-marker { display: none; }
	.spani-nav__mobile > summary::before { content: ""; width: 1rem; height: 0.75rem; background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat; }
	.spani-nav__mobile[open] > summary { border-color: var(--sa-ink); }
	.spani-nav__panel {
		position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
		background: var(--sa-sheet); border-bottom: 1px solid var(--sa-line);
		padding: 0.25rem 1rem 0.75rem !important;
	}
	.spani-nav__panel li { border-top: 1px solid var(--sa-line); }
	.spani-nav__panel li:first-child { border-top: 0; }
	.spani-nav__panel a { display: block; padding: 0.875rem 0; font-size: 1.125rem; }
}
.site-header__bar { position: relative; }

.site-notice { background: var(--sa-form); border-bottom: 1px solid var(--sa-line); }
.site-notice__text { margin: 0; padding-block: 0.45rem; font-size: 0.8125rem; color: var(--sa-muted); }
.site-notice__text strong { color: var(--sa-ink); font-weight: 650; }

/* ---------- Main ---------- */
.site-main { padding-block: 2rem 4rem; }
.site-main > .wp-block-post-title { margin-top: 0.5rem; }


/* ---------- Content: a filled-in form ---------- */
.entry-content { margin-top: 2rem; }
.entry-content > * + h2 { margin-top: 2.75rem; }
.entry-content > * + h3 { margin-top: 2rem; }
.entry-content li + li { margin-top: 0.375rem; }
.entry-content ul, .entry-content ol { padding-left: 1.375rem; }
.entry-content strong { font-weight: 650; }

.entry-content .wp-block-table { overflow-x: auto; margin-inline: 0; }
.entry-content table { width: 100%; border-collapse: collapse; background: var(--sa-sheet); border: 1px solid var(--sa-ink); font-size: 0.9375rem; }
.entry-content table th,
.entry-content table td { padding: 0.6rem 0.75rem; border: 0; border-bottom: 1px solid var(--sa-line); text-align: left; vertical-align: top; }
.entry-content table thead th,
.entry-content table tr:first-child th { border-bottom: 1px solid var(--sa-ink); font-family: var(--sa-display); font-stretch: 106%; font-weight: 760; }
.entry-content table td { font-variant-numeric: tabular-nums lining-nums; }
.entry-content :not(figure) > table { display: block; max-width: 100%; overflow-x: auto; }
.entry-content :not(figure) > table > * { min-width: 100%; }
.entry-content .wp-block-table figcaption { font-size: 0.875rem; color: var(--sa-muted); }

.entry-content blockquote,
.entry-content .wp-block-quote { margin-inline: 0; padding: 0.75rem 1.25rem; border-left: 4px solid var(--sa-blue); background: var(--sa-sheet); }
.entry-content .wp-block-image img { border: 1px solid var(--sa-line); }
.entry-content hr, .wp-block-separator { border: 0; border-top: 1px solid var(--sa-line); }

/* Details / FAQs as boxed form fields */
.entry-content details { background: var(--sa-sheet); border: 1px solid var(--sa-line); padding: 0.875rem 1rem; }
.entry-content details + details { border-top: 0; }
.entry-content summary { cursor: pointer; font-weight: 650; }

/* Buttons */
.wp-element-button, .wp-block-button__link { text-decoration: none; }
.wp-block-button__link:hover { background: #18329a; }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: var(--sa-sheet); color: var(--sa-blue); border: 1.5px solid var(--sa-blue); padding: calc(0.75rem - 1.5px) calc(1.125rem - 1.5px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--sa-blue-soft); }

/* Independent note on every guide */
.post-independent { margin-top: 3rem; padding: 1rem 1.25rem; background: var(--sa-sheet); border: 1px solid var(--sa-line); border-left: 4px solid var(--sa-blue); }
.post-independent p { margin: 0; }

/* ---------- Guide rows (lists of posts: ruled rows, like the circular's table) ---------- */
.guide-rows { list-style: none; margin: 0; padding: 0; background: var(--sa-sheet); border: 1px solid var(--sa-line); }
.guide-rows > li { margin: 0; }
.guide-rows > li + li { border-top: 1px solid var(--sa-line); }
.guide-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1.5rem; padding: 1rem 1.125rem; }
.guide-row__title { grid-column: 1; margin: 0; font-size: 1.1875rem; line-height: 1.25; text-wrap: pretty; }
.guide-row__title a { color: var(--sa-ink); text-decoration: none; }
.guide-row__title a:hover { color: var(--sa-blue); text-decoration: underline; }
.guide-row__excerpt { grid-column: 1; margin: 0; font-size: 0.9375rem; color: var(--sa-muted); }
.guide-row__excerpt p { margin: 0; }
.guide-row__excerpt .wp-block-post-excerpt__more-text { display: none; }
.guide-row__date { grid-column: 2; grid-row: 1; margin: 0; font-family: var(--sa-display); font-stretch: 106%; font-weight: 650; font-size: 0.875rem; color: var(--sa-muted); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.wp-block-query-pagination { margin-top: 1.5rem; font-weight: 600; }

/* ---------- Home ---------- */
.home__title { font-size: clamp(1.75rem, 1.2rem + 2.4vw, var(--wp--preset--font-size--huge)); max-width: 22ch; margin-bottom: 2rem; }
.home__top { gap: 2.5rem; align-items: flex-start; }
.home__pay { background: var(--sa-sheet); border: 1px solid var(--sa-line); padding: 1.25rem 1.25rem 0.5rem; }
.home__pay h2 { font-size: var(--wp--preset--font-size--large); margin-top: 0; }
/* Job alerts sign-up at the foot of the pay card: part of the card, not a box inside it. */
.home__pay .spani-subscribe.is-compact { margin: 1.5rem -1.25rem -0.5rem; padding: 1.25rem; border: 0; border-top: 1.5px solid var(--sa-ink); border-radius: 0; }
.home__pay .spani-subscribe__field,
.home__pay .spani-subscribe__go { flex-basis: 100%; }
.home__pay .spani-subscribe__button { width: 100%; }

.link-list { list-style: none; padding: 0 !important; margin: 0 0 1rem; }
.link-list li { margin: 0 !important; border-top: 1px solid var(--sa-line); }
.link-list li:last-child { border-bottom: 1px solid var(--sa-line); }
.link-list a { display: block; padding: 0.625rem 0; font-weight: 600; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }

.home__apply, .home__guides { margin-top: 4rem; }
.home__apply > p { max-width: 60ch; }

/* Numbered steps: a real sequence, boxed like form sections */
.steps { list-style: none; counter-reset: step; padding: 0 !important; margin: 1.5rem 0; display: grid; gap: 0; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); background: var(--sa-sheet); border: 1px solid var(--sa-line); }
.steps > li { counter-increment: step; position: relative; margin: 0 !important; padding: 3.25rem 1.25rem 1.25rem; border-right: 1px solid var(--sa-line); }
.steps > li:last-child { border-right: 0; }
.steps > li::before {
	content: counter(step); position: absolute; top: 1rem; left: 1.25rem;
	font-family: var(--sa-display); font-weight: 820; font-stretch: 112%; font-size: 1.5rem; line-height: 1; color: var(--sa-blue);
}
.steps strong { display: block; margin-bottom: 0.25rem; font-size: 1.0625rem; }

.scam-strip { margin-top: 3rem; padding: 1rem 1.25rem; background: var(--sa-pink); border-left: 4px solid var(--sa-red); }
.scam-strip p { margin: 0; }
.scam-strip a { font-weight: 650; }

/* ---------- Search ---------- */
.site-search .wp-block-search__inside-wrapper { border: 1px solid var(--sa-line); background: var(--sa-sheet); padding: 0; border-radius: 4px; }
.site-search .wp-block-search__input { border: 0; padding: 0.7rem 0.875rem; font-size: 1rem; background: transparent; }
.site-search .wp-block-search__button { margin: 0; border-radius: 0 3px 3px 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 2rem; }
.site-footer__inner { background: var(--sa-ink); color: #d7dbe2; padding-block: 3rem 2rem; font-size: 0.9375rem; }
.site-footer__inner a { color: #fff; }
.site-footer__cols { gap: 2.5rem; }
.site-footer__brand .spani-brand__logo { height: 2.25rem; }
.site-footer__about { margin-top: 1rem; max-width: 52ch; }
.site-footer__about strong { color: #fff; }
.site-footer__heading { font-size: 1rem; color: #fff; margin: 0 0 0.75rem; }
.site-footer__links { list-style: none; padding: 0; margin: 0; }
.site-footer__links li { margin: 0 0 0.5rem; }
.site-footer__links a { text-decoration: none; }
.site-footer__links a:hover { text-decoration: underline; }
.site-footer__legal { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #3a3f4a; font-size: 0.8125rem; color: #aab0bb; }
.site-footer__legal a { color: #d7dbe2; }

/* ---------- Small screens ---------- */
@media (max-width: 781px) {
	.site-main { padding-block: 1.25rem 3rem; }
	.site-header__brand .spani-brand__logo { height: 2.125rem; }
	.home__title { margin-bottom: 1.75rem; }
	.home__top { gap: 1.5rem; }
	.steps > li { border-right: 0; border-top: 1px solid var(--sa-line); padding: 1rem 1rem 1rem 3.25rem; }
	.steps > li:first-child { border-top: 0; }
	.steps > li::before { top: 1rem; left: 1rem; }
	.guide-row { grid-template-columns: 1fr; }
	.guide-row__date { grid-column: 1; grid-row: auto; }
}
