/*
Theme Name: 13 Steps Companion
Theme URI: https://13stepscompanion.com/
Author: Ian Fenn
Description: Styling for a single-book site. Holds no content: build the home page from blocks using the Cream band / Black band group styles, and the [tsc_news] and [tsc_signup] shortcodes.
Version: 1.1.6
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thirteen-steps
*/

@font-face { font-family: "Jost"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: italic; font-weight: 400; font-display: swap; src: url("assets/fonts/jost-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 500; font-display: swap; src: url("assets/fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/jost-latin-700-normal.woff2") format("woff2"); }

:root {
	--cream: #f1ead9;
	--cream-deep: #e6dcc4;
	--ink: #141312;
	--ink-soft: #45413b;
	--rule: #cbbfa3;
	--focus: #b3261e;
	--font: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
	--measure: 38rem;
	--wrap: 68rem;
	--gutter: clamp(1rem, 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; } }

body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.125rem;
	line-height: 1.6;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.6em; font-weight: 700; }
p { margin: 0 0 1em; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
	left: 1rem; top: 1rem; z-index: 100; padding: 0.75rem 1rem;
	background: var(--ink); color: var(--cream);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Header ---------------------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--ink); }
.site-header .wrap {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 0.5rem 2rem; padding-top: 1rem; padding-bottom: 1rem;
}
.site-title {
	font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
	text-decoration: none; font-size: 1rem;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"]:not([href*="#"]) { text-decoration: underline; }

/* Front page: blocks from the Home page -------------------------------- */

.front-content > * { margin-top: 0; margin-bottom: 0; }

.is-style-band,
.is-style-ink-band {
	padding: clamp(3rem, 8vw, 5.5rem) var(--gutter);
	margin: 0;
}
.is-style-band > *,
.is-style-ink-band > * { max-width: calc(var(--wrap) - 2 * var(--gutter)); margin-left: auto; margin-right: auto; }
.is-style-band p, .is-style-ink-band p { max-width: var(--measure); }

.is-style-ink-band { background: var(--ink); color: var(--cream); }
.is-style-ink-band :focus-visible { outline-color: var(--cream); }
.is-style-ink-band a { color: var(--cream); }

h2.is-style-section, .is-style-section {
	font-size: clamp(1.5rem, 3vw, 2rem);
	text-transform: uppercase; letter-spacing: 0.06em;
	margin-bottom: 1.5rem;
}
.is-style-display {
	font-size: clamp(2.5rem, 7vw, 4.25rem);
	text-transform: uppercase; letter-spacing: 0.02em; line-height: 1;
	margin-bottom: 0.4rem;
}
.is-style-strapline { font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 500; line-height: 1.35; margin-bottom: 0.25rem; }
.is-style-byline { color: var(--ink-soft); margin-bottom: 1.75rem; }
.is-style-ink-band .is-style-byline { color: inherit; opacity: 0.8; }
.is-style-small { font-size: 0.95rem; opacity: 0.88; }

/* Columns (e.g. cover beside title) */
.wp-block-columns { gap: clamp(2rem, 5vw, 4.5rem); margin: 0; }
.wp-block-column > :last-child { margin-bottom: 0; }

.is-style-cover img {
	width: 100%; max-width: 22rem; margin: 0 auto;
	box-shadow: 0 1px 2px rgba(0,0,0,.2), 0 18px 40px -12px rgba(0,0,0,.45);
}
.wp-block-image.is-style-cover { margin: 0; }

/* Buttons */
.wp-block-button__link {
	display: inline-block; font: inherit; font-weight: 700; font-size: 1rem;
	text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none;
	padding: 0.8rem 1.4rem; border: 2px solid var(--ink); border-radius: 0;
	background: var(--ink); color: var(--cream); cursor: pointer;
}
.wp-block-button__link:hover { background: transparent; color: var(--ink); text-decoration: none; }
.is-style-ink-band .wp-block-button__link { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.is-style-ink-band .wp-block-button__link:hover { background: transparent; color: var(--cream); }
.wp-block-buttons { margin-top: 1.75rem; }

/* News ------------------------------------------------------------------ */

.news-list { list-style: none; margin: 0 0 1.75rem; padding: 0; display: grid; gap: 2rem; }
@media (min-width: 48rem) { .news-list--home { grid-template-columns: 1fr 1fr; } }
.news-item { border-top: 1px solid currentColor; padding-top: 1rem; max-width: var(--measure); }
.news-item time { font-size: 0.95rem; opacity: 0.8; }
.news-item h3 { font-size: 1.35rem; margin: 0.25rem 0 0.5rem; }
.news-item h3 a { text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-item p { margin: 0; }
.more-link { font-weight: 500; }

/* List style "Numbered sections": bold first line = title, rest = text */

ol.is-style-sections, ul.is-style-sections {
	list-style: none; margin: 0; padding: 0;
	counter-reset: step;
}
/* Two columns that read downwards: 1–3 left, 4–5 right */
@media (min-width: 48rem) { ol.is-style-sections, ul.is-style-sections { columns: 2; column-gap: clamp(2rem, 5vw, 4rem); } }
.is-style-sections > li {
	counter-increment: step;
	border-top: 1px solid currentColor;
	padding: 1.25rem 0 1.5rem 3.25rem; position: relative;
	break-inside: avoid;
}
.is-style-ink-band .is-style-sections > li { border-top-color: rgba(241, 234, 217, 0.35); }
.is-style-sections > li::before {
	content: counter(step, decimal-leading-zero);
	position: absolute; left: 0; top: 1.2rem;
	font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em;
}
.is-style-sections > li > strong:first-child { display: block; font-size: 1.2rem; line-height: 1.25; margin-bottom: 0.4rem; }
.is-style-sections > li > strong:first-child + br { display: none; }

/* Sign-up form (Fluent Forms) ----------------------------------------- */
/* Email field and button on one row, the same height, as on piddingtonsbook.com. */

.signup-fluent { margin: 1.25rem 0; max-width: var(--measure); }
.signup-setup { font-weight: 500; }
.signup-fluent .fluentform,
.signup-fluent .fluentform form { margin: 0; }
.signup-fluent .fluentform fieldset { min-width: 0; }
.signup-fluent .fluentform p:empty,
.signup-fluent .fluentform fieldset > p { margin: 0; height: 0; }
.signup-fluent .fluentform .ff-t-container,
.signup-fluent .fluentform fieldset:not(:has(.ff-t-container)) {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: .75rem !important;
	margin: 0 !important;
}
.signup-fluent .fluentform .ff-t-cell { padding: 0 !important; min-width: 0; }
.signup-fluent .fluentform .ff-t-column-1,
.signup-fluent .fluentform fieldset:not(:has(.ff-t-container)) > .ff-el-group:not(.ff_submit_btn_wrapper) { flex: 1 1 0 !important; width: auto !important; min-width: 0; }
.signup-fluent .fluentform .ff-t-column-2,
.signup-fluent .fluentform .ff_submit_btn_wrapper { flex: 0 0 auto !important; width: auto !important; }
.signup-fluent .fluentform .ff-el-group { margin: 0 !important; position: relative; }
.signup-fluent .fluentform .ff-el-input--label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.signup-fluent .fluentform .ff-el-form-control {
	display: block; width: 100%; height: 3.25rem;
	font: inherit; font-size: 1.05rem; padding: 0 0.9rem;
	border: 2px solid var(--cream); border-radius: 0; box-shadow: none;
	background: var(--cream); color: var(--ink);
}
.signup-fluent .fluentform .ff-el-form-control::placeholder { color: var(--ink-soft); opacity: 1; }
.signup-fluent .fluentform .ff-el-form-control:focus { outline: 3px solid var(--cream); outline-offset: 3px; box-shadow: none; }
.signup-fluent form .ff-btn.ff-btn-submit,
.signup-fluent form .ff-btn.ff-btn-submit.wpf_has_custom_css {
	display: block; height: 3.25rem; margin: 0 !important;
	min-width: 0 !important; width: auto !important;
	font: inherit; font-weight: 700; font-size: 1rem;
	text-transform: uppercase; letter-spacing: 0.08em;
	padding: 0 1.4rem !important; white-space: nowrap; cursor: pointer;
	background: var(--cream) !important; color: var(--ink) !important;
	border: 2px solid var(--cream) !important; border-radius: 0 !important; box-shadow: none !important;
}
.signup-fluent form .ff-btn.ff-btn-submit:hover { background: transparent !important; color: var(--cream) !important; }
.signup-fluent .fluentform .error,
.signup-fluent .fluentform .text-danger {
	position: absolute; top: 100%; left: 0; margin-top: .35rem;
	color: #f0a8a0; font-size: .9rem; white-space: nowrap;
}
.signup-fluent .ff-errors-in-stack:empty { display: none; }
.signup-fluent .ff-message-success {
	background: transparent; border: 2px solid var(--cream); color: var(--cream);
	box-shadow: none; padding: .75rem 1rem; margin: 0; font-weight: 500;
}

/* Single posts, pages, archive ----------------------------------------- */

.page-main { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.page-main .wrap > * { max-width: var(--measure); }
.entry-title { font-size: clamp(2rem, 5vw, 2.75rem); }
.entry-meta { color: var(--ink-soft); margin-bottom: 2rem; }
.entry-content > * { max-width: 100%; }
.entry-content img { margin: 1.5rem 0; }
.entry-content blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 3px solid var(--ink); font-style: italic; }
.entry-content h2 { font-size: 1.6rem; margin-top: 2rem; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.75rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--ink); padding-top: 1rem; }
.pagination { margin-top: 2.5rem; }
.pagination .nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Footer ---------------------------------------------------------------- */

.footer-bar { border-top: 1px solid var(--ink); padding: 1.5rem 0; font-size: 0.95rem; }
.footer-bar .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; }
.footer-bar p { margin: 0; }
.footer-signup + .footer-bar { border-top: 0; }
.footer-bar .footer-note { max-width: var(--measure); margin-top: 0.75rem; font-size: 0.85rem; color: var(--ink-soft); }

/* Admin bar offset for anchor jumps */
:target { scroll-margin-top: 1.5rem; }
.admin-bar :target { scroll-margin-top: 3.5rem; }
