/*
 * Al-Aqsa Fundraising Progress Tracker - display styles.
 *
 * Colours come from CSS custom properties set inline by PHP, using the
 * approved palette derived from the center's logo and expansion flyer:
 *   --aacc-primary   #EF9406  bar fill
 *   --aacc-secondary #2B8334  accents
 *   --aacc-track     #F5F0D0  unfilled track
 *   --aacc-headline  #715A3E  headline numerals
 *   --aacc-panel     #FFFFFF  card background
 *
 * Sizes are in rem/clamp() so the bar scales from a phone up to a 4K monitor
 * without configuration.
 */

.aacc-ft {
	--aacc-primary: #EF9406;
	--aacc-secondary: #2B8334;
	--aacc-track: #F5F0D0;
	--aacc-headline: #715A3E;
	--aacc-panel: #FFFFFF;

	display: block;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 1rem;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--aacc-headline);
}

.aacc-ft *,
.aacc-ft *::before,
.aacc-ft *::after {
	box-sizing: border-box;
}

.aacc-ft__card {
	background: var(--aacc-panel);
	border: 1px solid rgba(113, 90, 62, 0.15);
	border-radius: 18px;
	padding: clamp(1.25rem, 3vw, 3rem);
	box-shadow: 0 10px 40px rgba(113, 90, 62, 0.08);
}

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

.aacc-ft__head {
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 2vw, 1.5rem);
	margin-bottom: clamp(1rem, 2.5vw, 2rem);
}

.aacc-ft__logo {
	height: clamp(44px, 6vw, 88px);
	width: auto;
	flex: 0 0 auto;
}

.aacc-ft__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.aacc-ft__title {
	margin: 0;
	font-size: clamp(1.1rem, 2.2vw, 2rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--aacc-headline);
}

.aacc-ft__sub {
	margin: 0.25rem 0 0;
	font-size: clamp(0.8rem, 1.2vw, 1.05rem);
	opacity: 0.75;
	color: var(--aacc-headline);
}

.aacc-ft__phase {
	flex: 0 0 auto;
	background: var(--aacc-secondary);
	color: #fff;
	font-size: clamp(0.7rem, 1vw, 0.95rem);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.4em 0.9em;
	border-radius: 999px;
	white-space: nowrap;
}

/* ---------- Headline figures ---------- */

.aacc-ft__figures {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.aacc-ft__figure-main {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.aacc-ft__raised {
	font-size: clamp(2.4rem, 8vw, 6.5rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.03em;
	color: var(--aacc-headline);
	font-variant-numeric: tabular-nums;
}

.aacc-ft__of {
	font-size: clamp(0.9rem, 1.6vw, 1.4rem);
	opacity: 0.8;
	white-space: nowrap;
}

.aacc-ft__of strong {
	font-weight: 700;
}

.aacc-ft__percent {
	font-size: clamp(1.8rem, 5vw, 4rem);
	font-weight: 900;
	line-height: 1;
	color: var(--aacc-primary);
	font-variant-numeric: tabular-nums;
}

.aacc-ft__percent-sign {
	font-size: 0.55em;
	font-weight: 800;
	margin-left: 0.05em;
}

/* ---------- The bar ---------- */

.aacc-ft__track {
	position: relative;
	width: 100%;
	height: clamp(24px, 4.5vw, 64px);
	margin: clamp(1rem, 2.5vw, 1.75rem) 0;
	background: var(--aacc-track);
	border-radius: 999px;
	overflow: hidden;
	box-shadow: inset 0 1px 3px rgba(113, 90, 62, 0.15);
}

.aacc-ft__fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--aacc-primary) 0%, var(--aacc-primary) 70%, var(--aacc-secondary) 100%);
	transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
	min-width: 0;
}

/* ---------- Meta row ---------- */

.aacc-ft__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.75rem;
	align-items: baseline;
	font-size: clamp(0.85rem, 1.3vw, 1.15rem);
	color: var(--aacc-headline);
}

.aacc-ft__stat strong {
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.aacc-ft__stat--total {
	opacity: 0.85;
}

.aacc-ft__of-total {
	opacity: 0.7;
}

.aacc-ft__stamp {
	margin-left: auto;
	opacity: 0.6;
	font-size: 0.9em;
}

/* ---------- Live / reconnecting indicator ---------- */

.aacc-ft__status {
	margin-top: 0.75rem;
	font-size: 0.8rem;
	min-height: 1.1em;
	opacity: 0.65;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.aacc-ft__status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--aacc-secondary);
	flex: 0 0 auto;
}

.aacc-ft--error .aacc-ft__status::before {
	background: #C0392B;
}

.aacc-ft--error .aacc-ft__status {
	color: #C0392B;
	opacity: 0.9;
}

/* ---------- Compact variant (inside a page, above the fold) ---------- */

.aacc-ft--compact .aacc-ft__raised {
	font-size: clamp(2rem, 5vw, 3.5rem);
}

.aacc-ft--compact .aacc-ft__card {
	padding: clamp(1rem, 2vw, 1.75rem);
}

/* ---------- Kiosk (full-screen monitor) ---------- */

body.aacc-ft-kiosk {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #FBF8F1;
}

body.aacc-ft-kiosk .aacc-ft {
	max-width: none;
	padding: clamp(1rem, 3vw, 3rem);
}

body.aacc-ft-kiosk .aacc-ft__card {
	width: 100%;
}

body.aacc-ft-kiosk .aacc-ft__title {
	font-size: clamp(1.4rem, 2.6vw, 2.6rem);
}

body.aacc-ft-kiosk .aacc-ft__raised {
	font-size: clamp(3rem, 9vw, 9rem);
}

body.aacc-ft-kiosk .aacc-ft__track {
	height: clamp(32px, 5vw, 80px);
}

body.aacc-ft-kiosk .aacc-ft__meta {
	font-size: clamp(0.95rem, 1.5vw, 1.5rem);
}

/* ---------- Preview banner (console users only, display switched off) ---------- */

.aacc-ft__preview {
	max-width: 1400px;
	margin: 0 auto 1rem;
	padding: 0.85rem 1.1rem;
	background: #FDF5E3;
	border-left: 5px solid #8A5A00;
	border-radius: 0 6px 6px 0;
	color: #6b4600;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 0.95rem;
	line-height: 1.5;
}

body.aacc-ft-kiosk .aacc-ft__preview {
	max-width: none;
	width: 100%;
}

/* ---------- Dormant page (display switched off, public visitor) ---------- */

body.aacc-ft-kiosk .aacc-ft__dormant {
	text-align: center;
	padding: 2rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #715A3E;
}

body.aacc-ft-kiosk .aacc-ft__dormant h1 {
	font-size: clamp(1.3rem, 3vw, 2rem);
	margin: 0 0 0.5rem;
}

body.aacc-ft-kiosk .aacc-ft__dormant p {
	font-size: clamp(0.9rem, 1.5vw, 1.1rem);
	opacity: 0.75;
	margin: 0;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
	.aacc-ft__head {
		flex-wrap: wrap;
	}

	.aacc-ft__stamp {
		margin-left: 0;
		width: 100%;
	}

	.aacc-ft__figures {
		align-items: flex-start;
	}
}

/* ---------- Respect reduced-motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.aacc-ft__fill {
		transition: none;
	}
}


/* ---- Collapsible tracker (page embeds) ---- */
.aacc-ft__shell { border-radius: inherit; }

.aacc-ft__reveal {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 22px 26px;
	background: var(--aacc-panel);
	border: 1px solid rgba(113, 90, 62, 0.16);
	border-radius: 12px;
	color: var(--aacc-headline);
	font-size: 1.05em;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-align: center;
	user-select: none;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.aacc-ft__reveal::-webkit-details-marker { display: none; }

.aacc-ft__reveal:hover {
	border-color: var(--aacc-primary);
	box-shadow: 0 2px 10px rgba(113, 90, 62, 0.10);
}

.aacc-ft__reveal-text { display: inline-block; }

.aacc-ft__chev {
	width: 0; height: 0;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid currentColor;
	transition: transform 0.2s ease;
}

.aacc-ft__shell[open] > .aacc-ft__reveal {
	padding: 10px 14px;
	font-size: 0.82em;
	font-weight: 600;
	background: transparent;
	border-color: transparent;
	opacity: 0.6;
	justify-content: flex-end;
}

.aacc-ft__shell[open] > .aacc-ft__reveal:hover { opacity: 1; }
.aacc-ft__shell[open] .aacc-ft__chev { transform: rotate(180deg); }
.aacc-ft__shell[open] > .aacc-ft__card { margin-top: 2px; }

/* ---- Notes under the bar ---- */
.aacc-ft__notes { margin-top: 16px; }

.aacc-ft__milestone {
	margin: 0 0 14px;
	padding: 11px 15px;
	background: rgba(43, 131, 52, 0.08);
	border-left: 4px solid var(--aacc-secondary);
	border-radius: 0 4px 4px 0;
	font-size: 0.92em;
	line-height: 1.55;
	color: var(--aacc-headline);
}

.aacc-ft__recon-table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	font-size: 0.92em;
}

.aacc-ft__recon-table th,
.aacc-ft__recon-table td {
	padding: 6px 4px;
	text-align: left;
	border-bottom: 1px solid rgba(113, 90, 62, 0.12);
	color: var(--aacc-headline);
	font-weight: 500;
}

.aacc-ft__recon-table td { text-align: right; }
.aacc-ft__recon-table th { font-weight: 600; opacity: 0.8; }

.aacc-ft__recon-total th,
.aacc-ft__recon-total td,
.aacc-ft__recon-project th,
.aacc-ft__recon-project td {
	border-bottom: none;
	font-weight: 700;
}

.aacc-ft__recon-total th,
.aacc-ft__recon-total td {
	border-top: 2px solid rgba(113, 90, 62, 0.26);
	padding-top: 9px;
}

.aacc-ft__of-total { font-weight: 400; opacity: 0.7; font-size: 0.92em; }

.aacc-ft__note {
	margin: 10px 0 0;
	font-size: 0.82em;
	line-height: 1.55;
	color: var(--aacc-headline);
	opacity: 0.7;
}

/* ---------- Signage (16:9 wall display) ----------
 * For a monitor read from across a room. The card fills the viewport and
 * every size is in vmin, so 1280x720, 1920x1080 and 3840x2160 all render
 * identically with no configuration. Reachable at /progress-tracker/?signage=1
 */
body.aacc-ft-signage {
	display: block;
	overflow: hidden;
	background: #FBF8F1;
}

body.aacc-ft-signage .aacc-ft {
	max-width: none;
	width: 100%;
	height: 100vh;
	margin: 0;
	padding: 0;
}

body.aacc-ft-signage .aacc-ft__card {
	width: 100%;
	height: 100vh;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 4.2vmin 5vmin;
	display: flex;
	flex-direction: column;
}

body.aacc-ft-signage .aacc-ft__head {
	gap: 2vmin;
	margin-bottom: 0;
}

body.aacc-ft-signage .aacc-ft__logo {
	height: 9.5vmin;
}

body.aacc-ft-signage .aacc-ft__title {
	font-size: 3.8vmin;
	letter-spacing: -0.02em;
}

body.aacc-ft-signage .aacc-ft__sub {
	font-size: 2.1vmin;
	opacity: 0.7;
	margin-top: 0.6vmin;
}

body.aacc-ft-signage .aacc-ft__phase {
	font-size: 1.75vmin;
	padding: 1vmin 2.2vmin;
	letter-spacing: 0.14em;
}

body.aacc-ft-signage .aacc-ft__figures {
	margin-top: auto;
	align-items: flex-end;
	gap: 3vmin;
}

body.aacc-ft-signage .aacc-ft__raised {
	font-size: 20vmin;
	letter-spacing: -0.035em;
}

body.aacc-ft-signage .aacc-ft__of {
	font-size: 2.9vmin;
	opacity: 0.85;
}

body.aacc-ft-signage .aacc-ft__percent {
	font-size: 13vmin;
}

body.aacc-ft-signage .aacc-ft__track {
	height: 3.8vmin;
	margin: 3.6vmin 0 2.6vmin;
}

body.aacc-ft-signage .aacc-ft__meta {
	font-size: 2.6vmin;
	gap: 1.2vmin 3.4vmin;
}

body.aacc-ft-signage .aacc-ft__stamp {
	font-size: 1em;
	margin-left: auto;
	opacity: 0.65;
}

body.aacc-ft-signage .aacc-ft__status {
	font-size: 1.6vmin;
	margin-top: 1.4vmin;
	opacity: 0.45;
}

body.aacc-ft-signage .aacc-ft__status::before {
	width: 1.2vmin;
	height: 1.2vmin;
}

body.aacc-ft-signage .aacc-ft__status:empty {
	display: none;
}

body.aacc-ft-signage .aacc-ft__notes {
	margin-top: auto;
	padding-top: 2.2vmin;
	border-top: 1px solid rgba(113, 90, 62, 0.14);
}

body.aacc-ft-signage .aacc-ft__milestone {
	font-size: 2.3vmin;
	line-height: 1.5;
	margin: 0;
	padding: 0 0 0 2vmin;
	border-left-width: 0.8vmin;
}

/* The reconciliation table repeats the headline figure and is unreadable
   from across a room. Page and kiosk views keep it. */
body.aacc-ft-signage .aacc-ft__recon-table,
body.aacc-ft-signage .aacc-ft__note {
	display: none;
}

/* Offline: the figures on screen are the last ones we could verify. Muted,
   amber, and always accompanied by the "figures from ..." status line. */
.aacc-ft--stale .aacc-ft__status {
	color: #8a6d1f;
}

.aacc-ft--stale .aacc-ft__status::before {
	background: #c99a2e;
}
