/*
 * Think Forward - site stylesheet.
 *
 * CONVENTIONS
 *
 * 1. Every colour, font and heading size is a token. The core plugin's Brand
 *    Guide prints the live values as --core-* custom properties on every page;
 *    the aliases below name them once, each with the seed value as a fallback,
 *    so the site still renders if the plugin is off. Nothing further down names
 *    a hex value.
 * 2. Edit the rule that is wrong rather than appending a correction below it.
 *    A stylesheet that grows by appended fixes becomes rules fighting by source
 *    order. (OHRA's reached 170k that way.)
 * 3. Specificity beats source order, and media queries add none. A responsive
 *    rule above an unconditional rule of equal specificity never applies, so
 *    the responsive section is last.
 * 4. NectarBlocks forces padding and border-radius on input[type=submit] with
 *    !important. Those two properties are the only place !important is matched
 *    here, and each one says so.
 *
 * SECTIONS
 *   1. Tokens   2. Base   3. Layout helpers   4. Buttons and forms
 *   5. Core plugin components   6. Story pages   7. Utilities   8. Responsive
 */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
	--tf-ink:         var(--core-ink, #151928);
	--tf-accent:      var(--core-accent, #9A5200);
	--tf-highlight:   var(--core-highlight, #FE982A);
	--tf-body:        var(--core-body, #3A3F4E);
	--tf-muted:       var(--core-muted, #5B6070);
	--tf-paper:       var(--core-paper, #F9FAFB);
	--tf-stone:       var(--core-stone, #EEF0F3);
	--tf-tint:        var(--core-lilac, #FFF4E8);
	--tf-surface:     var(--core-surface, #FFFFFF);
	--tf-line:        var(--core-line, #E3E6EB);
	--tf-line-soft:   var(--core-line-soft, #EEF0F3);
	--tf-line-strong: var(--core-line-strong, #CDD1D9);
	--tf-on-dark:     var(--core-on-dark, #D9DCE3);
	--tf-on-dark-dim: var(--core-on-dark-dim, #A9AEBB);
	--tf-urgent:      var(--core-brick, #B3463A);
	--tf-caution:     var(--core-gold, #FE982A);

	--tf-font-heading: var(--core-font-heading, Abhaya Libre, Georgia, serif);
	--tf-font-body:    var(--core-font-body, Lexend, Helvetica, Arial, sans-serif);

	--tf-radius:     10px;
	--tf-radius-sm:  6px;
	--tf-gutter:     clamp(16px, 4vw, 24px);
	--tf-section:    clamp(3rem, 8vw, 5.5rem);
	--tf-shadow:     0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.06);
	--tf-focus:      2px solid var(--tf-accent);
}

/* 2. Base ------------------------------------------------------------------ */

body {
	font-family: var(--tf-font-body);
	color: var(--tf-body);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.nectar-font-h1, .nectar-font-h2, .nectar-font-h3,
.nectar-font-h4, .nectar-font-h5, .nectar-font-h6 {
	font-family: var(--tf-font-heading);
	font-weight: 600;                  /* Abhaya Libre SemiBold */
	color: var(--tf-ink);
	text-wrap: balance;
}

/*
 * Heading sizes come from the Brand Guide (--core-h1 and so on, already a
 * clamp between the phone and desktop size). The parent's style.css sets
 * fixed pixel sizes on the bare elements, so they are restated here, at the
 * same specificity and later.
 */
h1 { font-size: var(--core-h1, 4rem);     line-height: var(--core-h1-lh, 1.08); }
h2 { font-size: var(--core-h2, 3rem);     line-height: var(--core-h2-lh, 1.15); }
h3 { font-size: var(--core-h3, 1.5rem);   line-height: var(--core-h3-lh, 1.3); }
h4 { font-size: var(--core-h4, 1.25rem);  line-height: var(--core-h4-lh, 1.3); }
h5 { font-size: var(--core-h5, 1.125rem); line-height: var(--core-h5-lh, 1.35); }
h6 { font-size: var(--core-h6, 1rem);     line-height: var(--core-h6-lh, 1.4); }

/*
 * NectarBlocks text blocks set to a heading preset ("typography": "h3") print
 * .nectar-font-h3 on a <p>. The builder's own sizes are switched off so the
 * Brand Guide controls them, which left these classes at body size. They take
 * the same scale. Colour is not set, so a block's own colour still applies.
 */
.nectar-font-h1 { font-size: var(--core-h1, 4rem);     line-height: var(--core-h1-lh, 1.08); }
.nectar-font-h2 { font-size: var(--core-h2, 3rem);     line-height: var(--core-h2-lh, 1.15); }
.nectar-font-h3 { font-size: var(--core-h3, 1.5rem);   line-height: var(--core-h3-lh, 1.3); }
.nectar-font-h4 { font-size: var(--core-h4, 1.25rem);  line-height: var(--core-h4-lh, 1.3); }
.nectar-font-h5 { font-size: var(--core-h5, 1.125rem); line-height: var(--core-h5-lh, 1.35); }
.nectar-font-h6 { font-size: var(--core-h6, 1rem);     line-height: var(--core-h6-lh, 1.4); }

p { text-wrap: pretty; }

a { color: var(--tf-accent); text-underline-offset: 0.18em; }
a:hover { color: var(--tf-ink); }

/* One visible focus style everywhere. Never removed, only restyled. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--tf-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

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

/* The AVIF wrapper must not change layout or break "> img" selectors. */
picture { display: contents; }

::selection { background: var(--tf-highlight); color: var(--tf-ink); }

/* 3. Layout helpers -------------------------------------------------------- */

/*
 * Full-bleed band. Bleed at ONE wrapper only: bleeding a section and its inner
 * row separately leaves the band hanging off one edge. Not width:100vw, which
 * ignores the scrollbar and is overridden by the theme.
 */
.is-full-bleed {
	width: auto !important;     /* the builder sets an explicit width on sections */
	max-width: none !important;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/*
 * Content inside a bled band lines up with content outside it. NectarBlocks
 * sets the global content size to its container (1425px) rather than the
 * 1200px in theme.json, so the band's children are capped here directly.
 */
.is-full-bleed > :not(.alignfull) { max-width: min(1200px, 100%); }

/* Section grounds, for groups given these classes in the editor. */
.tf-ground-paper   { background: var(--tf-paper); }
.tf-ground-stone   { background: var(--tf-stone); }
.tf-ground-tint    { background: var(--tf-tint); }
.tf-ground-dark    { background: linear-gradient(180deg, #262B40 0%, var(--tf-ink) 100%); color: var(--tf-on-dark); }
.tf-ground-orange  { background: linear-gradient(180deg, #FBA322 0%, #F27405 100%); color: var(--tf-ink); }
.tf-ground-orange :where(h1, h2, h3, h4, h5, h6, a) { color: var(--tf-ink); }

/* The brand's dot pattern, as a decoration on any block. */
.tf-dots {
	background-image: radial-gradient(var(--tf-line-strong) 1.5px, transparent 1.6px);
	background-size: 18px 18px;
}
.tf-ground-dark :where(h1, h2, h3, h4, h5, h6) { color: var(--tf-surface); }
/* Not buttons: those keep their own colours (this selector would outrank them). */
.tf-ground-dark a:not(.wp-block-button__link):not(.core-btn) { color: var(--tf-highlight); }
.tf-ground-dark :where(p, li) { color: inherit; }

.tf-section { padding-block: var(--tf-section); }

/* The brand guide's "Tag": Lexend Bold, 16px. */
.tf-eyebrow {
	font-family: var(--tf-font-body);
	font-size: 1rem;
	font-weight: 700;
	color: var(--tf-accent);
	margin: 0 0 0.5rem;
}
.tf-ground-dark .tf-eyebrow { color: var(--tf-highlight); }

.tf-lead { font-size: 1.1875rem; line-height: 1.55; }

/*
 * WordPress gives constrained-layout children auto inline margins, which soak
 * up free space whatever their grid placement. Clear them on grid children,
 * button wrappers included (the bug only shows when the wrapper is narrower
 * than its column).
 */
.is-layout-grid > *,
.is-layout-grid > .wp-block-buttons { margin-inline: 0; }

/* 4. Buttons and forms ----------------------------------------------------- */

.wp-block-button__link,
.core-btn,
input[type="submit"],
button.tf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	min-height: 44px;                 /* tap target */
	padding: 0.7em 1.4em;
	border: 2px solid var(--tf-highlight);
	border-radius: var(--tf-radius-sm);
	background: var(--tf-highlight);
	color: var(--tf-ink);              /* 8.1:1 on the brand orange; white is 2.2:1 */
	font-family: var(--tf-font-body);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wp-block-button__link:hover,
.core-btn:hover,
input[type="submit"]:hover,
button.tf-btn:hover {
	background: var(--tf-ink);
	border-color: var(--tf-ink);
	color: var(--tf-surface);
}

.is-style-outline > .wp-block-button__link,
.core-btn.is-secondary {
	background: transparent;
	border-color: var(--tf-ink);
	color: var(--tf-ink);
}
.is-style-outline > .wp-block-button__link:hover,
.core-btn.is-secondary:hover {
	background: var(--tf-ink);
	color: var(--tf-surface);
}
.tf-ground-dark .is-style-outline > .wp-block-button__link {
	border-color: var(--tf-surface);
	color: var(--tf-surface);
}

/*
 * NectarBlocks buttons (header, footer and menu links) use the builder's
 * "Default" style. Its Reveal and Underline animations, where the text rolls,
 * were turned off at Graeme's request on 3 Dec 2026. The hover is a plain
 * underline, and filled buttons also darken slightly.
 */
.nectar-blocks-button__inner {
	transition: filter 0.15s ease;
}
.nectar-blocks-button__inner:hover .nectar-blocks-button__text,
.nectar-blocks-button__inner:focus-visible .nectar-blocks-button__text {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.nectar-blocks-button__inner:hover { filter: brightness(0.95); }

/* NectarBlocks forces these two on submit buttons with !important; matched,
   and nothing else forced. */
input[type="submit"] {
	padding: 0.7em 1.4em !important;
	border-radius: var(--tf-radius-sm) !important;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="search"], input[type="number"], select, textarea {
	min-height: 44px;
	padding: 0.6em 0.8em;
	border: 1px solid var(--tf-line-strong);
	border-radius: var(--tf-radius-sm);
	background: var(--tf-surface);
	color: var(--tf-ink);
	font: inherit;
}

/* 5. Core plugin components ------------------------------------------------ */

/* 5.1 Notice bar ([core_alerts]) */

.core-notice-bar { background: var(--tf-ink); color: var(--tf-surface); }

.core-alerts {
	position: relative;
	display: flex;
	align-items: center;
	overflow: hidden;
	padding-right: 44px;                /* room for the pause button */
	font-size: 0.9375rem;
}
.core-alerts-track {
	display: flex;
	width: max-content;
	animation: tf-ticker var(--core-ticker-duration, 30s) linear infinite;
}
.core-alerts.is-static .core-alerts-track { animation: none; width: auto; }
.core-alerts.is-static .core-alerts-set[aria-hidden="true"] { display: none; }
.core-alerts.is-paused .core-alerts-track { animation-play-state: paused; }
.core-alerts:hover .core-alerts-track,
.core-alerts:focus-within .core-alerts-track { animation-play-state: paused; }

.core-alerts-set { display: flex; flex-shrink: 0; }
.core-alert-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.55rem 2.5rem 0.55rem 0;
	white-space: nowrap;
}
.core-alert-item a { color: inherit; text-decoration: underline; }
.core-alert-icon { color: var(--tf-highlight); flex-shrink: 0; }

.core-alerts-pause {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	background: var(--tf-ink);
	color: inherit;
	cursor: pointer;
}
.core-alerts .core-icon-play { display: none; }
.core-alerts.is-paused .core-icon-play { display: block; }
.core-alerts.is-paused .core-icon-pause { display: none; }
.core-alerts.is-static .core-alerts-pause { display: none; }

@keyframes tf-ticker { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
	.core-alerts-track { animation: none; }
}

/* 5.2 Listing filters and pager */

.core-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}
.core-filter-chip {
	min-height: 40px;
	padding: 0.4em 1em;
	border: 1px solid var(--tf-line-strong);
	border-radius: 999px;
	background: var(--tf-surface);
	color: var(--tf-body);
	font: inherit;
	font-size: 0.9375rem;
	cursor: pointer;
}
.core-filter-chip:hover { border-color: var(--tf-accent); color: var(--tf-accent); }
.core-filter-chip.is-on,
.core-filter-chip[aria-pressed="true"] {
	background: var(--tf-ink);
	border-color: var(--tf-ink);
	color: var(--tf-surface);
}
.core-filter-count { color: var(--tf-muted); font-size: 0.875rem; margin: 0 0 1rem; }

.core-pager {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 2rem;
}
.core-pager--top { margin: 0 0 1.5rem; justify-content: flex-start; }

.core-empty, .core-no-match {
	padding: 2rem;
	border: 1px dashed var(--tf-line-strong);
	border-radius: var(--tf-radius);
	color: var(--tf-muted);
	text-align: center;
}

/* 5.3 Cards ([core_list layout=cards]) */

.core-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: clamp(1rem, 2.5vw, 1.75rem);
}

.core-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	background: var(--tf-surface);
	box-shadow: var(--tf-shadow);
}
.core-card-media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--tf-stone);
}
.core-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.core-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex: 1;
	padding: 1.25rem 1.25rem 1.5rem;
}
.core-card-title {
	margin: 0;
	font-size: var(--core-h3, 1.5rem);
	line-height: var(--core-h3-lh, 1.3);
}
.core-card-sub, .core-card-phone { margin: 0; color: var(--tf-muted); font-size: 0.9375rem; }
.core-card-desc { margin: 0; }
.core-card-tail { margin-top: auto; }
.core-card-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding-top: 0.75rem;
}

/* Date chip, on cards and rows */
.core-chip {
	display: inline-grid;
	justify-items: center;
	min-width: 3.5rem;
	padding: 0.4rem 0.5rem;
	border-radius: var(--tf-radius-sm);
	background: var(--tf-surface);
	color: var(--tf-ink);
	line-height: 1.05;
	text-align: center;
}
.core-chip .m { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tf-accent); }
.core-chip .d { font-family: var(--tf-font-heading); font-size: 1.5rem; font-weight: 600; }
.core-chip .y { font-size: 0.75rem; color: var(--tf-muted); }
.core-chip--card {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 1;
	box-shadow: var(--tf-shadow);
}

.core-pill {
	align-self: flex-start;
	display: inline-block;
	padding: 0.2em 0.7em;
	border-radius: 999px;
	background: var(--tf-tint);  /* pale orange */
	color: var(--tf-ink);
	font-size: 0.8125rem;
	font-weight: 600;
}

/* 5.4 Rows ([core_list layout=rows]) */

.core-rows { display: grid; gap: 1rem; }
.core-row {
	display: grid;
	gap: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	background: var(--tf-surface);
}
.core-row-has-media { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
.core-row-media {
	position: relative;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: var(--tf-radius-sm);
	background: var(--tf-stone);
}
.core-row-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.core-row-media .core-chip { position: absolute; top: 0.5rem; left: 0.5rem; }
.core-row-body { display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.core-row-title { margin: 0; font-size: var(--core-h3, 1.5rem); }
.core-row-meta { margin: 0; color: var(--tf-muted); font-size: 0.9375rem; }
.core-row-desc { margin: 0; }

/* 5.5 People ([core_people] / committee) */

.core-members {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 1.5rem;
}
.core-member { display: flex; flex-direction: column; gap: 0.75rem; }
.core-member-photo {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--tf-radius);
	background: var(--tf-stone);
}
.core-member-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.core-member-name { margin: 0; font-size: 1.125rem; }
.core-member-role { margin: 0; color: var(--tf-accent); font-weight: 600; font-size: 0.9375rem; }
.core-member-bio { margin: 0; font-size: 0.9375rem; }
.core-member-email { font-size: 0.9375rem; overflow-wrap: anywhere; }

/* 5.6 Contact list */

.core-contact-list { display: grid; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.core-contact-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.core-contact-icon { flex-shrink: 0; color: var(--tf-accent); }
.core-contact-title { margin: 0; font-weight: 600; color: var(--tf-ink); }
.core-contact-desc { margin: 0; color: var(--tf-muted); }

/* 5.7 Announcement cards */

.core-alert-cards { display: grid; gap: 1rem; }
.core-alert-card {
	padding: 1.25rem 1.5rem;
	border-left: 4px solid var(--tf-caution);
	border-radius: var(--tf-radius-sm);
	background: var(--tf-surface);
	box-shadow: var(--tf-shadow);
}
.core-alert-card-title { margin: 0 0 0.35rem; font-size: 1.125rem; }
.core-alert-card-lead { margin: 0; }
.core-alert-card-foot { margin-top: 0.75rem; font-size: 0.875rem; color: var(--tf-muted); }

/* 5.8 FAQs: the plugin sets the section ground inline from the Brand Guide. */

.core-faq-section details {
	border-bottom: 1px solid var(--tf-line);
	padding: 1rem 0;
}
.core-faq-section summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--tf-ink);
	min-height: 44px;
	display: flex;
	align-items: center;
}

/* 5.9 Image credits and tables */

.core-credit,
.wp-element-caption {
	margin-top: 0.5rem;
	font-size: 0.8125rem;
	color: var(--tf-muted);
}
.core-credits {
	margin-top: 2.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--tf-line);
}
.core-credits-head { font-size: 0.875rem; font-family: var(--tf-font-body); margin: 0 0 0.25rem; }

.wp-block-table,
.core-table { overflow-x: auto; }
.wp-block-table table,
.core-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th, .wp-block-table td,
.core-table th, .core-table td {
	padding: 0.6rem 0.8rem;
	border: 0;                          /* core's table block draws a full grid in currentColor */
	border-bottom: 1px solid var(--tf-line);
	text-align: left;
	vertical-align: top;
}
.wp-block-table th,
.core-table th { color: var(--tf-ink); font-weight: 600; border-bottom-color: var(--tf-line-strong); }

/* 6. Story pages ([tf_story]) ---------------------------------------------- */

.tf-story {
	max-width: 760px;
	margin-inline: auto;
	padding-block: clamp(2rem, 6vw, 4rem);
}
.tf-story-back { margin: 0 0 1.5rem; font-size: 0.9375rem; }
.tf-story-back a { text-decoration: none; }
.tf-story-back a:hover { text-decoration: underline; }
.tf-story-title { margin: 0 0 0.75rem; }
.tf-story-meta { margin: 0 0 1.5rem; color: var(--tf-muted); }
.tf-standfirst {
	font-size: 1.25rem;
	line-height: 1.5;
	color: var(--tf-ink);
	margin: 0 0 1.75rem;
}
.core-story-figure,
.tf-story-figure { margin: 0 0 2rem; }
.core-story-figure img,
.tf-story-figure img { width: 100%; border-radius: var(--tf-radius); display: block; }
.tf-story-content > * + * { margin-top: 1.1em; }

/* 7. Utilities ------------------------------------------------------------- */

.tf-to-top {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 50;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 0.35);  /* stays visible over the navy footer */
	border-radius: 50%;
	background: var(--tf-ink);
	color: var(--tf-surface);
	box-shadow: var(--tf-shadow);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.tf-to-top.is-visible { opacity: 1; visibility: visible; }

.screen-reader-text:not(:focus) {
	position: absolute !important;  /* must beat any builder positioning */
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* 8. Responsive (last, so it wins at equal specificity) -------------------- */

@media (max-width: 781px) {
	/* A bled band needs its gutter back, or text touches the screen edge. */
	.is-full-bleed { padding-inline: var(--tf-gutter); }

	.core-row-has-media { grid-template-columns: 1fr; }
	.core-row-media { max-width: 100%; }
}

@media (max-width: 400px) {
	.core-filter-chip { font-size: 0.875rem; padding-inline: 0.8em; }
	.core-card-body { padding: 1rem 1rem 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
