/*
Theme Name: Cr Benedict Ong
Theme URI: https://benedictong.net
Description: Public record site for Cr Benedict Ong, Dunedin City Council. Child theme of Twenty Twenty-Five.
Author: Moaz Mahmoud
Template: twentytwentyfive
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crbenedictong
*/

/* ==========================================================================
   Design tokens
   Palette drawn from Dunedin bluestone and the Otago harbour.
   ========================================================================== */

:root {
	--ink:      #14202B;
	--harbour:  #1F4E5F;
	--pounamu:  #3D6B54;
	--paper:    #EDEEEA;
	--rule:     #C9CCC5;
	--ink-soft: rgba(20, 32, 43, 0.66);
	--ink-mute: rgba(20, 32, 43, 0.46);

	--measure:  38rem;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--paper);
	color: var(--ink);
	font-synthesis-weight: none;
}

/* Keyboard focus is visible everywhere, on every interactive thing. */
a:focus-visible,
button:focus-visible,
:focus-visible {
	outline: 2px solid var(--pounamu);
	outline-offset: 3px;
	border-radius: 1px;
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.cbo-masthead {
	padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
	border-bottom: 1px solid var(--rule);
}

.cbo-masthead__name {
	font-family: "Fraunces", Georgia, serif;
	font-optical-sizing: auto;
	font-variation-settings: "SOFT" 0, "WONK" 0;
	font-weight: 600;
	font-size: clamp(2.25rem, 6.5vw, 4rem);
	line-height: 1.02;
	letter-spacing: -0.02em;
	color: var(--ink);
	margin: 0;
}

.cbo-masthead__role {
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--harbour);
	margin: 1.15rem 0 0;
	display: flex;
	align-items: center;
	gap: 0.85rem;
}

/* The one accent, spent once. */
.cbo-masthead__role::before {
	content: "";
	width: 1.75rem;
	height: 2px;
	background: var(--pounamu);
	flex: none;
}

/* Specificity has to beat the constrained-layout rule that centres children. */
.cbo-masthead p.cbo-masthead__intro {
	max-width: var(--measure);
	margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
	/* The constrained-layout rule centres children with !important. */
	margin-inline: 0 !important;
	font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
	line-height: 1.62;
	color: var(--ink-soft);
	text-wrap: pretty;
}

.cbo-masthead p.cbo-masthead__role {
	margin-inline: 0 !important;
}

/* ==========================================================================
   Section label — the mono rubric used above each feed
   ========================================================================== */

.cbo-rubric {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	margin: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2rem);
	font-family: var(--mono);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.cbo-rubric::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--rule);
}

/* ==========================================================================
   Facebook Page Plugin shell (homepage)
   Three states: loading -> ready, or loading -> failed.
   ========================================================================== */

.cbo-embed {
	margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.cbo-embed__frame {
	background: #fff;
	border: 1px solid var(--rule);
	padding: clamp(0.75rem, 2vw, 1.25rem);
	display: flex;
	justify-content: center;
	min-height: 220px;
	align-items: center;
	/* The plugin caps itself at 500px; let the frame hug it rather than
	   stranding it in the middle of a full-width panel. */
	max-width: 34rem;
	margin-inline: auto !important;
}

.cbo-embed__frame .fb-page {
	max-width: 100%;
}

/* Loading + fallback share the panel, only one shows at a time. */
.cbo-embed__status {
	font-family: var(--mono);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	color: var(--ink-mute);
	text-align: center;
	padding: 2rem 1rem;
}

.cbo-embed__fallback {
	border: 1px solid var(--rule);
	border-top: 2px solid var(--harbour);
	background: #fff;
	padding: clamp(1.5rem, 4vw, 2.25rem);
	max-width: var(--measure);
	margin-inline: auto;
}

.cbo-embed__fallback p {
	margin: 0 0 1rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ink-soft);
	text-wrap: pretty;
}

.cbo-embed__fallback p:last-child {
	margin-bottom: 0;
}

.cbo-embed__fallback strong {
	color: var(--ink);
	font-weight: 600;
}

/* State machine: hide everything, then reveal the one that applies. */
.cbo-embed__status,
.cbo-embed__fallback {
	display: none;
}

.cbo-embed.is-loading .cbo-embed__status { display: block; }
.cbo-embed.is-failed  .cbo-embed__fallback { display: block; }
.cbo-embed.is-loading .cbo-embed__frame { min-height: 0; border: 0; padding: 0; }

/* Park the failed frame off-screen rather than display:none — a hidden iframe
   reports zero height, which would stop the watcher ever noticing a late
   arrival and recovering. */
.cbo-embed.is-failed .cbo-embed__frame {
	position: absolute;
	left: -9999px;
	top: 0;
	border: 0;
	padding: 0;
	min-height: 0;
}

/* No JavaScript at all: skip straight to the link, never a blank space. */
.no-js .cbo-embed__frame { display: none; }
.no-js .cbo-embed__fallback { display: block; }

/* ==========================================================================
   Buttons / links
   ========================================================================== */

.cbo-btn {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	color: #fff;
	background: var(--harbour);
	padding: 0.85em 1.6em;
	border: 1px solid var(--harbour);
	transition: background 0.18s ease, color 0.18s ease;
}

.cbo-btn:hover,
.cbo-btn:focus-visible {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.cbo-footer {
	border-top: 1px solid var(--rule);
	margin-top: clamp(3rem, 7vw, 5rem);
	padding-block: 2.25rem clamp(2.25rem, 5vw, 3.5rem);
	font-family: var(--mono);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	color: var(--ink-mute);
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.75rem;
	justify-content: space-between;
	align-items: baseline;
}

.cbo-footer a {
	color: var(--harbour);
	text-decoration: none;
	border-bottom: 1px solid var(--rule);
	padding-bottom: 1px;
}

.cbo-footer a:hover {
	color: var(--ink);
	border-bottom-color: var(--ink);
}

/* ==========================================================================
   Smash Balloon feed — the minute-book treatment
   Entries are dated public statements in sequence, so they are set as
   record entries strung on a single hairline rule.
   ========================================================================== */

#cff.cff-wrapper,
.cff-wrapper {
	background: transparent !important;
	padding: 0 !important;
}

.cff-wrapper .cff-posts-wrap {
	position: relative;
	padding-left: 0;
}

/* The spine. */
@media (min-width: 48em) {
	.cff-wrapper .cff-posts-wrap::before {
		content: "";
		position: absolute;
		left: 8.5rem;
		top: 0.6rem;
		bottom: 0.6rem;
		width: 1px;
		background: var(--rule);
	}
}

.cff-wrapper .cff-item {
	background: transparent !important;
	border: 0 !important;
	border-bottom: 1px solid var(--rule) !important;
	padding: clamp(1.75rem, 4vw, 2.5rem) 0 !important;
	margin: 0 !important;
	position: relative;
}

.cff-wrapper .cff-item:last-child {
	border-bottom: 0 !important;
}

@media (min-width: 48em) {
	.cff-wrapper .cff-item {
		padding-left: 11rem !important;
	}

	/* The node on the spine. */
	.cff-wrapper .cff-item::before {
		content: "";
		position: absolute;
		left: calc(8.5rem - 3px);
		top: clamp(1.95rem, 4vw, 2.7rem);
		width: 7px;
		height: 7px;
		background: var(--paper);
		border: 1px solid var(--harbour);
		border-radius: 50%;
	}
}

/* Date, set in the left margin like a minute-book stamp. */
.cff-wrapper .cff-date {
	font-family: var(--mono) !important;
	font-size: 0.6875rem !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	color: var(--ink-mute) !important;
	margin: 0 0 0.85rem !important;
	padding: 0 !important;
}

@media (min-width: 48em) {
	.cff-wrapper .cff-date {
		position: absolute;
		left: 0;
		top: clamp(1.75rem, 4vw, 2.5rem);
		width: 7.25rem;
		text-align: right;
		margin: 0 !important;
	}
}

/* The author line is the same name on every entry — redundant, so it goes. */
.cff-wrapper .cff-author,
.cff-wrapper .cff-page-name,
.cff-wrapper .cff-post-links,
.cff-wrapper .cff-likebox,
.cff-wrapper .cff-credit,
.cff-wrapper .cff-meta-wrap,
.cff-wrapper .cff-shared-link-box .cff-post-desc {
	display: none !important;
}

.cff-wrapper .cff-post-text,
.cff-wrapper .cff-text {
	font-family: "Public Sans", system-ui, sans-serif !important;
	font-size: 1.0625rem !important;
	line-height: 1.68 !important;
	color: var(--ink) !important;
	max-width: var(--measure);
	text-wrap: pretty;
}

.cff-wrapper .cff-post-text a {
	color: var(--harbour) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	word-break: break-word;
}

/* "See More" — the control that does the whole job. Make it read as a control. */
.cff-wrapper .cff-expand .cff-readmore {
	font-family: var(--mono) !important;
	font-size: 0.6875rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	color: var(--harbour) !important;
	background: none !important;
	border: 0 !important;
	border-bottom: 1px solid var(--rule) !important;
	padding: 0 0 2px !important;
	margin-left: 0.35rem;
	cursor: pointer;
	transition: color 0.18s ease, border-color 0.18s ease;
}

.cff-wrapper .cff-expand .cff-readmore:hover {
	color: var(--ink) !important;
	border-bottom-color: var(--ink) !important;
}

.cff-wrapper .cff-media-wrap,
.cff-wrapper .cff-post-media {
	margin-top: 1.25rem !important;
	max-width: var(--measure);
}

.cff-wrapper .cff-media-wrap img,
.cff-wrapper .cff-post-media img {
	border: 1px solid var(--rule);
	max-width: 100%;
	height: auto;
}

/* Load-more / follow buttons inherit the site button, not Facebook blue. */
.cff-wrapper .cff-load-more,
.cff-wrapper #cff-load-more {
	font-family: var(--mono) !important;
	font-size: 0.75rem !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	background: var(--harbour) !important;
	color: #fff !important;
	border-radius: 0 !important;
	padding: 0.85em 1.6em !important;
	border: 0 !important;
}

/* Empty feed (before the page is connected) shouldn't look broken. */
.cff-wrapper .cff-error-msg {
	font-family: var(--mono) !important;
	font-size: 0.8125rem !important;
	color: var(--ink-mute) !important;
	background: transparent !important;
	border: 1px dashed var(--rule) !important;
	padding: 1.5rem !important;
}

/* Admin-only build note. */
.cbo-admin-note {
	max-width: var(--measure);
	margin: 1.5rem auto 0;
	padding: 1rem 1.15rem;
	border-left: 2px solid var(--pounamu);
	background: rgba(61, 107, 84, 0.06);
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--ink-soft);
}

/* ==========================================================================
   Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}
