/*
 * FLO — shared components: buttons, links, pills, cards, form fields,
 * medallions, gold rules, numbers, placeholders.
 * Values from design/README.md §3.4 and the inline styles in design/source/.
 */

/* ---- Buttons --------------------------------------------------------------- */
.c-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 32px;
	border: 0;
	border-radius: var(--r-pill);
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: var(--fs-button);
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: background var(--t-base), color var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}

.c-btn:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 3px;
	border-radius: var(--r-pill);
}

.c-btn--sm {
	padding: 14px 24px;
	font-size: var(--fs-button-sm);
}

.c-btn--xs {
	padding: 12px 24px;
	font-size: 12.5px;
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* Primary: gold with navy text (one per block) */
/* Navy text on gold everywhere, in dark sections too: `.is-dark a` would
   otherwise recolour the button white (1.98:1 — the design has #001B42). */
.c-btn--primary,
.is-dark .c-btn--primary {
	background: var(--gold);
	color: var(--navy);
}

.c-btn--primary:hover,
.is-dark .c-btn--primary:hover {
	background: var(--gold-hover);
	color: var(--navy);
}

.c-btn--primary:active {
	background: #d98f08;
}

.c-btn--primary.c-btn--glow {
	box-shadow: var(--shadow-gold);
}

/* Navy on light (projects showcase "Read the story") */
.c-btn--navy {
	background: var(--navy);
	color: var(--paper);
}

.c-btn--navy:hover {
	background: #0d3363;
	color: var(--paper);
}

/* Secondary on light: navy outline, fills on hover */
.c-btn--secondary {
	background: transparent;
	border: 1.5px solid var(--navy);
	color: var(--navy);
}

.c-btn--secondary:hover {
	background: var(--navy);
	color: var(--white);
}

.c-btn--secondary:active {
	background: var(--navy-ink);
	border-color: var(--navy-ink);
	color: var(--white);
}

/* Secondary on navy: frosted, fills with paper on hover */
.c-btn--ghost {
	background: rgba(255, 255, 255, .1);
	border: 1.5px solid rgba(255, 255, 255, .5);
	color: var(--paper);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.c-btn--ghost:hover {
	background: var(--paper);
	border-color: var(--paper);
	color: var(--navy);
}

.c-btn--ghost:active {
	background: var(--sand);
	border-color: var(--sand);
	color: var(--navy);
}

.c-btn:disabled,
.c-btn[aria-disabled="true"] {
	opacity: .5;
	cursor: not-allowed;
	pointer-events: none;
}

.c-btn--block {
	width: 100%;
}

/* Text link with the gold underline */
.c-link {
	display: inline-block;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.4;
	color: var(--navy-ink);
	text-decoration: none;
	border-bottom: 1.5px solid rgba(245, 163, 4, .5);
	transition: border-color var(--t-fast), color var(--t-fast);
}

.c-link:hover {
	color: var(--navy);
	border-bottom-color: var(--gold);
}

.c-link--arrow::after {
	content: " \2192";
}

.is-dark .c-link {
	color: rgba(255, 255, 255, .88);
}

.is-dark .c-link:hover {
	color: var(--paper);
	border-bottom-color: var(--gold);
}

/* ---- Pills and tags -------------------------------------------------------- */
.c-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border-radius: var(--r-pill);
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: var(--fs-pill);
	line-height: 1;
	letter-spacing: var(--ls-pill);
	text-transform: uppercase;
	white-space: nowrap;
	background: rgba(0, 27, 66, .08);
	color: var(--navy-ink);
}

.c-pill--sm {
	padding: 5px 10px;
	font-size: var(--fs-pill-sm);
	letter-spacing: var(--ls-pill-wide);
}

/* Project statuses on light (flo-projects.js LIGHT) */
.c-pill--urgent {
	background: var(--gold);
	color: var(--navy);
}

.c-pill--ongoing,
.c-pill--funded {
	background: rgba(0, 27, 66, .08);
	color: var(--navy-ink);
}

.c-pill--completed {
	background: var(--navy);
	color: var(--paper);
}

/* …and on navy (flo-projects.js DARK) */
.is-dark .c-pill,
.is-dark .c-pill--ongoing,
.is-dark .c-pill--funded {
	background: rgba(255, 255, 255, .16);
	color: var(--paper);
}

.is-dark .c-pill--urgent {
	background: var(--gold);
	color: var(--navy);
}

.is-dark .c-pill--completed {
	background: var(--paper);
	color: var(--navy);
}

/* Neutral tag: sand chip, no uppercase */
.c-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 11px;
	border-radius: var(--r-pill);
	border: 1px solid var(--line-2);
	background: var(--sand);
	font-weight: 600;
	font-size: 12.5px;
	line-height: 1;
	color: var(--muted-2);
	white-space: nowrap;
}

.is-dark .c-tag {
	background: var(--glass);
	border-color: var(--glass-line);
	color: var(--on-navy-2);
}

.c-tag__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--gold);
	flex: none;
}

/* ---- Cards ----------------------------------------------------------------- */
.c-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px;
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	background: var(--white);
	color: var(--text);
	box-shadow: var(--shadow-card);
}

.c-card--paper {
	background: var(--paper);
}

.c-card--sand {
	background: var(--sand);
	border-color: var(--line-2);
	box-shadow: none;
}

.c-card--flat {
	box-shadow: none;
}

/* Glass card on navy */
.c-card--glass {
	background: var(--glass);
	border: 1px solid var(--glass-line);
	border-radius: 24px;
	color: var(--on-navy);
	box-shadow: none;
}

.c-card__title {
	font-family: var(--font-display);
	font-optical-sizing: auto;
	font-weight: 700;
	font-size: var(--fs-h3);
	line-height: var(--lh-h3);
	letter-spacing: var(--ls-h3);
	color: var(--navy);
}

.c-card--glass .c-card__title {
	color: var(--paper);
}

.c-card__text {
	font-size: var(--fs-body-sm);
	line-height: 1.62;
	color: var(--text);
}

.c-card--glass .c-card__text {
	color: var(--on-navy-2);
}

/* Explicit placeholder where a photo is still missing (README §3.5) */
.c-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	border: 2px dashed var(--line-3);
	border-radius: var(--r-photo);
	background: var(--sand);
	text-align: center;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.5;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--muted-2);
}

.is-dark .c-placeholder {
	background: var(--glass);
	border-color: rgba(255, 255, 255, .3);
	color: var(--on-navy-3);
}

/* ---- Form fields ----------------------------------------------------------- */
.c-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.c-label {
	font-family: var(--font-sans);
	font-weight: 700;
	font-size: 11.5px;
	line-height: 1.2;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted-2);
}

.c-label__optional {
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: none;
	color: var(--muted);
}

.c-input,
.c-select,
.c-textarea {
	display: block;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--input-line);
	border-radius: var(--r-input);
	background: var(--paper);
	font-family: var(--font-sans);
	font-size: 15px;
	line-height: 1.4;
	color: var(--navy);
	transition: border-color var(--t-fast), box-shadow var(--t-fast);
	appearance: none;
	-webkit-appearance: none;
}

.c-input::placeholder,
.c-textarea::placeholder {
	color: var(--muted);
	opacity: 1;
}

.c-input:hover,
.c-select:hover,
.c-textarea:hover {
	border-color: var(--line-3);
}

.c-input:focus,
.c-select:focus,
.c-textarea:focus {
	border-color: var(--navy-ink);
	box-shadow: 0 0 0 3px rgba(0, 27, 66, .08);
}

.c-input:focus-visible,
.c-select:focus-visible,
.c-textarea:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
	border-radius: var(--r-input);
}

.c-input:disabled,
.c-select:disabled,
.c-textarea:disabled {
	background: var(--sand);
	color: var(--muted);
	cursor: not-allowed;
}

.c-input.is-invalid,
.c-select.is-invalid,
.c-textarea.is-invalid,
.c-input[aria-invalid="true"],
.c-select[aria-invalid="true"],
.c-textarea[aria-invalid="true"] {
	border-color: var(--error);
}

.c-textarea {
	min-height: 140px;
	resize: vertical;
}

/* Select with an inline caret — data URI, so no request leaves the site */
.c-select {
	padding-right: 44px;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2312325E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	cursor: pointer;
}

.c-select:invalid {
	color: var(--muted);
}

/* Checkbox: box + label in one row, the box drawn with accent-color */
.c-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid #EFE9DD;
	border-radius: var(--r-input);
	background: var(--paper);
	font-size: 14px;
	line-height: 1.5;
	color: var(--text);
	cursor: pointer;
	transition: border-color var(--t-fast);
}

.c-checkbox:hover {
	border-color: var(--line-3);
}

.c-checkbox.is-invalid {
	border-color: var(--error);
}

.c-checkbox__input {
	flex: none;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--navy);
	cursor: pointer;
}

.c-checkbox__input:focus-visible {
	outline: var(--focus-ring);
	outline-offset: 2px;
}

.c-hint {
	font-weight: 500;
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--muted);
}

.c-error {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.4;
	color: var(--error);
}

.c-error:empty {
	display: none;
}

/* Fields on navy (newsletter card, hero forms) */
.is-dark .c-label {
	color: var(--on-navy-2);
}

.is-dark .c-input,
.is-dark .c-select,
.is-dark .c-textarea {
	background: rgba(255, 255, 255, .08);
	border-color: rgba(255, 255, 255, .22);
	color: var(--paper);
}

.is-dark .c-input::placeholder,
.is-dark .c-textarea::placeholder {
	color: rgba(255, 255, 255, .55);
}

.is-dark .c-input:focus,
.is-dark .c-select:focus,
.is-dark .c-textarea:focus {
	border-color: var(--gold);
	box-shadow: 0 0 0 3px rgba(245, 163, 4, .18);
}

.is-dark .c-select {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23FBFAF7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.is-dark .c-hint {
	color: var(--on-navy-3);
}

.is-dark .c-checkbox {
	background: var(--glass);
	border-color: var(--glass-line);
	color: var(--on-navy);
}

.is-dark .c-checkbox__input {
	accent-color: var(--gold);
}

/* ---- Medallions, rules, numbers -------------------------------------------- */
.c-medallion {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: var(--medallion);
	height: var(--medallion);
	border-radius: 50%;
	background: var(--navy);
	color: var(--gold);
}

.c-medallion svg {
	width: 46%;
	height: 46%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.c-medallion img {
	width: 50%;
	height: 50%;
	object-fit: contain;
}

.c-medallion--sm {
	width: var(--medallion-sm);
	height: var(--medallion-sm);
}

.c-medallion--lg {
	width: var(--medallion-lg);
	height: var(--medallion-lg);
}

.is-dark .c-medallion {
	background: var(--medallion-dark-fill);
	border: 1.5px solid var(--medallion-dark-line);
	color: var(--gold);
}

/* Gold rule: 30×2 under a card title, 74×5 under a big heading */
.c-rule {
	display: block;
	width: 30px;
	height: 2px;
	border-radius: 2px;
	background: var(--gold);
}

.c-rule--lg {
	width: 74px;
	height: 5px;
	border-radius: 3px;
}

/* Block numbers */
.c-num {
	display: inline-block;
	font-family: var(--font-sans);
	font-weight: 800;
	font-size: 13px;
	line-height: 1;
	letter-spacing: .06em;
	color: var(--gold-text);
	font-variant-numeric: tabular-nums;
}

.is-dark .c-num {
	color: var(--gold);
}

.c-num--lg {
	font-family: var(--font-display);
	font-optical-sizing: auto;
	font-size: var(--fs-number-lg);
	letter-spacing: var(--ls-number);
	color: var(--number-ghost);
}

.c-num--outline {
	font-family: var(--font-display);
	font-optical-sizing: auto;
	font-size: var(--fs-number-lg);
	letter-spacing: var(--ls-number);
	color: transparent;
	-webkit-text-stroke: 1.5px var(--number-outline);
}

.is-dark .c-num--lg {
	color: var(--number-ghost);
}

.is-dark .c-num--outline {
	color: transparent;
}

/* Timeline dot with the pulse from the design (heroes, founder timeline) */
.c-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gold);
	flex: none;
}

@keyframes floGlow {
	0% {
		box-shadow: 0 0 0 0 rgba(245, 163, 4, .6);
		transform: scale(1);
	}

	3% {
		transform: scale(1.24);
	}

	20% {
		box-shadow: 0 0 0 15px rgba(245, 163, 4, 0);
		transform: scale(1);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(245, 163, 4, 0);
		transform: scale(1);
	}
}

.c-dot--pulse {
	animation: floGlow 3.6s ease-out infinite;
}

/* ---- Skip link ------------------------------------------------------------- */
.c-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 300;
	padding: 14px 22px;
	border-radius: 0 0 12px 0;
	background: var(--gold);
	color: var(--navy);
	font-weight: 700;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
}

.c-skip:focus,
.c-skip:focus-visible {
	left: 0;
	outline-offset: -4px;
	color: var(--navy);
}
